{"openapi":"3.1.0","info":{"title":"XAuth API","version":"2.45.0","summary":"XSuite identity, receiver-bound tokens and current app, workspace and project authority.","description":"One account per person across the XSuite.\n\n**Database override.** XAuth has one server-configured active authority. Business and discovery requests may assert its name with the optional `database` query parameter; password sign-in also accepts it in the JSON body. Unknown or inactive names fail closed with HTTP 409. The page configuration identifies the active database. Omission preserves existing client behavior.\n\n**The XAuth token.** Legacy sign-in answers the suite token accepted by existing paths: a JWT access token (RFC 9068, `typ: at+jwt`) signed **EdDSA** for the audience `https://xgi.io`, verified against `/.well-known/jwks.json`. It names the person — `sub`, `email`, the session `sid` — and nothing else: no role or permission. Its lifetime is configured by the issuer. Strict Finance paths require exact receiver-bound identity; resource indicators and trusted TokenExchange supply it, preserving the original user and session.\n\n**Decided per request.** What the person may do is answered by XAuth at the time of each request, from their allocations then: workspace roles and the resources in workspaces (the Access Graph), and roles and permissions at each app (grants). Services ask through the `Access` entrypoint their Worker binds to — Workers RPC, not HTTP — which also checks the token’s session and account are still alive. Signing out, a disabled account or a removed membership is refused at the very next request.\n\n**Sign-in for web apps** is OAuth 2.1 authorization code with PKCE (S256): the app sends the person to XTND Auth’s sign-in page, which asks for a code (`/v1/oauth/authorize`); the app exchanges it (`/v1/oauth/token`). No token is ever in a URL. Discovery: `/.well-known/openid-configuration`.\n\n**API keys** are for programs, and modelled on Cloudflare’s API tokens: `Authorization: Bearer xak_…` at any XSuite API, with policies (allow and deny; permission groups — workspace roles and each app’s permissions; resources — workspaces and apps), apps held as a person holds them (roles, given and taken away ad hoc), a client-address condition, `not_before` and `expires_on`. A person’s key acts as them and never past what they may do at the time of the request; a workspace’s key acts inside that workspace only, outlives whoever made it, and reaches only routes that accept one. The secret is shown once.\n\n**Invitations** are how a person without an account comes to have one. Administrators invite into a service’s roles here; platform services (XWorkspace) invite through the `Invitations` entrypoint, never over HTTP, and give access themselves once the person arrives.\n\n**Errors** are RFC 9457 problems (`application/problem+json`): `type`, `title`, `status`, `detail`, `code` — branch on `code` — and the request’s `trace`. Transitional: every refusal also carries `error` (the same as `code`) and `message` (the same as `detail`), which clients built before this format read; they will be removed. Only the OAuth routes (`/v1/oauth/*`) answer RFC 6749’s `{ error, error_description }` instead.","contact":{"name":"XTND DYNAMICS","url":"https://github.com/XTND-DYNAMICS/xtnd-auth-api"},"license":{"name":"UNLICENSED","identifier":"LicenseRef-Proprietary"}},"servers":[{"url":"https://api.auth.xgi.io","description":"This deployment"}],"tags":[{"name":"Service","description":"Liveness, keys and discovery."},{"name":"Registry","description":"The apps of the XSuite: how their sign-in pages look, and where their manifests are."},{"name":"OAuth","description":"OAuth 2.1 code + PKCE and OpenID Connect, for web apps."},{"name":"Auth","description":"Sign in, refresh, sessions."},{"name":"Account","description":"The signed-in person’s own account settings."},{"name":"Invitations","description":"Accepting an invitation, from XTND Auth’s own page. The token is the proof."},{"name":"API keys","description":"Long-lived bearer keys for programs, as Cloudflare’s API tokens: a person’s, or a workspace’s."},{"name":"Credentials","description":"The credential vault: secrets a person keeps in XAuth for a registered service to use on their behalf. Write-only here; only that service’s Worker opens them."},{"name":"Admin","description":"Account, grant, service and invitation administration."}],"security":[{"bearerAuth":[]}],"paths":{"/health":{"get":{"tags":["Service"],"summary":"Liveness probe","operationId":"getHealth","security":[],"responses":{"200":{"description":"Running. Exactly the XTND health contract; diagnostics are on `/version`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}}}}},"/version":{"get":{"tags":["Service"],"summary":"Build and signing-key check","operationId":"getVersion","security":[],"responses":{"200":{"description":"What this build is, and whether a signing key is configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Version"}}}}}}},"/.well-known/jwks.json":{"get":{"tags":["Service"],"summary":"Public signing keys","operationId":"getJwks","security":[],"description":"What consumer services fetch to verify tokens. Cached for 5 minutes.","responses":{"200":{"description":"The active key, plus any retired keys still in their token lifetime.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Jwks"}}}},"503":{"description":"No signing key is configured on this Worker.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/.well-known/openid-configuration":{"get":{"tags":["Service"],"summary":"Discovery document","operationId":"getDiscovery","security":[],"parameters":[{"name":"database","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,62}$","description":"The configured active Auth database name only. This cannot select a connection URL, schema, role or inactive snapshot. A mismatch returns database_not_active (409)."}}],"description":"OpenID Connect Discovery 1.0. The same document is at `/.well-known/oauth-authorization-server` (RFC 8414).","responses":{"200":{"description":"Issuer metadata.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/.well-known/oauth-authorization-server":{"get":{"tags":["Service"],"summary":"Discovery document (RFC 8414)","operationId":"getOAuthMetadata","security":[],"parameters":[{"name":"database","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,62}$","description":"The configured active Auth database name only. This cannot select a connection URL, schema, role or inactive snapshot. A mismatch returns database_not_active (409)."}}],"responses":{"200":{"description":"Issuer metadata.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/openapi.json":{"get":{"tags":["Service"],"summary":"This document","operationId":"getOpenApi","security":[],"responses":{"200":{"description":"OpenAPI 3.1 document.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/apps":{"get":{"tags":["Registry"],"summary":"Discover XSuite apps and their explanatory prompts","operationId":"discoverApps","security":[],"description":"The deliberately public product index, independent of OAuth clients and user access. Every listed app remains present when it has no embedded view or its manifest is unavailable. Metadata is maintained once through the app administration routes. Prompts describe an app; they are not host instructions or permission to act. Responses may be cached for up to 60 seconds.","responses":{"200":{"description":"Every deliberately listed product, with metadata and isolated integration discovery state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppDiscoveryList"}}}}}}},"/v1/services":{"get":{"tags":["Registry"],"summary":"Registered services","operationId":"listServices","security":[],"responses":{"200":{"description":"Every registered service, by slug and name, with its manifest.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceSummaryList"}}}}}}},"/v1/services/{slug}":{"get":{"tags":["Registry"],"summary":"One service, as its sign-in page needs it","operationId":"getService","security":[],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Name, redirect allowlist, home, wordmark, accent and manifest.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceInfo"}}}},"404":{"description":"No such service.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/auth/config":{"get":{"tags":["Auth"],"summary":"What the sign-in page needs first","operationId":"getAuthConfig","security":[],"description":"Whether to show Turnstile, and its (public) site key — Turnstile is asked for once both its site key and secret are configured; the password policy every route that sets a password enforces; and how long an XAuth token lives.","responses":{"200":{"description":"The page configuration.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthConfig"}}}}}}},"/v1/auth/register":{"post":{"tags":["Auth"],"summary":"Create the founding account","operationId":"register","security":[],"description":"Open only while no account exists. Returns 403 afterwards; use `POST /v1/admin/users`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}}},"responses":{"201":{"description":"Account created and signed in.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"400":{"description":"A required field is missing, or the password is under 12 characters.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Registration is closed.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/auth/signup":{"post":{"tags":["Auth"],"summary":"Self-service sign-up: send the link that makes an account","operationId":"signup","security":[],"description":"Makes nothing yet. Sends the address, through XCHANGE, a link to XTND Auth’s invitation page — an invitation to itself at the app `client_id` names, granting nothing — that lasts 24 hours. Opening it, the person chooses a name and a password and the account is made (`POST /v1/invitations/accept`); then the page takes them on to `redirect_uri`. The answer is the same whether or not the address has an account: one that has is sent a link that continues with that account’s password, and one whose account is not active is sent nothing. Rate limited per address and per client address; with Turnstile configured, `turnstile_token` is required.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignupRequest"}}}},"responses":{"202":{"description":"Asked for: a link is on its way unless the address cannot have one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignupAccepted"}}}},"400":{"description":"Not an email address, an unknown app, an unregistered redirect_uri, or a failed challenge.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too many sign-ups for this address or from this client address. Wait a minute.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"502":{"description":"XCHANGE did not send the link; nothing was kept.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"XTND Auth cannot send sign-up links right now.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/auth/login":{"post":{"tags":["Auth"],"summary":"Sign in","operationId":"login","security":[],"parameters":[{"name":"database","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,62}$","description":"The configured active Auth database name only. This cannot select a connection URL, schema, role or inactive snapshot. A mismatch returns database_not_active (409)."}}],"description":"An optional provider instance explicitly selects its authentication/session library; omission uses the configured native default. Existing browser sessions do not override an explicit choice. Verified upstream identities require an approved canonical principal link. Starts a session for XTND Auth’s sign-in page, or for the registered app `client_id` names. The XAuth token is the same either way; sign-in needs an active account and its password, nothing more. Rate limited per address and per client; with Turnstile configured, `turnstile_token` is required.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}}},"responses":{"200":{"description":"Signed in, or password reset required.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/TokenResponse"},{"$ref":"#/components/schemas/PasswordResetRequiredResponse"}]}}}},"400":{"description":"Missing credentials, an unknown app or redirect_uri, or a failed challenge (`challenge_failed`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Invalid email or password.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too many attempts (`too_many_requests`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/auth/reset-password":{"post":{"tags":["Auth"],"summary":"Complete required password reset","operationId":"resetPassword","security":[],"description":"Completes a forced password reset using the scoped reset token, clears the forced reset flag, and issues a session.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordRequest"}}}},"responses":{"200":{"description":"Password reset completed and signed in.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"400":{"description":"Missing field, short password, or unregistered redirect_uri.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Invalid or expired reset token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/auth/change-password":{"post":{"tags":["Auth"],"summary":"Change password for authenticated user","operationId":"changePassword","description":"Allows an authenticated user to change their password voluntarily by verifying their current password.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangePasswordRequest"}}}},"responses":{"200":{"description":"Password changed successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"400":{"description":"Missing password or under 12 characters.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Current password incorrect or unauthenticated.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/auth/refresh":{"post":{"tags":["Auth"],"summary":"Renew a session","operationId":"refresh","security":[],"description":"Rotates the refresh token within its session: the session (`sid`) stays, so XAuth tokens minted before keep working. A token rotated within the last 30 seconds is still honoured. Deprecated: the sign-in page’s own session may name another app (`client_id`) to start a session there; web apps use code + PKCE instead.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshRequest"}}}},"responses":{"200":{"description":"A new XAuth token and refresh token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"400":{"description":"refresh_token is required, or an unknown app.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Expired, revoked, or unknown refresh token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"A password reset is required, or an app’s session asked for another app.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too many attempts.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/auth/logout":{"post":{"tags":["Auth"],"summary":"Sign out: end the session","operationId":"logout","security":[],"description":"Ends the session the refresh token belongs to: every XAuth token from it is refused at its next request, by every service.","requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshRequest"}}}},"responses":{"204":{"description":"Revoked, or the handle was already unknown. Deliberately indistinguishable."}}}},"/v1/auth/providers/link-options":{"get":{"tags":["Account"],"summary":"Configured account linking options","operationId":"getProviderLinkOptions","description":"Requires a live native management session and the exact credentialed Auth Web origin. No-store. Enrollment and identity linking are separate from sign-in.","responses":{"200":{"description":"Active instance choices and approvals for this account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderLinkOptions"}}}},"401":{"description":"A current native management session is required.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Native session or Auth Web origin required.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/auth/providers/{instance}/link/begin":{"post":{"tags":["Account"],"summary":"Begin a browser-bound provider link","operationId":"beginProviderLink","parameters":[{"name":"instance","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Server-approved provider instance ID. Choice never selects an arbitrary URL or links an account by email."}}],"description":"Current native management proof required. Creates a single-use intent bound to the native principal/session, browser and current provider activation. Never links by email.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false}}}},"responses":{"201":{"description":"Opaque intent; HttpOnly secure browser-binding cookie set.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderLinkIntent"}}}},"401":{"description":"Native session required.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Origin or provider refused.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Restart linking with current proof.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/auth/providers/{instance}/link/complete":{"post":{"tags":["Account"],"summary":"Complete verified provider ownership","operationId":"completeProviderLink","parameters":[{"name":"instance","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Server-approved provider instance ID. Choice never selects an arbitrary URL or links an account by email."}}],"description":"Uses actual provider SDK credentials plus the live native session, browser cookie and one-use intent. Global upstream issuer/subject ownership and separate instance approval are atomic. This proof-only operation terminates the upstream proof session; it issues no suite token.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderLinkCompletion"}}}},"responses":{"200":{"description":"Verified identity linked to the existing principal.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderLinkResult"}}}},"401":{"description":"Credential/native proof refused.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Origin or instance refused.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Ownership, activation or intent changed.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Provider unavailable.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/auth/providers/{instance}/link/verify":{"post":{"tags":["Account"],"summary":"Verify a provider sign-in for review","operationId":"verifyProviderLink","parameters":[{"name":"instance","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Server-approved provider instance ID. Choice never selects an arbitrary URL or links an account by email."}}],"description":"Verifies credentials with the instance and ends the proof session before issuing a sealed receipt. No link is created. The receipt is bound to the live native account session, browser and provider activation, and expires with the original intent.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderLinkCompletion"}}}},"responses":{"200":{"description":"Sign-in verified for the connection review.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderLinkReview"}}}},"401":{"description":"Native proof refused.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Credentials, origin or instance refused.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Activation or intent changed.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Provider unavailable.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/auth/providers/{instance}/link/confirm":{"post":{"tags":["Account"],"summary":"Save a reviewed provider connection","operationId":"confirmProviderLink","parameters":[{"name":"instance","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Server-approved provider instance ID. Choice never selects an arbitrary URL or links an account by email."}}],"description":"Consumes the reviewed intent for the same live native account session, browser and activation. Atomically records verified upstream ownership and the instance link. Discarding the receipt leaves the account unchanged.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderLinkConfirmation"}}}},"responses":{"200":{"description":"Verified identity linked to the existing principal.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderLinkResult"}}}},"401":{"description":"Native proof refused.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Origin or instance refused.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Ownership, activation, review receipt or intent invalid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Provider unavailable.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/auth/providers/{instance}/enroll":{"post":{"tags":["Account"],"summary":"Request verified-email provider enrollment","operationId":"enrollProviderAccount","parameters":[{"name":"instance","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Server-approved provider instance ID. Choice never selects an arbitrary URL or links an account by email."}}],"description":"Explicit user action with a live native session and trusted Auth Web origin. Supported SDK enrollment requires email confirmation and configured return URL. Pending enrollment never signs in or creates an identity link.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderCredentials"}}}},"responses":{"202":{"description":"Email verification is required; no session or link was created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderEnrollmentPending"}}}},"401":{"description":"Native proof refused.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Enrollment or origin refused.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Provider unavailable.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/auth/providers/{instance}/link/hosted/begin":{"post":{"tags":["Account"],"summary":"Begin linking through the provider’s hosted page","operationId":"beginHostedProviderLink","parameters":[{"name":"instance","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Server-approved provider instance ID. Choice never selects an arbitrary URL or links an account by email."}}],"description":"Current native management session at the exact credentialed Auth Web origin. Creates the same single-use link intent as password linking, bound to this principal, session, browser and activation, and a hosted transaction; sets the HttpOnly `__Host-xauth-provider-hosted` browser handle (SameSite=Lax, for the provider’s cross-site callback). The adapter asks the provider to authenticate the person again and verifies that it did (an OIDC adapter: `prompt=login` and `max_age=0`, checked against `auth_time`); a provider session the browser already had cannot link. The callback proves the upstream identity and binds it with the atomic owner + instance-link bind; an identity another account owns is refused. Never links by email.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false}}}},"responses":{"201":{"description":"Send the browser to authorization_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostedProviderStart"}}}},"401":{"description":"Native session required.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Origin or native session refused.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Instance not hosted, not linkable or not activated.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Provider or completion route unavailable.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/auth/providers/{instance}/unlink":{"post":{"tags":["Account"],"summary":"Remove this account’s link to a provider","operationId":"unlinkProvider","parameters":[{"name":"instance","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Server-approved provider instance ID. Choice never selects an arbitrary URL or links an account by email."}}],"description":"Current native management session at the exact Auth Web origin. Deletes this account’s instance links only, and in the same transaction revokes the account’s live sessions with that instance; their upstream grants are then ended where the provider supports it. Global identity ownership is kept: the identity can be linked again by this account and never by another. Refused when it would leave no way to sign in: a native password, or a link on another instance that can sign in now.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false}}}},"responses":{"200":{"description":"Unlinked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderUnlinkResult"}}}},"401":{"description":"Native session required.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Origin or native session refused.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not linked (`not_linked`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"The last way to sign in (`last_sign_in_method`), or a native instance.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/auth/providers/{instance}/begin":{"post":{"tags":["Auth"],"summary":"Begin sign-in through a provider’s hosted page","operationId":"beginHostedSignIn","security":[],"parameters":[{"name":"instance","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Server-approved provider instance ID. Choice never selects an arbitrary URL or links an account by email."}}],"description":"From the exact credentialed Auth Web origin. Validates where the session continues (an app’s exact registered OAuth redirect, or a registered legacy return origin) before the provider is contacted, stores the adapter’s private transaction sealed and sets the HttpOnly `__Host-xauth-provider-hosted` browser handle. Rate limited per client; with Turnstile configured, `turnstile_token` is required.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostedProviderBegin"}}}},"responses":{"201":{"description":"Send the browser to authorization_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostedProviderStart"}}}},"400":{"description":"Invalid continuation or a failed challenge (`challenge_failed`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Origin or instance refused.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too many attempts.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Provider or completion route unavailable.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/auth/providers/{instance}/callback":{"get":{"tags":["Auth"],"summary":"Hosted provider callback","operationId":"hostedProviderCallback","security":[],"parameters":[{"name":"instance","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Server-approved provider instance ID. Choice never selects an arbitrary URL or links an account by email."}}],"description":"The route the instance’s configured callback URL must name, reached by the provider’s redirect with this browser’s handle. Claims the transaction once, only when the callback carries the correlation (OAuth `state`) issued at begin; a callback that does not match consumes nothing and keeps the browser handle. Finishes the transaction with the provider. Sign-in establishes the suite session exactly as password sign-in does, resolving the account only through an existing identity link; an unlinked identity is refused and its upstream session ended. Linking binds the identity to the account that began it. Always answers 303 to AUTH_WEB_ORIGIN + AUTH_WEB_PROVIDER_COMPLETION_PATH (registered for the gateway), with `#completion=<one-use handle>` or `#error=<category>`; no token is ever in the URL.","responses":{"303":{"description":"To the sign-in page’s completion route."},"503":{"description":"The completion route is not configured or not registered.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/auth/providers/complete":{"post":{"tags":["Auth"],"summary":"Redeem a hosted provider completion","operationId":"completeHostedProvider","security":[],"description":"From the exact credentialed Auth Web origin, with the same browser handle. Works once, before the transaction expires. Sign-in answers the gateway session with the validated continuation; linking answers the link.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostedProviderCompletion"}}}},"responses":{"200":{"description":"The completed sign-in or link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostedProviderResult"}}}},"400":{"description":"Missing handle.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"The session established at the callback has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Unknown, spent, expired or another browser’s completion.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too many attempts.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"The provider session vault is unavailable.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/me/api-origins":{"get":{"tags":["Account"],"summary":"List this account’s additional API origins","operationId":"listMyApiOrigins","description":"Requires a real live user session. Browser requests must come from XAuth’s own registered account-control origin. Account origin additions do not extend this management control plane. Responses are no-store.","responses":{"200":{"description":"Only the current person’s entries.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountApiOriginList"}}}},"401":{"description":"Missing, invalid or ended user session.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"API key or untrusted account-control origin.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Account origin settings are unavailable.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"post":{"tags":["Account"],"summary":"Allow an exact additional API origin for this account","operationId":"addMyApiOrigin","description":"Adds only to the verified subject’s policy. No account id is accepted in the body. Duplicate exact origins return the existing record. This does not create an OAuth client, redirect, cookie, resource grant or app permission.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountApiOriginInput"}}}},"responses":{"200":{"description":"The exact origin was already enabled; original entry returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountApiOriginResult"}}}},"201":{"description":"New entry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountApiOriginResult"}}}},"400":{"description":"Malformed body or unsupported exact origin.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid or ended user session.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"API key or untrusted account-control origin.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"413":{"description":"JSON request exceeds the transport size limit.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Account origin settings are unavailable.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/me/api-origins/{id}":{"delete":{"tags":["Account"],"summary":"Revoke one of this account’s additional API origins","operationId":"deleteMyApiOrigin","description":"The id is always filtered by the verified subject. Unknown and another account’s ids have the same response. New resource requests read current policy; cached preflight is not permission.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No matching entry remains for this account."},"401":{"description":"Missing, invalid or ended user session.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"API key or untrusted account-control origin.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Account origin settings are unavailable.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/me/emails":{"get":{"tags":["Account"],"summary":"List this account’s primary, secondary and pending email identities","operationId":"listMyEmails","responses":{"200":{"description":"The current account email identities and pending verification challenges.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountEmailsState"}}}},"401":{"description":"Missing, invalid or ended user session.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"API key or untrusted account-control origin.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"post":{"tags":["Account"],"summary":"Send a verification code to add or replace an email on this account","operationId":"startMyEmailVerification","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountEmailVerificationStartInput"}}}},"responses":{"202":{"description":"Verification code dispatched.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountEmailVerificationStartResult"}}}},"400":{"description":"Invalid email.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid or ended user session.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"API key or untrusted account-control origin.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Replacement target is not on this account.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Email is already verified or belongs to another account.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too many verification requests.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"502":{"description":"Verification code could not be delivered.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/me/emails/verify":{"post":{"tags":["Account"],"summary":"Confirm a pending account email verification code","operationId":"verifyMyEmail","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountEmailVerifyInput"}}}},"responses":{"200":{"description":"Email verified and attached to this account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountEmailVerifyResult"}}}},"400":{"description":"Incorrect or malformed code.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid or ended user session.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Verification request not found or expired.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Email belongs to another account.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too many incorrect code attempts.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/me/emails/verifications/{id}":{"delete":{"tags":["Account"],"summary":"Cancel a pending account email verification","operationId":"cancelMyEmailVerification","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Updated email state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountEmailsState"}}}},"401":{"description":"Missing, invalid or ended user session.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Verification request not found.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/me/emails/primary":{"post":{"tags":["Account"],"summary":"Promote a verified email on this account to primary","operationId":"setMyPrimaryEmail","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountPrimaryEmailInput"}}}},"responses":{"200":{"description":"Updated email state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountEmailsState"}}}},"400":{"description":"Invalid email.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid or ended user session.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Email is not verified on this account.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Email conflict.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/me/emails/{email}":{"delete":{"tags":["Account"],"summary":"Remove a secondary verified email from this account","operationId":"deleteMyEmail","parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Updated email state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountEmailsState"}}}},"400":{"description":"Invalid email.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid or ended user session.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Email not on this account.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Primary email cannot be removed directly.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/auth/me":{"get":{"tags":["Auth"],"summary":"The signed-in account and its grants","operationId":"getMe","responses":{"200":{"description":"The account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionAccount"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"The account no longer exists.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/auth/workspaces":{"get":{"tags":["Auth"],"summary":"The workspaces the person can see","operationId":"listMyWorkspaces","description":"From the Access Graph, with their role in each: what their API keys can name. Each carries the name XWorkspace gives it, asked of XWorkspace as the signed-in person; null where XWorkspace has none for it, and the id stands in.","responses":{"200":{"description":"Every workspace they can see.","content":{"application/json":{"schema":{"type":"object","required":["workspaces"],"properties":{"workspaces":{"type":"array","items":{"type":"object","required":["id","role","via","parent","name"],"properties":{"id":{"type":"string"},"role":{"type":"string","enum":["member","admin","owner"]},"via":{"type":"string","enum":["direct","inherited"]},"parent":{"type":["string","null"]},"name":{"type":["string","null"],"description":"The workspace’s name at XWorkspace; null when XWorkspace has none for it."}}}}}}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/auth/sessions":{"get":{"tags":["Auth"],"summary":"Active sessions","operationId":"listSessions","responses":{"200":{"description":"Every live session of this account, one per sign-in.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionList"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/auth/sessions/{guid}":{"delete":{"tags":["Auth"],"summary":"End one session","operationId":"revokeSession","description":"`guid` is the session’s `sid`. Its XAuth tokens are refused at their next request.","parameters":[{"name":"guid","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Revoked."},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such active session.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/auth/sessions/revoke-all":{"post":{"tags":["Auth"],"summary":"Sign out everywhere","operationId":"revokeAllSessions","responses":{"204":{"description":"All sessions revoked."},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/auth/keys":{"get":{"tags":["API keys"],"summary":"List the signed-in person’s API keys","operationId":"listPersonKeys","parameters":[],"responses":{"200":{"description":"Never the secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyList"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Presented with an API key: keys are managed by a signed-in person.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such key of yours.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"post":{"tags":["API keys"],"summary":"Create an API key for the signed-in person","operationId":"createPersonKey","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyRequest"}}}},"responses":{"201":{"description":"Created. `value` is the secret, shown this once.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyWithValue"}}}},"400":{"description":"Not a key: the message says what.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Presented with an API key: keys are managed by a signed-in person.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such key of yours.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"The owner has 100 keys already.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/auth/keys/events":{"get":{"tags":["API keys"],"summary":"What was done to the signed-in person’s API keys","operationId":"listPersonKeyEvents","parameters":[],"description":"Newest first, at most 200: created, changed, rolled, deleted — by whom, through the owner’s routes or an administrator’s. Deleted keys’ events stay. Never the secret.","responses":{"200":{"description":"The events.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyEventList"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Presented with an API key: keys are managed by a signed-in person.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such key of yours.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/auth/keys/{id}":{"get":{"tags":["API keys"],"summary":"One API key","operationId":"getPersonKey","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{32}$"}}],"responses":{"200":{"description":"Never the secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Presented with an API key: keys are managed by a signed-in person.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such key of yours.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"patch":{"tags":["API keys"],"summary":"Change an API key","operationId":"updatePersonKey","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{32}$"}}],"description":"Whichever fields are given replace what the key has; `null` clears `condition`, `not_before` or `expires_on`. New policies, and turning a disabled key back on, are checked as a new key is.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyPatch"}}}},"responses":{"200":{"description":"Changed: at the next use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"400":{"description":"Not a change: the message says what.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Presented with an API key: keys are managed by a signed-in person.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such key of yours.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"delete":{"tags":["API keys"],"summary":"Delete an API key","operationId":"deletePersonKey","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{32}$"}}],"responses":{"204":{"description":"Deleted: it stops working at its next use."},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Presented with an API key: keys are managed by a signed-in person.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such key of yours.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/auth/keys/{id}/apps/{app}":{"put":{"tags":["API keys"],"summary":"Give a key an app","operationId":"setPersonKeyApp","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{32}$"}},{"name":"app","in":"path","required":true,"schema":{"type":"string"}}],"description":"As a person is given an app: these roles at it, whose permissions are the registry’s, replacing any it held there. At the key’s next request. A workspace’s key may be given only roles its writer holds there, or could fully perform.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roles"],"properties":{"roles":{"type":"array","minItems":1,"items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Given.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"400":{"description":"No such app, or a role it does not define.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Presented with an API key: keys are managed by a signed-in person.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such key of yours.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"delete":{"tags":["API keys"],"summary":"Take an app away from a key","operationId":"removePersonKeyApp","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{32}$"}},{"name":"app","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Taken away, at the key’s next request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Presented with an API key: keys are managed by a signed-in person.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such key of yours.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"It would leave the key allowing nothing: disable or delete the key instead.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/auth/keys/{id}/value":{"put":{"tags":["API keys"],"summary":"Roll an API key","operationId":"rollPersonKey","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{32}$"}}],"description":"A new secret, shown this once. The old one stops working at once.","responses":{"200":{"description":"Rolled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyWithValue"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Presented with an API key: keys are managed by a signed-in person.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such key of yours.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/workspaces/{ws}/keys":{"get":{"tags":["API keys"],"summary":"List the workspace’s API keys","operationId":"listWorkspaceKeys","parameters":[{"name":"ws","in":"path","required":true,"description":"The workspace (its id in the Access Graph). Its admins, and admins of a workspace above it, manage its keys.","schema":{"type":"string"}}],"responses":{"200":{"description":"Never the secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyList"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Not an admin of the workspace; or the key allows a role you do not hold where it allows it; or presented with an API key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such workspace you can see, or no such key of it.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"post":{"tags":["API keys"],"summary":"Create an API key for the workspace","operationId":"createWorkspaceKey","parameters":[{"name":"ws","in":"path","required":true,"description":"The workspace (its id in the Access Graph). Its admins, and admins of a workspace above it, manage its keys.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyRequest"}}}},"responses":{"201":{"description":"Created. `value` is the secret, shown this once.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyWithValue"}}}},"400":{"description":"Not a key: the message says what.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Not an admin of the workspace; or the key allows a role you do not hold where it allows it; or presented with an API key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such workspace you can see, or no such key of it.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"The owner has 100 keys already.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/workspaces/{ws}/keys/events":{"get":{"tags":["API keys"],"summary":"What was done to the workspace’s API keys","operationId":"listWorkspaceKeyEvents","parameters":[{"name":"ws","in":"path","required":true,"description":"The workspace (its id in the Access Graph). Its admins, and admins of a workspace above it, manage its keys.","schema":{"type":"string"}}],"description":"Newest first, at most 200: created, changed, rolled, deleted — by whom, through the owner’s routes or an administrator’s. Deleted keys’ events stay. Never the secret.","responses":{"200":{"description":"The events.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyEventList"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Not an admin of the workspace; or the key allows a role you do not hold where it allows it; or presented with an API key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such workspace you can see, or no such key of it.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/workspaces/{ws}/keys/{id}":{"get":{"tags":["API keys"],"summary":"One API key","operationId":"getWorkspaceKey","parameters":[{"name":"ws","in":"path","required":true,"description":"The workspace (its id in the Access Graph). Its admins, and admins of a workspace above it, manage its keys.","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{32}$"}}],"responses":{"200":{"description":"Never the secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Not an admin of the workspace; or the key allows a role you do not hold where it allows it; or presented with an API key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such workspace you can see, or no such key of it.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"patch":{"tags":["API keys"],"summary":"Change an API key","operationId":"updateWorkspaceKey","parameters":[{"name":"ws","in":"path","required":true,"description":"The workspace (its id in the Access Graph). Its admins, and admins of a workspace above it, manage its keys.","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{32}$"}}],"description":"Whichever fields are given replace what the key has; `null` clears `condition`, `not_before` or `expires_on`. New policies, and turning a disabled key back on, are checked as a new key is.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyPatch"}}}},"responses":{"200":{"description":"Changed: at the next use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"400":{"description":"Not a change: the message says what.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Not an admin of the workspace; or the key allows a role you do not hold where it allows it; or presented with an API key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such workspace you can see, or no such key of it.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"delete":{"tags":["API keys"],"summary":"Delete an API key","operationId":"deleteWorkspaceKey","parameters":[{"name":"ws","in":"path","required":true,"description":"The workspace (its id in the Access Graph). Its admins, and admins of a workspace above it, manage its keys.","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{32}$"}}],"responses":{"204":{"description":"Deleted: it stops working at its next use."},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Not an admin of the workspace; or the key allows a role you do not hold where it allows it; or presented with an API key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such workspace you can see, or no such key of it.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/workspaces/{ws}/keys/{id}/apps/{app}":{"put":{"tags":["API keys"],"summary":"Give a key an app","operationId":"setWorkspaceKeyApp","parameters":[{"name":"ws","in":"path","required":true,"description":"The workspace (its id in the Access Graph). Its admins, and admins of a workspace above it, manage its keys.","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{32}$"}},{"name":"app","in":"path","required":true,"schema":{"type":"string"}}],"description":"As a person is given an app: these roles at it, whose permissions are the registry’s, replacing any it held there. At the key’s next request. A workspace’s key may be given only roles its writer holds there, or could fully perform.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roles"],"properties":{"roles":{"type":"array","minItems":1,"items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Given.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"400":{"description":"No such app, or a role it does not define.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Not an admin of the workspace; or the key allows a role you do not hold where it allows it; or presented with an API key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such workspace you can see, or no such key of it.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"delete":{"tags":["API keys"],"summary":"Take an app away from a key","operationId":"removeWorkspaceKeyApp","parameters":[{"name":"ws","in":"path","required":true,"description":"The workspace (its id in the Access Graph). Its admins, and admins of a workspace above it, manage its keys.","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{32}$"}},{"name":"app","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Taken away, at the key’s next request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Not an admin of the workspace; or the key allows a role you do not hold where it allows it; or presented with an API key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such workspace you can see, or no such key of it.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"It would leave the key allowing nothing: disable or delete the key instead.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/workspaces/{ws}/keys/{id}/value":{"put":{"tags":["API keys"],"summary":"Roll an API key","operationId":"rollWorkspaceKey","parameters":[{"name":"ws","in":"path","required":true,"description":"The workspace (its id in the Access Graph). Its admins, and admins of a workspace above it, manage its keys.","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{32}$"}}],"description":"A new secret, shown this once. The old one stops working at once.","responses":{"200":{"description":"Rolled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyWithValue"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Not an admin of the workspace; or the key allows a role you do not hold where it allows it; or presented with an API key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such workspace you can see, or no such key of it.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/auth/credentials":{"parameters":[],"get":{"tags":["Credentials"],"summary":"The credentials of the signed-in person","operationId":"listCredentials","security":[{"bearerAuth":[]},{"apiKey":[]}],"description":"Metadata only: no answer ever carries a secret. With an API key, only the credentials of services the key holds, or all of them when it holds XAuth itself (`auth`); a workspace’s within the role the key allows there.","parameters":[{"name":"service","in":"query","required":false,"description":"Only this service’s credentials.","schema":{"type":"string"}}],"responses":{"200":{"description":"By service, then label.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CredentialList"}}}},"401":{"description":"Missing or invalid token or key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Not an admin of the workspace.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such workspace you can see.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"post":{"tags":["Credentials"],"summary":"Store a credential for the signed-in person","operationId":"createCredential","security":[{"bearerAuth":[]},{"apiKey":[]}],"description":"Sealed at once (AES-GCM, bound to the credential’s id, owner and service). The service must be one a registered Worker takes credentials for. The secret is never answered, here or anywhere over HTTP.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CredentialCreate"}}}},"responses":{"201":{"description":"Stored.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CredentialAnswer"}}}},"400":{"description":"Invalid service (`invalid_service`), label, metadata or secret.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid token or key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Not an admin of the workspace, or an API key holding neither the service nor `auth`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"The label is taken for this service and owner (`label_taken`), or too many credentials.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"The vault has no sealing key (`vault_unavailable`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/auth/credentials/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":32,"maxLength":32}}],"get":{"tags":["Credentials"],"summary":"One credential","operationId":"getCredential","security":[{"bearerAuth":[]},{"apiKey":[]}],"responses":{"200":{"description":"Metadata only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CredentialAnswer"}}}},"401":{"description":"Missing or invalid token or key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such credential.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"patch":{"tags":["Credentials"],"summary":"Change a credential","operationId":"updateCredential","security":[{"bearerAuth":[]},{"apiKey":[]}],"description":"Rename it, replace its metadata, or replace its secret (sealed again). At least one.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CredentialPatch"}}}},"responses":{"200":{"description":"Changed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CredentialAnswer"}}}},"400":{"description":"Nothing to change, or an invalid field.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid token or key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such credential.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"The label is taken for this service and owner.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"The vault has no sealing key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"delete":{"tags":["Credentials"],"summary":"Delete a credential","operationId":"deleteCredential","security":[{"bearerAuth":[]},{"apiKey":[]}],"responses":{"204":{"description":"Deleted."},"401":{"description":"Missing or invalid token or key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such credential.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/auth/credentials/{id}/owner":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":32,"maxLength":32}}],"put":{"tags":["Credentials"],"summary":"Give a credential to another owner","operationId":"transferCredential","security":[{"bearerAuth":[]},{"apiKey":[]}],"description":"To a workspace the person manages credentials for, or to the person themselves. The secret is sealed again for its new owner.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CredentialOwnerChange"}}}},"responses":{"200":{"description":"Moved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CredentialAnswer"}}}},"400":{"description":"No owner named (`invalid_owner`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid token or key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Not an admin of the target workspace.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such credential, or no such workspace you can see.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"The label is taken at the new owner.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"The vault has no sealing key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/workspaces/{ws}/credentials":{"parameters":[{"name":"ws","in":"path","required":true,"description":"The workspace (its id in the Access Graph). Its admins, and admins of a workspace above it, manage and use its credentials.","schema":{"type":"string"}}],"get":{"tags":["Credentials"],"summary":"The credentials of the workspace","operationId":"listWorkspaceCredentials","security":[{"bearerAuth":[]},{"apiKey":[]}],"description":"Metadata only: no answer ever carries a secret. With an API key, only the credentials of services the key holds, or all of them when it holds XAuth itself (`auth`); a workspace’s within the role the key allows there.","parameters":[{"name":"service","in":"query","required":false,"description":"Only this service’s credentials.","schema":{"type":"string"}}],"responses":{"200":{"description":"By service, then label.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CredentialList"}}}},"401":{"description":"Missing or invalid token or key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Not an admin of the workspace.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such workspace you can see.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"post":{"tags":["Credentials"],"summary":"Store a credential for the workspace","operationId":"createWorkspaceCredential","security":[{"bearerAuth":[]},{"apiKey":[]}],"description":"Sealed at once (AES-GCM, bound to the credential’s id, owner and service). The service must be one a registered Worker takes credentials for. The secret is never answered, here or anywhere over HTTP.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CredentialCreate"}}}},"responses":{"201":{"description":"Stored.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CredentialAnswer"}}}},"400":{"description":"Invalid service (`invalid_service`), label, metadata or secret.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid token or key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Not an admin of the workspace, or an API key holding neither the service nor `auth`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"The label is taken for this service and owner (`label_taken`), or too many credentials.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"The vault has no sealing key (`vault_unavailable`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/workspaces/{ws}/credentials/{id}":{"parameters":[{"name":"ws","in":"path","required":true,"description":"The workspace (its id in the Access Graph). Its admins, and admins of a workspace above it, manage and use its credentials.","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":32,"maxLength":32}}],"get":{"tags":["Credentials"],"summary":"One credential","operationId":"getWorkspaceCredential","security":[{"bearerAuth":[]},{"apiKey":[]}],"responses":{"200":{"description":"Metadata only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CredentialAnswer"}}}},"401":{"description":"Missing or invalid token or key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such credential.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"patch":{"tags":["Credentials"],"summary":"Change a credential","operationId":"updateWorkspaceCredential","security":[{"bearerAuth":[]},{"apiKey":[]}],"description":"Rename it, replace its metadata, or replace its secret (sealed again). At least one.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CredentialPatch"}}}},"responses":{"200":{"description":"Changed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CredentialAnswer"}}}},"400":{"description":"Nothing to change, or an invalid field.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid token or key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such credential.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"The label is taken for this service and owner.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"The vault has no sealing key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"delete":{"tags":["Credentials"],"summary":"Delete a credential","operationId":"deleteWorkspaceCredential","security":[{"bearerAuth":[]},{"apiKey":[]}],"responses":{"204":{"description":"Deleted."},"401":{"description":"Missing or invalid token or key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such credential.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/workspaces/{ws}/credentials/{id}/owner":{"parameters":[{"name":"ws","in":"path","required":true,"description":"The workspace (its id in the Access Graph). Its admins, and admins of a workspace above it, manage and use its credentials.","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":32,"maxLength":32}}],"put":{"tags":["Credentials"],"summary":"Give a credential to another owner","operationId":"transferWorkspaceCredential","security":[{"bearerAuth":[]},{"apiKey":[]}],"description":"To a workspace the person manages credentials for, or to the person themselves. The secret is sealed again for its new owner.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CredentialOwnerChange"}}}},"responses":{"200":{"description":"Moved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CredentialAnswer"}}}},"400":{"description":"No owner named (`invalid_owner`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid token or key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Not an admin of the target workspace.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such credential, or no such workspace you can see.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"The label is taken at the new owner.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"The vault has no sealing key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/keys/owners":{"get":{"tags":["API keys"],"summary":"Whose API keys the person may manage","operationId":"listKeyOwners","description":"Their own, always; and each workspace on which their role — held there or on a workspace above it — is admin or owner: exactly the workspaces whose `/v1/workspaces/{ws}/keys` they may use. Decided by XAuth at the time of the request.","responses":{"200":{"description":"The person first, then the workspaces, by id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyOwnerList"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Presented with an API key: keys are managed by a signed-in person.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/keys/permission_groups":{"get":{"tags":["API keys"],"summary":"What a key may be allowed","operationId":"listPermissionGroups","description":"The workspace roles (`workspace.member`, `workspace.admin`, `workspace.owner`) and every permission each registered service defines (`<app>:<permission>`). App permissions are for a person’s keys only.","responses":{"200":{"description":"Every permission group, and every app a key may be given with its roles.","content":{"application/json":{"schema":{"type":"object","required":["permission_groups","apps"],"properties":{"permission_groups":{"type":"array","items":{"$ref":"#/components/schemas/PermissionGroup"}},"apps":{"type":"array","items":{"type":"object","required":["slug","name","roles"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"roles":{"type":"array","items":{"type":"object","required":["role","permissions"],"properties":{"role":{"type":"string"},"permissions":{"type":"array","items":{"type":"string"}}}}}}}}}}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Presented with an API key: keys are managed by a signed-in person.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/keys/verify":{"get":{"tags":["API keys"],"summary":"Whether the key presented works now","operationId":"verifyKey","security":[{"apiKey":[]}],"description":"Every kind of key — a person’s and a workspace’s — as the Access entrypoint decides it, from this client’s address. An XAuth token is not a key: verify it against `/.well-known/jwks.json`.","responses":{"200":{"description":"The key works.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyVerification"}}}},"400":{"description":"Not an API key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Unknown, disabled (`key_disabled`), expired (`key_expired`), not yet valid (`key_not_yet_valid`), its account inactive (`account_inactive`) or its workspace gone (`owner_gone`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Not from an address its condition allows (`ip_not_allowed`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/oauth/register":{"post":{"tags":["OAuth"],"summary":"Dynamic client registration (RFC 7591, MCP-scoped)","operationId":"registerMcpClient","security":[],"description":"Registers a public PKCE OAuth client (`mcp_<hex>`) scoped strictly to registered `https://mcp.*` servers.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DynamicClientRegistrationRequest"}}}},"responses":{"201":{"description":"Registered public MCP client; Cache-Control: no-store.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DynamicClientRegistrationResponse"}}}},"400":{"description":"`invalid_client_metadata` or `invalid_redirect_uri`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}}},"429":{"description":"Too many requests (`slow_down`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}}}}}},"/v1/oauth/authorize":{"post":{"tags":["OAuth"],"summary":"A code for an app (the sign-in page only)","operationId":"authorize","description":"XTND Auth’s sign-in page asks, for the person signed in there, after receiving the app’s authorization request. Only the sign-in page’s own session may ask (403 `access_denied` otherwise). The redirect URI must be one of the app’s registered addresses exactly. The code works once, for 60 seconds, with the PKCE verifier.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizeRequest"}}}},"responses":{"200":{"description":"Where to send the browser: the app’s redirect URI with `code`, `state` and `iss`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizeResponse"}}}},"400":{"description":"Refused. Once the redirect URI is known to be the app’s, `redirect_to` carries the error back to it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizeError"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Not the sign-in page’s session (`access_denied`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}}}}}},"/v1/oauth/token":{"post":{"tags":["OAuth"],"summary":"The token endpoint","operationId":"token","security":[],"description":"RFC 6749 §3.2 for public clients: no secret, PKCE instead. `authorization_code` answers the XAuth token, a refresh token and an OpenID Connect ID token; a code presented twice ends the session it opened. `refresh_token` rotates within the session, for the app it was issued to only.","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/TokenRequest"}},"application/json":{"schema":{"$ref":"#/components/schemas/TokenRequest"}}}},"responses":{"200":{"description":"Tokens. Cache-Control: no-store.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthTokens"}}}},"400":{"description":"`invalid_request`, `invalid_grant` or `unsupported_grant_type`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}}},"429":{"description":"Too many requests (`slow_down`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}}}}}},"/v1/oauth/resource-token":{"post":{"tags":["OAuth"],"summary":"Resource identity from the current issuer session","operationId":"issueResourceToken","description":"The existing issuer session identifies the client and person. Only a registered resource may be supplied; actor, client and user selection are forbidden.","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/ResourceTokenRequest"}},"application/json":{"schema":{"$ref":"#/components/schemas/ResourceTokenRequest"}}}},"responses":{"200":{"description":"Receiver-bound access token; no-store.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceToken"}}}},"400":{"description":"Invalid or unregistered resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}}},"401":{"description":"Issuer session missing, invalid or ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/scoped-access":{"post":{"tags":["Access Graph"],"summary":"Current user permissions in an explicit scope","operationId":"scopedAccess","description":"Requires an exact Auth API resource token. For xfinance/xpense, reads current session, app entitlement, membership and explicit grants. The native xworkspace profile derives projects.read from current inherited membership, including archived metadata, and projects.manage from current admin/owner relations. Native project-scoped management and financial/expense profiles still require an active project. Workspace scope only: apps.read, dashboard.read and dashboard.write require inherited membership; apps.manage requires admin/owner. It grants no financial entitlements or scoped-grant editing; Workspace derives personal dashboard ownership from the authorized person. Returns UI hints only; each target API must still authorize each operation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["app","scope","permissions"],"properties":{"app":{"type":"string"},"scope":{"$ref":"#/components/schemas/ProjectAccessScope"},"permissions":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Current decisions; no-store.","content":{"application/json":{"schema":{"type":"object","required":["app","scope","decisions"],"properties":{"app":{"type":"string"},"scope":{"$ref":"#/components/schemas/ProjectAccessScope"},"decisions":{"type":"array","items":{"type":"object","required":["permission","allowed"],"properties":{"permission":{"type":"string"},"allowed":{"type":"boolean"}}}}}}}}},"400":{"description":"Invalid app, scope or permission.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Invalid resource identity.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Project archived.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Project authority unavailable.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/scoped-grants":{"get":{"tags":["Access Graph"],"summary":"Scoped grants and available recipients","operationId":"listScopedGrants","description":"Requires an exact Auth API resource token, current app entitlement, actual workspace membership and scoped access.manage.","parameters":[{"name":"app","in":"query","required":true,"schema":{"type":"string"}},{"name":"kind","in":"query","required":true,"schema":{"type":"string","enum":["workspace","project"]}},{"name":"workspaceId","in":"query","required":true,"schema":{"type":"string","minLength":1}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string","minLength":1},"description":"Required only when kind is project."}],"responses":{"200":{"description":"Grants, registry permissions and actual members.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScopedGrantList"}}}},"400":{"description":"Invalid scope or app.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Invalid resource identity.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Scoped access.manage is required.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"put":{"tags":["Access Graph"],"summary":"Replace explicit scoped permissions","operationId":"replaceScopedGrant","description":"The actor must hold access.manage and every delegated permission. The target must hold each app permission and actual workspace membership. expectedRevision:0 creates; an empty permission list revokes. CAS and last-administrator protection are transactional; successful writes are audited.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScopedGrantInput"}}}},"responses":{"200":{"description":"New grant revision.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScopedGrantResult"}}}},"400":{"description":"Invalid request.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Invalid resource identity.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Required current authority is absent.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Revision/authority changed or final administrator removal.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/scoped-grant-recoveries/expense-projects":{"post":{"security":[{"authResourceSession":[]}],"tags":["Administration"],"summary":"Begin one configured expense capability recovery","operationId":"beginExpenseProjectRecovery","description":"Strict direct Auth-resource session only. Requires current Auth admin, actual Workspace owner, current Xpense app entitlement and an existing own base grant at the expected revision. The configured active finance-only project and actual revision must match. The finite, audited one-shot intent never changes permanent scoped permissions or ordinary ScopedAccess. Exact retries cannot extend its SQL deadline or reopen a terminal intent. Trusted Auth control-plane Origin policy; all responses no-store.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseProjectRecoveryInput"}}}},"responses":{"200":{"description":"Original exact idempotent receipt; no new authority.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseProjectRecoveryResult"}}}},"201":{"description":"Created and audited one configured intent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseProjectRecoveryResult"}}}},"400":{"description":"Invalid or caller-selected extra intent fields.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"A strict direct Auth-resource session is required.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Current administrator, owner or real app entitlement required.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"CAS, configuration, idempotence or terminal-intent conflict.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"410":{"description":"The configured or persisted deadline ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"413":{"description":"Request too large.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Reviewed configuration or authority unavailable.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/scoped-grant-recoveries/expense-projects/{id}":{"get":{"security":[{"authResourceSession":[]}],"tags":["Administration"],"summary":"Read your recovery receipt","operationId":"expenseProjectRecoveryStatus","description":"Current strict Auth-resource session for the same subject; a new sid is permitted. Receipt only, not evidence that Workspace activated the capability. No-store.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Current durable receipt and SQL-derived expiry state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseProjectRecoveryResult"}}}},"400":{"description":"Invalid identifier.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Direct Auth-resource session required.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Control-plane or client refused.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Unknown or foreign recovery.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Authority unavailable.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/scoped-grant-recoveries/expense-projects/{id}/restore":{"post":{"security":[{"authResourceSession":[]}],"tags":["Administration"],"summary":"Close your recovery without rewriting grants","operationId":"restoreExpenseProjectRecovery","description":"One-way idempotent closure by the same subject with a current strict Auth-resource session, including a new sid after role loss. Accepts no replacement fields. Does not erase concurrent grants, undo completed activation or reopen consumed/expired recovery. No-store.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Closed receipt, unchanged on exact repeat.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseProjectRecoveryResult"}}}},"400":{"description":"Replacement fields are not accepted.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Direct Auth-resource session required.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Control-plane or client refused.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Unknown or foreign recovery.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"413":{"description":"Restore body too large.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Authority unavailable.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/oauth/clients":{"get":{"tags":["Administration"],"summary":"List explicitly registered external OAuth clients","operationId":"listOAuthClients","responses":{"200":{"description":"Client metadata, approved resources and enabled state; no secrets."},"401":{"description":"Invalid issuer session.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Current XAuth administrator required.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"post":{"tags":["Administration"],"summary":"Pre-register an approved public OAuth client","operationId":"registerOAuthClient","description":"Current XAuth administrator explicitly registers the actual external client callbacks and already registered resources. Generates a client ID; PKCE S256 with token endpoint authentication none. No user, app entitlement or scoped grant is created. External clients must use the resource-bound code flow. This is not public dynamic registration.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["client_name","redirect_uris","resources"],"properties":{"client_name":{"type":"string","minLength":1,"maxLength":100},"redirect_uris":{"type":"array","minItems":1,"maxItems":10,"items":{"type":"string","format":"uri"}},"resources":{"type":"array","minItems":1,"maxItems":10,"items":{"type":"string","format":"uri","minLength":1,"description":"One exact registered receiving resource; the trailing slash is significant. No audience fallback."}}}}}}},"responses":{"201":{"description":"Generated client_id, approved callbacks/resources, grant_types, response_types and token_endpoint_auth_method:none."},"400":{"description":"Invalid callback or unregistered resource.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Invalid issuer session.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Current XAuth administrator required.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/oauth/clients/{clientId}":{"delete":{"tags":["Administration"],"summary":"Disable an external OAuth client and revoke its sessions","operationId":"disableOAuthClient","parameters":[{"name":"clientId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Client disabled; its sessions are revoked."},"401":{"description":"Invalid issuer session.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Current XAuth administrator required.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Already disabled, unknown, or authority changed.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/scoped-grants/options":{"get":{"security":[{"bearerAuth":[]},{"authResourceSession":[]}],"tags":["Administration"],"summary":"Discover explicit bootstrap choices and current scoped grants","operationId":"scopedBootstrapOptions","description":"Requires a direct, unbound user session: the existing common-audience web session or an exact Auth API resource token from a currently registered, permitted client. Current XAuth administrator and actual owning-workspace membership required; workspace scope only. Keys, delegated actors and cnf/DPoP are refused. Returns stored grants and their revisions, including rows that currently confer no authority, without changing them. This snapshot is advisory; bootstrap rechecks its own first-administrator and revision predicates.","parameters":[{"name":"app","in":"query","required":true,"schema":{"type":"string"}},{"name":"kind","in":"query","required":true,"schema":{"type":"string","enum":["workspace","project"]}},{"name":"workspaceId","in":"query","required":true,"schema":{"type":"string","minLength":1}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string","minLength":1},"description":"Required only when kind is project."}],"responses":{"200":{"description":"Registry permissions, actual workspace members and stored workspace grants; no-store.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScopedGrantList"}}}},"400":{"description":"Invalid app or scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Invalid direct user session.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin or membership required.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/scoped-grants/bootstrap":{"post":{"security":[{"bearerAuth":[]},{"authResourceSession":[]}],"tags":["Administration"],"summary":"Explicitly establish the first scoped workspace administrator","operationId":"bootstrapScopedGrant","description":"Requires a direct, unbound user session: the existing common-audience web session or an exact Auth API resource token from a currently registered, permitted client. Keys, delegated actors and cnf/DPoP are refused. Current XAuth administrator and actual owning-workspace membership required. Workspace scope, expectedRevision:0, an absent target grant and explicit access.manage are required; any stored workspace administrator row prevents bootstrap. The target must already hold all requested app permissions and current workspace membership. Existing transactional authority, CAS, first-administrator and audit checks apply. Creates a persistent grant with no task-expiry field; does not create app entitlements or memberships.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScopedGrantInput"}}}},"responses":{"201":{"description":"First scoped administrator created and audited; no-store.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScopedGrantResult"}}}},"400":{"description":"Invalid bootstrap request.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Invalid direct user session.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin, membership or app permission required.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"A target grant or scoped administrator already exists, or authority changed.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/oauth/revoke":{"post":{"tags":["OAuth"],"summary":"Revoke a token (RFC 7009)","operationId":"revokeToken","security":[],"description":"A refresh token or an XAuth token ends the session it belongs to.","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/RevokeRequest"}},"application/json":{"schema":{"$ref":"#/components/schemas/RevokeRequest"}}}},"responses":{"200":{"description":"Revoked, or the token was unknown. Deliberately indistinguishable."}}}},"/v1/oauth/userinfo":{"get":{"tags":["OAuth"],"summary":"OpenID Connect UserInfo","operationId":"userinfo","responses":{"200":{"description":"Who the XAuth token’s person is.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserInfo"}}}},"401":{"description":"Missing or invalid token, or the session has ended.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/invitations/inspect":{"post":{"tags":["Invitations"],"summary":"What an invitation is","operationId":"inspectInvitation","security":[],"description":"The address it is for, who it is from and what it is to (`label`, or the roles it grants), whether it is still open, and whether that address has an account already — so the page asks for that account’s password rather than a new one. The token is sent in the body, never in the URL.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationTokenRequest"}}}},"responses":{"200":{"description":"The invitation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationDetails"}}}},"404":{"description":"No invitation has this token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/invitations/accept":{"post":{"tags":["Invitations"],"summary":"Accept an invitation","operationId":"acceptInvitation","security":[],"description":"Without an account at the address, makes one with the names and password given (12 characters or more). With one, that account’s password must be given. An administrator’s invitation adds its roles to the account — nothing is taken away; a platform service’s grants nothing here: the service gives access once the person arrives. The answer is a session of the sign-in page, which takes the person on to `redirect_uri`. An account whose password must be reset is answered as at sign-in; the invitation is accepted by then. Rate limited; with Turnstile configured, `turnstile_token` is required.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptInvitationRequest"}}}},"responses":{"200":{"description":"Accepted: a session, or a password reset first.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/AcceptedInvitation"},{"$ref":"#/components/schemas/AcceptedInvitationResetRequired"}]}}}},"400":{"description":"No password; for a new account, no names or a password under 12 characters; or a failed challenge.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Not the password of the account at the invited address.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The account at the address is not active.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No invitation has this token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Accepted already (`invitation_used`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"410":{"description":"Withdrawn or replaced (`invitation_revoked`), expired (`invitation_expired`), or for a role the service no longer has (`invitation_invalid`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/users":{"get":{"tags":["Admin"],"summary":"List accounts","operationId":"listUsers","responses":{"200":{"description":"Every account and its grants.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserList"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Requires admin at XTND Auth.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"post":{"tags":["Admin"],"summary":"Create an account with grants","operationId":"createUser","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUserRequest"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"400":{"description":"Missing field, short password, or unknown service.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Requires the admin role.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"That email already exists.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/users/{guid}":{"patch":{"tags":["Admin"],"summary":"Update account names or primary email","operationId":"updateUser","parameters":[{"name":"guid","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserRequest"}}}},"responses":{"200":{"description":"Updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"400":{"description":"Invalid field.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Requires the admin role.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such account.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"That email already exists.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/users/{guid}/emails":{"post":{"tags":["Admin"],"summary":"Attach an additional email address to an account","operationId":"addUserEmail","parameters":[{"name":"guid","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserEmailRequest"}}}},"responses":{"200":{"description":"Already held by this account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"201":{"description":"Email attached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"400":{"description":"Invalid email.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Requires the admin role.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such account.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"That email already exists on another account.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/users/{guid}/emails/{email}":{"delete":{"tags":["Admin"],"summary":"Remove a secondary email address from an account","operationId":"removeUserEmail","parameters":[{"name":"guid","in":"path","required":true,"schema":{"type":"string"}},{"name":"email","in":"path","required":true,"schema":{"type":"string","format":"email"}}],"responses":{"200":{"description":"Email removed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"400":{"description":"Invalid email.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Requires the admin role.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such account or email.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Primary email cannot be removed without promoting another.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/users/{guid}/reset-password":{"post":{"tags":["Admin"],"summary":"Admin reset password for user","operationId":"adminResetPassword","parameters":[{"name":"guid","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminResetPasswordRequest"}}}},"responses":{"200":{"description":"Password reset.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"user":{"$ref":"#/components/schemas/User"}}}}}},"400":{"description":"Missing password or under 12 characters.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Requires the admin role.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such account.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/users/{guid}/grants":{"put":{"tags":["Admin"],"summary":"Set service grants","operationId":"setGrants","description":"Sets the account’s roles at each service named; services not named keep their grants. Every role must be one the service defines, and each grant needs at least one. To take a service away, delete the grant.","parameters":[{"name":"guid","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantsRequest"}}}},"responses":{"200":{"description":"Updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"400":{"description":"Unknown service, a grant with no role, or a role the service does not define.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Requires the admin role.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such account.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"That would leave no active account holding admin on the gateway.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/users/{guid}/grants/{service}":{"delete":{"tags":["Admin"],"summary":"Take a service away from an account","operationId":"deleteGrant","description":"Removes the grant. Services ask for grants at each request, so it takes effect at the account’s next one.","parameters":[{"name":"guid","in":"path","required":true,"schema":{"type":"string"}},{"name":"service","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Removed; the account as it now stands.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Requires the admin role.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such account, or it has no grant for that service.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"That would leave no active account holding admin on the gateway.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/users/{guid}/revoke-sessions":{"post":{"tags":["Admin"],"summary":"Sign an account out everywhere","operationId":"adminRevokeSessions","parameters":[{"name":"guid","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"All sessions revoked."},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Requires the admin role.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such account.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/apps":{"get":{"tags":["Admin"],"summary":"List public product registrations","operationId":"adminListApps","responses":{"200":{"description":"Public product metadata, including unlisted drafts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminAppList"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Requires the XAuth admin role.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"post":{"tags":["Admin"],"summary":"Register a discoverable product","operationId":"adminCreateApp","description":"Creates only catalogue metadata. It does not create OAuth clients, redirects, users or grants. A listed app requires an explicit product home and explanatory prompt.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDiscoveryApp"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminApp"}}}},"400":{"description":"Invalid metadata or unknown associated OAuth service.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Requires the XAuth admin role.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"The app id is already registered.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/apps/{id}":{"patch":{"tags":["Admin"],"summary":"Update product discovery metadata","operationId":"adminUpdateApp","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDiscoveryApp"}}}},"responses":{"200":{"description":"Updated; the discovery cache is invalidated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminApp"}}}},"400":{"description":"Invalid metadata.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Requires the XAuth admin role.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No app has that id.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/services":{"get":{"tags":["Admin"],"summary":"List services with their roles","operationId":"adminListServices","responses":{"200":{"description":"Every registered service.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminServiceList"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Requires the admin role.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"post":{"tags":["Admin"],"summary":"Register a service","operationId":"createService","description":"A service is this record and nothing else. Its redirect URIs are where sessions may be delivered and, by their origins, which origins may call this API. Its lockup and accent brand its sign-in page. Its roles, and the permissions each holds, are what `Access.app()` answers for its users. Its manifest is how the XSuite shell composes it. CORS picks up a change within a minute.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateServiceRequest"}}}},"responses":{"201":{"description":"Registered.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminService"}}}},"400":{"description":"A field is missing or invalid.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Requires the admin role.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"That slug is taken.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/services/{slug}":{"patch":{"tags":["Admin"],"summary":"Change a service","operationId":"updateService","description":"Sets whichever fields are sent. The slug cannot change: grants and sessions refer to it. Permissions may name only roles the service will still define. The next request to the service sees the change.","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateServiceRequest"}}}},"responses":{"200":{"description":"Updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminService"}}}},"400":{"description":"A field is invalid, nothing was sent, or permissions name a role the service does not define.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Requires the admin role.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such service.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"A role being removed is still granted to someone.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/invitations":{"get":{"tags":["Admin"],"summary":"List invitations","operationId":"adminListInvitations","parameters":[{"name":"service","in":"query","required":false,"schema":{"type":"string"},"description":"Only those to this service."}],"responses":{"200":{"description":"Invitations, newest first. Never their tokens.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationList"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Requires the admin role.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"post":{"tags":["Admin"],"summary":"Invite someone to a service","operationId":"adminCreateInvitation","description":"XAuth sends no email: the answer carries the token and the link that accepts it, this once, for the administrator to deliver. An open invitation for the same address at the same service is withdrawn: only the newest link works. Nobody is invited into `admin` at `auth`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInvitationRequest"}}}},"responses":{"201":{"description":"Invited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssuedInvitation"}}}},"400":{"description":"Unknown service, a role it does not define, a bad address, an unregistered redirect_uri or lifetime.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Requires the admin role.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/invitations/{guid}":{"delete":{"tags":["Admin"],"summary":"Withdraw an invitation","operationId":"adminRevokeInvitation","parameters":[{"name":"guid","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Withdrawn: its link stops working at once.","content":{"application/json":{"schema":{"type":"object","required":["invitation"],"properties":{"invitation":{"$ref":"#/components/schemas/Invitation"}}}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Requires the admin role.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such invitation.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Accepted, withdrawn or expired already.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/keys":{"get":{"tags":["Admin"],"summary":"Every API key","operationId":"adminListKeys","description":"Whoever owns them, never the secret. Filter with `owner_type` and `owner_id` together.","parameters":[{"name":"owner_type","in":"query","schema":{"type":"string","enum":["user","workspace"]}},{"name":"owner_id","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"The keys.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyList"}}}},"400":{"description":"owner_type without owner_id, or the reverse.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Requires the admin role.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/keys/events":{"get":{"tags":["Admin"],"summary":"What was done to API keys","operationId":"adminListKeyEvents","description":"Newest first, at most 500. Filter by owner (`owner_type` and `owner_id` together) and by `key_id`.","parameters":[{"name":"owner_type","in":"query","schema":{"type":"string","enum":["user","workspace"]}},{"name":"owner_id","in":"query","schema":{"type":"string"}},{"name":"key_id","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"The events.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyEventList"}}}},"400":{"description":"owner_type without owner_id, or the reverse.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Requires the admin role.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/keys/{id}":{"delete":{"tags":["Admin"],"summary":"Delete any API key","operationId":"adminDeleteKey","description":"For a leaked key: it stops working at its next use. A workspace’s key has no person whose account could be disabled instead.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Deleted."},"401":{"description":"Missing or invalid token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Requires the admin role.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such API key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}}},"components":{"securitySchemes":{"authResourceSession":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Direct unbound user token for this exact Auth API resource. Current live session/client required; suite tokens, keys, delegated actors and cnf/DPoP are refused."},"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"The XAuth token (RFC 9068 `at+jwt`, EdDSA, `aud` `https://xgi.io`). Its session must be alive and its account active."},"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"xak_","description":"An API key: `xak_` and 43 characters. Accepted by every XSuite API through the Access entrypoint; managing keys needs an XAuth token."}},"schemas":{"AccountApiOrigin":{"type":"object","additionalProperties":false,"required":["id","origin","createdAt"],"properties":{"id":{"type":"string","format":"uuid"},"origin":{"type":"string","format":"uri","description":"Canonical exact scheme, hostname and port. HTTPS or explicit HTTP loopback only; no path, credentials, query, fragment or wildcard."},"createdAt":{"type":"string","format":"date-time"}}},"AccountApiOriginList":{"type":"object","additionalProperties":false,"required":["origins"],"properties":{"origins":{"type":"array","items":{"$ref":"#/components/schemas/AccountApiOrigin"}}}},"AccountApiOriginInput":{"type":"object","additionalProperties":false,"required":["origin"],"properties":{"origin":{"type":"string","format":"uri","description":"An exact HTTPS origin or HTTP loopback origin. A non-root path is rejected rather than silently widened to an origin."}}},"AccountApiOriginResult":{"type":"object","additionalProperties":false,"required":["origin"],"properties":{"origin":{"$ref":"#/components/schemas/AccountApiOrigin"}}},"AccountEmailView":{"type":"object","additionalProperties":false,"required":["email","primary","verified","created_at"],"properties":{"email":{"type":"string","format":"email"},"primary":{"type":"boolean"},"verified":{"const":true},"created_at":{"type":"string"}}},"PendingAccountEmailVerification":{"type":"object","additionalProperties":false,"required":["id","email","replaces_email","make_primary","created_at","expires_at"],"properties":{"id":{"type":"string","format":"uuid"},"email":{"type":"string","format":"email"},"replaces_email":{"type":["string","null"]},"make_primary":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"expires_at":{"type":"string","format":"date-time"}}},"AccountEmailsState":{"type":"object","additionalProperties":false,"required":["primary_email","emails","pending"],"properties":{"primary_email":{"type":"string","format":"email"},"emails":{"type":"array","items":{"$ref":"#/components/schemas/AccountEmailView"}},"pending":{"type":"array","items":{"$ref":"#/components/schemas/PendingAccountEmailVerification"}}}},"AccountEmailVerificationStartInput":{"type":"object","additionalProperties":false,"required":["email"],"properties":{"email":{"type":"string","format":"email"},"replaces_email":{"type":["string","null"]},"make_primary":{"type":"boolean"}}},"AccountEmailVerificationStartResult":{"type":"object","additionalProperties":false,"required":["verification","state"],"properties":{"verification":{"$ref":"#/components/schemas/PendingAccountEmailVerification"},"state":{"$ref":"#/components/schemas/AccountEmailsState"}}},"AccountEmailVerifyInput":{"type":"object","additionalProperties":false,"required":["verification_id","code"],"properties":{"verification_id":{"type":"string"},"code":{"type":"string","pattern":"^\\d{6}$"}}},"AccountEmailVerifyResult":{"type":"object","additionalProperties":false,"required":["verified_email","state"],"properties":{"verified_email":{"type":"string","format":"email"},"state":{"$ref":"#/components/schemas/AccountEmailsState"}}},"AccountPrimaryEmailInput":{"type":"object","additionalProperties":false,"required":["email"],"properties":{"email":{"type":"string","format":"email"}}},"ExpenseProjectRecoveryInput":{"type":"object","additionalProperties":false,"required":["recoveryId","expectedGrantRevision","expectedProjectRevision","reason","idempotencyKey"],"properties":{"recoveryId":{"type":"string","minLength":1,"maxLength":200},"expectedGrantRevision":{"type":"integer","minimum":1},"expectedProjectRevision":{"type":"integer","minimum":1},"reason":{"type":"string","minLength":1,"maxLength":500},"idempotencyKey":{"type":"string","minLength":1,"maxLength":200}}},"ExpenseProjectRecoveryReceipt":{"type":"object","additionalProperties":false,"required":["recoveryId","action","workspaceId","projectId","expectedProjectRevision","baseGrantRevision","state","expiresAt","authorizationId","createdAt","consumedAt","closedAt","auditIds"],"properties":{"recoveryId":{"type":"string"},"action":{"const":"capabilities.add-expenses"},"workspaceId":{"type":"string"},"projectId":{"type":"string"},"expectedProjectRevision":{"type":"integer","minimum":1},"baseGrantRevision":{"type":"integer","minimum":1},"state":{"type":"string","enum":["begun","consumed","closed","expired"]},"expiresAt":{"type":"string","format":"date-time"},"authorizationId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"consumedAt":{"type":["string","null"],"format":"date-time"},"closedAt":{"type":["string","null"],"format":"date-time"},"auditIds":{"type":"object","additionalProperties":false,"required":["begin","consume","close"],"properties":{"begin":{"type":"string"},"consume":{"type":["string","null"]},"close":{"type":["string","null"]}}}}},"ExpenseProjectRecoveryResult":{"type":"object","additionalProperties":false,"required":["recovery"],"properties":{"recovery":{"$ref":"#/components/schemas/ExpenseProjectRecoveryReceipt"}}},"Problem":{"type":"object","required":["type","title","status","detail","code"],"description":"RFC 9457 Problem Details, as every XSuite API answers a refusal.","properties":{"type":{"type":"string","format":"uri","description":"`https://xgi.io/problems/<code>`."},"title":{"type":"string","description":"The status’s reason phrase."},"status":{"type":"integer"},"detail":{"type":"string","description":"For a person to read. Not stable — branch on `code`."},"code":{"type":"string","description":"Stable machine-readable code."},"trace":{"type":"string","description":"The request’s W3C trace id, as its logs carry it."},"error":{"type":"string","deprecated":true,"description":"Transitional: the same as `code`, for clients built before problems. On every refusal XAuth answers; to be removed."},"message":{"type":"string","deprecated":true,"description":"Transitional: the same as `detail`, for clients built before problems. On every refusal XAuth answers; to be removed."}}},"Credential":{"type":"object","required":["id","owner","service","label","metadata","stored_by","created_by","created_at","updated_at"],"description":"A credential as anyone allowed to see it sees it: never its secret.","properties":{"id":{"type":"string"},"owner":{"type":"object","required":["type","id"],"properties":{"type":{"type":"string","enum":["user","workspace"]},"id":{"type":"string"}}},"created_by":{"type":"string","description":"The person who first stored it."},"service":{"type":"string","description":"The registered service it is for."},"label":{"type":"string"},"metadata":{"type":"object","additionalProperties":true,"description":"What may be seen without the secret."},"stored_by":{"type":"string","description":"`owner`, or the Worker that stored it for the person."},"created_at":{"type":"string"},"updated_at":{"type":"string"}}},"CredentialList":{"type":"object","required":["credentials"],"properties":{"credentials":{"type":"array","items":{"$ref":"#/components/schemas/Credential"}}}},"CredentialAnswer":{"type":"object","required":["credential"],"properties":{"credential":{"$ref":"#/components/schemas/Credential"}}},"CredentialCreate":{"type":"object","required":["service","label","secret"],"additionalProperties":false,"properties":{"service":{"type":"string"},"label":{"type":"string","minLength":1,"maxLength":120},"metadata":{"type":"object","additionalProperties":true,"description":"At most 4096 bytes of JSON. Never part of the secret."},"secret":{"type":"object","additionalProperties":true,"minProperties":1,"description":"At most 8192 bytes of JSON; its shape is the service’s."}}},"CredentialOwnerChange":{"type":"object","minProperties":1,"maxProperties":1,"additionalProperties":false,"properties":{"workspace":{"type":"string","description":"A workspace the person manages credentials for."},"user":{"type":"string","enum":["me"],"description":"The person themselves."}}},"CredentialPatch":{"type":"object","additionalProperties":false,"minProperties":1,"properties":{"label":{"type":"string","minLength":1,"maxLength":120},"metadata":{"type":"object","additionalProperties":true},"secret":{"type":"object","additionalProperties":true,"minProperties":1}}},"SessionAccount":{"oneOf":[{"$ref":"#/components/schemas/User"},{"$ref":"#/components/schemas/Account"}]},"ProviderCapabilities":{"type":"object","additionalProperties":false,"required":["password","hosted","renewable","termination"],"properties":{"password":{"type":"boolean"},"hosted":{"type":"boolean"},"renewable":{"type":"boolean"},"termination":{"type":"string","enum":["session","grant","unsupported"]}}},"ProviderDirectory":{"type":"object","required":["default","providers"],"properties":{"default":{"type":"string","minLength":1,"description":"Server-approved provider instance ID. Choice never selects an arbitrary URL or links an account by email."},"providers":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","label","configured","capabilities"],"properties":{"id":{"type":"string","minLength":1,"description":"Server-approved provider instance ID. Choice never selects an arbitrary URL or links an account by email."},"label":{"type":"string"},"configured":{"type":"boolean"},"capabilities":{"$ref":"#/components/schemas/ProviderCapabilities"}}}}}},"ProviderCredentials":{"type":"object","additionalProperties":false,"required":["identifier","password"],"properties":{"identifier":{"type":"string"},"password":{"type":"string","format":"password"}}},"ProviderLinkCompletion":{"type":"object","additionalProperties":false,"required":["transaction","identifier","password"],"properties":{"transaction":{"type":"string"},"identifier":{"type":"string"},"password":{"type":"string","format":"password"}}},"ProviderLinkIntent":{"type":"object","required":["transaction","expires_at"],"properties":{"transaction":{"type":"string"},"expires_at":{"type":"string","format":"date-time"}}},"ProviderLinkReview":{"type":"object","additionalProperties":false,"required":["status","provider","identifier","receipt"],"properties":{"status":{"const":"verified"},"provider":{"type":"string","minLength":1,"description":"Server-approved provider instance ID. Choice never selects an arbitrary URL or links an account by email."},"identifier":{"type":"string","description":"The sign-in identifier accepted by the upstream provider."},"receipt":{"type":"string"}}},"ProviderLinkConfirmation":{"type":"object","additionalProperties":false,"required":["transaction","receipt"],"properties":{"transaction":{"type":"string"},"receipt":{"type":"string"}}},"ProviderLinkResult":{"type":"object","required":["status","provider","identity"],"properties":{"status":{"type":"string","enum":["linked"]},"provider":{"type":"string","minLength":1,"description":"Server-approved provider instance ID. Choice never selects an arbitrary URL or links an account by email."},"identity":{"$ref":"#/components/schemas/LinkedProviderIdentity"}}},"LinkedProviderIdentity":{"type":"object","additionalProperties":false,"required":["issuer","subject"],"description":"The verified upstream identity that was bound: its issuer and subject, never a credential.","properties":{"issuer":{"type":"string"},"subject":{"type":"string"}}},"ProviderEnrollmentPending":{"type":"object","additionalProperties":false,"required":["status"],"properties":{"status":{"type":"string","enum":["verification_required"]}}},"ProviderLinkOptions":{"type":"object","required":["providers"],"properties":{"providers":{"type":"array","items":{"type":"object","required":["id","label","enrollment","linked","password","hosted"],"properties":{"id":{"type":"string","minLength":1,"description":"Server-approved provider instance ID. Choice never selects an arbitrary URL or links an account by email."},"label":{"type":"string"},"enrollment":{"type":"boolean"},"linked":{"type":"boolean"},"password":{"type":"boolean","description":"Link with the instance’s own credentials (link/begin, link/complete)."},"hosted":{"type":"boolean","description":"Link through the provider’s hosted page (link/hosted/begin)."}}}}}},"HostedProviderBegin":{"type":"object","additionalProperties":false,"required":["continuation"],"properties":{"continuation":{"$ref":"#/components/schemas/HostedProviderContinuation"},"turnstile_token":{"type":"string"}}},"HostedProviderContinuation":{"oneOf":[{"type":"object","additionalProperties":false,"required":["kind"],"properties":{"kind":{"const":"account"}}},{"type":"object","additionalProperties":false,"required":["kind","request"],"properties":{"kind":{"const":"oauth"},"request":{"type":"object","additionalProperties":false,"required":["client_id","redirect_uri","response_type","code_challenge","code_challenge_method"],"properties":{"client_id":{"type":"string"},"redirect_uri":{"type":"string","format":"uri"},"response_type":{"const":"code"},"code_challenge":{"type":"string"},"code_challenge_method":{"const":"S256"},"state":{"type":"string"},"nonce":{"type":"string"},"scope":{"type":"string"},"resource":{"type":"string","format":"uri","minLength":1,"description":"One exact registered receiving resource; the trailing slash is significant. No audience fallback."}}}}},{"type":"object","additionalProperties":false,"required":["kind","service"],"properties":{"kind":{"const":"legacy"},"service":{"type":"string"},"redirect_uri":{"type":"string","format":"uri"}}}]},"HostedProviderStart":{"type":"object","additionalProperties":false,"required":["authorization_url","expires_at"],"properties":{"authorization_url":{"type":"string","format":"uri"},"expires_at":{"type":"string","format":"date-time"}}},"HostedProviderCompletion":{"type":"object","additionalProperties":false,"required":["completion"],"properties":{"completion":{"type":"string","pattern":"^[a-f0-9]{64}$"}}},"HostedProviderResult":{"oneOf":[{"type":"object","additionalProperties":false,"required":["provider","session","continuation"],"properties":{"provider":{"type":"string","minLength":1,"description":"Server-approved provider instance ID. Choice never selects an arbitrary URL or links an account by email."},"session":{"$ref":"#/components/schemas/TokenResponse"},"continuation":{"$ref":"#/components/schemas/HostedProviderContinuation"}}},{"type":"object","additionalProperties":false,"required":["provider","status","identity"],"properties":{"provider":{"type":"string","minLength":1,"description":"Server-approved provider instance ID. Choice never selects an arbitrary URL or links an account by email."},"status":{"const":"linked"},"identity":{"$ref":"#/components/schemas/LinkedProviderIdentity"}}}]},"ProviderUnlinkResult":{"type":"object","additionalProperties":false,"required":["status","provider"],"properties":{"status":{"const":"unlinked"},"provider":{"type":"string","minLength":1,"description":"Server-approved provider instance ID. Choice never selects an arbitrary URL or links an account by email."}}},"AuthConfig":{"type":"object","required":["authentication","database","turnstile","password_policy","access_token_ttl_seconds"],"properties":{"authentication":{"$ref":"#/components/schemas/ProviderDirectory"},"database":{"type":"object","required":["active","override","provider"],"properties":{"active":{"type":["string","null"]},"override":{"type":["string","null"]},"provider":{"type":"string","enum":["d1","postgres"]}}},"turnstile":{"oneOf":[{"type":"null"},{"type":"object","required":["site_key"],"properties":{"site_key":{"type":"string"}}}],"description":"Null when Turnstile is not asked for."},"password_policy":{"type":"object","required":["min_length"],"properties":{"min_length":{"type":"integer","minimum":1,"description":"The fewest characters a new password may have."}}},"access_token_ttl_seconds":{"type":"integer","minimum":1,"description":"How long an XAuth token lives, in seconds."}}},"KeyOwnerList":{"type":"object","required":["owners"],"properties":{"owners":{"type":"array","items":{"oneOf":[{"type":"object","required":["type","id"],"properties":{"type":{"type":"string","enum":["user"]},"id":{"type":"string","description":"The person’s account guid."}}},{"type":"object","required":["type","id","role","via","parent"],"properties":{"type":{"type":"string","enum":["workspace"]},"id":{"type":"string","description":"The workspace’s id in the Access Graph."},"role":{"type":"string","enum":["admin","owner"],"description":"The person’s effective role there."},"via":{"type":"string","enum":["direct","inherited"]},"parent":{"type":["string","null"],"description":"Only when the person can see the parent."}}}]}}},"examples":[{"owners":[{"type":"user","id":"<account-guid>"},{"type":"workspace","id":"<workspace-id>","role":"admin","via":"direct","parent":null}]}]},"Health":{"type":"object","required":["status","service","version","time","timestamp"],"additionalProperties":false,"description":"The XTND health contract: these five keys and nothing else.","properties":{"status":{"type":"string","enum":["ok"]},"service":{"type":"string","enum":["xtnd-auth-api"]},"version":{"type":"string","description":"package.json version."},"time":{"type":"string","format":"date-time"},"timestamp":{"type":"string","format":"date-time","description":"Identical to `time`."}}},"Version":{"type":"object","required":["service","version","sha","committed_at","checks"],"properties":{"service":{"type":"string","enum":["xtnd-auth-api"]},"version":{"type":"string","description":"package.json version."},"sha":{"type":"string","description":"Short commit SHA of the build."},"committed_at":{"type":"string","description":"Author date of that commit, ISO-8601."},"checks":{"type":"object","required":["signing_key"],"properties":{"signing_key":{"type":"string","enum":["configured","not_configured"],"description":"Whether AUTH_SIGNING_KEY holds a usable private key."}}}}},"Jwks":{"type":"object","required":["keys"],"properties":{"keys":{"type":"array","items":{"type":"object","required":["kty","crv","x","kid"],"properties":{"kty":{"type":"string","enum":["OKP"]},"crv":{"type":"string","enum":["Ed25519"]},"x":{"type":"string"},"kid":{"type":"string"},"alg":{"type":"string","enum":["EdDSA"]},"use":{"type":"string","enum":["sig"]}}}}}},"RegisterRequest":{"type":"object","required":["email","password","first_name","last_name"],"properties":{"email":{"type":"string","format":"email"},"password":{"type":"string","minLength":12,"format":"password"},"first_name":{"type":"string"},"middle_name":{"type":["string","null"]},"last_name":{"type":"string"}}},"SignupRequest":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email"},"client_id":{"type":"string","default":"auth","description":"The registered app the person came from: the link leads back to it."},"service":{"type":"string","deprecated":true,"description":"The older name of `client_id`."},"redirect_uri":{"type":"string","description":"Registered for `client_id`: where the person lands once the account is made. Default: the app’s home."},"sign_in":{"type":"string","maxLength":4096,"description":"Optional explicit XAuth-relative / or /authorize sign-in request. Validated for this client and retained with its invitation; never inferred from redirect_uri."},"turnstile_token":{"type":"string","description":"Required when Turnstile is configured."}}},"SignupAccepted":{"type":"object","required":["email","expires_in"],"properties":{"email":{"type":"string","format":"email"},"expires_in":{"type":"integer","description":"How long the link lasts, in seconds."},"sign_in":{"type":"string","description":"The validated canonical continuation, when requested."}}},"LoginRequest":{"type":"object","required":["email","password"],"properties":{"database":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,62}$","description":"The configured active Auth database name only. This cannot select a connection URL, schema, role or inactive snapshot. A mismatch returns database_not_active (409)."},"provider":{"type":"string","minLength":1,"description":"Server-approved provider instance ID. Choice never selects an arbitrary URL or links an account by email."},"email":{"type":"string","format":"email"},"password":{"type":"string","format":"password"},"client_id":{"type":"string","default":"auth","description":"The registered app the session is for. Bookkeeping: the token is the same."},"service":{"type":"string","deprecated":true,"description":"The older name of `client_id`."},"redirect_uri":{"type":"string","description":"Checked against the app’s registered origins."},"turnstile_token":{"type":"string","description":"Required when Turnstile is configured."}}},"RefreshRequest":{"type":"object","required":["refresh_token"],"properties":{"refresh_token":{"type":"string"},"provider":{"type":"string","minLength":1,"description":"Server-approved provider instance ID. Choice never selects an arbitrary URL or links an account by email."},"client_id":{"type":"string","deprecated":true,"description":"From the sign-in page’s session only: start a session for this app instead."},"service":{"type":"string","deprecated":true,"description":"The older name of `client_id`."}}},"Grant":{"type":"object","required":["service","roles"],"properties":{"service":{"type":"string"},"roles":{"type":"array","minItems":1,"items":{"type":"string"},"description":"Roles at that service; each must be one the service defines."}}},"User":{"type":"object","required":["guid","email","first_name","middle_name","last_name","must_change_password","grants","created_at"],"properties":{"guid":{"type":"string","format":"uuid"},"email":{"type":"string","format":"email"},"emails":{"type":"array","items":{"type":"string","format":"email"},"description":"All verified addresses on this account (primary first)."},"first_name":{"type":"string"},"middle_name":{"type":["string","null"]},"last_name":{"type":"string"},"must_change_password":{"type":"boolean"},"password_expires_at":{"type":["string","null"]},"grants":{"type":"array","items":{"$ref":"#/components/schemas/Grant"}},"created_at":{"type":"string"}}},"UserList":{"type":"object","required":["users"],"properties":{"users":{"type":"array","items":{"$ref":"#/components/schemas/User"}}}},"Account":{"type":"object","additionalProperties":false,"required":["guid","email","grants","created_at"],"properties":{"guid":{"type":"string","format":"uuid"},"email":{"type":"string","format":"email"},"grants":{"type":"array","items":{"$ref":"#/components/schemas/Grant"}},"created_at":{"type":"string"}}},"CreateUserRequest":{"type":"object","required":["email","password","first_name","last_name"],"properties":{"email":{"type":"string","format":"email"},"password":{"type":"string","minLength":12,"format":"password"},"first_name":{"type":"string"},"middle_name":{"type":["string","null"]},"last_name":{"type":"string"},"must_change_password":{"type":"boolean","default":true},"password_expires_at":{"type":["string","null"]},"grants":{"type":"array","items":{"$ref":"#/components/schemas/Grant"}}}},"UpdateUserRequest":{"type":"object","additionalProperties":false,"minProperties":1,"properties":{"first_name":{"type":"string","minLength":1,"maxLength":100},"middle_name":{"type":["string","null"],"maxLength":100},"last_name":{"type":"string","minLength":1,"maxLength":100},"email":{"type":"string","format":"email"}}},"UserEmailRequest":{"type":"object","additionalProperties":false,"required":["email"],"properties":{"email":{"type":"string","format":"email"}}},"AdminResetPasswordRequest":{"type":"object","required":["password"],"properties":{"password":{"type":"string","minLength":12,"format":"password"},"must_change_password":{"type":"boolean","default":true},"password_expires_at":{"type":["string","null"]}}},"GrantsRequest":{"type":"object","required":["grants"],"properties":{"grants":{"type":"array","items":{"$ref":"#/components/schemas/Grant"}}}},"TokenResponse":{"type":"object","required":["access_token","token_type","expires_in","refresh_token","client_id","audience","user"],"properties":{"access_token":{"type":"string","description":"The XAuth token: accepted by every XSuite service."},"token_type":{"type":"string","enum":["Bearer"]},"expires_in":{"type":"integer","description":"Seconds."},"refresh_token":{"type":"string"},"client_id":{"type":"string","description":"The app the session was started for. It grants nothing."},"audience":{"type":"string","deprecated":true,"description":"The same as `client_id`, for sign-in pages built before the XAuth token."},"provider":{"type":"string","minLength":1,"description":"Server-approved provider instance ID. Choice never selects an arbitrary URL or links an account by email."},"user":{"$ref":"#/components/schemas/SessionAccount"}}},"PasswordResetRequiredResponse":{"type":"object","required":["password_reset_required","reset_token","expires_in","user"],"properties":{"password_reset_required":{"type":"boolean","enum":[true]},"reset_token":{"type":"string"},"expires_in":{"type":"integer","description":"Seconds."},"user":{"$ref":"#/components/schemas/User"}}},"ResetPasswordRequest":{"type":"object","required":["new_password"],"properties":{"reset_token":{"type":"string","description":"Scoped reset token if not supplied in Authorization header."},"new_password":{"type":"string","minLength":12,"format":"password"},"client_id":{"type":"string","default":"auth"},"service":{"type":"string","deprecated":true},"redirect_uri":{"type":"string"}}},"ChangePasswordRequest":{"type":"object","required":["current_password","new_password"],"properties":{"current_password":{"type":"string","format":"password"},"new_password":{"type":"string","minLength":12,"format":"password"}}},"Session":{"type":"object","required":["guid","service","user_agent","created_at","last_used_at","expires_at","current","provider","last_renewed_at"],"properties":{"guid":{"type":"string","description":"The session: the `sid` of its XAuth tokens."},"service":{"type":"string","description":"The app it was started for."},"user_agent":{"type":["string","null"]},"created_at":{"type":"string"},"last_used_at":{"type":["string","null"]},"expires_at":{"type":"string"},"current":{"type":"boolean"},"last_renewed_at":{"type":["string","null"],"format":"date-time","description":"Actual committed rotation time, or null when none is recorded."},"provider":{"oneOf":[{"type":"null"},{"type":"object","required":["id","label"],"properties":{"id":{"type":"string","minLength":1,"description":"Server-approved provider instance ID. Choice never selects an arbitrary URL or links an account by email."},"label":{"type":"string"}}}]}}},"SessionList":{"type":"object","required":["sessions"],"properties":{"sessions":{"type":"array","items":{"$ref":"#/components/schemas/Session"}}}},"Accent":{"type":"object","required":["50","100","200","300","400","500","600","700","ring"],"additionalProperties":false,"description":"The sign-in page’s accent ramp and focus ring. Each value a colour: #rgb, #rrggbb, rgb(…) or hsl(…).","properties":{"50":{"type":"string"},"100":{"type":"string"},"200":{"type":"string"},"300":{"type":"string"},"400":{"type":"string"},"500":{"type":"string"},"600":{"type":"string"},"700":{"type":"string"},"ring":{"type":"string"}}},"DiscoverySection":{"type":"object","required":["id","label","component"],"properties":{"id":{"type":"string"},"label":{"type":"string"},"component":{"type":"string"},"order":{"type":"integer"}}},"DiscoveryWidget":{"type":"object","required":["id","label","component"],"properties":{"id":{"type":"string"},"label":{"type":"string"},"component":{"type":"string"},"description":{"type":"string"}}},"AppDiscoveryBranding":{"type":["object","null"],"additionalProperties":false,"description":"Optional owner-published display metadata. Missing themes stay neutral; colours normalize to lowercase. Asset URLs are metadata only and are never fetched by Auth.","properties":{"accent":{"type":"object","additionalProperties":false,"properties":{"light":{"type":["string","null"],"pattern":"^#[a-fA-F0-9]{6}$","default":null},"dark":{"type":["string","null"],"pattern":"^#[a-fA-F0-9]{6}$","default":null}}},"iconUrl":{"type":["string","null"],"format":"uri","maxLength":2048,"description":"HTTPS owned asset on the registered home_url origin, without credentials. No inline SVG, HTML, CSS or executable URL schemes.","default":null}}},"AppDiscoveryKeywords":{"type":"array","maxItems":24,"default":[],"items":{"type":"string","minLength":1,"maxLength":64},"description":"Owner-published search text: NFKC, trim and collapse whitespace; preserve first display case and deduplicate by locale-independent lowercase comparison. Each normalized value is 1–64 Unicode code points."},"AppDiscoveryEntry":{"type":"object","required":["id","name","homeUrl","prompt","description","icon","category","manifest","workspace","integration","discovery"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"homeUrl":{"type":["string","null"],"format":"uri","description":"Explicit administrator-published HTTPS product home, including verified branded domains. Publication metadata, never a server fetch target."},"prompt":{"type":["string","null"],"description":"Owner-maintained explanation of the product, tasks and capability boundaries. Descriptive untrusted metadata, never executable host instructions."},"description":{"type":["string","null"]},"icon":{"type":["string","null"]},"category":{"type":["string","null"]},"manifest":{"type":["string","null"],"format":"uri"},"branding":{"$ref":"#/components/schemas/AppDiscoveryBranding"},"keywords":{"$ref":"#/components/schemas/AppDiscoveryKeywords"},"workspace":{"type":"object","required":["sections","widgets"],"properties":{"sections":{"type":"array","items":{"$ref":"#/components/schemas/DiscoverySection"}},"widgets":{"type":"array","items":{"$ref":"#/components/schemas/DiscoveryWidget"}}}},"integration":{"type":["object","null"],"additionalProperties":true,"description":"Validated materialised xsuite-app/1 manifest, including federation and components. Null when absent or unavailable."},"discovery":{"type":"object","required":["state"],"properties":{"state":{"type":"string","enum":["ready","incomplete","unavailable"]},"detail":{"type":"string"}},"description":"Metadata/integration discovery state, not a service uptime claim."}}},"AppDiscoveryList":{"type":"object","required":["apps"],"properties":{"apps":{"type":"array","items":{"$ref":"#/components/schemas/AppDiscoveryEntry"}}}},"DiscoveryAppFields":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"service_slug":{"type":["string","null"],"description":"Optional associated existing OAuth service. It confers no access."},"home_url":{"type":["string","null"],"format":"uri","description":"Explicit administrator-published HTTPS product home, without credentials. Loopback HTTP is accepted for development."},"prompt":{"type":["string","null"],"minLength":1,"maxLength":16000},"description":{"type":["string","null"],"maxLength":2000},"icon":{"type":["string","null"],"pattern":"^[a-z][a-z0-9-]{0,63}$"},"category":{"type":["string","null"],"maxLength":100},"manifest":{"type":["string","null"],"format":"uri","description":"XSuite HTTPS URL on the product home origin. External branded homes do not expand this fetch allowlist. Redirects are refused."},"listed":{"type":"boolean","description":"Only deliberately listed product records appear publicly."},"branding":{"$ref":"#/components/schemas/AppDiscoveryBranding"},"keywords":{"$ref":"#/components/schemas/AppDiscoveryKeywords"}}},"CreateDiscoveryApp":{"allOf":[{"$ref":"#/components/schemas/DiscoveryAppFields"},{"type":"object","required":["id","name"],"properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9._-]{0,62}$"}}}]},"UpdateDiscoveryApp":{"allOf":[{"$ref":"#/components/schemas/DiscoveryAppFields"}],"minProperties":1},"AdminApp":{"allOf":[{"$ref":"#/components/schemas/DiscoveryAppFields"},{"type":"object","required":["id","name","listed","created_at","updated_at"],"properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}}}]},"AdminAppList":{"type":"object","required":["apps"],"properties":{"apps":{"type":"array","items":{"$ref":"#/components/schemas/AdminApp"}}}},"ServiceSummary":{"type":"object","required":["slug","name","manifest"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"manifest":{"type":["string","null"],"format":"uri"}}},"ServiceSummaryList":{"type":"object","required":["services"],"properties":{"services":{"type":"array","items":{"$ref":"#/components/schemas/ServiceSummary"}}}},"ServiceInfo":{"type":"object","required":["slug","name","redirect_uris","home","lockup","accent","manifest"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"redirect_uris":{"type":"array","items":{"type":"string","format":"uri"}},"home":{"type":["string","null"],"description":"The first redirect URI."},"lockup":{"type":["string","null"],"description":"Wordmark after the X; null for the family mark."},"accent":{"oneOf":[{"$ref":"#/components/schemas/Accent"},{"type":"null"}]},"manifest":{"type":["string","null"],"format":"uri","description":"The app’s `xsuite-app/1` manifest."}}},"AdminService":{"type":"object","required":["slug","name","redirect_uris","home","lockup","accent","manifest","roles","permissions","created_at"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"redirect_uris":{"type":"array","items":{"type":"string","format":"uri"}},"home":{"type":["string","null"]},"lockup":{"type":["string","null"]},"accent":{"oneOf":[{"$ref":"#/components/schemas/Accent"},{"type":"null"}]},"roles":{"type":"array","items":{"type":"string"},"description":"Roles this service defines."},"manifest":{"type":["string","null"],"format":"uri"},"permissions":{"$ref":"#/components/schemas/Permissions"},"created_at":{"type":"string"}}},"Permissions":{"type":"object","description":"What each role may do at the service: permission name → the roles that hold it. Names are lowercase words joined by dots (`transfers.write`). `Access.app()` answers the permissions of the person’s roles; an empty object means none.","propertyNames":{"pattern":"^[a-z][a-z0-9_-]{0,31}(?:\\.[a-z][a-z0-9_-]{0,31}){0,3}$"},"additionalProperties":{"type":"object","required":["roles"],"properties":{"description":{"type":"string","maxLength":200},"roles":{"type":"array","items":{"type":"string"}}}}},"Invitation":{"type":"object","required":["guid","email","service","roles","label","status","invited_by","redirect_uri","expires_at","created_at","accepted_at","accepted_by","revoked_at"],"properties":{"guid":{"type":"string"},"email":{"type":"string","format":"email"},"service":{"type":"string","description":"Who it is from: the service whose roles it grants, or the platform service that invited."},"roles":{"type":"array","items":{"type":"string"},"description":"Granted on acceptance. Empty for a platform service’s invitation."},"label":{"type":["string","null"],"description":"What a platform service’s invitation is to, e.g. a workspace."},"status":{"type":"string","enum":["open","accepted","revoked","expired"]},"invited_by":{"type":"string","description":"The inviter’s account guid."},"redirect_uri":{"type":["string","null"]},"expires_at":{"type":"string"},"created_at":{"type":"string"},"accepted_at":{"type":["string","null"]},"accepted_by":{"type":["string","null"]},"revoked_at":{"type":["string","null"]}}},"InvitationList":{"type":"object","required":["invitations"],"properties":{"invitations":{"type":"array","items":{"$ref":"#/components/schemas/Invitation"}}}},"CreateInvitationRequest":{"type":"object","required":["service","email","roles"],"properties":{"service":{"type":"string"},"email":{"type":"string","format":"email"},"roles":{"type":"array","minItems":1,"items":{"type":"string"}},"redirect_uri":{"type":["string","null"],"description":"One of the service’s redirect URIs; default its home."},"expires_in_days":{"type":"integer","minimum":1,"maximum":90,"default":30}}},"IssuedInvitation":{"type":"object","required":["invitation","token","url"],"properties":{"invitation":{"$ref":"#/components/schemas/Invitation"},"token":{"type":"string","description":"Shown this once; stored only as its SHA-256."},"url":{"type":["string","null"],"description":"XTND Auth’s page that accepts it, the token on the fragment."}}},"InvitationTokenRequest":{"type":"object","required":["token"],"properties":{"token":{"type":"string"}}},"InvitationDetails":{"type":"object","required":["invitation"],"properties":{"invitation":{"type":"object","required":["email","status","service","roles","label","redirect_uri","expires_at","account"],"properties":{"email":{"type":"string","format":"email"},"status":{"type":"string","enum":["open","accepted","revoked","expired"]},"service":{"$ref":"#/components/schemas/ServiceInfo"},"roles":{"type":"array","items":{"type":"string"}},"label":{"type":["string","null"]},"redirect_uri":{"type":["string","null"]},"expires_at":{"type":"string"},"account":{"type":"string","enum":["existing","new"],"description":"`existing`: accept with that account’s password. `new`: with names and a new password."},"signup":{"type":"boolean","description":"A self-service sign-up’s link: the address asked for it itself (`POST /v1/auth/signup`)."},"sign_in":{"type":"string","description":"Validated sign-in continuation, only for a signup that supplied one."}}}}},"AcceptInvitationRequest":{"type":"object","required":["token","password"],"properties":{"token":{"type":"string"},"password":{"type":"string","format":"password"},"first_name":{"type":"string","description":"For a new account."},"middle_name":{"type":["string","null"]},"last_name":{"type":"string","description":"For a new account."},"turnstile_token":{"type":"string","description":"Required when Turnstile is configured."}}},"AcceptedInvitationTarget":{"type":"object","required":["service","roles","label","redirect_uri","home"],"description":"Where the page takes the invitee next: `redirect_uri`, or the service’s home, where the app signs them in.","properties":{"service":{"type":"string"},"roles":{"type":"array","items":{"type":"string"}},"label":{"type":["string","null"]},"redirect_uri":{"type":["string","null"]},"home":{"type":["string","null"]},"sign_in":{"type":"string","description":"Validated sign-in continuation, only for a signup that supplied one."}}},"AcceptedInvitation":{"allOf":[{"$ref":"#/components/schemas/TokenResponse"},{"type":"object","required":["invitation"],"properties":{"invitation":{"$ref":"#/components/schemas/AcceptedInvitationTarget"}}}]},"AcceptedInvitationResetRequired":{"allOf":[{"$ref":"#/components/schemas/PasswordResetRequiredResponse"},{"type":"object","required":["invitation"],"properties":{"invitation":{"$ref":"#/components/schemas/AcceptedInvitationTarget"}}}]},"AdminServiceList":{"type":"object","required":["services"],"properties":{"services":{"type":"array","items":{"$ref":"#/components/schemas/AdminService"}}}},"CreateServiceRequest":{"type":"object","required":["slug","name"],"properties":{"slug":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,62}$","description":"The app’s `client_id`. Cannot change later."},"name":{"type":"string","minLength":1,"maxLength":100},"redirect_uris":{"type":"array","items":{"type":"string","format":"uri"},"description":"Where sessions may be delivered. Their origins may also call this API. https, or http on localhost and 127.0.0.1 only; no fragment, no comma."},"lockup":{"type":["string","null"],"maxLength":24,"description":"Wordmark after the X on the sign-in page (`360` reads X360); null for the family mark."},"accent":{"oneOf":[{"$ref":"#/components/schemas/Accent"},{"type":"null"}],"description":"Accent for the sign-in page; null for the neutral XTND accent."},"roles":{"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,31}$"},"description":"Roles this service defines. A grant may use only these; a granted role the service no longer defines confers nothing. A role still granted to someone cannot be removed (409)."},"permissions":{"$ref":"#/components/schemas/Permissions"},"manifest":{"type":["string","null"],"format":"uri","description":"Where the app publishes its manifest (`xsuite-app/1`): its API, web components and what it contributes to a workspace. https, or http on localhost only; null for none."}}},"UpdateServiceRequest":{"type":"object","minProperties":1,"properties":{"name":{"type":"string","minLength":1,"maxLength":100},"redirect_uris":{"type":"array","items":{"type":"string","format":"uri"},"description":"Where sessions may be delivered. Their origins may also call this API. https, or http on localhost and 127.0.0.1 only; no fragment, no comma."},"lockup":{"type":["string","null"],"maxLength":24,"description":"Wordmark after the X on the sign-in page (`360` reads X360); null for the family mark."},"accent":{"oneOf":[{"$ref":"#/components/schemas/Accent"},{"type":"null"}],"description":"Accent for the sign-in page; null for the neutral XTND accent."},"roles":{"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,31}$"},"description":"Roles this service defines. A grant may use only these; a granted role the service no longer defines confers nothing. A role still granted to someone cannot be removed (409)."},"permissions":{"$ref":"#/components/schemas/Permissions"},"manifest":{"type":["string","null"],"format":"uri","description":"Where the app publishes its manifest (`xsuite-app/1`): its API, web components and what it contributes to a workspace. https, or http on localhost only; null for none."}}},"OAuthError":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"error_description":{"type":"string"}}},"DynamicClientRegistrationRequest":{"type":"object","required":["redirect_uris"],"properties":{"client_name":{"type":"string","maxLength":100},"redirect_uris":{"type":"array","minItems":1,"maxItems":10,"items":{"type":"string","format":"uri"}},"grant_types":{"type":"array","items":{"type":"string","enum":["authorization_code","refresh_token"]}},"response_types":{"type":"array","items":{"type":"string","enum":["code"]}},"token_endpoint_auth_method":{"type":"string","enum":["none"]},"scope":{"type":"string"}}},"DynamicClientRegistrationResponse":{"type":"object","required":["client_id","redirect_uris","token_endpoint_auth_method"],"properties":{"client_id":{"type":"string"},"client_id_issued_at":{"type":"integer"},"client_name":{"type":"string"},"redirect_uris":{"type":"array","items":{"type":"string","format":"uri"}},"grant_types":{"type":"array","items":{"type":"string"}},"response_types":{"type":"array","items":{"type":"string"}},"token_endpoint_auth_method":{"type":"string","enum":["none"]}}},"AuthorizeRequest":{"type":"object","required":["client_id","redirect_uri","code_challenge","code_challenge_method"],"properties":{"client_id":{"type":"string"},"redirect_uri":{"type":"string","format":"uri"},"response_type":{"type":"string","enum":["code"],"default":"code"},"code_challenge":{"type":"string","pattern":"^[A-Za-z0-9\\-._~]{43,128}$"},"code_challenge_method":{"type":"string","enum":["S256"]},"resource":{"type":"string","format":"uri","minLength":1,"description":"One exact registered receiving resource; the trailing slash is significant. No audience fallback."},"state":{"type":"string","maxLength":4096},"nonce":{"type":"string","maxLength":256},"scope":{"type":"string","description":"Space-separated: openid (always), email, profile, offline_access."}}},"AuthorizeResponse":{"type":"object","required":["redirect_to"],"properties":{"redirect_to":{"type":"string","format":"uri"},"client":{"$ref":"#/components/schemas/ServiceInfo"}}},"AuthorizeError":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"error_description":{"type":"string"},"redirect_to":{"type":"string","format":"uri","description":"The app’s redirect URI carrying the error, once it is known to be the app’s."}}},"TokenRequest":{"type":"object","required":["grant_type","client_id"],"properties":{"grant_type":{"type":"string","enum":["authorization_code","refresh_token"]},"client_id":{"type":"string"},"code":{"type":"string"},"redirect_uri":{"type":"string"},"resource":{"type":"string","format":"uri","minLength":1,"description":"One exact registered receiving resource; the trailing slash is significant. No audience fallback."},"code_verifier":{"type":"string"},"refresh_token":{"type":"string"},"scope":{"type":"string"}}},"OAuthTokens":{"type":"object","required":["access_token","token_type","expires_in","refresh_token","scope"],"properties":{"access_token":{"type":"string","description":"The XAuth token."},"token_type":{"type":"string","enum":["Bearer"]},"expires_in":{"type":"integer"},"refresh_token":{"type":"string"},"scope":{"type":"string"},"resource":{"type":"string","format":"uri","minLength":1,"description":"One exact registered receiving resource; the trailing slash is significant. No audience fallback."},"id_token":{"type":"string","description":"After a code: the OpenID Connect ID token, for the app itself (`aud` is the app)."}}},"RevokeRequest":{"type":"object","required":["token"],"properties":{"token":{"type":"string"},"token_type_hint":{"type":"string","enum":["refresh_token","access_token"]}}},"UserInfo":{"type":"object","required":["sub","email","name","given_name","family_name"],"properties":{"sub":{"type":"string"},"email":{"type":"string","format":"email"},"name":{"type":"string"},"given_name":{"type":"string"},"family_name":{"type":"string"}}},"KeyPolicy":{"type":"object","required":["effect","permission_groups","resources"],"properties":{"id":{"type":"string","readOnly":true},"effect":{"type":"string","enum":["allow","deny"]},"permission_groups":{"type":"array","minItems":1,"items":{"type":"object","required":["id"],"properties":{"id":{"type":"string","examples":["workspace.admin","xpresent:decks.read"]},"name":{"type":["string","null"],"readOnly":true}}}},"resources":{"type":"object","minProperties":1,"additionalProperties":{"type":"string","enum":["*"]},"description":"`workspace:<id>` (it and every workspace below it), `workspace:*`, `app:<slug>` or `app:*` → `\"*\"`. A permission group applies only to resources of its scope. A workspace’s key names workspaces inside its own only.","examples":[{"workspace:<workspace-id>":"*","app:xpresent":"*"}]}}},"KeyCondition":{"type":"object","required":["request_ip"],"properties":{"request_ip":{"type":"object","properties":{"in":{"type":"array","items":{"type":"string"},"description":"IPv4 or IPv6 CIDR blocks the key works from."},"not_in":{"type":"array","items":{"type":"string"},"description":"Blocks it never works from."}}}}},"KeyApps":{"type":"object","additionalProperties":{"type":"array","minItems":1,"items":{"type":"string"}},"description":"Roles at each app, as a person’s grants: `{ \"xpresent\": [\"viewer\"] }`. Their permissions are the registry’s, at each request.","examples":[{"xpresent":["viewer"]}]},"ApiKeyRequest":{"type":"object","required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":120},"policies":{"type":"array","maxItems":50,"items":{"$ref":"#/components/schemas/KeyPolicy"},"description":"Denies are applied first, then allows, then everything else is denied. A key needs an allow policy or an app. At most 20 workspaces named."},"apps":{"$ref":"#/components/schemas/KeyApps"},"condition":{"oneOf":[{"$ref":"#/components/schemas/KeyCondition"},{"type":"null"}]},"not_before":{"type":["string","null"],"format":"date-time"},"expires_on":{"type":["string","null"],"format":"date-time","description":"In the future, and after `not_before`."}}},"ApiKeyPatch":{"type":"object","minProperties":1,"additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":120},"policies":{"type":"array","maxItems":50,"items":{"$ref":"#/components/schemas/KeyPolicy"},"description":"Denies are applied first, then allows, then everything else is denied. A key needs an allow policy or an app. At most 20 workspaces named."},"apps":{"$ref":"#/components/schemas/KeyApps"},"condition":{"oneOf":[{"$ref":"#/components/schemas/KeyCondition"},{"type":"null"}]},"not_before":{"type":["string","null"],"format":"date-time"},"expires_on":{"type":["string","null"],"format":"date-time","description":"In the future, and after `not_before`."},"status":{"type":"string","enum":["active","disabled"]}}},"ApiKey":{"type":"object","required":["id","name","status","owner","created_by","hint","issued_on","modified_on","policies"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["active","disabled","expired"]},"owner":{"type":"object","required":["type","id"],"properties":{"type":{"type":"string","enum":["user","workspace"]},"id":{"type":"string"}}},"created_by":{"type":"string","description":"The person who made it."},"hint":{"type":"string","description":"The prefix and the last four characters of the secret."},"issued_on":{"type":"string","format":"date-time"},"modified_on":{"type":"string","format":"date-time"},"rolled_on":{"type":["string","null"],"format":"date-time"},"last_used_on":{"type":["string","null"],"format":"date-time","description":"Written at most once a minute."},"not_before":{"type":["string","null"],"format":"date-time"},"expires_on":{"type":["string","null"],"format":"date-time"},"condition":{"oneOf":[{"$ref":"#/components/schemas/KeyCondition"},{"type":"null"}]},"policies":{"type":"array","items":{"$ref":"#/components/schemas/KeyPolicy"}},"apps":{"$ref":"#/components/schemas/KeyApps"}}},"ApiKeyWithValue":{"allOf":[{"$ref":"#/components/schemas/ApiKey"},{"type":"object","required":["value"],"properties":{"value":{"type":"string","pattern":"^xak_[A-Za-z0-9_-]{43}$","description":"The secret. Shown this once."}}}]},"KeyEventList":{"type":"object","required":["events"],"properties":{"events":{"type":"array","items":{"type":"object","required":["id","at","key","owner","op","actor","route"],"properties":{"id":{"type":"integer"},"at":{"type":"string","format":"date-time"},"key":{"type":"string"},"owner":{"type":"object","required":["type","id"],"properties":{"type":{"type":"string","enum":["user","workspace"]},"id":{"type":"string"}}},"op":{"type":"string","enum":["create","update","roll","delete"]},"actor":{"type":"string","description":"The person who did it."},"route":{"type":"string","enum":["owner","admin"]},"detail":{"description":"What changed; never the secret."}}}}}},"ApiKeyList":{"type":"object","required":["keys"],"properties":{"keys":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}}}},"PermissionGroup":{"type":"object","required":["id","name","description","scope","owners"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"scope":{"type":"string","enum":["workspace","app"]},"owners":{"type":"array","items":{"type":"string","enum":["user","workspace"]},"description":"Whose keys may carry it."}}},"KeyVerification":{"type":"object","required":["id","status","owner"],"properties":{"id":{"type":"string"},"status":{"type":"string","enum":["active"]},"owner":{"type":"object","required":["type","id"],"properties":{"type":{"type":"string","enum":["user","workspace"]},"id":{"type":"string"}}},"not_before":{"type":["string","null"],"format":"date-time"},"expires_on":{"type":["string","null"],"format":"date-time"},"condition":{"oneOf":[{"$ref":"#/components/schemas/KeyCondition"},{"type":"null"}]}}},"ProjectAccessScope":{"oneOf":[{"type":"object","additionalProperties":false,"required":["kind","workspaceId"],"properties":{"kind":{"const":"workspace"},"workspaceId":{"type":"string","minLength":1,"maxLength":200}}},{"type":"object","additionalProperties":false,"required":["kind","workspaceId","projectId"],"properties":{"kind":{"const":"project"},"workspaceId":{"type":"string","minLength":1,"maxLength":200},"projectId":{"type":"string","minLength":1,"maxLength":200}}}]},"ScopedGrantInput":{"type":"object","required":["app","scope","userGuid","permissions","expectedRevision"],"properties":{"app":{"type":"string"},"scope":{"$ref":"#/components/schemas/ProjectAccessScope"},"userGuid":{"type":"string"},"permissions":{"type":"array","uniqueItems":true,"items":{"type":"string"}},"expectedRevision":{"type":"integer","minimum":0}}},"ScopedGrantResult":{"type":"object","required":["ok","grant"],"properties":{"ok":{"const":true},"grant":{"type":"object","required":["userGuid","permissions","revision"],"properties":{"userGuid":{"type":"string"},"permissions":{"type":"array","items":{"type":"string"}},"revision":{"type":"integer","minimum":1}}}}},"ScopedGrantOptions":{"type":"object","required":["app","scope","permissions","members"],"properties":{"app":{"type":"string"},"scope":{"$ref":"#/components/schemas/ProjectAccessScope"},"permissions":{"type":"array","items":{"type":"object","required":["name","description"],"properties":{"name":{"type":"string"},"description":{"type":"string"}}}},"members":{"type":"array","items":{"type":"object","description":"Current canonical XWorkspace member, including user guid/email/name, role, via and from."}}}},"ScopedGrantList":{"allOf":[{"$ref":"#/components/schemas/ScopedGrantOptions"},{"type":"object","required":["grants"],"properties":{"grants":{"type":"array","items":{"type":"object","required":["userGuid","permissions","revision"],"properties":{"userGuid":{"type":"string"},"permissions":{"type":"array","items":{"type":"string"}},"revision":{"type":"integer"}}}}}}]},"ResourceTokenRequest":{"type":"object","additionalProperties":false,"required":["resource"],"properties":{"resource":{"type":"string","format":"uri","minLength":1,"description":"One exact registered receiving resource; the trailing slash is significant. No audience fallback."}}},"ResourceToken":{"type":"object","required":["access_token","token_type","expires_in","resource"],"properties":{"access_token":{"type":"string"},"token_type":{"const":"Bearer"},"expires_in":{"type":"integer"},"resource":{"type":"string","format":"uri","minLength":1,"description":"One exact registered receiving resource; the trailing slash is significant. No audience fallback."}}}}}}