Developers · Send notifications
Use template codes
Copy the ready-made request for any template and fill in its values.
On this page
Every approved template in your workspace has a template code: the exact request your backend sends to deliver it, with every field the template needs already filled in. You don’t have to work out headers, variables or buttons yourself.
Get the code for a template
Open EngageTemplates
Click the code icon (
</>) on the template’s rowThe Send “template_name” from a backend window opens.
Pick the calling app
Choose the connected app that will send it. This fills the
x-app-idheader. No apps yet? Register one first.Check what the template needs
The summary shows the number of body variables, button variables and the header type, with the body text so you can see which value goes where.
Copy curl and replace the placeholders
Replace
YOUR_SERVICE_KEYwith the key you saved, and the sample values with real ones. Notes under the request tell you about media headers, carousels and one-time passcodes.
curl -X POST 'https://api.example.com/api/app-notifications/send' \ -H 'Content-Type: application/json' \ -H 'x-app-id: acme-orders' \ -H 'x-app-service-key: YOUR_SERVICE_KEY' \ -d '{ "to": "919876543210", "category": "TRANSACTIONAL", "notification_type": "order_shipped", "template_name": "order_shipped", "template_variables": ["Aarav", "#4421"], "language_code": "en_US", "button_variables": ["4421"]}'How template parts map to fields
Fill in only the fields your template uses. The template code already includes the right ones.
| In the template | Field | Example |
|---|---|---|
Body {{1}}, {{2}}… | template_variables | ["Aarav", "#4421"] |
Body {{first_name}} (named) | template_variables | {"first_name": "Aarav"} |
| Text header variable | header_variables | ["Diwali"] |
| Image, video or document header | header_media_url | "https://…/invoice.pdf" |
| Location header | header_location | {"latitude": 12.97, "longitude": 77.59, "name": "Store"} |
| Website button with a variable | button_variables | ["4421"] |
| Copy-code button | coupon_code | "SAVE20" |
| Limited-time offer | offer_expiration | Expiry as a timestamp or ISO date |
| Carousel | cards | [{"body_variables": ["…"], "header_media": {"link": "https://…"}}] |
| One-time passcode (Authentication) | template_variables | ["482910"]; the copy-code button is filled from it |
- Numbered variables go in order: the first value fills
{{1}}. - Media headers: if you leave
header_media_urlout, the image or file approved with the template is sent. Use a publichttpslink to send a different one. - If a value is missing, the request is refused and the error names it, for example
Template "order_shipped" needs values for: Button "Track order" URL {{1}}, instead of sending a broken message. language_codepicks the template’s language when you have several translations. It defaults toen_US.
Examples
{ "to": "919876543210", "category": "SYSTEM", "notification_type": "login_otp", "template_name": "login_code", "template_variables": ["482910"]}{ "to": "919876543210", "category": "TRANSACTIONAL", "notification_type": "invoice_ready", "template_name": "invoice_ready", "header_media_url": "https://files.example.com/invoices/INV-1042.pdf", "template_variables": { "customer_name": "Aarav", "amount": "₹2,499" }}{ "to": "919876543210", "category": "TRANSACTIONAL", "notification_type": "loyalty_reward", "template_name": "loyalty_reward", "template_variables": ["Aarav"], "coupon_code": "THANKYOU15"}Turn the code into your language
The same request in the language your backend uses. Swap in the body from your template code.
curl -X POST https://api.example.com/api/app-notifications/send \ -H "Content-Type: application/json" \ -H "x-app-id: $CODIQUE_APP_ID" \ -H "x-app-service-key: $CODIQUE_SERVICE_KEY" \ -d '{ "to": "919876543210", "category": "TRANSACTIONAL", "notification_type": "order_confirmed", "template_name": "order_confirmation", "language_code": "en_US", "template_variables": ["Aarav", "#4421"] }'Every field and response is listed in the Notifications API reference.
Still stuck? Contact us with what you were doing and the exact message you saw.