Your SMS are sent from your own mobile.See how it works
PLATFORMAPI-first architectureSecure device pairingDelivery visibilityMulti-device controlVersioned documentation
Developer hub / WhatsApp API

WA · 9 documented operations

WhatsApp API documentation

Send WhatsApp messages and media, retry failures, verify recipient numbers and securely retrieve received messages after an explicit synchronization request.

Connected phones synchronizing conversations and media
REST base URLhttps://api.smsmobileapi.com

JSON responses · HTTPS required · UTF-8

Connect your API key

Connect once, then test endpoints across SMS, calls, notifications, WhatsApp and email.

Start here

Your first request in four steps

1

Connect and enable WhatsApp for a supported mobile.

2

Confirm the recipient with the number-check endpoint.

3

Send with waonly=yes.

4

To retrieve received messages: activate collection, call /getwa/synchronisation/, wait for recovery, then call /getwa.

MANDATORY BEFORE RETRIEVING RECEIVED MESSAGES

Request WhatsApp synchronization first.

Before calling /getwa to view received WhatsApp messages, you must request a synchronization window through https://api.smsmobileapi.com/getwa/synchronisation/. This explicit step is required to securely authorize the exchange between WhatsApp and SMSMobileAPI. Wait for recovery, then call /getwa.

Open the required synchronization endpoint →
The secure SMSMobileAPI mobile app connecting a phone to the web dashboard and REST API for SMS and call operations
Encrypted mobile-to-platform connection

Official mobile application

The secure bridge between your phone, dashboard and API.

SMS and call operations pass through the official SMSMobileAPI app installed on your connected phone. The app securely pairs the device with your account, synchronizes authorized events and links the mobile network to the dashboard and REST API.

1Mobile appPairs the phone and its SIM 2Encrypted linkAuthenticates and protects data in transit 3Dashboard & APIControls workflows and activity
  • Signed releases distributed through the official Google Play and Apple App Store listings
  • Google and Apple platform review, signing and distribution controls
  • Secure device pairing, HTTPS transport and authenticated API access
  • Only the permissions required for the mobile features you enable
Get the official SMSMobileAPI app on Google Play Download the official SMSMobileAPI app on the Apple App Store
Capabilities depend on the permissions and background access allowed by Android or iOS.

Authentication

Keep credentials on your server

Use apikey for direct integrations. OAuth2 client credentials are available for server-side applications; request a token and send it as Authorization: Bearer ACCESS_TOKEN.

History management

Clear history safely: preview, delete, follow progress

These endpoints clear the selected server history for your API key, not messages on phones or external services. They do not provide account erasure. New activity can appear after deletion.

Read the request_id and retry guide
Integration protection

By default, linked or processing records remain visible. Only use include_linked=1 if you accept that integrations or ongoing processing may stop working.

How request_id works

  1. Preview the counts with action=preview. No request_id is needed and no records are deleted.
  2. Generate a unique request_id for a new deletion, for example a UUID. Save it before sending action=delete.
  3. For retries, timeouts or HTTP 202, reuse the same API key, history endpoint, request_id and include_linked value. Never generate a new ID automatically after an error.
  4. When completed=true, the operation is finished. Reusing its ID returns the same result instead of deleting newly arrived records. Use a new ID only for a deliberately new cleanup.

request_id identifies your deletion operation, not an individual SMS. Allowed format: 16–128 ASCII letters, digits, hyphens or underscores. A UUID generated with crypto.randomUUID() is suitable.

Deletion runs in batches. HTTP 202 with continue_required=true means you must repeat action=delete after 3 seconds. There is no background cron. action=status only reads progress, even when its HTTP status is 200.

Deletion and status examples

Replace the sample request_id with your own unique value before starting. The following delete requests change real account history; they are not previews.

POST · API key
curl -X POST "https://api.smsmobileapi.com/delete-history-whatsapp-sent/" \
  --data-urlencode "apikey=YOUR_API_KEY" \
  -d "action=delete" -d "include_linked=0" \
  -d "request_id=6d54ac58-41f1-4fbc-9a39-6e6c86089451"
