{
  "opencollection": "1.0.0",
  "info": {
    "name": "Amigo Account API Keys API",
    "version": "0.1.0"
  },
  "request": {
    "auth": {
      "type": "bearer",
      "token": "{{bearerToken}}"
    }
  },
  "items": [
    {
      "info": {
        "name": "API Keys",
        "type": "folder"
      },
      "items": [
        {
          "info": {
            "name": "List API keys",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://api.amigo.ai/v1/:workspace_id/api-keys",
            "params": [
              {
                "name": "workspace_id",
                "value": "",
                "type": "path"
              },
              {
                "name": "mine_only",
                "value": "",
                "type": "query"
              },
              {
                "name": "limit",
                "value": "",
                "type": "query"
              },
              {
                "name": "continuation_token",
                "value": "",
                "type": "query"
              }
            ]
          },
          "docs": "List all API keys for a workspace with pagination. Requires `ApiKey.view` permission."
        },
        {
          "info": {
            "name": "Create an API key",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "https://api.amigo.ai/v1/:workspace_id/api-keys",
            "params": [
              {
                "name": "workspace_id",
                "value": "",
                "type": "path"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            }
          },
          "docs": "Create a new API key for a workspace. The response includes the plaintext `api_key` — store it securely, it cannot be retrieved again."
        },
        {
          "info": {
            "name": "Get the API-key role/permission catalog",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://api.amigo.ai/v1/:workspace_id/api-keys/permission-catalog",
            "params": [
              {
                "name": "workspace_id",
                "value": "",
                "type": "path"
              }
            ]
          },
          "docs": "Return the authoritative role→permission model: each role's default permission set (what an API key of that role may carry) plus the full permission universe. Clients use this to build the create-key form instead of hard-coding the matrix. Requires `ApiKey.view` permission."
        },
        {
          "info": {
            "name": "Delete an API key",
            "type": "http"
          },
          "http": {
            "method": "DELETE",
            "url": "https://api.amigo.ai/v1/:workspace_id/api-keys/:key_id",
            "params": [
              {
                "name": "workspace_id",
                "value": "",
                "type": "path"
              },
              {
                "name": "key_id",
                "value": "",
                "type": "path"
              }
            ]
          },
          "docs": "Revoke an API key. Requires `ApiKey.delete` permission."
        },
        {
          "info": {
            "name": "Rotate an API key",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "https://api.amigo.ai/v1/:workspace_id/api-keys/:key_id/rotate",
            "params": [
              {
                "name": "workspace_id",
                "value": "",
                "type": "path"
              },
              {
                "name": "key_id",
                "value": "",
                "type": "path"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            }
          },
          "docs": "Replace an API key secret in one step. The old secret stops working immediately, and the response includes the new plaintext `api_key` exactly once."
        }
      ]
    }
  ],
  "bundled": true
}