Create a new webhook
const url = 'https://smtp-app.kirim.email/api/domains/example.com/webhooks';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"type":"queued","url":"https://example.com/webhook"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Example
example.comDomain name that must be owned by the authenticated user
Request Bodyrequired
Section titled “Request Bodyrequired”Webhook configuration details
object
Event type that will trigger this webhook
Example
deliveredURL endpoint where webhook events will be sent (must use HTTP or HTTPS)
Example
https://example.com/webhookResponses
Section titled “Responses”Webhook created successfully
object
Indicates the request was successful
Human-readable success message
Webhook configuration for email event notifications
object
Unique identifier for the webhook
GUID of the user who owns the webhook
GUID of the domain associated with the webhook
GUID of the SMTP configuration
Event type that triggers the webhook
URL endpoint where webhook events will be sent
Whether the webhook has been deleted
Unix timestamp when the webhook was created
Unix timestamp when the webhook was last modified
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
object
Example
{ "success": false, "message": "Unauthorized"}Not Found - Domain or webhook not found
object
Example
{ "success": false, "message": "Domain not found or you do not own this domain"}Validation Error - Invalid input data
object
Field-specific validation errors
object
Example
{ "success": false, "message": "Validation failed."}Too Many Requests - Rate limit exceeded. Retry after the specified time.
object
Example
{ "success": false, "message": "Too many attempts. Please try again later."}Headers
Section titled “Headers”Seconds until rate limit resets
Maximum requests per minute
Remaining requests in current window
Server Error - Unexpected error occurred
object
Example
{ "success": false, "message": "An error occurred while processing the request."}