Vesper Relay

Messages

Send a template

Templates are the only way to start a conversation, for example an appointment reminder.

POST /api/v1/messages
{"to": "+41 79 123 45 67", "template": "termin_bestaetigung", "language": "de",
 "params": ["Max", "Dienstag, 14.10.2026", "09:00", "Haarschnitt"]}

202 {"id": 17, "wa_message_id": "wamid.…", "to": "41791234567", "status": "accepted", "mode": "live", ...}

params fill the template's {{1}}, {{2}}, … in order. Numbers without a country code are read in default_region (default CH). Add number_id when the account has more than one number; without it the first number sends.

Send free text

POST /api/v1/messages
{"to": "+41791234567", "text": "Danke, bis morgen."}

Meta only delivers free text inside the 24-hour window after the customer last wrote. Outside it the send fails with Meta code 131047; use a template instead.

Idempotency

Send an Idempotency-Key header with every POST /messages, built from something stable such as your booking id and the message kind (booking-4711-reminder).

  • The same key within 24 hours returns the first answer again, with header Idempotent-Replayed: true. Nothing is sent twice.
  • The same key with a different body answers 422.
  • A second request while the first is still running answers 409; retry after a second.
  • Keys are 1 to 255 characters, per account and per mode (test and live keys never collide).
  • When Meta rejected the first attempt, the replay returns that same 502. Use a new key once you have fixed the cause.
  • Validation errors (422 before anything was sent) do not use up the key.

Delivery status

The 202 means Meta accepted the message. sent, delivered, read or failed follow by webhook, and GET /api/v1/messages/{id} shows the latest state:

GET /api/v1/messages/17
{"id": 17, "status": "delivered", "error": "", "updated_at": "2026-10-14T07:01:12+00:00", ...}

Templates

GET  /api/v1/templates
POST /api/v1/templates
{"name": "termin_erinnerung", "language": "de", "category": "UTILITY",
 "body": "Hallo {{1}}, Erinnerung: {{2}} um {{3}} Uhr.", "examples": ["Max", "Dienstag", "09:00"]}

Names are lowercase letters, digits and underscores. Variables are {{1}}, {{2}}, … without gaps, with one example each. Meta reviews every template, usually within minutes; the result arrives as a message_template_status_update webhook and in GET /templates. Reminders and confirmations belong in UTILITY; Meta reclassifies promotional wording as MARKETING, which costs more.

Quick-reply buttons

Add buttons to put up to three quick-reply buttons under the text, 1 to 25 characters each, all different. Not allowed on AUTHENTICATION templates.

POST /api/v1/templates
{"name": "termin_bestaetigen", "language": "de", "category": "UTILITY",
 "body": "Bitte bestätigen Sie Ihren Termin am {{1}} um {{2}} Uhr.", "examples": ["Dienstag", "09:00"],
 "buttons": ["Bestätigen", "Absagen"]}

Send it like any other template; the buttons need no params. A tap arrives in the messages webhook as "type": "button" with the button text in button.text and the id of your message in context.id (the wa_message_id from POST /messages). GET /templates does not list the buttons.

Numbers

GET /api/v1/numbers
[{"id": 3, "display_phone": "+41 79 841 72 47", "verified_name": "Salon Bellevue", "quality_rating": "GREEN",
  "status": "connected", "external_ref": "customer-4711", ...}]

The full schema of every endpoint is in the API reference.