Skip to content

Create an API key

POST
/api-keys
curl --request POST \
--url https://api.duta.indra.sh/v1/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "permission": "full_access", "scope": "send", "domain_id": "example" }'
Media typeapplication/json
object
name
required
string
>= 1 characters <= 60 characters
permission

Defaults to sending_access. full_access can also manage domains, keys and webhooks

string
Allowed values: full_access sending_access
scope

The same as permission, under Duta’s original spelling

string
Allowed values: send full
domain_id

Not supported yet. Sending it is refused

Success

Media typeapplication/json
object
id
required
string
name
required
string
permission
required
string
Allowed values: full_access sending_access
scope
required
string
Allowed values: send full
prefix
required
string
last4
required
string
created_at
required

ISO 8601

string format: date-time
token
required

The key. Shown once and never again

string
key
required

The same as token

string
Example
{
"permission": "full_access",
"scope": "send"
}

Missing or invalid API key

Media typeapplication/json
object
statusCode
required
integer
name
required

The Resend error name, so code that branches on it keeps working

string
message
required
string
code
required

Duta’s error code, finer grained than name

string
Allowed values: unauthorized forbidden not_found validation_failed domain_not_verified from_domain_not_allowed recipient_suppressed recipient_not_confirmed rate_limited quota_exceeded conflict payment_required account_paused content_rejected platform_halted payload_too_large length_required idempotency_conflict provider_error internal_error
detail
object
key
additional properties
request_id
required

Find this request on the Logs screen

string
Example
{
"code": "unauthorized"
}

The key has sending access only

Media typeapplication/json
object
statusCode
required
integer
name
required

The Resend error name, so code that branches on it keeps working

string
message
required
string
code
required

Duta’s error code, finer grained than name

string
Allowed values: unauthorized forbidden not_found validation_failed domain_not_verified from_domain_not_allowed recipient_suppressed recipient_not_confirmed rate_limited quota_exceeded conflict payment_required account_paused content_rejected platform_halted payload_too_large length_required idempotency_conflict provider_error internal_error
detail
object
key
additional properties
request_id
required

Find this request on the Logs screen

string
Example
{
"code": "unauthorized"
}

The request was refused. code says why

Media typeapplication/json
object
statusCode
required
integer
name
required

The Resend error name, so code that branches on it keeps working

string
message
required
string
code
required

Duta’s error code, finer grained than name

string
Allowed values: unauthorized forbidden not_found validation_failed domain_not_verified from_domain_not_allowed recipient_suppressed recipient_not_confirmed rate_limited quota_exceeded conflict payment_required account_paused content_rejected platform_halted payload_too_large length_required idempotency_conflict provider_error internal_error
detail
object
key
additional properties
request_id
required

Find this request on the Logs screen

string
Example
{
"code": "unauthorized"
}

Rate limited. Retry after the Retry-After header

Media typeapplication/json
object
statusCode
required
integer
name
required

The Resend error name, so code that branches on it keeps working

string
message
required
string
code
required

Duta’s error code, finer grained than name

string
Allowed values: unauthorized forbidden not_found validation_failed domain_not_verified from_domain_not_allowed recipient_suppressed recipient_not_confirmed rate_limited quota_exceeded conflict payment_required account_paused content_rejected platform_halted payload_too_large length_required idempotency_conflict provider_error internal_error
detail
object
key
additional properties
request_id
required

Find this request on the Logs screen

string
Example
{
"code": "unauthorized"
}