POST · OAuth2
curl -X POST "https://api.smsmobileapi.com/delete-history-whatsapp-sent/" \
  -H "Authorization: Bearer YOUR_OAUTH_ACCESS_TOKEN" \
  -d "action=delete" -d "include_linked=0" \
  -d "request_id=6d54ac58-41f1-4fbc-9a39-6e6c86089451"
GET · status
curl -G "https://api.smsmobileapi.com/delete-history-whatsapp-sent/" \
  --data-urlencode "apikey=YOUR_API_KEY" \
  -d "action=status" \
  -d "request_id=6d54ac58-41f1-4fbc-9a39-6e6c86089451"

GET also accepts action=preview or action=delete. POST is recommended: URL parameters can leak into browser history and server logs. Never place a deletion URL in a public link, image or prefetch.

For POST, send all parameters in the form body or a JSON object, never in the query string. Unknown parameters are rejected; date or mobile filters are not supported.

Authentication for history endpoints

Use apikey or an Authorization: Bearer access token issued by SMSMobileAPI OAuth2. Do not send a refresh token or an API key as a Bearer token. Expired tokens are refused.

When scopes are set, history:read allows preview/status and history:delete also allows deletion. Restrictions on both the token and OAuth client apply. Legacy tokens without scopes retain their existing account access.

OAuth2 selects the unique primary API key. If several primary keys exist, also provide apikey to select one belonging to the account. Secondary keys never grant access to the primary key history.

Read the response before continuing

count_delete is the cumulative number removed by this operation. selected_at_start is the initial selection; protected_at_start counts excluded records. Use preview.linked_or_processing to count linked records even when include_linked=1.

JSON · HTTP 202
{
    "result": {
        "error": 0,
        "history": "whatsapp-sent",
        "action": "delete",
        "request_id": "6d54ac58-41f1-4fbc-9a39-6e6c86089451",
        "status": "processing",
        "completed": false,
        "count_delete": 100,
        "total_before": 250,
        "selected_at_start": 200,
        "protected_at_start": 50,
        "include_linked": 0,
        "continue_required": true,
        "message": "Repeat GET or POST with the same request_id and include_linked to continue. Status requests do not run deletion."
    }
}
  • 200 with completed=true: finished. A 200 preview or status response alone does not prove completion.
  • 400 INVALID_REQUEST_ID: check the format. 404 REQUEST_NOT_FOUND: no operation exists for this ID, API key and history.
  • 401: invalid or expired credentials. 403: insufficient OAuth scope or unauthorized account.
  • 409 HISTORY_BUSY: another cleanup is running; continue it from the original client. 409 INCLUDE_LINKED_CONFLICT: restore the original include_linked value.
  • 409 OAUTH_ACCOUNT_AMBIGUOUS: provide an API key belonging to this account.
  • 503 or network interruption: some batches may already be completed. Check configuration, then retry with the original request_id. Do not create a replacement operation automatically.
POST · GET

Send a WhatsApp message

#
ENDPOINThttps://api.smsmobileapi.com/sendsms

Sends a WhatsApp text or supported media through the connected environment.

When to use it

Use it for individual recipients or a dashboard contact group.

Parameters

NameTypeRequirementDescription
apikey string Required Your API key; omit when using a Bearer token.
recipients phone Required Country code plus number, without + or 00.
message string Required Text body; multiple lines are supported.
waonly yes Required Must be yes to request WhatsApp-only delivery.
url_media HTTPS URL Optional Public PDF, document, archive or JPG/PNG URL.
url_media_shorted yes Optional Use a shortened download URL with PDF preview mode.
pdf_with_image yes Optional Add an image preview for a PDF.
encrypt_message yes Optional Require recipient-side decryption.
contactGroup GUID Optional Send to every contact in a dashboard group.

Request example

cURL
curl -X POST "https://api.smsmobileapi.com/sendsms?waonly=yes" \
  -d "apikey=YOUR_API_KEY" \
  -d "recipients=191728660" \
  --data-urlencode "message=Your order is ready."

Example response

JSON
{
  "result": {
    "error": 0,
    "sent": "1",
    "id": "MESSAGE_GUID",
    "send_with_whatsapp": "1"
  }
}

Want to run this request? Connect your API key at the top of the page to unlock the interactive tester.

