Skip to content

Admin API ​

The Admin API provides tenant lifecycle management. It is exposed on the External Task API surface (port 8084) under the /admin/* path prefix.

Authentication ​

The Admin API does not accept OAuth2 client_credentials JWTs. It requires a Kubernetes ServiceAccount bearer token whose SA carries the agentorca.io/admin: "true" label.

bash
# Obtain an admin SA token
kubectl create token agentorca-admin -n agent-orca-system

# Use it with aoctl
aoctl admin tenants list --token $(kubectl create token agentorca-admin -n agent-orca-system)

The operator validates the SA token via the Kubernetes TokenReview API and checks the agentorca.io/admin label on the ServiceAccount. Unlabeled SAs receive 403 Forbidden.

Endpoints ​

MethodPathDescription
GET/admin/tenantsList all tenants
POST/admin/tenantsCreate a new tenant
GET/admin/tenants/{name}Get a tenant by name
DELETE/admin/tenants/{name}Delete a tenant
POST/admin/tenants/{name}/rotate-secretRotate a tenant's client secret

GET /admin/tenants ​

List all tenants.

Response:

json
{
  "tenants": [
    {
      "name": "acme",
      "namespace": "agentorca-system",
      "clientID": "acme-client",
      "allowedNamespaces": ["tenant-acme"],
      "allowedAgents": ["support-bot"],
      "rateLimit": {"requestsPerMinute": 60, "concurrentRuns": 10},
      "budgetPerDayUSD": "100.00"
    }
  ]
}

POST /admin/tenants ​

Create a new tenant. This writes a TenantConfig CRD and a client-secret Secret in the agentorca-system namespace.

Request body:

FieldTypeRequiredDescription
namestringyesTenant name (used for the TenantConfig name)
allowedNamespaces[]stringyesNamespaces the tenant is authorized to access; agents/runs are resolved to their namespace within this set
clientIDstringyesOAuth2 client ID
clientSecretstringnoInitial client secret (auto-generated if omitted)
allowedAgents[]stringnoAgent names this tenant can access
rateLimit.requestsPerMinuteintnoMax task submissions per minute (0 = unlimited)
rateLimit.concurrentRunsintnoMax concurrent runs (0 = unlimited)
budgetPerDayUSDstringnoDaily spend ceiling in USD

Response (201):

json
{
  "name": "acme",
  "namespace": "agentorca-system",
  "clientID": "acme-client",
  "clientSecret": "auto-generated-secret-abc123",
  "allowedNamespaces": ["tenant-acme"],
  "allowedAgents": ["support-bot"],
  "rateLimit": {"requestsPerMinute": 60, "concurrentRuns": 10},
  "budgetPerDayUSD": "100.00"
}

Note: clientSecret is included only in the create response. It is never retrievable afterwards. Save it immediately.

GET /admin/tenants/ ​

Get a single tenant by name. Returns the same shape as a tenant entry in the list response (without clientSecret).

POST /admin/tenants/{name}/rotate-secret ​

Rotate the client secret for a tenant. The new secret is generated by the operator and returned in the response.

Response (200):

json
{
  "name": "acme",
  "clientID": "acme-client",
  "clientSecret": "new-secret-xyz789"
}

DELETE /admin/tenants/ ​

Delete a tenant. This removes the TenantConfig and associated client-secret Secret. Existing AgentRun resources in the tenant's namespace are not automatically cleaned up.

Response: 204 No Content

Using the CLI ​

All admin operations are available via aoctl admin tenants:

bash
# List
aoctl admin tenants list --token $SA_TOKEN

# Get
aoctl admin tenants get acme --token $SA_TOKEN

# Create
aoctl admin tenants create acme \
  --namespace tenant-acme \
  --client-id acme-client \
  --allowed-agents support-bot,faq-bot \
  --rpm 60 \
  --concurrent 10 \
  --budget 100.00 \
  --token $SA_TOKEN

# Rotate secret
aoctl admin tenants rotate-secret acme --token $SA_TOKEN

# Delete
aoctl admin tenants delete acme --token $SA_TOKEN

Rate limiting & budget ​

When creating a tenant, set rateLimit and budgetPerDayUSD to control resource usage. See Rate Limiting & Budget Enforcement for details on how these are enforced and what HTTP responses clients receive when limits are exceeded.

Released under the Apache 2.0 License.