API DOCUMENTATION · V1.1

S3 API
for WhatsApp Business API.

Base URL: https://s-3.tech/api/v1.1

Send WABA templates and messages from your own systems and receive incoming messages through webhooks. Create keys in your S3 account: Settings, Developers, Secret keys. Limits: 600 requests and 60 sends per minute.

Introduction

The S3 API connects your business to WhatsApp Business for efficient, automated communication with customers. You get:

  • Automated customer communication
  • Support for text, media and template messages
  • Incoming messages received and processed through a webhook
  • Secure integration with your systems

To get started, get access to S3 (access is by invitation), then create a key in your S3 account.

Quick start

  1. 1
    Create a key
    In your S3 account: Settings → Developers → Secret keys. It is shown only once, so save it. Authentication
  2. 2
    Get your numbers and templates
    Account numbers give you the phone_id for the from field, and templates give you the name, language and number of variables.
  3. 3
    Send a template
    One POST /public/messages/template request: the message goes to the customer and shows up in the S3 conversation.
# 1. Key: Settings → Developers → Secret keys
export S3_API_KEY="sk-…"

# 2. Numbers and approved templates
curl https://s-3.tech/api/v1.1/public/numbers \
  -H "Authorization: Bearer $S3_API_KEY"

curl "https://s-3.tech/api/v1.1/public/templates?status=APPROVED" \
  -H "Authorization: Bearer $S3_API_KEY"

# 3. Send a template
curl -X POST https://s-3.tech/api/v1.1/public/messages/template \
  -H "Authorization: Bearer $S3_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "540238085832615",
    "to": "77001234567",
    "template": { "name": "order_ready", "language": "ru" },
    "variables": ["Anna", "15:00"]
  }'

Authentication

Every request to the S3 API needs an API key in the request header. You create it in your S3 account: Settings → Developers → Secret keys. It is shown in full only once, right after you create it, so save it.

Recommended header: Authorization: Bearer sk-…. We also accept X-API-Key: sk-… and Authorization: sk-… (without Bearer, for integrations connected earlier).

Headers

AuthorizationstringBearer sk-…, the API key that authorizes requests
X-API-Keystringthe same, if a separate header suits you better
Content-Typestringrequest content type (application/json)

Good to know

  • The API key is issued to the business account, not to a specific user
  • You get it in your S3 account: Settings → Developers → Secret keys
  • The same page shows when it was last used, and you can revoke it there: requests with that key stop working immediately
  • Keep your API key in a safe place and don’t share it with third parties
The key is for the API only
The API key works only for the API endpoints in this documentation. It can’t be used to log in to your S3 account.
Lost your key? Create a new one
We store only a hash of the key, so it can’t be shown again. If you lose it, revoke it and create a new one: Settings → Developers → Secret keys.

Common errors

Code
Meaning
401 Unauthorized
the request has no key
403 Forbidden
the key is invalid or revoked
400 Bad Request
invalid phone number or message format
429 Too Many Requests
rate limit exceeded, see Rate limits
curl https://s-3.tech/api/v1.1/public/numbers \
  -H "Authorization: Bearer YOUR_API_KEY"

Rate limits

Limits are counted separately for each API key:

Limit
What counts
600 / min
all API requests
60 / min
message sends

When you go over a limit, the API returns 429 with the rate_limited code and a Retry-After header: the number of seconds before you can retry.

Response headers

X-RateLimit-Limitintegerthe limit that applies to the request; included in every response
X-RateLimit-Remainingintegerhow many requests are left in the current minute; included in every response
Retry-Afterintegeronly in a 429 response: how many seconds to wait before retrying
Tip
When you get a 429, retry the request after the pause given in Retry-After. Send broadcasts at an even pace rather than in one burst, so you stay within the limit.
HTTP/1.1 429 Too Many Requests
Retry-After: 12
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 0

{ "error": { "code": "rate_limited", "message": "…" } }

Errors

The /public/… endpoints return every error in the same shape: an error object with a machine-readable code and a human-readable message.

The examples on this page show the message text translated into English; the API may return it in Russian. In your code, rely on code and the HTTP status, not on message.

HTTP
code
Meaning
400
invalid_request invalid_recipient from_required template_ambiguous
invalid request; the message says what to fix
401
(none)
no key
402
billing_suspended
sending is suspended because the account is unpaid
403
(none) or number_not_owned
the key is invalid or revoked; number_not_owned means the number isn’t yours
404
number_not_found template_not_found
your account has no such number or template
422
template_not_approved variables_mismatch and Meta errors
the template can’t be sent in this form
429
rate_limited
rate limit exceeded, retry after Retry-After seconds. See Limits
502
send_failed
temporary sending error, try again later
Error format4xx
{ "error": { "code": "template_not_found", "message": "Template not found (list: GET /public/templates)" } }
API v1.1

