Create webhook

Registers an endpoint. The signing secret is returned only in this response.

POST/webhooks

Body parameters

  • urlstringrequired

    Public HTTPS URL.

  • eventsstring[]

    Event types to send. Empty or omitted means all events.

The webhook object

An endpoint that receives events.

  • objectstring

    Always webhook.

  • idstring

    Unique ID of the webhook.

  • urlstring

    Where events are posted.

  • eventsstring[]

    Event types it receives. Empty means all of them.

  • activeboolean

    false while paused.

  • created_atstring

    When it was created (ISO 8601, UTC).

  • secretstring

    Only in the create response: the secret for verifying signatures.

Request

curl -X POST 'https://api.mailvina.com/webhooks' \
  -H 'Authorization: Bearer mv_xxxxxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
  "url": "https://acme.com/webhooks/mailvina",
  "events": [
    "email.delivered",
    "email.bounced",
    "email.complained"
  ]
}'

Response

{
  "object": "webhook",
  "id": "a1f9c1d2-7d3e-4b8f-9a0c-2e5b6d7f8a90",
  "secret": "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw"
}