Skip to content

Create a new webhook

POST
/api/domains/{domain}/webhooks
curl --request POST \
--url https://smtp-app.kirim.email/api/domains/example.com/webhooks \
--header 'Content-Type: application/json' \
--data '{ "type": "queued", "url": "https://example.com/webhook" }'

Create a new webhook configuration for the specified domain owned by the authenticated user

domain
required
string
Example
example.com

Domain name that must be owned by the authenticated user

Webhook configuration details

Media typeapplication/json
object
type
required

Event type that will trigger this webhook

string
Allowed values: queued send delivered bounced failed permanent_fail opened clicked unsubscribed temporary_fail deferred
Example
delivered
url
required

URL endpoint where webhook events will be sent (must use HTTP or HTTPS)

string format: uri
Example
https://example.com/webhook

Webhook created successfully

Media typeapplication/json
object
success

Indicates the request was successful

boolean
message

Human-readable success message

string
data

Webhook configuration for email event notifications

object
webhook_guid

Unique identifier for the webhook

string format: uuid
user_guid

GUID of the user who owns the webhook

string
user_domain_guid

GUID of the domain associated with the webhook

string
user_smtp_guid

GUID of the SMTP configuration

string
type

Event type that triggers the webhook

string
Allowed values: queued send delivered bounced failed permanent_fail opened clicked unsubscribed temporary_fail deferred
url

URL endpoint where webhook events will be sent

string format: uri
is_deleted

Whether the webhook has been deleted

boolean
created_at

Unix timestamp when the webhook was created

integer
modified_at

Unix timestamp when the webhook was last modified

integer
Example
{
"success": true,
"message": "Webhook created successfully.",
"data": {
"webhook_guid": "550e8400-e29b-41d4-a716-446655440000",
"user_guid": "user-guid-123",
"user_domain_guid": "domain-guid-456",
"user_smtp_guid": "smtp-guid-789",
"type": "queued",
"url": "https://example.com/webhook",
"is_deleted": false,
"created_at": 1640995200,
"modified_at": 1640995200
}
}

Unauthorized - Invalid or missing authentication credentials

Media typeapplication/json
object
success
boolean
message
string
Example
{
"success": false,
"message": "Unauthorized"
}

Not Found - Domain or webhook not found

Media typeapplication/json
object
success
boolean
message
string
Example
{
"success": false,
"message": "Domain not found or you do not own this domain"
}

Validation Error - Invalid input data

Media typeapplication/json
object
success
boolean
message
string
errors

Field-specific validation errors

object
Example
{
"success": false,
"message": "Validation failed."
}

Too Many Requests - Rate limit exceeded. Retry after the specified time.

Media typeapplication/json
object
success
boolean
message
string
Example
{
"success": false,
"message": "Too many attempts. Please try again later."
}
Retry-After
integer

Seconds until rate limit resets

X-RateLimit-Limit
integer

Maximum requests per minute

X-RateLimit-Remaining
integer

Remaining requests in current window

Server Error - Unexpected error occurred

Media typeapplication/json
object
success
boolean
message
string
Example
{
"success": false,
"message": "An error occurred while processing the request."
}