Dina SMS skickas från din egen mobil.Se hur det fungerar
PLATFORMAPI-first architectureSecure device pairingDelivery visibilityMulti-device controlVersioned documentation
Developer hub/ WhatsApp API

WA · 9 dokumenterade åtgärder

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 →

WEBHOOK V2 FÖR DETTA API

Prenumerera endast på de mobilhändelser ditt arbetsflöde behöver.

5 händelsetyper

En destination kan ta emot allt, eller så kan du separera produktionssystem, analyser och operationella varningar. Varje händelse har ett precist namn så att din applikation kan hantera den förutsägbart.

whatsapp.submitted

WhatsApp inlämnat

Ett sändningsjobb för WhatsApp skapades.

whatsapp.sent

WhatsApp skickat

Den anslutna WhatsApp-miljön bekräftade att meddelandet skickades.

whatsapp.failed

WhatsApp misslyckades

Sändningsoperationen för WhatsApp misslyckades.

whatsapp.received

WhatsApp mottaget

Ett WhatsApp-meddelande hämtades efter att kontot begärde synkronisering.

whatsapp.voice.transcribed

Röstmeddelande transkriberat

Ett hämtat WhatsApp-röstmeddelande som uppfyllde villkoren konverterades till användbar text.

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.

Historia management

Tydlig historia säkert: förhandsgranskning, radera, följ framsteg

Dessa slutpunkter rensar den valda serverhistoriken för din API-nyckel, inte meddelanden på telefoner eller externa tjänster. De ger inte konto radering. Ny aktivitet kan dyka upp efter radering.

Läs request_id och retry guide
Integrationsskydd

Som standard, länkade eller bearbetningsregister förblir synliga. Använd endast include_linked=1 om du accepterar att integrationer eller pågående bearbetning kan sluta fungera.

Hur request_id fungerar

  1. Förhandsgranska räkningarna med action=preview. Ingen request_id behövs och inga poster raderas.
  2. Skapa en unik request_id för en ny radering, till exempel en UUID. Spara det innan du skickar action=delete.
  3. För retries, timeouts eller HTTP 202, återanvända samma API nyckel, historia endpoint, request_id och include_linked värde. Aldrig generera ett nytt ID automatiskt efter ett fel.
  4. När completed=true är operationen klar. Återanvändning av ID returnerar samma resultat istället för att ta bort nykomna poster. Använd ett nytt ID endast för en medvetet ny rengöring.

request_id identifierar din radering, inte en enskild SMS. Tillåtet format: 16–128 ASCII-brev, siffror, hyfs eller understruktioner. En UUID som genereras med crypto.randomUID() är lämplig.

Raderingen sker i omgångar. Vid HTTP 202 med continue_required=true ska action=delete upprepas efter 3 sekunder. Inget cron-jobb körs i bakgrunden. action=status läser bara förloppet och fortsätter inte raderingen, även om svaret är HTTP 200.

radering och statusexempel

Byt ut provet request_id med ditt eget unika värde innan du börjar. Följande raderingsförfrågningar ändrar riktig kontohistorik; de är inte förhandsgranskningar.

POST · API nyckel
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 accepterar också action=preview eller action=delete.. POST rekommenderas: URL-parametrar kan läcka in i webbläsarhistorik och serverloggar. Placera aldrig en raderingsadress i en offentlig länk, bild eller prefetch.

För POST, skicka alla parametrar i formkroppen eller ett JSON-objekt, aldrig i fråga strängen. Okända parametrar avvisas; datum eller mobila filter stöds inte.

Autentisering för historia slutpunkter

Använd apikey eller en Authorization: Bearer-åtkomsttoken som utfärdats av SMSMobileAPI OAuth2. Skicka inte en uppdaterad token eller en API-nyckel som en Bearer-token. Utgångna tokens vägras.

När omfattningar är inställda tillåter history:read förhandsgranskning/status och history:delete också radering. Begränsningar på både token och OAuth-klienten gäller. Legacy tokens utan omfattningar behåller sin befintliga kontoåtkomst.

OAuth2 väljer den unika primära API-nyckeln. Om flera primärnycklar finns, ge också apikey att välja en som tillhör kontot. Sekundära nycklar ger aldrig tillgång till den primära nyckelhistorien.

Läs svaret innan du fortsätter

count_delete är det kumulativa numret som tas bort av denna operation. selected_at_start är det första urvalet; protected_at_start räknas exkluderade poster. Användning preview.linked_or_processing räkna länkade poster även när 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 med completed=true: färdig. Enbart 200 förhandsgranskning eller statusrespons bevisar inte slutförandet.
  • 400 INVALID_REQUEST_ID: Kontrollera formatet. 404 REQUEST_NOT_FOUND: Ingen operation existerar för denna ID, API nyckel och historia.
  • 401: ogiltig eller utgången referenser. 403: otillräcklig OAuth-omfattning eller obehörigt konto.
  • 409 HISTORY_BUSY: en annan rengöring körs; fortsätt den från den ursprungliga klienten. 409 INCLUDE_LINKED_CONFLICT: återställa det ursprungliga include_linked-värdet.
  • 409 OAUTH_ACCOUNT_AMBIGUOUS: ge en API-nyckel som tillhör detta konto.
  • 503 eller nätverksavbrott: vissa partier kan redan slutföras. Konfiguration, sedan retry med den ursprungliga request_id. Skapa inte en ersättningsoperation automatiskt.
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

