Skip to main content
POST
/
v1
/
account
/
keys
Create an API key
curl --request POST \
  --url https://api.naga.ac/v1/account/keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>"
}
'
{
  "id": 18,
  "name": "CI worker",
  "key": "ng-1234567890abcdefghijklmnopqrstuv",
  "created_at": "2026-03-31T10:00:00Z",
  "expires_at": "2026-12-31T23:59:59Z",
  "is_enabled": true,
  "credit_limit": 25,
  "message": "Store this key securely. It will not be shown again."
}

Authorizations

Authorization
string
header
required

Provisioning key required for account management endpoints under /v1/account.

Body

application/json

Request model for creating an API key

name
string
required

Name for the API key

Required string length: 1 - 255
credit_limit
number | null

Optional credit limit for the API key

Required range: x >= 0
expires_at
string<date-time> | null

Optional expiration datetime for the API key. Must be in the future.

Response

API key created successfully.

Response model for created API key (includes the actual key)

id
integer
required
name
string
required
key
string
required
created_at
string<date-time>
required
expires_at
string<date-time> | null
required
is_enabled
boolean
required
credit_limit
number | null
required
message
string
default:Store this key securely. It will not be shown again.