Skip to main content
POST
/
api
/
admin
/
api-keys
Create API key
curl --request POST \
  --url https://{cluster_id}.on-hellgate.cloud/api/admin/api-keys \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "expires_in": 3600,
  "scopes": [
    "admin:api-keys:create",
    "admin:api-keys:update"
  ]
}
'
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "created_at": "2023-10-01T10:00:00Z",
  "expires_at": "2023-10-01T11:00:00Z",
  "key_value": "key_1234567890ABCDEF",
  "scopes": [
    "admin:api-keys:create",
    "admin:api-keys:update"
  ]
}

Authorizations

x-api-key
string
header
required

Body

application/json
scopes
enum<string>[]
required

A list of scopes that the API key will have access to.

Minimum array length: 1
Available options:
admin:api-keys:create,
admin:api-keys:read,
admin:api-keys:update,
admin:api-keys:delete,
admin:webhooks:create,
admin:webhooks:read,
admin:webhooks:delete,
pci:tokens:create,
pci:tokens:read,
pci:tokens:update,
pci:tokens:delete,
pci:tokens:forward,
network:tokens:create,
network:tokens:read,
network:tokens:delete,
network:tokens:use,
generic:tokens:create,
generic:tokens:read,
generic:tokens:delete,
admin:types:create,
admin:types:read,
admin:types:delete
expires_in
integer

How many seconds after creation the API key expires automatically.

Required range: 1 <= x <= 7776000

Response

Success response

id
string<uuid>
required
created_at
string<date-time>
required
key_value
string
required

The generated API key value. It will only be returned once with this response.

scopes
enum<string>[]
required

A list of scopes that the API key will have access to.

Minimum array length: 1
Available options:
admin:api-keys:create,
admin:api-keys:read,
admin:api-keys:update,
admin:api-keys:delete,
admin:webhooks:create,
admin:webhooks:read,
admin:webhooks:delete,
pci:tokens:create,
pci:tokens:read,
pci:tokens:update,
pci:tokens:delete,
pci:tokens:forward,
network:tokens:create,
network:tokens:read,
network:tokens:delete,
network:tokens:use,
generic:tokens:create,
generic:tokens:read,
generic:tokens:delete,
admin:types:create,
admin:types:read,
admin:types:delete
expires_at
string<date-time>