Connect key ↑
Good to know
  • Supported media URLs must be public HTTPS resources.
  • WhatsApp formatting: *bold*, _italic_, ~strikethrough~ and triple-backtick monospace.
POST · GET

Resend an unsent WhatsApp message

#
ENDPOINThttps://api.smsmobileapi.com/resendwa/

Retries a WhatsApp message that currently has an error status.

When to use it

Use it after diagnosing a failed WhatsApp log entry.

Parameters

NameTypeRequirementDescription
apikey string Required Your API key.
guid string Required GUID of the failed message.

Request example

cURL
curl "https://api.smsmobileapi.com/resendwa/?apikey=YOUR_API_KEY&guid=MESSAGE_GUID"

Want to run this request? Connect your API key at the top of the page to unlock the interactive tester.

Connect key ↑
Good to know
  • Only failed messages are eligible for resend.
GET

Activate inbound retrieval

#
ENDPOINThttps://api.smsmobileapi.com/getwa/active/

Activates, deactivates or toggles WhatsApp message retrieval.

When to use it

Activate collection first. Then, before retrieving received messages, you must request synchronization through /getwa/synchronisation/.

Parameters

NameTypeRequirementDescription
apikey string Required Your API key.
statut 0 | 1 | x Optional 1 activates, 0 deactivates, x or omission toggles the current state.

Request example

cURL
curl "https://api.smsmobileapi.com/getwa/active/?apikey=YOUR_API_KEY&statut=1"

Example response

JSON
{
  "success": true,
  "read_message_active": 1,
  "status_note": "Activated"
}

Want to run this request? Connect your API key at the top of the page to unlock the interactive tester.

Connect key ↑
Good to know
  • Inbound retrieval is disabled by default for privacy.
  • Activation alone does not retrieve messages: a synchronization request remains mandatory before using /getwa for newly received activity.
GET

Required: request WhatsApp synchronization

#
ENDPOINThttps://api.smsmobileapi.com/getwa/synchronisation/

Mandatory security step before retrieving received WhatsApp messages. It opens a time-limited synchronization window.

When to use it

You must call this endpoint before /getwa whenever you need SMSMobileAPI to check WhatsApp for newly received messages. Wait for recovery, then call /getwa.

Parameters

NameTypeRequirementDescription
apikey string Required Your API key.

Request example

cURL
curl "https://api.smsmobileapi.com/getwa/synchronisation/?apikey=YOUR_API_KEY"

Example response

JSON
{
  "error": "0",
  "messages": "synchronized",
  "expire_at": "2026-03-11 12:27:00",
  "expire_at_unix": "1773232020"
}

Want to run this request? Connect your API key at the top of the page to unlock the interactive tester.

Connect key ↑
Good to know
  • Synchronization is for receiving messages only. Do not call it before sending.
  • The response returns expire_at and expire_at_unix. Request another synchronization window when you need to collect newer received messages.
  • A synchronization request is mandatory to protect the exchange between WhatsApp and SMSMobileAPI.
GET

Retrieve WhatsApp messages

#
ENDPOINThttps://api.smsmobileapi.com/getwa

Returns received WhatsApp messages that were recovered during a requested synchronization window.

When to use it

Mandatory prerequisite: activate inbound retrieval, call https://api.smsmobileapi.com/getwa/synchronisation/ first, wait for recovery, then call this endpoint. /getwa does not itself start synchronization.

Parameters

NameTypeRequirementDescription
apikey string Required Your API key.
before Unix timestamp Optional Return records before this timestamp.
date YYYY-MM-DD Optional Return records for one date.
message_type text | audio Optional Filter text messages or audio messages converted to text; omit for both.

Request example

cURL
curl "https://api.smsmobileapi.com/getwa/?apikey=YOUR_API_KEY&message_type=text"

Example response

JSON
{
  "date": "2026-03-11",
  "hour": "12:27:00",
  "timestamp": "1773232020",
  "number": "19176728660",
  "contact": "SMSMobileAPI",
  "message": "When will I receive my order?",
  "guid": "652fcfc0-12a8-46f5-b5ba-9391135b8b4c"
}

Want to run this request? Connect your API key at the top of the page to unlock the interactive tester.

Connect key ↑
GET

Check a WhatsApp number

