API keys
Create API key
Create a new scoped API key with the TypeScript SDK.
POST
Create API key
Use
blnk.ApiKeys.create to create a scoped API key.
Call the method
blnk.ApiKeys.create
| Field | Type | Description |
|---|---|---|
name | string | Descriptive name for the key or service account. |
owner | string | Owner identifier you assign, such as a team, service, or user ID. |
scopes | string[] | List of permissions in resource:action format (for example ledgers:read). |
expires_at | string | Expiration timestamp (ISO 8601, for example 2026-12-31T23:59:59Z). |
Store the plaintext key
Save
response.data.key immediately. It is only returned at creation and cannot be retrieved later.Response
201 Created
| Field | Type | Description |
|---|---|---|
api_key_id | string | Unique ID for the key. Use it to revoke the key. |
key | string | Plaintext secret. Store it now. It is only returned at creation. |
scopes | string[] | Permissions granted to the key. |
expires_at | string | Date and time the key expires. |
is_revoked | boolean | Whether the key has been revoked. |
Related docs
How API keys work
Scopes, the master key, and the auth model.
Create API key
HTTP request and response schema.