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.
# 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
| Method | Path | Description |
|---|---|---|
GET | /admin/tenants | List all tenants |
POST | /admin/tenants | Create a new tenant |
GET | /admin/tenants/{name} | Get a tenant by name |
DELETE | /admin/tenants/{name} | Delete a tenant |
POST | /admin/tenants/{name}/rotate-secret | Rotate a tenant's client secret |
GET /admin/tenants
List all tenants.
Response:
{
"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:
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | Tenant name (used for the TenantConfig name) |
allowedNamespaces | []string | yes | Namespaces the tenant is authorized to access; agents/runs are resolved to their namespace within this set |
clientID | string | yes | OAuth2 client ID |
clientSecret | string | no | Initial client secret (auto-generated if omitted) |
allowedAgents | []string | no | Agent names this tenant can access |
rateLimit.requestsPerMinute | int | no | Max task submissions per minute (0 = unlimited) |
rateLimit.concurrentRuns | int | no | Max concurrent runs (0 = unlimited) |
budgetPerDayUSD | string | no | Daily spend ceiling in USD |
Response (201):
{
"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:
clientSecretis 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):
{
"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:
# 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_TOKENRate 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.
