API

Webhooks: events sent to your server

Get a signed request on your server when an email is sent, opened, clicked or bounced, or a contact changes.

A webhook sends each event to a URL on your server as it happens, so your systems can react: stop a reminder once someone clicks, log where a sale came from, or start the next step.

Add a webhook

Owners and admins open Settings, then Webhooks, and choose Add webhook. Enter the URL and pick the events, or All events to also get events VeloSend adds later. The signing secret is shown once, when the webhook is added. Copy it to your server.

  • The URL must start with https:// and point to a public server. Private, local and internal addresses are refused, when the webhook is saved and again on every request.
  • Your plan sets how many webhooks a project can have: 1 on Free, 3 on Starter and 10 on Growth.
  • Send test event sends a ping event, so you can check your server before real events arrive.

Events

  • email.sent: the email was handed to your sending server.
  • email.opened: the email was opened. first_open is true the first time and false after that.
  • email.clicked: a tracked link was clicked. url is the link.
  • email.bounced: the email bounced. bounce_type is hard or soft.
  • email.failed: a single email (POST /api/v1/templates/{id}/send) that could not be handed to your mail server or the sending service, with error (the server's reason, addresses masked). A queued send is tried again for about two and a half hours first.
  • email.delivered and email.complained: sent when the sending service reports that an email reached the person's mailbox, or that they marked it as spam. A mailbox connected over SMTP reports neither, so a project sending through its own mailbox never gets them. GET /api/v1/sends/{id} then shows the status delivered and delivered_at, the time the delivery was confirmed.
  • contact.unsubscribed: the person unsubscribed by the link, the API or the dashboard. reason and source say how.
  • contact.created and contact.updated: a contact was added or changed. via says where: dashboard, api, import, direct_send, direct_chat, whatsapp or store.
  • contact.deleted: a contact was deleted.

An event goes to the webhooks that existed when it happened. Events from before a webhook was added are not sent to it.

What VeloSend sends

Each request is a POST with one event as JSON:

json
{
  "id": "evt_4182",
  "type": "email.clicked",
  "created_at": "2026-11-02T10:15:30.000Z",
  "project_id": 12,
  "data": {
    "send_type": "direct",
    "send_id": 55,
    "campaign_id": null,
    "template_id": 123,
    "contact": { "id": 9, "email": "a@example.com" },
    "url": "https://shop.example.com/cart",
    "metadata": { "flow": "abandoned_cart", "cart_id": "abc" }
  }
}

Ids are numbers. send_type is campaign for a campaign email and direct for an email sent with the send API or Quick send, because the two have separate send ids. metadata is what you passed to the send API for that send, on every event of the send, and null otherwise.

The headers are X-VeloSend-Signature, X-VeloSend-Event-Id (the same as id in the body), X-VeloSend-Event-Type and X-VeloSend-Delivery-Id. The event id stays the same when an event is sent again, so use it to ignore repeats.

Check the signature

X-VeloSend-Signature looks like t=1762078530,v1=5257a869… The v1 value is the HMAC-SHA256 of the timestamp, a full stop and the raw body, keyed with the signing secret, in hex. Refuse a request whose timestamp is more than 5 minutes old, and compare in constant time. Check the raw body before parsing it.

javascript
const crypto = require("crypto");

function verifyVeloSend(rawBody, header, secret) {
  const parts = header.split(",").map((part) => part.split("="));
  const t = Number(parts.find(([key]) => key === "t")?.[1]);
  if (!t || Math.abs(Date.now() / 1000 - t) > 300) return false;
  const expected = crypto.createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
  return parts
    .filter(([key]) => key === "v1")
    .some(([, value]) => value.length === expected.length && crypto.timingSafeEqual(Buffer.from(value), Buffer.from(expected)));
}

Answer and retries

Answer with any 2xx status within 10 seconds. Anything else, a redirect or no answer counts as a failure, and the request is tried again after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 24 hours. After the last try the delivery is marked failed.

When 100 requests in a row fail, VeloSend turns the webhook off and emails the account owners and admins. Fix the server, then choose Turn on in the webhook's menu. Deliveries shows every request for 30 days with its status, the body sent and the first 1 KB of your server's answer, and Send again sends a delivery's event again with the same event id.

Rotate the secret

Rotate secret in the webhook's menu gives a new secret, shown once. For 24 hours each request carries two v1 values, one for the old secret and one for the new, so your server can switch over without missing events. After that only the new secret signs.

Webhooks API

The same is available through the API. Reading needs the webhooks:read or webhooks:write scope; changes need webhooks:write. Create a new API key to get these scopes.

GET/api/v1/webhooks

Scope

webhooks:read

Returns

data, a list of webhooks without their secrets

POST/api/v1/webhooks

Scope

webhooks:write

Fields

urlRequiredevents (requireda list of event typesor ["*"] for all)description

Returns

data and secret, which is shown only here. Over the plan's limit the answer is HTTP 402 with error plan_limit.

GET/api/v1/webhooks/{id}

Scope

webhooks:read
PATCH/api/v1/webhooks/{id}

Scope

webhooks:write

Fields

urleventsdescriptionstatus (active or disabled)

Setting status active turns a webhook back on and clears its failure count.

DELETE/api/v1/webhooks/{id}

Scope

webhooks:write
POST/api/v1/webhooks/{id}/rotate-secret

Scope

webhooks:write

Returns

data and the new secret. The old secret keeps signing for 24 hours.

POST/api/v1/webhooks/{id}/test

Scope

webhooks:write

Sends a ping event. Returns: delivery_id, event_id

GET/api/v1/webhooks/{id}/deliveries

Scope

webhooks:read

Query

status (pendingsucceeded or failed)since (a date and time)limit (up to 100)before

Returns

data, newest first, and next_before. Pass next_before as before to get the next page.

POST/api/v1/webhook-deliveries/{id}/redeliver

Scope

webhooks:write

Sends the delivery's event again as a new delivery. Returns: delivery_id

Errors use the usual shape. A URL that is not https or not public is HTTP 400 with the code invalid_url, an unknown event is invalid_events, and a webhook that is turned off answers test and redeliver with HTTP 409 and the code webhook_disabled.

Each delivery counts once in the project's usage, whatever its retries.