Skip to creators
Docs menu

Webhooks

Get signed Besday webhooks when orders are paid, delivered, completed or cancelled. Event types, payload, HMAC-SHA256 signature check and retry schedule.

Updated · API version 2026-12-03

Webhooks tell your server when an order changes, so you do not have to poll. Besday sends an HTTPS POST with a JSON event, signed with your endpoint’s secret.

Set up an endpoint#

  1. Expose an https URL on your server (port 443) that accepts POST and answers 2xx within 10 seconds.
  2. Register it with POST /v1/webhook_endpoints and store the secret it returns (shown once).
  3. Send a test event with POST /v1/webhook_endpoints/{id}/test and check that your server verifies it.

Event types#

EventSent when
order.paidThe order was paid (from credits, or by card for older orders). Sent together with the status event that follows.
order.awaiting_acceptanceA real creator has the order and must accept it (they have 48 hours).
order.awaiting_productThe creator accepted and is waiting for the product you ship to them.
order.in_productionThe creator is making the video (status active).
order.deliveredA version of the video was delivered. Review it, then approve or ask for changes.
order.revision_requestedYou asked for changes; the creator is working on them.
order.disputedA dispute was opened on the order; Besday support is reviewing it.
order.completedThe order is complete: approved by you, or automatically after the review window.
order.cancelledThe order was cancelled (declined, expired, or cancelled with a refund to credits).
pingA test event sent by POST /v1/webhook_endpoints/{id}/test.

Payload#

data.object is the order as it was when the event happened, in the same shape as GET /v1/orders/{id}; data.previous_status is the status before.

{
  "id": "evt_0c1d2e3f4a5b6c7d",
  "object": "event",
  "type": "order.delivered",
  "api_version": "2026-12-03",
  "created_at": "2026-12-06T18:40:00.000Z",
  "data": {
    "object": {
      "object": "order",
      "id": "prj_01HZX8Q4V2",
      "status": "delivered",
      "creator": {
        "id": "cr_7f3a9c21",
        "slug": "maya-w",
        "name": "Maya W.",
        "kind": "real"
      },
      "duration_seconds": 30,
      "aspect_ratio": "9:16",
      "quantity": 1,
      "add_ons": [
        {
          "kind": "captions",
          "quantity": 1,
          "unit_price_credits": 19
        }
      ],
      "price_credits": 168,
      "product_url": "https://yourbrand.com/products/vitamin-c-serum",
      "brief": {
        "goal": "sales",
        "goal_other": null,
        "platforms": [
          "tiktok",
          "instagram_reels"
        ],
        "audience": "Women 25–40 with sensitive skin",
        "key_messages": [
          "Fragrance-free",
          "Visible glow in 2 weeks"
        ],
        "hooks": [
          "I stopped wearing foundation because of this"
        ],
        "must_say": "Use code MAYA15",
        "must_avoid": "Medical claims",
        "call_to_action": "Tap the link to try it",
        "script": null,
        "reference_links": [],
        "anything_else": null
      },
      "note": null,
      "requires_shipping": true,
      "delivery_days": 3,
      "campaign_id": null,
      "paid_at": "2026-12-03T17:03:40.000Z",
      "accept_by": "2026-12-05T17:03:40.000Z",
      "accepted_at": "2026-12-03T19:12:00.000Z",
      "delivery_due_at": "2026-12-07T15:00:00.000Z",
      "delivered_at": "2026-12-06T18:40:00.000Z",
      "approved_at": null,
      "cancelled_at": null,
      "cancellation_reason": null,
      "created_at": "2026-12-03T17:02:11.000Z",
      "updated_at": "2026-12-04T15:00:00.000Z",
      "dashboard_url": "https://besday.com/app/brands/projects/prj_01HZX8Q4V2"
    },
    "previous_status": "active"
  }
}

Request headers#

HeaderValue
Besday-Signaturet=<unix seconds>,v1=<hex HMAC-SHA256>
Besday-Event-IdThe event id (evt_…), the same on every retry.
Besday-Event-TypeThe event type.
Content-Typeapplication/json
User-AgentBesday-Webhooks/1.0

Verify the signature#

Compute HMAC-SHA256 of <t>.<raw body> with your endpoint secret, compare it in constant time with v1, and reject timestamps more than 5 minutes old. Use the raw body bytes, before any JSON parsing.

import crypto from "node:crypto";
import express from "express";