Account numbers

GET/api/v1.1/public/numbers

The WhatsApp Business (WABA) numbers connected to your account. When sending, pass the phone_id or the number from this response in from.

Response fields

numbers[].phone_idstringnumber ID, for the from field when sending
numbers[].display_phone_numberstringthe number as customers see it
numbers[].namestringthe number’s display name
numbers[].waba_idstringWhatsApp Business Account (WABA) ID
numbers[].messaging_limitstringthe number’s Meta messaging limit for broadcasts, for example TIER_2K
curl https://s-3.tech/api/v1.1/public/numbers \
  -H "Authorization: Bearer YOUR_API_KEY"
API v1.1

Templates

GET/api/v1.1/public/templates

Your account’s WhatsApp templates. By default, the list includes only templates approved by Meta, which are the ones you can send.

Query parameters

statusstringoptionalAPPROVED (default), PENDING, REJECTED or all
namestringoptionalexact template name
languagestringoptionallanguage, for example ru or en_US

The parameters field

body_variablesintegerhow many values to pass in variables ({{1}}, {{2}}…)
body_namesstring[]variable names, if the template uses named variables ({{name}})
headerstringheader type: text, image, video, document; for media, pass components
url_buttons_with_variableinteger[]indexes of URL buttons that have a variable; their values go in components
curl "https://s-3.tech/api/v1.1/public/templates?status=APPROVED" \
  -H "Authorization: Bearer YOUR_API_KEY"
API v1.1

Sending a template

POST/api/v1.1/public/messages/template

Send an approved template to a customer. A template lets you message first, and also after the customer has been silent for more than 24 hours. The message appears in the S3 conversation and is passed to amoCRM if it’s connected.

Request fields

fromstringsender number: the phone_id or the number itself from the list of numbers. If you have only one number, you can leave it out
tostringrequiredcustomer number with country code, for example 77001234567
templateobjectrequired{ "id": "…" } or { "name": "…", "language": "ru" }; the language is required if the template has more than one
variablesstring[]optionalvalues for the text variables, in order; their count must match body_variables
componentsarrayoptionalparameters in Meta format for a header with a file, buttons with a variable or a carousel; in that case variables are not needed
codestringoptionalcode for an authentication template: it is inserted into the text and the button
message_id is the WhatsApp message ID. Delivery and read statuses for the message arrive in the webhook with this ID.
curl -X POST https://s-3.tech/api/v1.1/public/messages/template \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "540238085832615",
    "to": "77001234567",
    "template": { "name": "order_ready", "language": "ru" },
    "variables": ["Anna", "15:00"]
  }'
Events

Webhook messages

You set up the webhook in your S3 account. Your URL receives three kinds of events for your WABA numbers:

  • an incoming customer message: there is no event field, and direction: incoming;
  • event: message: an outgoing message sent by an operator in S3 chat, the API, a broadcast, a funnel, amoCRM or Bitrix24 (the sender is in sender_type);
  • event: status: the status of an outgoing message: sent, delivered, read, failed (with error_code and error).

Match statuses by message_id: it’s the same ID that /public/messages/template and send-message return.

S3 sends POST requests to your webhook URL, with the data in the request body as JSON.

n8n and similar platforms
When you integrate with platforms like n8n, access the fields through the body object, for example: $json.body.phone_number, $json.body.text, $json.body.phone_number_id.

Parameters

eventstringoptionalmessage (outgoing) or status (status of an outgoing message); incoming messages don’t have this field
wa_idstringUnique WhatsApp business account ID
namestringContact name (if available)
phone_number_idstringID of your WhatsApp Business number
phone_numberstringCustomer phone number
message_idstringWhatsApp message ID (wamid): it links a sent message to its statuses
statusstringnew for incoming; sent, delivered, read, failed for outgoing
file_pathstringoptionalLink to the file of an incoming photo, video, document or voice message; served with the correct Content-Type
mime_typestringoptionalFile type, for example image/jpeg or audio/ogg; codecs=opus
sender_typestringoptionalWho sent the outgoing message: manager (operator in chat), api, mailing, funnel, amo_manager and others
error_codenumberoptionalMeta error code when status=failed
errorstringoptionalThe reason for non-delivery in plain language
contentobjectFull message content
textstringMessage text (for text messages)
typestringMessage type (text, image, video, etc.)
directionstringMessage direction (incoming/outgoing)
timestampstringTime the message was created

Use cases

Webhook messages are used to:

  • Receive incoming messages from customers
  • Track delivery and read status of sent messages
  • Sync operator replies from S3 chat with your system
  • Process media files and documents

