text, template, image, and document. Use it for transactional notifications, customer communication, alerts, reminders, and automated messaging workflows.
Authentication is handled through request headers, so your API credentials are never exposed in the request body.
To generate your
x-access-key and x-secret-key values, log in to your
Antryk dashboard, open the API Keys section in the sidebar, and create a
new API key. Your access key and secret key are shown there.Endpoint
Quickstart: send a text message
Authentication is handled through the
x-access-key and x-secret-key
headers. Do not include your API credentials inside the request body.Keep your API credentials on your backend or another secure server-side
environment. Do not expose your access key or secret key in frontend
applications or publicly accessible code.
Request Parameters
Headers
Body
The ID of your configured WhatsApp service in Antryk. This identifies which
connected WhatsApp Business number sends the message. Example:
xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxxThe recipient’s WhatsApp phone number in international E.164 format,
including the country code. Example:
+919340487676 for an Indian phone
number.The type of message to send. Supported values:
text, template, image,
and document. See Message types.The message content. The fields inside
content depend on the selected
type. See the sections below for the exact structure of each type.Message types
Thetype field determines the kind of message you send and the shape of content.
Text messages
Usetype: "text" to send a standard WhatsApp text message. The message text goes in content.body.
Template messages
Usetype: "template" to send a message template that has been approved in WhatsApp Manager. The content object holds the template name, the language, and the variable values if the template has any.
The template language. Contains a
code field, for example
{ "code": "en" }. The code must match the approved language of the
template exactly.The variable values for the template. Required only if the template contains
variables. Each component has a
type (for example body) and a
parameters array.- No variables
- Numbered variables
- Named variables
Use this when the template text is fixed and contains no placeholders. Omit
components.The variable name, for example
first_name. Required only for templates that
use named variables. Omit it for numbered variables.How to tell which variable style a template uses: open the template in
WhatsApp Manager and check its text.
{{1}} is numbered. {{first_name}} is
named.Image messages
Usetype: "image" to send an image.
Document messages
Usetype: "document" to send a file such as a PDF.
Media content fields
These fields apply toimage and document messages.
The ID of an existing, previously uploaded media file. To use a media ID,
replace
"link": "..." with "id": "<media_id>". Provide either link or
id, never both.Optional caption shown with the file. Up to 1024 characters. Supported for
images and documents.
The file name shown to the recipient. Documents only. Include the file
extension, for example
invoice-123.pdf.Media requirements
URLs passed in
link must be publicly reachable. Files behind a login,
firewall, or expiring private link cannot be fetched and will not be
delivered.Response
A successful request returns a confirmation that the WhatsApp message has been accepted for processing.messageId to correlate the message with delivery status events and webhook notifications.
Delivery status
A successful response means Antryk accepted the request for processing. It does not necessarily mean the message has been delivered to the recipient. Use WhatsApp webhooks to track delivery. A message can progress through these statuses:sentdeliveredreadfailed
sent → delivered → read.
A failed message may include additional error information in the Antryk dashboard and logs.
Error scenarios
Common API errors include:- 401 invalid credentials: Invalid
x-access-keyorx-secret-key. - 400 invalid request: Required fields are missing or the request payload is invalid.
- 400 invalid recipient: The
tophone number is missing or incorrectly formatted. - 404 service not found: The
clientIddoes not identify an active WhatsApp service. - 400 unsupported message type: The requested
typeis not supported, or thecontentdoes not match the selected message type. - 429 rate limited: Too many requests were sent in a short period, or the service has exceeded its applicable quota.
- 500 provider unavailable: An upstream WhatsApp provider or service is temporarily unavailable.
Error response example
Troubleshooting
The API returned a message ID, but the image never arrived
The API returned a message ID, but the image never arrived
Check the image format. Only JPEG and PNG are supported, up to 5 MB. SVG,
WebP, and GIF files may be silently dropped by WhatsApp even though the API
accepts the request. Also confirm the
link is publicly reachable.My template message is rejected
My template message is rejected
Verify that:
content.namematches the approved template name exactly.language.codematches the approved language exactly (enanden_USare different).- The number of parameters matches the number of variables in the template.
- For named variables, every
parameter_namematches a variable in the template.
I'm not sure whether my template uses numbered or named variables
I'm not sure whether my template uses numbered or named variables
Open the template in WhatsApp Manager.
{{1}} and {{2}} are numbered
variables, so send values in order. {{first_name}} is a named variable, so
send each value with its parameter_name.Best practices
- Keep your
x-access-keyandx-secret-keycredentials secure. - Call the API from your backend rather than exposing credentials in frontend code.
- Store credentials in environment variables or a secure secret manager.
- Always provide the recipient’s full international phone number.
- Validate recipient numbers before sending messages.
- Use
templatemessages for notifications you send proactively, and keep transactional messages clear and relevant. - Use a stable, publicly hosted URL for media, or reuse an uploaded media
id. - Avoid unnecessary or duplicate messages.
- Handle API errors and rate limits gracefully.
- Use webhooks to monitor delivery and read status.
- Use the returned
messageIdto correlate messages with delivery events.
Environment variables
For backend applications, store your Antryk credentials as environment variables:Never commit production API credentials to Git repositories or expose them in
client-side JavaScript.

