Skip to content

Add a webhook endpoint

POST
/webhooks
curl --request POST \
--url https://api.duta.indra.sh/v1/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "endpoint": "https://example.com", "url": "https://example.com", "events": [ "email.sent" ] }'

Events: email.sent, email.delivered, email.bounced, email.complained, email.failed, email.delivery_delayed, email.opened, email.clicked. Up to 10 endpoints.

Media typeapplication/json
object
endpoint

A public https URL

string format: uri
url

The same as endpoint, under Duta’s original spelling

string format: uri
events

Leave out or empty for every event

Array<string>
Allowed values: email.sent email.delivered email.bounced email.complained email.failed email.delivery_delayed email.opened email.clicked

Success

Media typeapplication/json
object
object
required
string
Allowed values: webhook
id
required
string
url
required
string
endpoint
required
string
events
required
Array<string>
signing_secret
required

Whsec_ secret for verifying deliveries. Shown once

string
secret
required

The same as signing_secret

string
created_at
required

ISO 8601

string format: date-time
Example
{
"object": "webhook"
}

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"
}