Good to know

  • The webhook must be set up in your S3 account
  • The webhook URL must be reachable from the internet
  • We recommend HTTPS for security
  • Your server must respond with 200 OK to every request

Common errors

Error
Meaning
Timeout
the server doesn’t respond within 15 seconds
Invalid Response
the server returned an invalid status
Network Error
the server can’t be reached
// Incoming customer message (no event field)
{
  "wa_id": "1234567890",
  "name": "Customer name",
  "phone_number_id": "12345",
  "phone_number": "79998887766",
  "message_id": "wamid.HBgL...",
  "status": "new",
  "file_path": "https://s-3.tech/media/incoming/1234567890123456.jpg",
  "mime_type": "image/jpeg",
  "content": { "media_id": "1234567890123456", "mime_type": "image/jpeg", "caption": "Photo" },
  "type": "image",
  "direction": "incoming",
  "timestamp": "1760000000"
}

// Outgoing: operator in chat, API, broadcast, funnel, amoCRM
{
  "event": "message",
  "phone_number_id": "12345",
  "phone_number": "79998887766",
  "message_id": "wamid.HBgL...",
  "status": "sent",
  "content": { "text": "Hello" },
  "text": "Hello",
  "type": "text",
  "direction": "outgoing",
  "sender_type": "manager",
  "timestamp": "1760000005"
}

// Status of an outgoing message: sent, delivered, read, failed
{
  "event": "status",
  "phone_number_id": "12345",
  "phone_number": "79998887766",
  "message_id": "wamid.HBgL...",
  "status": "failed",
  "content": null,
  "type": "",
  "direction": "outgoing",
  "timestamp": "1760000010",
  "error_code": 131047,
  "error": "More than 24 hours have passed since the customer's last message, a template is required."
}
legacy endpoints, still working

Sending messages

Text message

To send a message, make a POST request to this endpoint:

POST/api/v1.1/messages/send-messagelegacy endpoint

Endpoint details

URLhttps://s-3.tech/api/v1.1/messages/send-message
MethodPOST
AuthorizationheaderAPI key for authorization
Content-Typeheaderapplication/json
Request bodyJSON object with the message parameters

Parameters

recipient_phonestringrequiredrecipient phone number in international format
phone_idstringrequiredID of your WhatsApp Business number. You can find it in your S3 account profile by clicking “Show all numbers”. The ID is listed as PhoneId next to the number.
message_typestringrequiredmessage type: text (plain text), button (reply buttons), cta_url (link button), image, video, document (files)
textstringmessage text
componentsarrayoptionalarray of message components (used only for messages with buttons)

The S3 API supports two main types of outgoing messages:

  • Regular messages (text and media): can be sent only during an active session (24 hours after the customer’s last message)
  • Template messages: can be sent at any time, as long as you have an approved template

Use cases

Text messages are used for:

  • Notifications to customers within the open 24-hour window
  • Replying to customer inquiries
  • Confirmations and reminders

Good to know

  • Messages can be sent only within the 24-hour window after the customer’s last message
  • Maximum text length: 4096 characters
  • Emoji and special characters are supported
  • We recommend template messages for broadcasts

Common errors

Error
Meaning
Session Expired
the 24-hour window has expired
Invalid Phone Number
invalid number format
Text Too Long
maximum length exceeded
curl -X POST https://s-3.tech/api/v1.1/messages/send-message \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "recipient_phone": "79XXXXXXXXX",
  "phone_id": "PHONE_ID",
  "text": "Hi, this is a text message.",
  "message_type": "text"
}'

Sending a template message

To send a template message, make a POST request to this endpoint:

POST/api/v1.1/messages/send-template-messagelegacy endpoint
For new integrations, use Sending a template (/public/messages/template) instead: you pick the template by name and the number by phone_id.

Template message parameters

facebook_idstringrequiredtemplate ID in Facebook
recipient_phonestringrequiredrecipient phone number in international format
display_phone_numberstringrequiredthe sender’s display phone number (enter it exactly as it appears in your S3 account)
user_compsstring[]array of values to insert into the template

Good to know

  • A template message can be sent at any time, even after the 24-hour window has expired
  • The template must be approved by Meta beforehand (you can see its status in your S3 account)
  • The number of variables in a template is limited (usually up to 4)
  • Values in user_comps must follow the order of the variables in the template
POST/api/v1.1/messages/send-template-message
curl -X POST https://s-3.tech/api/v1.1/messages/send-template-message \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "facebook_id": "12121233123123",
    "recipient_phone": "77001234567",
    "display_phone_number": "+7 700 000-00-00",
    "user_comps": ["Anna"]
  }'

Sending a message with reply buttons

Messages with reply buttons let the user pick one of several predefined answers.

