Skip to main content
POST
cURL
First key? Start here. This endpoint needs an existing developer org and a WorkOS session bearer (from signup) — not a 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

Authorization
string
header
required

A logged-in user session bearer token (WorkOS AuthKit access token from signup/login).

Path Parameters

orgId
string<uuid>
required

UUID of the developer organization.

Body

application/json
name
string
required

Human-readable label for the key.

environment
enum<string>
required

Key environment — test keys cannot call production endpoints.

Available options:
test,
live
scopes
enum<string>[]

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.

Available options:
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
Example:

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).

id
string<uuid>

Unique identifier for this resource.

org_id
string<uuid>

UUID identifier.

name
string

Human-readable display name.

key_prefix
string

Key prefix.

environment
enum<string>

One of: test, live.

Available options:
test,
live
scopes
string[]

Permission scopes granted to this key; empty means unscoped (full access within the account).

last_used_at
string<date-time>

RFC 3339 timestamp.

last_used_ip
string

IP address of the most recent request made with this key; null if never used.

expires_at
string<date-time>

RFC 3339 timestamp of when this value expires.

revoked_at
string<date-time> | null

RFC 3339 timestamp of when the key was revoked; null while the key is active.

created_by
string<uuid>

UUID identifier.

created_at
string<date-time>

RFC 3339 timestamp of when the resource was created.

key
string

The raw secret key — shown only once.