For generating your x-access-key and x-secret-key values, login into you
Antryk’s dashboard go to Api Keys section on side bar and create new api key .
There you will be provided with your access key and secret key.
Send a WhatsApp Message
Use thehttps://ses.antryk.com/api/v1/whatsapp/send endpoint to send a WhatsApp message to a customer.
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
string
required
Your Antryk access key used for API authentication.
string
required
Your Antryk secret key used to securely authorize the request.
string
required
The ID of your configured WhatsApp service in Antryk. This identifies which
connected WhatsApp Business number should send the message.
string
required
The recipient’s WhatsApp phone number in international E.164 format, including
the country code. For example,
+919340487676 for an Indian phone
number.string
required
The type of WhatsApp message to send. Use
text for text messages. Other
message types can be used for supported media or file messages.object
required
The content of the WhatsApp message. The fields inside
content depend on the
selected message type.string
required
The text content of the WhatsApp message when
type is text.Request Example
A basic text message request looks like this:Request Headers
Content-Type: application/json x-access-key: YOUR_ACCESS_KEY x-secret-key: YOUR_SECRET_KEYParameter Examples
string
required
Example:
YOUR_ACCESS_KEYstring
required
Example:
YOUR_SECRET_KEYstring
required
Example:
xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxxstring
required
Example:
+919340487676string
required
Example:
textstring
required
Example:
Your order has been shipped!Message Types
The type field determines the kind of WhatsApp message you want to send.Text Messages
Use type: “text” to send a standard WhatsApp text message.File and Media Messages
The type field can also be used for supported file or media message types. For example:Response
A successful request returns a confirmation that the WhatsApp message has been accepted for processing.Example:
Delivery Status
Sending a WhatsApp message successfully means that Antryk accepted the request for processing. It does not necessarily mean that the message has already been delivered to the recipient. Use WhatsApp webhooks to track message delivery status. A message can progress through statuses such as:- sent
- delivered
- read
- failed
For example:
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-key or x-secret-key.
- 400 invalid request — Required fields are missing or the request payload is invalid.
- 400 invalid recipient — The to phone number is missing or incorrectly formatted.
- 404 service not found — The clientId does not identify an active WhatsApp service.
- 400 unsupported message type — The requested type is not supported or the content does not match the selected message type.
- 429 rate limited — Too many requests were sent within 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
Best Practices
- Keep your x-access-key and x-secret-key credentials secure.
- Use 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.
- Keep transactional messages clear and relevant.
- Avoid unnecessary or duplicate messages.
- Handle API errors and rate limits gracefully.
- Use webhooks to monitor delivery and read status.
- Use the returned messageId to correlate messages with delivery events.
Environment Variables
For backend applications, store your Antryk credentials as environment variables. For example:Never commit production API credentials to Git repositories or expose them in
client-side JavaScript.

