Create a new API key.
Create a new API key for the authenticated user. Requires a unique name per user per organization. The full composite API key (key_id.secret) is returned once in the response and cannot be retrieved again. Enforces the per-user API key count limit.
Authorizations
Body
Body to create an API key. Unknown fields return a 400. Send either expires_in_days or the deprecated expires_at, not both.
User-assigned label for the API key. Must be unique per user per organization. Must start with a letter (A-Z or a-z). After that, letters, digits, spaces, hyphens, and underscores are allowed. Leading and trailing whitespace is stripped by the server before saving.
1 - 128^[A-Za-z][A-Za-z0-9_ -]*$Number of days from creation after which the API key expires. Optional — defaults to 3650 (about 10 years) when omitted. Must be between 1 and 36500 (100 years); null is rejected. Use this instead of the deprecated expires_at. (The schema declares no default on purpose: generated clients would pre-fill it and then send it next to expires_at, which is rejected.)
1 <= x <= 36500365
Deprecated in 26.28; removal no earlier than 26.32.
Use expires_in_days instead. Until removal, this must be a future timestamp and cannot
exceed 100 years from now. If neither field is provided, the key expires 10 years after
creation. Cannot be combined with expires_in_days.
Response
API key created successfully. The token field contains the full composite key_id.secret — this is the only time the secret is available.
Response object for standard API responses.