ZapAPI Docs
Get StartedConceptsAI GatewayGuidesPayment GatewaySDKAPI ReferenceResources
ApiApi keys

Create a new API key

POST
/api/v1/api-keys

Creates a new API key. The full key is only shown ONCE - save it securely!

Authorization

bearer

Header Parameters

X-API-Version?string

API version for header-based versioning

Default"1"
Value in"1""2"

Request Body

application/json
  1. body
name*string

API key name

Length3 <= length <= 100
environment*string

Environment type

Value in"test""live"
projectId?string

Associated project ID

expiresAt?string

Expiration date (ISO 8601)

scopes?array<array<any>>

Permission scopes. Defaults to ["*"] (full access). Example: ["invoices:read", "invoices:write"]

Response Body

API key created successfully. Full key is returned only once.

Example Request
curl -X POST 'http://localhost:3001/api/v1/api-keys' \  -H 'Content-Type: application/json' \  -d '{  "name": "Production API Key",  "environment": "test"}'
Example Response201
Empty