Create API key
Creates an API key for the organization and returns the full secret exactly once. Store it securely — it cannot be retrieved again.
phosra_ key. You never need a phosra_ key to mint your first phosra_ key. The full zero-to-key path — sign up, auto-provision an org, mint the first key (console or one curl) — is Create your account & get keys. The orgId above is the org that page returns.Authorizations
A logged-in user session bearer token (WorkOS AuthKit access token from signup/login).
Path Parameters
UUID of the developer organization.
Body
Human-readable label for the key.
Key environment — test keys cannot call production endpoints.
test, live Optional permission scopes granted to this key. Omit the field entirely (or send []) to mint an unscoped key — the documented zero-to-key body { "name": …, "environment": "test" } does exactly that. Every entry must be one of the values in the enum below; an unknown scope is rejected 400 invalid scope requested.
read:families, write:families, read:children, write:children, read:policies, write:policies, read:enforcement, write:enforcement, read:devices, write:devices, read:webhooks, write:webhooks, read:ratings, read:platforms Response
Key created. The raw secret (key) is returned only in this response — store it now, it can never be retrieved again. A freshly minted key has no last_used_at, last_used_ip, or expires_at yet (those fields are omitted until set), and key_prefix is the first token of the secret (phosra_test_<8 hex>), safe to display in a dashboard. (Body captured verbatim from the live sandbox.)
An API key. The secret is returned only once at create/regenerate (see DeveloperApiKeyWithSecret).
Unique identifier for this resource.
UUID identifier.
Human-readable display name.
Key prefix.
One of: test, live.
test, live Permission scopes granted to this key; empty means unscoped (full access within the account).
RFC 3339 timestamp.
IP address of the most recent request made with this key; null if never used.
RFC 3339 timestamp of when this value expires.
RFC 3339 timestamp of when the key was revoked; null while the key is active.
UUID identifier.
RFC 3339 timestamp of when the resource was created.
The raw secret key — shown only once.