{
  "info": {
    "name": "RedRover API v1",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "description": "Set baseUrl to your application URL. Store apiKey in a local sensitive environment variable or Postman Vault; never export a populated key. GET requests are safe reads; the two write examples create data. Grants and live RedRover permissions are enforced. For updates GET item, edit allowed fields, then POST the full record with its current version."
  },
  "auth": {
    "type": "apikey",
    "apikey": [
      {
        "key": "key",
        "value": "X-API-Key",
        "type": "string"
      },
      {
        "key": "value",
        "value": "{{apiKey}}",
        "type": "string"
      },
      {
        "key": "in",
        "value": "header",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "http://localhost:8080/redrover"
    },
    {
      "key": "workspaceId",
      "value": ""
    },
    {
      "key": "itemId",
      "value": ""
    }
  ],
  "item": [
    {
      "name": "Capabilities",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": "{{baseUrl}}/api/v1/capabilities"
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test(\"JSON response\", () => pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\"));",
              "pm.test(\"Authorized request succeeds\", () => pm.response.to.have.status(200));"
            ]
          }
        }
      ]
    },
    {
      "name": "Workspaces",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": "{{baseUrl}}/api/v1/workspaces"
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test(\"JSON response\", () => pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\"));",
              "pm.test(\"Authorized request succeeds\", () => pm.response.to.have.status(200));"
            ]
          }
        }
      ]
    },
    {
      "name": "Workspace options",
      "request": {
        "method": "GET",
        "url": "{{baseUrl}}/api/v1/options?workspaceId={{workspaceId}}"
      }
    },
    {
      "name": "Tasks",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": "{{baseUrl}}/api/v1/items?workspaceId={{workspaceId}}&type=task&after=0&limit=50"
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test(\"JSON response\", () => pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\"));",
              "pm.test(\"Authorized request succeeds\", () => pm.response.to.have.status(200));"
            ]
          }
        }
      ]
    },
    {
      "name": "Requirements",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": "{{baseUrl}}/api/v1/items?workspaceId={{workspaceId}}&type=requirement"
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test(\"JSON response\", () => pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\"));",
              "pm.test(\"Authorized request succeeds\", () => pm.response.to.have.status(200));"
            ]
          }
        }
      ]
    },
    {
      "name": "Goals",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": "{{baseUrl}}/api/v1/items?workspaceId={{workspaceId}}&type=goal"
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test(\"JSON response\", () => pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\"));",
              "pm.test(\"Authorized request succeeds\", () => pm.response.to.have.status(200));"
            ]
          }
        }
      ]
    },
    {
      "name": "Releases",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": "{{baseUrl}}/api/v1/items?workspaceId={{workspaceId}}&type=release"
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test(\"JSON response\", () => pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\"));",
              "pm.test(\"Authorized request succeeds\", () => pm.response.to.have.status(200));"
            ]
          }
        }
      ]
    },
    {
      "name": "Milestones",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": "{{baseUrl}}/api/v1/items?workspaceId={{workspaceId}}&type=milestone"
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test(\"JSON response\", () => pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\"));",
              "pm.test(\"Authorized request succeeds\", () => pm.response.to.have.status(200));"
            ]
          }
        }
      ]
    },
    {
      "name": "Work detail",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": "{{baseUrl}}/api/v1/item?workspaceId={{workspaceId}}&id={{itemId}}"
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test(\"JSON response\", () => pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\"));",
              "pm.test(\"Authorized request succeeds\", () => pm.response.to.have.status(200));"
            ]
          }
        }
      ]
    },
    {
      "name": "Comments",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": "{{baseUrl}}/api/v1/comments?workspaceId={{workspaceId}}&id={{itemId}}"
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test(\"JSON response\", () => pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\"));",
              "pm.test(\"Authorized request succeeds\", () => pm.response.to.have.status(200));"
            ]
          }
        }
      ]
    },
    {
      "name": "Load and forecast",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": "{{baseUrl}}/api/v1/capacity?workspaceId={{workspaceId}}"
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test(\"JSON response\", () => pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\"));",
              "pm.test(\"Authorized request succeeds\", () => pm.response.to.have.status(200));"
            ]
          }
        }
      ]
    },
    {
      "name": "Create task (writes data)",
      "request": {
        "method": "POST",
        "description": "Explicit write example. Run only in a test workspace. Do not blindly retry.",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": "{{baseUrl}}/api/v1/items/save",
        "body": {
          "mode": "raw",
          "raw": "{\n  \"workspaceId\": {{workspaceId}},\n  \"record\": {\n    \"type\": \"task\",\n    \"title\": \"Integration example task\",\n    \"description\": \"Created intentionally from Postman\",\n    \"status\": \"planned\",\n    \"fields\": {\n      \"estimatedHours\": 2,\n      \"priorityKey\": \"normal\"\n    }\n  }\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "Add comment (writes data)",
      "request": {
        "method": "POST",
        "description": "Explicit write example. Run only in a test workspace. Do not blindly retry.",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": "{{baseUrl}}/api/v1/comments",
        "body": {
          "mode": "raw",
          "raw": "{\n  \"workspaceId\": {{workspaceId}},\n  \"id\": {{itemId}},\n  \"body\": \"Integration example comment\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    }
  ]
}
