Sending and growing
Send WhatsApp messages from your own software (Developer API)
Your own software (a gym, school or billing system, a website, an app) sends WhatsApp messages through Sendmint with one call: renewal reminders, payment alerts, receipts. Sendmint checks the rules, sends within your daily limit, shows each message in your Inbox, and can tell your software when it is delivered or read. Part of the Pro plan.
Step 1: What you need
The Pro plan, a connected WhatsApp number, and an approved template in Sendmint → Templates (how to make one). Use a Utility template for reminders, alerts and receipts: it can go to everyone except people who replied STOP. A Marketing template only goes to people who agreed to get offers.
Meta charges for each message (Utility ₹0.115, Marketing ₹0.8631, + GST) from your payment method in Meta (how to add money). Sendmint adds nothing.
Settings → Integrations → Developer API Step 2: Create an API key
In Settings → Integrations → Developer API, click New key, give it a name (for example “Gym software”) and copy it. The key is shown only once. Keep it on your server, in a setting or an environment variable, never in a website or an app that customers can open. The same keys work for WhatsApp OTP. If a key gets out, click Revoke and create a new one.
New key: copy it now, it's shown once Step 3: Send a message
Your server calls POST https://sendmint.in/api/v1/messages with the header Authorization: Bearer and your key, and a JSON body:
to: the phone number with its country code, for example 919876543212 (+, spaces and dashes are fine; a 10-digit number without a code is taken as Indian, +91). template: the template's name as it shows in Sendmint → Templates. language: its language, for example en (needed only when the template has more than one). values: the words for its blanks, {{1}}, {{2}}… in order; send exactly as many values as the template has blanks. idempotency_key (optional): see below.
Amounts in rupees: send a value as {"text": "1499.0", "format": "inr"} and Sendmint writes it the Indian way: “1499.0” becomes ₹1,499 and “1499.5” becomes ₹1,499.50. The ₹ sign comes with it, so write the template as “Total {{2}}”, not “₹{{2}}”. Other values are sent exactly as you send them.
Sendmint answers 202 with {"id": "msg_…", "status": "queued"} and sends it within seconds. A new number becomes a contact (source “Developer API”); nobody's consent changes. The message shows in the Inbox chat with that person.
cURL
curl https://sendmint.in/api/v1/messages \ -H "Authorization: Bearer $SENDMINT_KEY" \ -H "Content-Type: application/json" \ -d '{"to": "919876543212", "template": "membership_renewal", "language": "en", "values": ["Rahul", "Gold", "31 Oct"]}' # {"id": "msg_8Qx...", "status": "queued"}Python
import requests res = requests.post( "https://sendmint.in/api/v1/messages", headers={"Authorization": "Bearer " + SENDMINT_KEY}, json={ "to": "919876543212", "template": "membership_renewal", "language": "en", "values": ["Rahul", "Gold", "31 Oct"], }, ) print(res.json()) # {"id": "msg_8Qx...", "status": "queued"}Java
HttpClient client = HttpClient.newHttpClient(); String body = """ {"to": "919876543212", "template": "membership_renewal", "language": "en", "values": ["Rahul", "Gold", "31 Oct"]} """; HttpRequest request = HttpRequest.newBuilder(URI.create("https://sendmint.in/api/v1/messages")) .header("Authorization", "Bearer " + System.getenv("SENDMINT_KEY")) .header("Content-Type", "application/json") .POST(HttpRequest.BodyPublishers.ofString(body)) .build(); HttpResponse<String> res = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(res.body()); // {"id":"msg_8Qx...","status":"queued"}PHP
$ch = curl_init('https://sendmint.in/api/v1/messages'); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer ' . getenv('SENDMINT_KEY'), 'Content-Type: application/json', ], CURLOPT_POSTFIELDS => json_encode([ 'to' => '919876543212', 'template' => 'membership_renewal', 'language' => 'en', 'values' => ['Rahul', 'Gold', '31 Oct'], ]), ]); echo curl_exec($ch); // {"id":"msg_8Qx...","status":"queued"}One call: the number, the template and its values Step 4: Check a message
GET https://sendmint.in/api/v1/messages/{id} with the same header tells you where a message is. status is one of: queued (waiting for its turn, or for room in your daily limit), sent (WhatsApp took it), delivered (on the person's phone), read (they opened it; only when they have read receipts on) or failed. reason says in plain English why it is waiting or why it failed. Only your own business's messages are found.
cURL and the answer
curl https://sendmint.in/api/v1/messages/msg_cm2x8q0a40001 \ -H "Authorization: Bearer $SENDMINT_KEY" { "id": "msg_cm2x8q0a40001", "status": "delivered", "reason": null, "to": "+91XXXXXXXXXX", "template": "membership_renewal", "language": "en", "created_at": "2026-10-20T09:15:02.114Z", "sent_at": "2026-10-20T09:15:04.870Z", "delivered_at": "2026-10-20T09:15:06.233Z", "read_at": null, "failed_at": null }The status and, when something went wrong, why Step 5: Save a contact's dates (for reminders)
POST https://sendmint.in/api/v1/contacts with the same header saves a contact by phone number: phone, name (optional) and fields, the contact fields by their name in Sendmint, for example {"Expiry date": "31/10/2026"}. Dates can be 31/10/2026, 31-10-2026, 31 Oct 2026 or 2026-10-31; null or "" clears a value. A new number becomes a contact (source “Developer API”); nobody's consent changes.
Use it when a member renews: send the new Expiry date and Sendmint's reminders by date stop the messages for the old date and start again from the new one. A field name that doesn't exist, or a date that can't be read, is refused (400) and nothing is saved.
cURL and the answer
curl https://sendmint.in/api/v1/contacts \ -H "Authorization: Bearer $SENDMINT_KEY" \ -H "Content-Type: application/json" \ -d '{"phone": "919876543212", "name": "Rahul Patil", "fields": {"Expiry date": "31/10/2026"}}' { "id": "cm2x8q0a40007", "phone": "+91XXXXXXXXXX", "name": "Rahul Patil", "created": false, "fields": { "Expiry date": "2026-10-31" } }The contact's dates, by the field's name Step 6: Rules and limits
Sendmint never sends to someone who replied STOP (the answer is 422 opted_out), and a Marketing template only to people who agreed to get offers (422 not_opted_in). Only approved templates on your current WhatsApp number can be sent.
Each template to someone who hasn't written to you in the last 24 hours counts towards your daily limit of new people (250 until you verify your business, more about it). When the limit is used up, messages wait as queued and go out as soon as there is room again; one that waits more than 7 days is dropped (failed). Your software can send up to 120 messages a minute with one key.
If Meta can't take payment (Meta error 131042), the message is failed with the reason “Meta could not take payment…”: add money in Meta and send it again.
Approved templates, no STOP, within the daily limit Step 7: Never send the same message twice
If your software may try again after a timeout, send an idempotency_key with each message: anything unique to it, for example “renewal-1042-oct” (up to 100 letters, digits and symbols, no spaces). For 24 hours, a second call with the same key sends nothing new and answers with the first message's id and status.
Without a key, Sendmint treats the same message (same number, template, language and values) within 10 minutes as a retry: it sends nothing new and answers with the first message's id. To send the same message again on purpose within 10 minutes, give each one its own idempotency_key.
JSON
{"to": "919876543212", "template": "membership_renewal", "values": ["Rahul", "Gold", "31 Oct"], "idempotency_key": "renewal-1042-oct"}The same key within 24 hours: the first message Step 8: Send from Shopify with Shopify Flow
In Shopify, open Flow, create a workflow with a trigger such as Order created, and add the action Send HTTP request:
HTTP method: POST. URL: https://sendmint.in/api/v1/messages. Headers: Authorization = Bearer and your key, and Content-Type = application/json. Body: the JSON below, with Shopify's own fields in {{ }}.
Use {{order.id}} in the idempotency_key: Shopify Flow tries a request again when it times out or gets a 429, and the key makes sure the customer gets the message once. Send the order total with "format": "inr" so it shows as ₹1,499, not 1499.0. One key can send 120 messages a minute; in a big sale, Flow tries the rest again a little later and the key stops any repeats.
Body (JSON)
{ "to": "{{order.customer.phone}}", "template": "order_confirmation", "values": [ "{{order.customer.firstName}}", "{{order.name}}", {"text": "{{order.totalPriceSet.shopMoney.amount}}", "format": "inr"} ], "idempotency_key": "{{order.id}}-order-confirmation" }Shopify Flow → Send HTTP request Step 9: Get delivery updates (optional)
In Settings → Integrations → Developer API, paste a link on your server under Delivery updates and click Save. Sendmint shows a signing secret once: keep it on your server. From then on, Sendmint POSTs an update to your link each time a message is sent, delivered, read or failed, with the same fields as a status check. Send a test update posts {"event": "test"} at once.
Your link must be a public https address and answer 200 within 10 seconds. If it doesn't, Sendmint tries again after 1 minute, 5 minutes, 30 minutes, 2 hours and 12 hours, then gives up. Updates can arrive more than once or out of order: use id and status, and ignore a status older than the one you have.
What your link receives
POST https://yourwebsite.in/sendmint/updates Content-Type: application/json X-Sendmint-Timestamp: 1760951706 X-Sendmint-Signature: sha256=5f2b9c…(64 hex characters) X-Sendmint-Delivery: cm2x8q9zk0004 { "event": "message.status", "id": "msg_cm2x8q0a40001", "status": "failed", "reason": "Meta could not take payment for this message: your Meta balance ran out or your payment method failed. Add money in Meta, then send it again.", "to": "+91XXXXXXXXXX", "template": "membership_renewal", "language": "en", "created_at": "2026-10-20T09:15:02.114Z", "sent_at": null, "delivered_at": null, "read_at": null, "failed_at": "2026-10-20T09:15:04.870Z", "idempotency_key": "renewal-1042-oct", "test": false }A signed update for each status change Step 10: Check that an update came from Sendmint
Every update has X-Sendmint-Timestamp (seconds since 1970) and X-Sendmint-Signature: “sha256=” followed by the HMAC-SHA256 (hex) of the timestamp, a dot and the raw body, made with your signing secret. Work it out the same way, compare the two in constant time, and refuse updates older than 5 minutes. Use the raw body exactly as it arrived, before your framework reads it as JSON. Lost the secret? Click New signing secret: the old one stops working at once.
Python
import hashlib, hmac, time def is_from_sendmint(raw_body: bytes, timestamp: str, signature: str) -> bool: if abs(time.time() - int(timestamp)) > 300: # older than 5 minutes return False signed = timestamp.encode() + b"." + raw_body expected = "sha256=" + hmac.new(SENDMINT_SECRET.encode(), signed, hashlib.sha256).hexdigest() return hmac.compare_digest(expected, signature) # Flask: is_from_sendmint(request.get_data(), request.headers["X-Sendmint-Timestamp"], # request.headers["X-Sendmint-Signature"])Java
import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; import java.nio.charset.StandardCharsets; import java.security.MessageDigest; import java.util.HexFormat; static boolean isFromSendmint(String rawBody, String timestamp, String signature) throws Exception { if (Math.abs(System.currentTimeMillis() / 1000 - Long.parseLong(timestamp)) > 300) return false; Mac mac = Mac.getInstance("HmacSHA256"); mac.init(new SecretKeySpec(System.getenv("SENDMINT_SECRET").getBytes(StandardCharsets.UTF_8), "HmacSHA256")); byte[] hash = mac.doFinal((timestamp + "." + rawBody).getBytes(StandardCharsets.UTF_8)); String expected = "sha256=" + HexFormat.of().formatHex(hash); return MessageDigest.isEqual(expected.getBytes(StandardCharsets.UTF_8), signature.getBytes(StandardCharsets.UTF_8)); }PHP
$raw = file_get_contents('php://input'); $timestamp = $_SERVER['HTTP_X_SENDMINT_TIMESTAMP'] ?? ''; $signature = $_SERVER['HTTP_X_SENDMINT_SIGNATURE'] ?? ''; $expected = 'sha256=' . hash_hmac('sha256', $timestamp . '.' . $raw, getenv('SENDMINT_SECRET')); if (abs(time() - (int) $timestamp) > 300 || !hash_equals($expected, $signature)) { http_response_code(401); exit; } $update = json_decode($raw, true); // $update['id'], $update['status'], $update['reason'] http_response_code(200);Node.js
const crypto = require("crypto"); // Express: app.post("/sendmint/updates", express.raw({ type: "application/json" }), handler) function isFromSendmint(rawBody, timestamp, signature) { if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false; const expected = "sha256=" + crypto.createHmac("sha256", process.env.SENDMINT_SECRET).update(timestamp + "." + rawBody).digest("hex"); return expected.length === signature.length && crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(signature)); }Your server checks the signature with the secret Step 11: Error codes
When Sendmint can't take a message, the answer is JSON with error (a plain-English message you can show or log) and code (for your software), for example {"error": "This person replied STOP, so they can't be messaged.", "code": "opted_out"}. A 429 also has retryAfter and the Retry-After header (seconds).
HTTP status, code and meaning
400 invalid_request A field is missing or wrong ("fields" says which) 400 invalid_phone The number isn't valid 400 wrong_value_count The values don't match the template's blanks 400 invalid_value A value is empty, too long, or has a new line or tab (or a date can't be read) 400 language_required The template is in more than one language 400 use_otp_api Login-code templates use /api/v1/otp/send 400 unknown_field No contact field with this name (contacts) 400 template_not_supported Sendmint can't fill this template (named variables) 401 invalid_key The API key is missing, wrong or revoked 403 plan_required The Developer API is on the Pro plan 403 account_paused The Sendmint account is paused 404 template_not_found No template with this name on your number 404 not_found No message with this id (status check) 409 template_not_approved The template isn't approved by WhatsApp 409 template_media_missing The template's photo, video or PDF is missing 409 not_connected Your WhatsApp number isn't connected 413 too_large The request is larger than 32 KB 422 opted_out The person replied STOP 422 not_opted_in Marketing template to someone who didn't agree 429 rate_limited Too many requests with this key (see Retry-After)error for people, code for your software
Common problems
401: “The API key is missing, wrong or revoked”
Send the header Authorization: Bearer followed by your key, from your server. Check that the key wasn't revoked in Settings → Integrations → Developer API.
404 template_not_found
Use the template's name exactly as it shows in Sendmint → Templates (small letters and underscores, for example membership_renewal), and check it is on your current WhatsApp number.
A message stays “queued”
Your daily limit of new people is used up: the reason says so, and it goes out when there is room again. Verify your business to raise the limit (how).
Failed: “Meta could not take payment”
Your Meta balance ran out or your payment method failed. Add money in Meta, then send the message again.
My link gets no updates
Check the link is a public https address that answers 200, then click Send a test update in Settings → Integrations → Developer API: it says what your link answered.
Still stuck? Book a free setup call and we'll connect it to your software with you.
Book a free setup callWas this helpful? ·