API keys
Create API key
Create a new scoped API key with the Python SDK.
POST
Create API key
Use
blnk.api_keys.create to create a scoped API key.
Call the method
blnk.api_keys.create
| Field | Type | Description |
|---|---|---|
name | str | Descriptive name for the key or service account. |
owner | str | 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 | str | 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 | str | Unique ID for the key. Use it to revoke the key. |
key | str | Plaintext secret. Store it now. It is only returned at creation. |
scopes | string[] | Permissions granted to the key. |
expires_at | str | Date and time the key expires. |
is_revoked | bool | 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.