Skip to main content
API keys authenticate every request to the Borga API. Each key has a type of either publishable (safe to expose in client-side code) or secret (server-side only), and a mode of either test or live. You can manage keys here or through the dashboard.
A rotated or revoked key cannot be recovered. Update your integrations with the new key immediately after rotating, as the old key is invalidated at the moment of rotation.

List API keys

GET /v1/api_keys Returns a list of all API keys for your merchant account.

Response fields

object[]
required
Array of API key objects.

Create an API key

POST /v1/api_keys Creates a new API key. The full key value is returned only in this response — store it securely before continuing.

Request parameters

string
required
Key type. One of publishable or secret.
string
required
Key mode. One of test or live.
string
Optional label to help identify the key’s purpose (e.g. "Production server", "Mobile app").

Response fields

string
required
Unique key identifier.
string
required
Key type: publishable or secret.
string
required
Key mode: test or live.
string
Key label.
string
required
The full key value. This is the only time it is returned in plaintext — save it now.
string
required
Last four characters of the key value.
string
required
ISO 8601 timestamp of when the key was created.

Rotate an API key

POST /v1/api_keys/{id}/rotate Generates a new value for an existing key and immediately invalidates the old one. Use this to rotate credentials without deleting and re-creating the key object.
The old key is invalidated immediately. Update every integration using this key before rotating.

Path parameters

string
required
The ID of the key to rotate.

Response fields

Returns the updated key object with the new key value in plaintext. After this response, the new value is only available via last4.
string
required
Unique key identifier.
string
required
Key type.
string
required
Key mode.
string
Key label.
string
required
The new full key value. Save this now — it will not be shown again.
string
required
Last four characters of the new key value.
string
required
ISO 8601 timestamp of the original key creation.

Revoke an API key

DELETE /v1/api_keys/{id} Permanently revokes an API key. Any requests using this key will be rejected immediately.

Path parameters

string
required
The ID of the key to revoke.

Response fields

Returns an empty body with a 204 No Content status on success.