{
  "info": {
    "name": "ActLoom Settings API Keys",
    "_postman_id": "5f5f8039-8d9c-4fd4-95d0-1e1f9d7146c1",
    "description": "Collection for testing Settings > API Keys endpoints. Requires an authenticated session cookie.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "item": [
    {
      "name": "List API Keys",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/api/settings/api-keys?companyId={{companyId}}",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "settings",
            "api-keys"
          ],
          "query": [
            {
              "key": "companyId",
              "value": "{{companyId}}"
            }
          ]
        }
      }
    },
    {
      "name": "Create API Key",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"companyId\": \"{{companyId}}\",\n  \"name\": \"Postman Test Key\",\n  \"scopes\": [\"read:reports\", \"write:reports\"],\n  \"expiresInDays\": 365\n}"
        },
        "url": {
          "raw": "{{baseUrl}}/api/settings/api-keys",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "settings",
            "api-keys"
          ]
        }
      }
    },
    {
      "name": "Rotate API Key",
      "request": {
        "method": "POST",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/api/settings/api-keys/{{apiKeyId}}/rotate",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "settings",
            "api-keys",
            "{{apiKeyId}}",
            "rotate"
          ]
        }
      }
    },
    {
      "name": "Revoke API Key",
      "request": {
        "method": "DELETE",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/api/settings/api-keys/{{apiKeyId}}",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "settings",
            "api-keys",
            "{{apiKeyId}}"
          ]
        }
      }
    }
  ],
  "variable": [
    {
      "key": "baseUrl",
      "value": "http://localhost:3000"
    },
    {
      "key": "companyId",
      "value": "demo_company_health"
    },
    {
      "key": "apiKeyId",
      "value": "replace_with_created_key_id"
    }
  ]
}