Fields

message_typestringbutton: a message with reply buttons
components[].buttons[].typestringreply: a reply button
components[].buttons[].textstringbutton text
Important
Reply buttons don’t support URLs. A message can have up to 3 buttons.
Request body: send-message
{
  "recipient_phone": "79XXXXXXXXX",
  "phone_id": "PHONE_ID",
  "text": "How can we help?",
  "message_type": "button",
  "components": [
    {
      "type": "button",
      "buttons": [
        {
          "type": "reply",
          "text": "See prices"
        },
        {
          "type": "reply",
          "text": "Talk to a manager"
        }
      ]
    }
  ]
}

Sending a message with a CTA URL button

A CTA URL button opens the specified website when tapped.

Fields

message_typestringcta_url: a message with a link button
components[].buttons[].urlstringthe URL to open when the button is tapped
Request body: send-message
{
  "recipient_phone": "79XXXXXXXXX",
  "phone_id": "PHONE_ID",
  "text": "Check out our website",
  "message_type": "cta_url",
  "components": [
    {
      "type": "button",
      "buttons": [
        {
          "type": "reply",
          "text": "Go to website",
          "url": "https://example.com"
        }
      ]
    }
  ]
}
legacy endpoints, still working

Sending media

POST/api/v1.1/messages/send-messagelegacy endpoint

Parameters

recipient_phonestringrequiredrecipient phone number in international format
phone_idstringrequiredID of your WhatsApp Business number
message_typestringrequiredmessage type: image, video or document
media_filestringrequiredthe filename value from the upload response, for example abc123.jpg. Not a link
textstringoptionalfile caption

Use cases

Images are used for:

  • Sending product photos
  • Showing work samples
  • Sending receipts and documents
  • Visual confirmation

Good to know

  • First upload the file through /media/upload, then pass its filename in media_file
  • Meta limits: JPG and PNG images up to 5 MB, MP4 video up to 16 MB, documents up to 100 MB
  • As with text, a file can be sent only within 24 hours after the customer’s last message
  • The response contains message_id: delivery statuses for it arrive in the webhook

Common errors

Error
Meaning
500, media_fetch_failed
no uploaded file has this name; pass the filename from the upload response, not a link
500, Meta error about size or format
the file exceeds Meta’s limit or the format isn’t supported
403
the phone_id doesn’t belong to the business that owns the key
import requests
import json

# Media message parameters
media_data = {
    "recipient_phone": "1231231231231",
    "phone_id": "12345667890",
    "message_type": "image",
    "media_file": "abc123.jpg"
}

# Request headers
headers = {
    "Authorization": "YOUR_API_KEY",
    "Content-Type": "application/json"
}

# Send the request
url = "https://s-3.tech/api/v1.1/messages/send-message"
response = requests.post(url, headers=headers, data=json.dumps(media_data))

# Check the response
if response.status_code == 200:
    print("Media file sent successfully")
    print("Server response:", response.json())
else:
    print(f"Error sending media file: {response.status_code}")
    print("Server response:", response.text)
legacy endpoints, still working

Media upload

POSThttps://s-3.tech/api/v1.1/media/uploadlegacy endpoint

To send media files (images, video, documents), first upload them to the S3 server. The upload response contains filename: pass it in the media_file parameter when you send the message. Authorization works the same way as in other requests: Authorization: Bearer sk-…, Authorization: sk-… or X-API-Key.

Parameters

AuthorizationheaderrequiredAPI key for authorizing requests
mediafilerequiredthe file to upload (image, video or document)

Response parameters

filenamestringFile name: pass it in media_file when sending
filepathstringTechnical parameter

Use cases

Media upload is used for:

  • Sending product images
  • Sharing video instructions
  • Sending documents and receipts
  • Exchanging media files with customers

Good to know

  • The file field is called media (multipart/form-data)
  • If the name is already taken, the file is saved under a new name, so always take filename from the response
  • Size limits and formats are set by Meta at sending time: JPG and PNG images up to 5 MB, MP4 video up to 16 MB, documents (PDF, DOC, XLS, etc.) up to 100 MB

Common errors

Error
Meaning
400, media file is required
the request has no media field
401 / 403
the key is missing, invalid or revoked
500
the file couldn’t be saved; retry the request, and if the error persists, contact support
curl -X POST https://s-3.tech/api/v1.1/media/upload \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "media=@/path/to/file.jpg"

Support

Our team is always ready to help you integrate and use the S3 API:

Email
info@s-3.tech
Support hours
Daily, 10:00 to 22:00 Astana time
FROM CONVERSATION TO RESULTS

Need help
with your integration?

Tell us where your customers come from and how your team works. We’ll show a suitable scenario and help with the setup.