Admin API
The management API behind the console: base URL, authentication with API secrets or bearer tokens, the response envelope, pagination, rate limits and the resource groups.
Everything the console does goes through the admin API, so anything you configure on screen can also be scripted: realms, clients, users, roles, webhooks and the rest. It is a JSON API on the same host as the protocol endpoints, under /api/v1/admin.
Base URL
https://authio.api.hyperio.tech/api/v1/adminOn a Dedicated environment, use your environment’s API address with the same paths, and credentials created in that environment’s own console. The version is part of the path; v1 is the current one.
In paths, {realm} is the realm ID (acme), {client} is the client ID (acme-web), and identifiers such as {userId} are GUIDs. A realm or client of another account answers as if it did not exist.
A client registered from a Client ID Metadata Document is identified by a URL, so escape it to a single path segment: https://mcp.example.com/client.json becomes https%3A%2F%2Fmcp.example.com%2Fclient.json. Authio puts the slashes back before reading the route, so every route that takes {client} finds the client as it is stored.
curl "https://authio.api.hyperio.tech/api/v1/admin/realms/acme/clients/https%3A%2F%2Fmcp.example.com%2Fclient.json" \
-H "x-api-key: $AUTHIO_API_KEY"Authentication
| Credential | Header | Use it for |
|---|---|---|
| API key | x-api-key: <key> or Authorization: Bearer <key> | Scripts, CI pipelines and integrations. The value starts with ak_. |
| Personal access token | Authorization: Bearer <token> or x-api-key: <token> | Automation that acts for the person who made it, never further than that person may act today. The value starts with pat_. |
| Bearer token | Authorization: Bearer <access token> | Calls made for a person signed in to the console, or with a token your script obtains from an account secret. The token must be issued by the platform realm authio to its client authio; tokens issued by your own realms are refused here. |
Authio generates every credential value, with a prefix that names its kind: ak_ for an API key, pat_ for a personal access token and cs_ for an account client secret. The prefix tells an API key or a personal access token in the Authorization header apart from a JWT, and lets secret scanners recognise a leaked value. A client secret (cs_) is never sent to the admin API itself: it is exchanged for a token first. When a request carries both headers, the one in Authorization is used.
The credentials of a client’s consumers are not accepted by the admin API: they act inside their client, while the admin API works at the level of the account. A consumer’s API key is validated by your own API at the realm’s introspection endpoint with token_type_hint=api_key — see API keys. A PUT on a consumer never changes its type: leaving type out keeps it, and another type is refused with ValidationFailed on type.
API secrets
Create the secret
In the console, open API secrets and choose New secret. Choose the type API key, give it a name and, if you want it to stop working on its own, an expiry date.
Allow only what the caller needs
Pick the roles and scopes the secret may use. They are the most it can ever do, whatever else the account allows.
Copy the value
The value is shown once, at creation. Keep it in a secret manager, and create a separate secret for each integration so you can revoke one without the others.
With the SDKs, the secret goes in the client’s configuration and every call carries it: createAuthioAdminClient from @hyper.authio/admin on Node.js, with a method for every route, and IAuthioAdminClient from Authio.Client on .NET, which covers users, roles, groups, sessions and secrets; any other route goes through the HttpClient of routes without a method. From any other language, send the secret in a header:
import { createAuthioAdminClient } from '@hyper.authio/admin'
const admin = createAuthioAdminClient({
authority: 'https://authio.api.hyperio.tech',
credential: process.env.AUTHIO_API_KEY!, // ak_…
})
const realm = await admin.realm.getByRealmId({ realm: 'acme' })Only active, unexpired API keys and personal access tokens authenticate directly, and only for realms and clients of the account that owns them. Every attempt, accepted or refused, is written to the access log. A call to a realm or client the account does not reach (another account’s, or one that does not exist) gets 403 with errorCode Forbidden, as a signed-in person would; a missing, unknown, deleted or expired secret gets 401 from the next call.
A machine credential of the account cannot impersonate anyone: an API key, a personal access token or a token exchanged with the account’s client secret gets 403 with errorCode ImpersonationActorNotAPerson from POST /api/v1/admin/realms/{realm}/users/{userId}/impersonate, whatever roles it carries. Impersonation is support work, done by a person signed in to the console, whose name the audit trail keeps. The refused attempt is still recorded, with the credential as its actor.
Bearer tokens from an account secret
A script that prefers short-lived bearer tokens can exchange an account secret for one. Create a secret of type Client secret in API secrets, with the roles the script needs. The SDKs make the exchange themselves, keep the token and renew it before it expires: give createAuthioAdminClient the value and the secret’s credentialId, or, on .NET, set AdminAuthentication to ClientCredentials and AdminClientId to the secret’s cred_… client ID. From any other language, present it to the platform realm’s token endpoint with the client credentials grant:
import { createAuthioAdminClient } from '@hyper.authio/admin'
const admin = createAuthioAdminClient({
authority: 'https://authio.api.hyperio.tech',
credential: process.env.AUTHIO_ACCOUNT_SECRET!, // cs_…
credentialId: process.env.AUTHIO_ACCOUNT_SECRET_ID, // the secret's ID, or its cred_… client ID
})The access token it returns carries only the roles and scopes allowed on the secret and never outlives the secret’s own expiry. Send it as Authorization: Bearer to the admin API.
Permissions
Each endpoint requires a permission made of a resource — realm, client, user, role, scope, secret, audit, account, support, userexport, plan, subscription, granttype or pkcemethod — and an action: read, write (create), update or delete. A caller holds what all of its roles grant together; an API key, an account client secret or a personal access token also holds the permissions it was given directly, its adminScopes (admin:realm:read, admin:client:write), and every one of them is narrowed to what the person who created it may do today. A realm scope granted to a credential gives no permission here. Missing or invalid credentials get 401; valid credentials without the permission get 403. See Team and access for the roles of the console.
Narrowing a token with administration scopes
Roles decide what a token may do; administration scopes narrow it. When you exchange an account client secret or a personal access token for a token, ask for scopes written admin:{permission}:{method} — such as admin:user:read or admin:client:write — and the token may do only those, even if the credential’s roles grant more. Hand such a token to a job that needs one thing, and a leak exposes only that thing. With the SDKs, it is scopes in createAuthioAdminClient and AdminScopes on .NET, which narrow only a token the credential is exchanged for.
const admin = createAuthioAdminClient({
authority: 'https://authio.api.hyperio.tech',
credential: process.env.AUTHIO_ACCOUNT_SECRET!, // cs_…
credentialId: process.env.AUTHIO_ACCOUNT_SECRET_ID,
scopes: ['admin:user:read', 'admin:client:read'],
})- A token that carries no administration scope is held to its roles alone.
- A scope can only narrow: each one asked for must be granted by the credential’s roles, or the token request fails with
invalid_scope. - The
admin:prefix is reserved. A scope under it that names no permission and method, such asadmin:users:readoradmin:user:*, is refused withinvalid_scopeinstead of being dropped, and no scope of your own may start with it. - A narrowed token cannot create, change or rotate an API secret that reaches further than the token itself: every permission of the secret’s roles, and every one of its
adminScopes, must be one of the token’s administration scopes, or the call gets403witherrorCodeWiderThanCaller. The same holds for any machine credential creating another.
Response envelope
Responses are JSON in camelCase, with empty fields left out. A success wraps the result in data:
{
"statusCode": 200,
"success": true,
"data": {
"id": "6f1c2a7e-3b4d-4e8f-9a10-5c6d7e8f9a0b",
"realmId": "acme",
"name": "Acme",
"status": "Active"
}
}| Field | What it holds |
|---|---|
success | Whether the request succeeded. |
statusCode | The HTTP status as a number, repeated in the body: 200 on a success, 404 on the error above. |
data | The result, on success. On paged lists it holds the page: items, totalCount, pageNumber and pageSize. |
notifications | Messages for people. On a validation error there is one per refused field, with field — its camelCase path in the request body — and code, the rule that refused it. |
errorCode | On errors: a stable code to branch on. See Error codes. |
requestId | On errors: the request’s identifier, also sent on every response in the X-Request-Id header. |
errorCode, never on the message. Messages are written for people and may change.The user export is the one answer outside the envelope: on success it is application/x-ndjson, one person per line, written as the people are read, with a Content-Disposition naming the file. A refusal comes before the first line, in the envelope above; a failure partway through drops the connection, so a file whose last line does not end in a line break is incomplete. See Export your users.
Pagination and filtering
Lists that page share the same query parameters and answer with the page in data: the records in items, the total across every page in totalCount, and the pageNumber and pageSize that were applied. @hyper.authio/admin answers that page as it is, and admin.paginate(admin.realmClient.getClientsPaginated, { realm: 'acme' }) walks every page; on .NET, ListUsersAsync and ListClientUsersAsync answer an AuthioAdminPage<T> with the same four fields.
| Parameter | Default | Notes |
|---|---|---|
pageNumber | 1 | Values below 1 read as 1. |
pageSize | 10 | At most 200; larger values read as 200. |
searchTerm | — | Free text matched against the resource’s text fields. |
status | — | Restricts the list to one status, such as Active. |
sortBy | Creation date | The field to order by; an unknown field falls back to the creation date. |
sortDirection | desc | asc or desc. |
createdFrom, createdTo | — | A creation-date range. createdFrom is inclusive, createdTo exclusive. |
curl "https://authio.api.hyperio.tech/api/v1/admin/realms/acme/clients?pageNumber=1&pageSize=20&sortDirection=asc" \
-H "x-api-key: $AUTHIO_API_KEY"Rate limits
Most endpoints allow 300 requests per minute per caller. Sensitive ones — creating or changing API secrets, imports, impersonation and a few others — allow 50. Above those, the API applies overall ceilings per caller and per realm. A refused request gets 429 with a Retry-After header, in seconds, and errorCode TooManyRequests.
Request IDs and retries
Every response carries an X-Request-Id header. Send your own — up to 128 characters of letters, digits, -, _, : and . — to follow a call across your logs and ours, and quote it when you contact support.
The API takes no idempotency key. If a create times out, read the resource back before sending it again: creating a realm or client whose ID is already taken is refused with 409 and AlreadyExists.
OpenAPI document and typed clients
The admin API is described by a versioned OpenAPI document, which the Node.js admin client is generated from. The shared platform does not serve it: /openapi/v1.json and the interactive reference at /scalar answer only where the deployment turns them on with ApiDocumentation__Enabled=true. To call the API with types, use the admin client of the SDKs, @hyper.authio/admin on Node.js or Authio.Client on .NET, authenticated with an account credential: see The Admin API from the libraries.
Rotating secrets
Two endpoints generate a new value and return it once: POST /realms/{realm}/clients/{client}/client-secret/rotate for a client’s secret, and POST /secrets/{id}/rotate for an account credential — an API key, a personal access token or an account client secret. Both take an optional JSON body that says what becomes of the previous value. Without one, the previous value is refused at once and the tokens issued with it keep working until they expire. On Node.js, they are admin.clientSecret.rotate({ realm, client, body }) and admin.secret.rotate({ id, body }). On .NET, RotateSecretAsync(secretId) of IAuthioAdminClient rotates an account credential without a body; a client’s secret, and any rotation with a body, go through the HttpClient of routes without a method.
| Field | Type | What it does |
|---|---|---|
previousValueValidForMinutes | integer, optional | Minutes the previous value keeps authenticating, from 0 to the environment’s maxPreviousValueValidForMinutes. 0 or absent refuses it at once. |
revokeIssuedTokens | boolean, optional | The previous value leaked: it is refused at once, the access tokens issued with it before the rotation turn inactive at introspection and are refused by Authio’s own APIs, and their refresh tokens stop working. For a client’s secret, people signed in to the client sign in again. |
A period above 0 and revokeIssuedTokens: true exclude each other. Sending both, or a period out of range, gets 400 with errorCode ValidationFailed, and the notification names the refused field (revokeIssuedTokens or previousValueValidForMinutes).
curl -X POST https://authio.api.hyperio.tech/api/v1/admin/realms/acme/clients/acme-web/client-secret/rotate \
-H "x-api-key: $AUTHIO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"previousValueValidForMinutes": 60}'The answer carries the new value once — clientSecret, clientSecretLastFour and clientSecretRotatedAt for a client, the secret with its value for an account credential — and rotation, which says what became of the previous one. Times are UTC.
| Field of rotation | What it holds |
|---|---|
mode | Immediate (refused at once), Overlap (still accepted for a while) or Compromise (refused at once, with its tokens revoked). |
previousValueValidUntil | Until when the previous value still authenticates; only for Overlap. |
issuedTokensRevokedBefore | Tokens issued with the previous value before this instant are revoked; only for Compromise. |
Reads follow the last rotation: a client’s clientConfiguration carries previousClientSecretValidUntil and issuedTokensRevokedBefore, and every API secret carries previousValueValidUntil and issuedTokensRevokedBefore. The …ValidUntil field is set only while the previous value still authenticates; a cached read can outlive it, so compare it with the current time before relying on it.
GET /secrets/rotation-policy answers maxPreviousValueValidForMinutes, the longest the environment lets a previous value keep working (currently 1440, a day). It is open to anyone holding secret:read, secret:write or secret:update, and the console offers only the overlaps within it.
Every rotation is recorded in the change trail with details holding mode, previous_value_valid_until and issued_tokens_revoked_before. A client’s secret rotation also raises admin_resource_updated on the realm’s webhooks, with the same details.
Resource groups
Paths are relative to /api/v1/admin.
| Group | Base paths | What it covers |
|---|---|---|
| Realms | /realms, /realms/{realm} | Realms, their status and identity configuration. |
| Clients | /realms/{realm}/clients, /realms/{realm}/clients/{client} | Clients and, under each, its secret, consumers, scopes, roles, claim mappers, allowed IPs and identity providers. |
| Client keys | /realms/{realm}/clients/{client}/security-keys, /public-keys, /encryption-key | The client’s signing keys, with rotate, {keyId}/set-current and {keyId}/revoke; the public keys it registered for private_key_jwt; and the key its tokens are encrypted to. |
| Client users and groups | /realms/{realm}/clients/{client}/users, /realms/{realm}/clients/{client}/groups | Who may use the client — access, status, roles, sessions, password and e-mail confirmation — and the client’s groups with their roles. |
| Client groups | /realms/{realm}/client-groups | Named sets of clients, with {clientGroupId}/clients to add and remove members. |
| E-mail texts | /realms/{realm}/clients/{client}/email-texts | The client’s own e-mail texts: GET lists them, PUT {kind}/{locale} saves one, DELETE {kind}/{locale} goes back to the platform’s text, POST {kind}/{locale}/preview renders it, POST {kind}/{locale}/test sends a test e-mail and POST {kind}/{locale}/ai-draft asks the AI for a draft. Saving needs the plan’s custom sign-in appearance (AuthLayoutNotIncluded otherwise); words refused or a language the messages are not written in answer 400 with EmailTextInvalid. |
| Realm users | /realms/{realm}/users, /realms/{realm}/users/export, /realms/{realm}/clients/{client}/users/export | The people of a realm, their roles, organizations, federated identities, connected accounts, threat standing and impersonation. POST users/export writes the people of the realm, or of one client, to NDJSON and needs userexport:read; {"includePasswordHashes": true} adds the hashes, only when the account’s Owner asks, signed in (PasswordHashExportNotOwner and PasswordHashExportNotAPerson otherwise). One export of an account runs at a time (409 UserExportInProgress). See Export your users. |
| Required enrolments | /users/{userId}/required-enrolments | GET reads, and PUT sets with { "passkey": true, "phone": false }, which credentials the person must enrol on their next sign-in. Needs user:read or user:update. Asking for one the person already holds gets 409 with errorCode EnrolmentAlreadyHeld, and a demand withdraws itself once the person enrols. |
| Roles | /realms/{realm}/roles, /realms/{realm}/clients/{client}/roles, /roles | Roles of a realm, of a client, and the account’s own. |
| Scopes | /scopes, /realms/{realm}/scopes, /realms/{realm}/clients/{client}/scopes | The scope catalogue, scopes exclusive to a realm and the scopes a client allows. |
| Organizations | /realms/{realm}/organizations | B2B organizations, their members, domains and identity providers. |
| Resource servers | /realms/{realm}/resource-servers | The APIs and MCP servers tokens are issued for. |
| Identity providers | /realms/{realm}/identity-providers | External identity providers and their role mappings. |
| Sessions | /realms/{realm}/sessions | Open sessions, to read and revoke. |
| Webhooks | /realms/{realm}/webhooks, /realms/{realm}/clients/{client}/webhooks | Webhook subscriptions per realm and per client, with {webhookId}/rotate-secret, {webhookId}/test and deliveries; a client’s webhooks also expose metrics, events and {webhookId}/deliveries/{deliveryId}/replay. See the event types. |
| Delegation | /realms/{realm}/delegation-grants | Delegation grants used by token exchange. |
| Connected accounts | /realms/{realm}/connection-providers, /realms/{realm}/connections | Connection providers and the accounts people connected. |
| Suspensions | /suspensions, /realms/{realm}/clients/{client}/users/{userId}/suspensions, /roles/{roleId}/suspensions, /scopes/{scopeId}/suspensions | User suspensions, and the ones that hold back a role or a scope. |
| Account-wide lists | /estate/users, /estate/clients, /estate/sessions, /estate/webhooks and the other /estate/... routes, /estate/summary | Read-only lists across every realm of the account, or narrowed to one realm or client, with the counts the console’s list screens show. |
| Attacks | /threat-incidents, /threat-incidents/mitigations, /threat-incidents/trusted-sources, /threat-incidents/protection, /threat-incidents/sensitivity, /threat-incidents/reinforcements, /threat-incidents/simulations | Detected attacks and how to lift or dismiss them, every measure in force with blocks taken by hand, the trusted addresses the engine never blocks whole, each realm’s sensitivity and reinforced protection, and the simulations of its levels. See Attack protection. |
| Client quarantine | /client-quarantines, /realms/{realm}/clients/{client}/quarantine-policy | GET lists the quarantines, the standing ones first, narrowed by realmId, clientId, status, origin and incidentId and paged with pageNumber and pageSize; GET overview reads the quarantines of a window across every realm you administer, with the totals and the figures of each day; POST puts a client in quarantine, now or scheduled, and answers 201; GET {quarantineId} reads one, GET {quarantineId}/activity the attempts refused and let through during it and GET {quarantineId}/briefings its AI readings; PUT {quarantineId}/end moves its end; POST {quarantineId}/lift ends it, or cancels it before its start, with a reason, and POST {quarantineId}/briefings/{briefingId}/retry asks again for a reading that failed. Under a client, GET and PUT quarantine-policy read and save its automatic quarantine. Reading needs client:read, the rest client:update. See Client quarantine. |
| Support | /support/tickets, /support/requests | Support tickets — messages, status, priority, assignee, escalation and {id}/ai-triage — and the trace of a request named by its requestId. Needs the support permission. See Support. |
| Notifications and dashboard | /notifications, /dashboard | The console’s notifications and the numbers of its dashboard. |
| Authio AI | Routes that start with ai- under /realms/{realm}, /realms/{realm}/clients/{client} and the account | The AI advisor’s readings, drafts and reviews. See Authio AI. |
| API secrets | /secrets | The account’s secret vault, with {id}/rotate and rotation-policy (see Rotating secrets). |
| Audit | /audit-trail, /access-logs | Changes made through the admin API — see the change trail — and sign-ins and token issuance. |
| Account | /account | The account and its team. |
| Import | /import, /import/{resourceType}, /import/translate, /import/migrate?dryRun=true, /realms/{realm}/clients/{client}/users/import | Importing configuration and users, and migrating from other providers, with a dry run first. |
The routes the console uses to follow and operate a Dedicated environment live on the shared platform, under /api/v1/dedicated/instance, and need the account permissions to read and update the account.
A client’s audience, in its token settings, is its Client ID and does not change: PUT /realms/{realm}/clients/{client} keeps it when the field is left out or sent unchanged, and answers 400 with errorCode AudienceNotEditable to any other value, empty included. A token meant for one of your APIs names it as a resource server instead.