Skip to main content
Creates an API key and returns its full value once. Pass member_principal_id to issue the key for a VIRTUAL member (the key then acts as that member); human members cannot be targeted. Issuing a key for a member is acting on that member: you can only target virtual members ranked below you (403 MEMBER_NOT_BELOW_CALLER), and one holding an admin-level role only as the team owner (403 ROLE_REQUIRES_OWNER).
Permission required: service_account:create (all keys)
  • When you set member_principal_id: member:manage_virtual
  • When the target virtual member is not ranked below you: it holds tenant_admin or an admin-level custom role (403 MEMBER_NOT_BELOW_CALLER / ROLE_REQUIRES_OWNER): team owner only

Headers

string
Optional. Retrying with the same value replays the first result instead of creating a second key.

Request Body

string
required
Display name for the key
array
Optional. Client IPs or CIDR ranges (e.g. 10.0.0.1, 192.168.0.0/16) this key may be used from. Omit or send [] for no restriction.
string
Optional. Fallback model-routing group, same rule as group.
integer
Expiry, Unix seconds. Omit or send 0 for a key that never expires.
string
Optional. Model-routing group. Must be a public group or the owner’s own group.
string
Optional. Issue the key for this VIRTUAL member (from POST /members); the key acts as that member. Human members cannot be targeted.
boolean
Optional. true = a read-only key: requests that create, change or delete anything are refused with 403 API_KEY_READ_ONLY. Default false (full access).

Response

object

Errors

Errors answer with success: false, a message and an error_code. See Error Codes for every code.