Skip to main content
POST
/
api
/
v1
/
admin
/
api-keys
curl -X POST "https://olive-gateway-a6ba.onrender.com/api/v1/admin/api-keys" \
  -H "Authorization: Bearer ADMIN_JWT" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Partner Integration",
    "scopes": ["payments:read", "balance:read"],
    "expires_at": "2026-01-01T00:00:00Z"
  }'
{
  "api_key": "olive_live_xxxxxxxxxxxxx",
  "name": "Partner Integration",
  "scopes": ["payments:read", "balance:read"],
  "created_at": "2025-01-15T10:00:00Z",
  "expires_at": "2026-01-01T00:00:00Z"
}
Generate API keys for integrations. Only system administrators can create API keys.

Request

Authorization
string
required
Bearer <token> - System Admin JWT

Body Parameters

name
string
required
Friendly name for the API key
scopes
array
Permission scopes for the key (e.g., ["payments:read", "balance:read"])
expires_at
string
Expiration date (ISO 8601). Leave empty for no expiration.

Response

api_key
string
The generated API key (shown only once)
name
string
Key name
scopes
array
Assigned permission scopes
created_at
string
Creation timestamp
expires_at
string
Expiration timestamp (if set)

Examples

curl -X POST "https://olive-gateway-a6ba.onrender.com/api/v1/admin/api-keys" \
  -H "Authorization: Bearer ADMIN_JWT" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Partner Integration",
    "scopes": ["payments:read", "balance:read"],
    "expires_at": "2026-01-01T00:00:00Z"
  }'
{
  "api_key": "olive_live_xxxxxxxxxxxxx",
  "name": "Partner Integration",
  "scopes": ["payments:read", "balance:read"],
  "created_at": "2025-01-15T10:00:00Z",
  "expires_at": "2026-01-01T00:00:00Z"
}

Available Scopes

ScopeDescription
payments:readRead payment data
payments:writeCreate payments
balance:readRead wallet balances
subscribers:readRead subscriber data
subscribers:writeModify subscribers
compliance:readRead compliance data
admin:fullFull admin access

Security

The API key is only shown once at creation. Store it securely immediately.
  • API keys should be rotated periodically
  • Use the minimum required scopes
  • Set expiration dates for temporary integrations

Errors

StatusCodeDescription
400INVALID_REQUESTInvalid request format
403FORBIDDENNot authorized to create API keys
500INTERNAL_ERRORServer error