#
ENDPOINThttps://api.smsmobileapi.com/whatsapp/checknumber/

Checks whether a phone number is available on WhatsApp.

When to use it

Use it before sending to reduce avoidable failures.

Parameters

NameTypeRequirementDescription
apikey string Required Your API key.
recipients phone Required Country code plus number, without + or 00.

Request example

cURL
curl "https://api.smsmobileapi.com/whatsapp/checknumber/?apikey=YOUR_API_KEY&recipients=19176728660"

Example response

JSON
{
  "contact_found_on_whatsapp": "yes",
  "recipients": "19176728660"
}

Want to run this request? Connect your API key at the top of the page to unlock the interactive tester.

Connect key ↑
POST

Create an OAuth2 access token

#
ENDPOINThttps://api.smsmobileapi.com/oauth2/token

Exchanges client credentials for a Bearer token.

When to use it

Use it for server-to-server integrations where short-lived credentials are preferred.

Parameters

NameTypeRequirementDescription
grant_type string Required Must be client_credentials.
client_id string Required Client ID from the dashboard.
client_secret string Required Client secret from the dashboard.

Request example

cURL
curl -X POST "https://api.smsmobileapi.com/oauth2/token" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=client_credentials" \
  -d "client_id=YOUR_CLIENT_ID" \
  -d "client_secret=YOUR_CLIENT_SECRET"

Want to run this request? Connect your API key at the top of the page to unlock the interactive tester.

Connect key ↑
Good to know
  • Keep the client secret on your server. Never include it in mobile or browser code.
POST · GET

Clear sent WhatsApp history

#
ENDPOINThttps://api.smsmobileapi.com/delete-history-whatsapp-sent/

Clears server records of sent WhatsApp messages. It does not delete messages from WhatsApp conversations.

When to use it

Use preview first, check the counts, then explicitly request deletion. This clears the entire selected history for the API key, without date, phone or message filters.

Parameters

NameTypeRequirementDescription
apikey string Optional Required without OAuth2. With OAuth2, optionally select an API key belonging to the same account.
action preview | delete | status Optional preview counts without deleting; delete starts or continues deletion; status reads progress without continuing. The API defaults to delete; this tester defaults to preview.
include_linked 0 | 1 Optional Default 0: keep linked or processing records. Set 1 to include them, with a risk of breaking integrations. Keep this value unchanged when continuing a deletion.
request_id string Optional Required for delete and status, optional for preview. Use 16 to 128 letters, digits, hyphens or underscores. Generate one unique ID per new deletion and keep it for every retry. This is not a message ID or an API key.

Request example

cURL
curl -X POST "https://api.smsmobileapi.com/delete-history-whatsapp-sent/" \
  --data-urlencode "apikey=YOUR_API_KEY" \
  -d "action=preview" -d "include_linked=0"
Deletion and status examples

Replace the sample request_id with your own unique value before starting. The following delete requests change real account history; they are not previews.

POST · API key
curl -X POST "https://api.smsmobileapi.com/delete-history-whatsapp-sent/" \
  --data-urlencode "apikey=YOUR_API_KEY" \
  -d "action=delete" -d "include_linked=0" \
  -d "request_id=6d54ac58-41f1-4fbc-9a39-6e6c86089451"
POST · OAuth2
curl -X POST "https://api.smsmobileapi.com/delete-history-whatsapp-sent/" \
  -H "Authorization: Bearer YOUR_OAUTH_ACCESS_TOKEN" \
  -d "action=delete" -d "include_linked=0" \
  -d "request_id=6d54ac58-41f1-4fbc-9a39-6e6c86089451"
GET · status
curl -G "https://api.smsmobileapi.com/delete-history-whatsapp-sent/" \
  --data-urlencode "apikey=YOUR_API_KEY" \
  -d "action=status" \
  -d "request_id=6d54ac58-41f1-4fbc-9a39-6e6c86089451"

Example response

JSON
{
    "result": {
        "error": 0,
        "history": "whatsapp-sent",
        "action": "preview",
        "total": 120,
        "simple": 100,
        "linked_or_processing": 20,
        "selected": 100,
        "include_linked": 0,
        "operation_in_progress": false,
        "active_include_linked": null
    }
}

