Admin
Organization, people, team, runtime, usage, and audit routes.
Manage organizations, people, teams, workers, jobs, schedules, usage, and audit. Tenant administration requires an owner or admin role for the target org/team; global worker operations require operator credentials.
Capability groups
| Group | Prefix | Manages |
|---|---|---|
| Organizations | /v1/admin/organizations | Org settings, slugs, and region/residency defaults. |
| People | /v1/admin/people | Directory, invitations, role assignment, and removal. |
| Teams | /v1/admin/teams | Team CRUD, membership, default model, and mode. |
| Harness policies | /v1/admin/harness-policies | Stored team harness configuration, not an enforcement engine. |
| Workers | /v1/admin/workers | Registered worker fleet and host visibility. |
| Jobs | /v1/admin/jobs | Control-plane job queue: inspect, retry, cancel. |
| Schedules | /v1/admin/schedules | Region scheduling policy (the field is region, never lane). |
| Usage | /v1/admin/usage | Per-team spend and request counters. |
| Audit | /v1/admin/audit | Append-only audit log of privileged actions. |
Shared conventions
- List routes are cursor-paginated (
limit+ opaquecursor). - Mutations accept an
Idempotency-Key; reusing it with different parameters returns409 idempotency_conflict. - Updates to mutable resources use
If-Match; a stale revision returns412 precondition_failed. - All path identifiers (team, email, ids) must be URL path-escaped.
Team settings
GET /v1/admin/teams/{team} returns configured settings and model IDs, not the servable, authorized model list. Use public GET /v1/teams/{team} for gated cloud discovery and authoritative modelMetadata.
On a running service, registry-verification outages do not block admin settings reads or model grant edits. Authentication, scope, ETag, and idempotency rules still apply. Saving settings or enabling a grant does not reopen model serving without independent verification.
Harness policies
GET /v1/admin/harness-policies?team={team} reads stored configuration; POST or PUT saves it. /v1/admin/harness-policies/{team} supports the same methods.
When no policy is stored, defaults are allowedFunctions: ["read", "bash", "edit", "write"], mandatoryFunctions: [], sandboxProfiles: ["vm-default"], loopEnabled: false, and exceptionLogging: true. Saving fills an empty sandbox-profile list with vm-default and forces exceptionLogging to true; it does not otherwise merge missing fields with those read defaults.
These fields do not establish CLI connect/status drift enforcement or a signed sandbox policy executed by each worker. Gateway model authorization and worker credential/lease checks are separate implemented controls. See the storage contract.
Worker administration
GET /v1/admin/workers/{id} and /logs, plus POST /drain and /revoke, authorize against the worker's stored team, else organization. A worker with both scopes empty is an intentional cross-organization operator pool: its details, logs, drain, and revoke operations require operator credentials. Request scope hints do not override the stored resource scope.
Registration is operator-only for every scope. The new boundary does not retroactively revoke issued credentials; operators must inventory and rotate/revoke them explicitly.
People & invitations
List directory members or send an invitation. Invites gate the device-login flow — an email with no active invitation fails login with 403 not_invited.
# List people
curl "https://api.s46.dev/v1/admin/people?team=%40s46%2Fengineering" \
-H "Authorization: Bearer $S46_ACCESS_TOKEN"
# Invite someone
curl -X POST https://api.s46.dev/v1/admin/people/invite \
-H "Authorization: Bearer $S46_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 9b7c1e0a-2f4d-4c8e-bf1a-1e2d3c4b5a6f" \
-d '{ "email": "newhire@s46.dev", "team": "@s46/engineering", "role": "member" }'await fetch("https://api.s46.dev/v1/admin/people/invite", {
method: "POST",
headers: {
Authorization: `Bearer ${accessToken}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({ email: "newhire@s46.dev", team: "@s46/engineering", role: "member" }),
});import uuid
requests.post(
"https://api.s46.dev/v1/admin/people/invite",
headers={"Authorization": f"Bearer {access_token}",
"Idempotency-Key": str(uuid.uuid4())},
json={"email": "newhire@s46.dev", "team": "@s46/engineering", "role": "member"},
){
"email": "newhire@s46.dev",
"team": "@s46/engineering",
"role": "member"
}Usage & audit
Usage reports per-team spend and request counters; audit is an append-only log of privileged actions. Both are cursor-paginated.
curl "https://api.s46.dev/v1/admin/audit?team=%40s46%2Fengineering&limit=50" \
-H "Authorization: Bearer $S46_ACCESS_TOKEN"const audit = await fetch(
"https://api.s46.dev/v1/admin/audit?team=%40s46%2Fengineering&limit=50",
{ headers: { Authorization: `Bearer ${accessToken}` } },
).then((r) => r.json());audit = requests.get("https://api.s46.dev/v1/admin/audit",
params={"team": "@s46/engineering", "limit": 50},
headers={"Authorization": f"Bearer {access_token}"}).json(){
"data": [
{
"at": "2030-01-01T12:00:00Z",
"actor": "dscape@s46.dev",
"action": "people.invite",
"target": "newhire@s46.dev",
"team": "@s46/engineering"
}
],
"hasMore": false,
"nextCursor": null
}