Skip to main content
POST
/
api
/
v1
/
webhooks
Create webhook
curl --request POST \
  --url https://api.torpedo.co.mz/api/v1/webhooks \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "url": "https://myapp.com/webhooks/torpedo",
  "events": [
    "email.delivered",
    "email.bounced",
    "email.failed"
  ]
}
'
{
  "data": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "url": "https://myapp.com/webhooks/torpedo",
    "events": [
      "email.delivered",
      "email.bounced"
    ],
    "createdAt": "2023-11-07T05:31:56Z",
    "lastDeliveryAt": "2023-11-07T05:31:56Z",
    "lastFailureAt": "2023-11-07T05:31:56Z",
    "lastFailureReason": "<string>",
    "signingSecret": "a3f2c1..."
  }
}

Authorizations

X-API-Key
string
header
required

Prefix tor_ followed by a base64url-encoded random key. Obtain one from POST /api/v1/workspaces or POST /api/v1/auth/keys.

Body

application/json
url
string<uri>
required

Must be an HTTPS URL

Example:

"https://myapp.com/webhooks/torpedo"

events
enum<string>[]
required
Minimum array length: 1
Available options:
email.delivered,
email.bounced,
email.complained,
email.failed,
domain.verified,
domain.failed
Example:
[
  "email.delivered",
  "email.bounced",
  "email.failed"
]

Response

Webhook created — store the signingSecret now

data
object