Skip to content

Creating Service Accounts

Step-by-step guide to creating and managing service accounts (agents).

Create Agent

curl -X POST http://localhost:8000/api/sso/v1/agents \
  -H "Authorization: Bearer TOKEN" \
  -d '{
    "name": "API Service",
    "description": "Backend API service",
    "scopes": ["read:users", "write:logs"],
    "workspace_id": "ws_engineering"
  }'

Generate API Key

curl -X POST http://localhost:8000/api/sso/v1/apikeys \
  -H "Authorization: Bearer TOKEN" \
  -d '{
    "agent_id": "service:abc123",
    "name": "Production Key",
    "expires_in_days": 365
  }'

Response includes the API key - save it securely!

Use API Key

curl -X GET http://localhost:8000/api/sso/v1/users \
  -H "Authorization: Bearer usso_sk_..."

Learn more →