Skip to main content
POST
Create API key

Authorizations

X-API-KEY
string
header
required

API Key Authentication.

Body

application/json

The API key to create.

friendlyName
string
required

The name that tells the API key apart from the other API keys of the tenant, such as the name of the system that uses it.

Example:

"ERP da Padaria Central"

roles
enum<string>[]
required

The roles of the API key, each a resource and a permission, such as invoices:read, which set what the API key can do. A write role does not cover read.

Available options:
contracts:admin,
contracts:read,
contracts:write,
customers:read,
customers:write,
dunning:read,
dunning:write,
emails:read,
events:read,
events:write,
integrations:read,
integrations:write,
invoices:read,
invoices:write,
items:read,
items:write,
legal_entities:read,
licenses:read,
licenses:write,
payment_accounts:read,
payment_accounts:write,
payments:read,
plan_instance_versions:read,
plan_instance_versions:write,
plan_instances:read,
plan_instances:write,
plans:read,
products:read,
products:write,
resources:read,
resources:write,
tenants:read,
watchtower:write
Example:
expireAt
string<date-time>
required

The instant, in UTC, when the API key stops working.

Example:

"2027-01-01T00:00:00.000Z"

Response

An API key that Aira just created, with the key itself, which no other reply shows.

id
string<uuid>
required

The unique identifier of the API key.

friendlyName
string
required

The name that tells the API key apart from the other API keys of the tenant, such as the name of the system that uses it.

Example:

"ERP da Padaria Central"

roles
string[]
required

The roles of the API key, each a resource and a permission, such as invoices:read, which set what the API key can do. A write role does not cover read.

Example:
status
enum<string>
required

The status of the API key. Only an active API key can call the public API.

Available options:
active,
deactivated,
revoked
expireAt
string<date-time>
required

The instant, in UTC, when the API key stops working.

Example:

"2027-01-01T00:00:00.000Z"

key
string
required

The key that a system sends in the X-API-KEY header to call the public API. Aira stores only a hash of it, so no later reply shows it.

Example:

"example-api-key"