Create an API key
Create a new API key. API keys may be scoped by project and may include a policy.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Label for the API key (1-255 characters). API keys are not addressable by name.
1 - 255"staging"
Number of days until expiry, up to 3650. Use null for never. Cannot be combined with expires_at.
1 <= x <= 365030
Exact expiry time. Must be in the future and no later than the issuing credential's own expiry. Cannot be combined with days_to_expire.
"2025-01-15T09:00:00Z"
Issue a scoped key that may only perform the listed actions on the listed resources.
Unique project identifier
"proj_abc123"
Response
API key created successfully
API key returned immediately after creation. Includes the plaintext key once.
When the API key was created
When the API key was deleted (soft-deleted). Null for keys that have not been deleted.
When the API key expires
Unique API key identifier
"ckv9w8q2f000001l5r3j7k9m4"
Masked version of the API key
"sk_1234...abcd"
Label for the API key. API keys are not addressable by name; use the ID or key identifier for stable references.
"production"
Project identifier for project-scoped API keys. Null means org-wide.
"proj_abc123"
Project name for project-scoped API keys. Null means the key is org-wide or the project name is unavailable.
"Production"
Plaintext API key. Only returned once when the key is created.
"sk_1234abcd"
Permissions granted to a scoped API key. Absent for an ordinary key, which keeps unrestricted access within its organization or project.