Overview
API keys allow you to enforce access control by granting specific scopes (permissions) to different services or applications, rather than using the master key for all operations.Available on version 0.10.1 or later. Requires master key authentication (the
server.secret_key from your configuration).Authorization
If set, the API uses an API key for authentication. Include the following header in your requests:X-blnk-key: <api-key>.
Replace <api-key> with your secret API key. Ensure the key is kept secure and not exposed in public repositories or client-side code.
See also: Secure your Blnk server
Body
The name of the API key or service account. Use descriptive names to identify the purpose of each key.
Unique identifier of the owner or service associated with the API key. This helps track which service or team owns each key.
A list of permissions granted to the API key. Each scope follows the format
resource:action. See Understanding Scopes for available resources and actions.Examples:["ledgers:read"]- Can only view ledgers["transactions:write", "balances:read"]- Can create/modify transactions and view balances["*:*"]- Full access to all resources and actions
The expiration date and time for the API key in ISO 8601 format (e.g.,
"2026-03-11T00:00:00Z").Response
Unique identifier for the created API key.
The actual API key value. Store this securely as it will not be shown again. Use this value in the
X-Blnk-Key header for authenticated requests.The name of the API key.
The owner identifier associated with the API key.
List of permissions granted to the API key.
The expiration date and time for the API key in ISO 8601 format.
ISO 8601 formatted timestamp of when the API key was created.
ISO 8601 formatted timestamp of when the API key was last used for authentication. Returns
"0001-01-01T00:00:00Z" if the key has never been used.Whether the API key has been revoked. Returns
false for newly created keys.