const app = express();
app.post("/webhooks/besday", express.raw({ type: "application/json" }), (req, res) => {
  const header = req.get("Besday-Signature") ?? "";
  const { t, v1 } = Object.fromEntries(header.split(",").map((p) => p.split("=")));
  const expected = crypto.createHmac("sha256", process.env.BESDAY_WEBHOOK_SECRET)
    .update(`${t}.${req.body}`).digest("hex");
  const fresh = Math.abs(Date.now() / 1000 - Number(t)) < 300;
  const ok = fresh && v1 && v1.length === expected.length &&
    crypto.timingSafeEqual(Buffer.from(v1), Buffer.from(expected));
  if (!ok) return res.status(400).send("bad signature");
  const event = JSON.parse(req.body);
  // Deliveries are at least once: skip event.id values you have seen.
  console.log(event.type, event.data.object.id);
  res.sendStatus(200);
});

Retries and ordering#

  • A delivery that does not get a 2xx within 10 seconds is retried after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h, 24 h: 8 tries in all, then it is marked failed.
  • Delivery is at least once: deduplicate on the event id.
  • Events can arrive out of order; compare data.object.updated_at, or fetch the order to read its current status.
  • Redirects are not followed. The URL must resolve to public internet addresses.
  • Events are written in the same database transaction as the status change, so you never get an event for a change that did not happen.

Endpoints#

Create a webhook endpoint#

POST/api/v1/webhook_endpointsscope: read_writeIdempotency-Key

Registers an https URL for order events. The answer includes the signing secret, once.

Body parameters (JSON)

ParameterDescription
url
string · required
https URL on port 443 that resolves to public addresses.
events
string[]
Event types to send, or ["*"] (default) for all: order.paid, order.awaiting_acceptance, order.awaiting_product, order.in_production, order.delivered, order.revision_requested, order.disputed, order.completed, order.cancelled.
description
string
Your label, up to 200 characters.

Request

curl -X POST "https://besday.com/api/v1/webhook_endpoints" \
  -H "Authorization: Bearer $BESDAY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "https://yourapp.com/webhooks/besday",
  "events": [
    "order.delivered",
    "order.completed",
    "order.cancelled"
  ],
  "description": "Production"
}'

Response 201

{
  "object": "webhook_endpoint",
  "id": "we_3f9d0c8e",
  "url": "https://yourapp.com/webhooks/besday",
  "description": "Production",
  "events": [
    "order.delivered",
    "order.completed",
    "order.cancelled"
  ],
  "created_at": "2026-12-03T17:20:00.000Z",
  "secret": "whsec_Wq3m…(shown once)"
}

Errors

  • 422 parameter_invalid: A parameter is missing or invalid; param names it.
  • 422 url_not_allowed: A webhook URL must be https on port 443 and resolve only to public internet addresses.
  • 409 limit_reached: The brand already has the most objects of this kind allowed (for example 5 webhook endpoints).

List webhook endpoints#

GET/api/v1/webhook_endpointsscope: read

Your brand’s webhook endpoints (secrets are never shown again).

Request

curl "https://besday.com/api/v1/webhook_endpoints" \
  -H "Authorization: Bearer $BESDAY_API_KEY"

Response 200

{
  "object": "list",
  "data": [
    {
      "object": "webhook_endpoint",
      "id": "we_3f9d0c8e",
      "url": "https://yourapp.com/webhooks/besday",
      "description": "Production",
      "events": [
        "order.delivered",
        "order.completed",
        "order.cancelled"
      ],
      "created_at": "2026-12-03T17:20:00.000Z"
    }
  ],
  "has_more": false,
  "next_cursor": null
}

Send a test event#

POST/api/v1/webhook_endpoints/{id}/testscope: read_write

Sends a signed ping event now and reports what your endpoint answered.

Path parameters

ParameterDescription
id
string · required
The endpoint id.

Request

curl -X POST "https://besday.com/api/v1/webhook_endpoints/we_3f9d0c8e/test" \
  -H "Authorization: Bearer $BESDAY_API_KEY"

Response 200

{
  "object": "webhook_test",
  "endpoint_id": "we_3f9d0c8e",
  "event_id": "evt_77aa01",
  "delivered": true,
  "status_code": 200,
  "error": null
}

Errors

  • 404 not_found: No such object for your brand.

Delete a webhook endpoint#

DELETE/api/v1/webhook_endpoints/{id}scope: read_write

Stops sending events to the endpoint. Pending deliveries to it are dropped.

Path parameters

ParameterDescription
id
string · required
The endpoint id.

Request

curl -X DELETE "https://besday.com/api/v1/webhook_endpoints/we_3f9d0c8e" \
  -H "Authorization: Bearer $BESDAY_API_KEY"

Response 200

{
  "object": "webhook_endpoint",
  "id": "we_3f9d0c8e",
  "deleted": true
}

Errors

  • 404 not_found: No such object for your brand.

This page as Markdown: /docs/api/webhooks.md · All docs for LLMs: llms-full.txt · OpenAPI 3.1