Skip to main content
POST
/
webhooks
curl --request POST \
  --url https://api.autosend.com/v1/webhooks \
  --header 'Authorization: Bearer AS_your-api-key' \
  --header 'Content-Type: application/json' \
  --data '{
  "url": "https://example.com/webhooks/autosend",
  "events": ["email.delivered", "email.bounced"],
  "metadata": { "team": "growth" }
}'
{
  "success": true,
  "message": "Webhook created successfully",
  "data": {
    "webhook": {
      "id": "60d5ec49f1b2c72d9c8b1234",
      "organizationId": "60d5ec49f1b2c72d9c8b0000",
      "projectId": "60d5ec49f1b2c72d9c8b1111",
      "url": "https://example.com/webhooks/autosend",
      "secret": "whsec_8f3a1c2d4e5b6a7c8d9e0f1a2b3c4d5e",
      "events": ["email.delivered", "email.bounced"],
      "isActive": true,
      "createdAt": "2026-06-12T10:15:00.000Z",
      "updatedAt": "2026-06-12T10:15:00.000Z"
    }
  }
}
This endpoint accepts a project API key (AS_ prefix). The signing secret is returned only on creation — store it securely. You can later retrieve it via the Reveal Webhook Secret endpoint.
curl --request POST \
  --url https://api.autosend.com/v1/webhooks \
  --header 'Authorization: Bearer AS_your-api-key' \
  --header 'Content-Type: application/json' \
  --data '{
  "url": "https://example.com/webhooks/autosend",
  "events": ["email.delivered", "email.bounced"],
  "metadata": { "team": "growth" }
}'
{
  "success": true,
  "message": "Webhook created successfully",
  "data": {
    "webhook": {
      "id": "60d5ec49f1b2c72d9c8b1234",
      "organizationId": "60d5ec49f1b2c72d9c8b0000",
      "projectId": "60d5ec49f1b2c72d9c8b1111",
      "url": "https://example.com/webhooks/autosend",
      "secret": "whsec_8f3a1c2d4e5b6a7c8d9e0f1a2b3c4d5e",
      "events": ["email.delivered", "email.bounced"],
      "isActive": true,
      "createdAt": "2026-06-12T10:15:00.000Z",
      "updatedAt": "2026-06-12T10:15:00.000Z"
    }
  }
}

Authorizations

Authorizations
string | header
required
Project API key header of the form Bearer AS_<key>.

Body

url
string
required
The HTTPS (or HTTP) endpoint AutoSend will POST events to. Must include the protocol.Example: "https://example.com/webhooks/autosend"
events
string[]
required
One or more event types to subscribe to. Must contain at least one valid event. See List Available Events for the full set.Example: ["email.delivered", "email.bounced"]

Response

Webhook created (201)
success
boolean
Indicates if the request was successfulExample: true
data
object
Wrapper containing the created webhook

Error Responses

400 - Validation error
object
Returned when the URL is invalid or no valid events are supplied.
{
  "success": false,
  "error": {
    "message": "A valid webhook URL is required",
    "code": "VALIDATION_ERROR",
  }
}