Want to run this request? Connect your API key at the top of the page to unlock the interactive tester.

Connect key ↑
Good to know
  • The example above is a preview, not a deletion. Counts are illustrative; the definitive selection is fixed when deletion starts.
  • include_linked=1 may disrupt GHL, Zapier, automations, unsubscribe links or delivery tracking. It never bypasses account ownership or storage integrity checks.
POST · GET

Clear received WhatsApp history

#
ENDPOINThttps://api.smsmobileapi.com/delete-history-whatsapp-received/

Clears server records of received WhatsApp messages. It does not disconnect WhatsApp or delete conversations.

When to use it

Use preview first, check the counts, then explicitly request deletion. This clears the entire selected history for the API key, without date, phone or message filters.

Parameters

NameTypeRequirementDescription
apikey string Optional Required without OAuth2. With OAuth2, optionally select an API key belonging to the same account.
action preview | delete | status Optional preview counts without deleting; delete starts or continues deletion; status reads progress without continuing. The API defaults to delete; this tester defaults to preview.
include_linked 0 | 1 Optional Default 0: keep linked or processing records. Set 1 to include them, with a risk of breaking integrations. Keep this value unchanged when continuing a deletion.
request_id string Optional Required for delete and status, optional for preview. Use 16 to 128 letters, digits, hyphens or underscores. Generate one unique ID per new deletion and keep it for every retry. This is not a message ID or an API key.

Request example

cURL
curl -X POST "https://api.smsmobileapi.com/delete-history-whatsapp-received/" \
  --data-urlencode "apikey=YOUR_API_KEY" \
  -d "action=preview" -d "include_linked=0"
Deletion and status examples

Replace the sample request_id with your own unique value before starting. The following delete requests change real account history; they are not previews.

POST · API key
curl -X POST "https://api.smsmobileapi.com/delete-history-whatsapp-received/" \
  --data-urlencode "apikey=YOUR_API_KEY" \
  -d "action=delete" -d "include_linked=0" \
  -d "request_id=6d54ac58-41f1-4fbc-9a39-6e6c86089451"
POST · OAuth2
curl -X POST "https://api.smsmobileapi.com/delete-history-whatsapp-received/" \
  -H "Authorization: Bearer YOUR_OAUTH_ACCESS_TOKEN" \
  -d "action=delete" -d "include_linked=0" \
  -d "request_id=6d54ac58-41f1-4fbc-9a39-6e6c86089451"
GET · status
curl -G "https://api.smsmobileapi.com/delete-history-whatsapp-received/" \
  --data-urlencode "apikey=YOUR_API_KEY" \
  -d "action=status" \
  -d "request_id=6d54ac58-41f1-4fbc-9a39-6e6c86089451"

Example response

JSON
{
    "result": {
        "error": 0,
        "history": "whatsapp-received",
        "action": "preview",
        "total": 120,
        "simple": 100,
        "linked_or_processing": 20,
        "selected": 100,
        "include_linked": 0,
        "operation_in_progress": false,
        "active_include_linked": null
    }
}

Want to run this request? Connect your API key at the top of the page to unlock the interactive tester.

Connect key ↑
Good to know
  • The example above is a preview, not a deletion. Counts are illustrative; the definitive selection is fixed when deletion starts.
  • include_linked=1 may disrupt GHL, Zapier, automations, unsubscribe links or delivery tracking. It never bypasses account ownership or storage integrity checks.

Troubleshooting

Errors and safe retries

Read the HTTP status and the JSON error field before retrying. Do not retry validation or authentication failures without correcting the request first.

HTTPCodeWhat to do
400missing_parameterA required parameter is empty or absent. Check the parameter table for the endpoint.
403invalid_apikeyThe API key is unknown, expired or not authorized for the requested feature.
429too_many_requestsRequests are arriving too quickly. Wait, then retry with exponential backoff.
500server_errorThe service could not complete the request. Keep the response and contact support if it persists.
Retry ruleRetry only transient 429 and 5xx responses. Start after 1 second, then back off to 2, 4 and 8 seconds.

Need help?

Bring the request context—not your secrets.

Share the endpoint, timestamp, HTTP status and sanitized response. Never include API keys, tokens or private message content.

Contact API support →