NamnTypeRequirementDescription
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 Optionell Public PDF, document, archive or JPG/PNG URL.
url_media_shorted yes Optionell Use a shortened download URL with PDF preview mode.
pdf_with_image yes Optionell Add an image preview for a PDF.
encrypt_message yes Optionell Require recipient-side decryption.
contactGroup GUID Optionell 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

NamnTypeRequirementDescription
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

NamnTypeRequirementDescription
apikey string Required Your API key.
statut 0 | 1 | x Optionell 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

NamnTypeRequirementDescription
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

NamnTypeRequirementDescription
apikey string Required Your API key.
before Unix timestamp Optionell Return records before this timestamp.
date YYYY-MM-DD Optionell Return records for one date.
message_type text | audio Optionell 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

NamnTypeRequirementDescription
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

NamnTypeRequirementDescription
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

Rensa historiken för skickade WhatsApp-meddelanden

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

Clears serverposter av skickade WhatsApp-meddelanden. Det tar inte bort meddelanden från WhatsApp-konversationer.

When to use it

Använd förhandsgranskning först, kontrollera räknas, sedan uttryckligen begära radering. Detta rensar hela den valda historien för API-nyckeln, utan datum, telefon- eller meddelandefilter.

Parameters

NamnTypeRequirementDescription
apikey string Optionell Krävs utan OAuth2. Med OAuth2 väljer du valfritt en API-nyckel som tillhör samma konto.
action preview | delete | status Optionell preview räknar utan att radera; delete startar eller fortsätter raderingen; status visar endast förloppet. API:ns standard är delete; testverktygets standard är preview.
include_linked 0 | 1 Optionell Standard 0: hålla länkade eller bearbetningsregister. Ange 1 att inkludera dem, med risk för att bryta integrationer. Håll detta värde oförändrat när du fortsätter en radering.
request_id string Optionell Obligatoriskt för delete och status, valfritt för preview. Använd 16–128 ASCII-bokstäver, siffror, bindestreck (-) eller understreck (_). Skapa ett unikt ID för varje ny radering och behåll det vid alla återförsök. Detta är varken ett meddelande-ID eller en API-nyckel.

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"
radering och statusexempel

Byt ut provet request_id med ditt eget unika värde innan du börjar. Följande raderingsförfrågningar ändrar riktig kontohistorik; de är inte förhandsgranskningar.

POST · API nyckel
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
  • Exemplet ovan är en förhandsgranskning, inte en radering. Räknen är illustrativa; det slutgiltiga urvalet är fastställt när raderingen börjar.
  • include_linked=1 kan störa GHL, Zapier, automationer, avregistrera länkar eller leveransspårning. Det kringgår aldrig kontoägande eller lagringsintegritetskontroller.
POST · GET

Rensa historiken för mottagna WhatsApp-meddelanden

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

Clears serverposter av mottagna WhatsApp-meddelanden. Det kopplar inte bort WhatsApp eller raderar samtal.

When to use it

Använd förhandsgranskning först, kontrollera räknas, sedan uttryckligen begära radering. Detta rensar hela den valda historien för API-nyckeln, utan datum, telefon- eller meddelandefilter.

Parameters

NamnTypeRequirementDescription
apikey string Optionell Krävs utan OAuth2. Med OAuth2 väljer du valfritt en API-nyckel som tillhör samma konto.
action preview | delete | status Optionell preview räknar utan att radera; delete startar eller fortsätter raderingen; status visar endast förloppet. API:ns standard är delete; testverktygets standard är preview.
include_linked 0 | 1 Optionell Standard 0: hålla länkade eller bearbetningsregister. Ange 1 att inkludera dem, med risk för att bryta integrationer. Håll detta värde oförändrat när du fortsätter en radering.
request_id string Optionell Obligatoriskt för delete och status, valfritt för preview. Använd 16–128 ASCII-bokstäver, siffror, bindestreck (-) eller understreck (_). Skapa ett unikt ID för varje ny radering och behåll det vid alla återförsök. Detta är varken ett meddelande-ID eller en API-nyckel.

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"
radering och statusexempel

Byt ut provet request_id med ditt eget unika värde innan du börjar. Följande raderingsförfrågningar ändrar riktig kontohistorik; de är inte förhandsgranskningar.

POST · API nyckel
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
  • Exemplet ovan är en förhandsgranskning, inte en radering. Räknen är illustrativa; det slutgiltiga urvalet är fastställt när raderingen börjar.
  • include_linked=1 kan störa GHL, Zapier, automationer, avregistrera länkar eller leveransspårning. Det kringgår aldrig kontoägande eller lagringsintegritetskontroller.

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 →
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.