{
  "opencollection": "1.0.0",
  "info": {
    "name": "SuperAI Flow Platform auth service-accounts API",
    "version": "0.1.0"
  },
  "items": [
    {
      "info": {
        "name": "service-accounts",
        "type": "folder"
      },
      "items": [
        {
          "info": {
            "name": "List all service accounts",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "{{baseUrl}}/api/service-accounts",
            "params": [
              {
                "name": "offset",
                "value": "0",
                "type": "query",
                "description": "Number of records to skip for pagination"
              },
              {
                "name": "limit",
                "value": "100",
                "type": "query",
                "description": "Maximum number of records to return"
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "List all service accounts accessible to the current user.\n\nReturns organization accounts for your organization plus all system accounts.\n\nContext:\n    - Returns accounts from your organization\n    - Includes all system accounts\n    - Does not include accounts from other organizations\n\nRelated Endpoints:\n    - GET /service-accounts/{id} - Get specific account details\n    - POST /service-accounts - Create new account"
        },
        {
          "info": {
            "name": "Create a new service account",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "{{baseUrl}}/api/service-accounts",
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Create a new service account.\n\nCreates a new service account and returns the full authentication token.\n**Important**: The full token is only shown once during creation. Store it securely.\n\nContext:\n    - This API creates organization-scoped accounts only\n    - Token format: saf_{type}_{org_prefix}_{account_id_prefix}_{random_part}\n\nUse Cases:\n    - Create API integration accounts\n    - Set up automated workflows\n    - Enable programmatic access to platform resources\n\nRelated Endpoints:\n    - GE"
        },
        {
          "info": {
            "name": "Get a specific service account",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "{{baseUrl}}/api/service-accounts/:service_account_id",
            "params": [
              {
                "name": "service_account_id",
                "value": "550e8400-e29b-41d4-a716-446655440000",
                "type": "path",
                "description": "UUID of the service account to retrieve"
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Get details for a specific service account.\n\nReturns service account information including status and token prefix.\nNote: Full token is never returned after creation.\n\nContext:\n    - Users can only access accounts from their organization\n    - System accounts are accessible to all users\n    - Token prefix is shown for identification purposes\n\nRelated Endpoints:\n    - GET /service-accounts - List all accounts\n    - PATCH /service-accounts/{id} - Update account"
        },
        {
          "info": {
            "name": "Update a service account",
            "type": "http"
          },
          "http": {
            "method": "PATCH",
            "url": "{{baseUrl}}/api/service-accounts/:service_account_id",
            "params": [
              {
                "name": "service_account_id",
                "value": "550e8400-e29b-41d4-a716-446655440000",
                "type": "path",
                "description": "UUID of the service account to update"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Update a service account.\n\nUpdates name and/or description of a service account.\nStatus updates should use activate/deactivate endpoints.\n\nContext:\n    - Can update name and description\n    - Cannot update token (use delete + create for new token)\n    - Cannot update status (use activate/deactivate endpoints)\n\nRelated Endpoints:\n    - POST /service-accounts/{id}/activate - Activate account\n    - POST /service-accounts/{id}/deactivate - Deactivate account"
        },
        {
          "info": {
            "name": "Delete a service account",
            "type": "http"
          },
          "http": {
            "method": "DELETE",
            "url": "{{baseUrl}}/api/service-accounts/:service_account_id",
            "params": [
              {
                "name": "service_account_id",
                "value": "550e8400-e29b-41d4-a716-446655440000",
                "type": "path",
                "description": "UUID of the service account to delete"
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Delete a service account.\n\nPermanently deletes a service account. This action cannot be undone.\n\nContext:\n    - Hard delete (permanent removal)\n    - Cannot be undone\n    - Use deactivate if you want to temporarily disable access\n\nRelated Endpoints:\n    - POST /service-accounts/{id}/deactivate - Temporarily disable account"
        },
        {
          "info": {
            "name": "List API keys for a service account",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "{{baseUrl}}/api/service-accounts/:service_account_id/api-keys",
            "params": [
              {
                "name": "service_account_id",
                "value": "550e8400-e29b-41d4-a716-446655440000",
                "type": "path",
                "description": "UUID of the service account to list API keys for"
              },
              {
                "name": "offset",
                "value": "0",
                "type": "query",
                "description": "Number of records to skip for pagination"
              },
              {
                "name": "limit",
                "value": "100",
                "type": "query",
                "description": "Maximum number of records to return"
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "List all API keys associated with a specific service account.\n\nReturns all API keys that belong to the specified service account.\nThe user must have access to the service account to view its API keys.\n\nContext:\n    - Only returns API keys for the specified service account\n    - User must have access to the service account\n    - Returns empty list if no API keys exist for the account\n\nRelated Endpoints:\n    - GET /service-accounts/{id} - Get service account details\n    - POST /api-keys - Create a"
        },
        {
          "info": {
            "name": "Create an API key for a service account",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "{{baseUrl}}/api/service-accounts/:service_account_id/api-keys",
            "params": [
              {
                "name": "service_account_id",
                "value": "550e8400-e29b-41d4-a716-446655440000",
                "type": "path",
                "description": "UUID of the service account to create an API key for"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Create a new API key for a specific service account.\n\nCreates a new API key associated with the specified service account and returns\nthe full authentication token.\n**Important**: The full token is only shown once during creation. Store it securely.\n\nContext:\n    - The user must have access to the service account\n    - System accounts are not visible to API users due to RLS restrictions\n    - All accessible service accounts are organization accounts\n    - Uses 'organization_service_account' iden"
        },
        {
          "info": {
            "name": "Update an API key",
            "type": "http"
          },
          "http": {
            "method": "PATCH",
            "url": "{{baseUrl}}/api/service-accounts/:service_account_id/api-keys/:api_key_id",
            "params": [
              {
                "name": "service_account_id",
                "value": "550e8400-e29b-41d4-a716-446655440000",
                "type": "path",
                "description": "UUID of the service account"
              },
              {
                "name": "api_key_id",
                "value": "550e8400-e29b-41d4-a716-446655440000",
                "type": "path",
                "description": "UUID of the API key to update"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Update an API key name and/or description.\n\nUpdates the name and/or description of an API key.\nNote: Cannot update the token itself - delete and create a new key for that.\n\nContext:\n    - Can update name and description only\n    - Cannot update token (use delete + create for new token)\n    - User must have access to the API key\n\nRelated Endpoints:\n    - DELETE /service-accounts/{id}/api-keys/{key_id} - Delete API key\n    - GET /service-accounts/{id}/api-keys - List API keys for service account"
        },
        {
          "info": {
            "name": "Delete an API key",
            "type": "http"
          },
          "http": {
            "method": "DELETE",
            "url": "{{baseUrl}}/api/service-accounts/:service_account_id/api-keys/:api_key_id",
            "params": [
              {
                "name": "service_account_id",
                "value": "550e8400-e29b-41d4-a716-446655440000",
                "type": "path",
                "description": "UUID of the service account"
              },
              {
                "name": "api_key_id",
                "value": "550e8400-e29b-41d4-a716-446655440000",
                "type": "path",
                "description": "UUID of the API key to delete"
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Soft delete an API key (sets deleted = True).\n\nPermanently deletes an API key. Any applications using this key will immediately lose access.\n\nContext:\n    - Soft delete (sets deleted = True)\n    - Applications using this key will lose access immediately\n    - Cannot be undone\n\nRelated Endpoints:\n    - PATCH /service-accounts/{id}/api-keys/{key_id} - Update API key\n    - GET /service-accounts/{id}/api-keys - List API keys for service account"
        }
      ]
    }
  ],
  "bundled": true
}