Skip to main content
Preview. Workflow campaigns that message on WhatsApp are being rolled out to pilot accounts. This page is the contract your gateway implements for them; nothing changes for agents you already run.
A workflow campaign can have a chat step: a chat agent messages a contact on WhatsApp, waits for the reply, and the conversation’s outcome decides what happens next. WhatsApp only lets a business message someone first with a template that Meta has approved, and only within 24 hours of the customer’s last message can it send free text. Osvi doesn’t hold your WhatsApp Business account; your gateway (or your WhatsApp provider) does. So for the first message of a chat step, Osvi asks your gateway to send a template, and your gateway sends it. Everything after that first message works the way it does today:

Where it’s sent

Template requests go to the same place as every other delivery: the chat agent’s Delivery URL, with the agent’s Delivery headers. The agent’s Settings tab has both, in the Delivery card. A chat agent needs a delivery URL before it can be added to a workflow campaign.
As with other deliveries, these requests are not signed. Check for a custom header you configured (for example a bearer token) to verify a request came from Osvi.

Telling the two apart

Every template request carries "kind": "template". Ordinary reply deliveries have no kind field. Treat a missing kind as an ordinary reply, so an endpoint that already handles replies keeps working unchanged.

The template envelope

Registering templates

You choose which templates a workflow may send. Under the chat agent’s Settings, in the Delivery card, list each approved template with:
  • its name and language;
  • its placeholders, in order, with a short description of each (for example “1: the contact’s first name”).
The workflow editor only offers templates listed there. In each chat step, the operator maps every placeholder to a contact column, an answer from an earlier step, or fixed text.

Your response

Answer within 15 seconds. A 2xx body is optional. If you send one, Osvi keeps the provider’s message id with the step:
A rejection body names the reason:
Use one of these reasons where it fits, or your own short code:

Retries

Retries follow the same schedule as reply deliveries: up to 6 attempts in total, a few seconds apart at first and up to about a minute apart later. A Retry-After header on a 429 is respected. Every attempt carries the same idempotency_key. If you already sent the template for that key, answer 2xx again and don’t send it a second time.

Throughput

When a campaign’s batch starts, Osvi sends template requests at a steady rate per agent, not all at once. If your provider limits your sending rate, answer 429 with a Retry-After header and Osvi slows down.

What a test request looks like

When the operator sends a test message from the workflow editor, Osvi sends the same envelope, with the operator’s own number as customer_id. Treat it like any other request.

Checklist for your gateway

  1. Route envelopes by kind: template sends a template, and no kind sends the reply text as you do today.
  2. Send the template with your WhatsApp provider, using template.name, template.language and template.params.
  3. De-duplicate on idempotency_key.
  4. Answer 2xx when the provider accepts the message, 4xx with a reason when it refuses for good, and 429 or 5xx when it’s worth trying again.
  5. Forward the customer’s replies to Osvi for the same customer_id and agent, as you already do.
  6. Give us a stage (sandbox) delivery URL to test against before your production one.