I tuoi SMS partono dal tuo cellulare.Scopri come funziona
PIATTAFORMAAPI-prima architetturaAccoppiamento sicuro del dispositivoVisibilità della consegnaControllo multidispositivoDocumentazione del Versione
Mozzo di sviluppo/ WhatsApp API

WA · 9 operazioni documentate

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.

Inizia qui

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 PER QUESTA API

Sottoscrivi solo gli eventi mobili necessari al tuo flusso di lavoro.

5 tipi di evento

Una destinazione può ricevere tutto, oppure puoi separare sistemi di produzione, analisi e avvisi operativi. Ogni evento ha un nome preciso così la tua applicazione può gestirlo in modo prevedibile.

whatsapp.submitted

WhatsApp inviato

È stato creato un job di invio WhatsApp.

whatsapp.sent

WhatsApp inviato

L'ambiente WhatsApp connesso ha confermato che il messaggio è stato inviato.

whatsapp.failed

WhatsApp fallito

L'operazione di invio WhatsApp non è riuscita.

whatsapp.received

WhatsApp ricevuto

Un messaggio WhatsApp è stato recuperato dopo che l'account ha richiesto la sincronizzazione.

whatsapp.voice.transcribed

Messaggio vocale trascritto

Un messaggio vocale WhatsApp recuperato e idoneo è stato convertito in testo utilizzabile.

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.

Gestione della storia

Cancella la storia in modo sicuro: anteprima, eliminare, seguire i progressi

Questi endpoint chiariscono la cronologia dei server selezionata per il tasto API, non messaggi sui telefoni o servizi esterni. Non forniscono la cancellazione del conto. Una nuova attività può apparire dopo la cancellazione.

Leggi la guida request_id e retry
Protezione dell'integrazione

Per impostazione predefinita, i record di connessione o di elaborazione rimangono visibili. Utilizzare solo include_linked=1 se si accetta che le integrazioni o l'elaborazione in corso possono smettere di lavorare.

Come funziona request_id

  1. Anteprima i conti con action=preview. Non è necessario alcun request_id e non vengono eliminati i record.
  2. Generare un unico request_id per una nuova cancellazione, ad esempio un UUID. Salvalo prima di inviare action=delete.
  3. Per i retries, timeout o HTTP 202, riutilizzare lo stesso tasto API, endpoint di storia, request_id e include_linked valore. Non generare mai un nuovo ID automaticamente dopo un errore.
  4. Quando completed=true, l'operazione è terminata. Riutilizzare il suo ID restituisce lo stesso risultato invece di cancellare i record appena arrivati. Utilizzare un nuovo ID solo per una pulizia deliberatamente nuova.

request_id identifica l'operazione di cancellazione, non un singolo SMS. Formato consentito: 16–128 lettere ASCII, cifre, trattini o sottolineature. È adatto un UUID generato con crypto.randomUUID().

L’eliminazione avviene in lotti. HTTP 202 con continue_required=true richiede di ripetere action=delete dopo 3 secondi. Non è previsto un cron in background. action=status legge solo l’avanzamento senza proseguire l’eliminazione, anche con HTTP 200.

Esempi di cancellazione e stato

Sostituire il campione request_id con il proprio valore unico prima di iniziare. Le seguenti richieste di cancellazione cambiano la cronologia del conto reale; non sono anteprime.

POST · API chiave
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"
Stato di GET ·
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 accetta anche action=preview o action=delete. POST è consigliato: i parametri dell'URL possono penetrare nella cronologia del browser e nei registri del server. Non posizionare mai un URL di cancellazione in un link pubblico, immagine o prefetch.

Per POST, inviare tutti i parametri nel corpo del modulo o un oggetto JSON, mai nella stringa di query. I parametri sconosciuti sono rifiutati; i filtri data o mobile non sono supportati.

Autenticazione per i endpoint storici

Utilizzare apikey o un token di accesso Authorization: Bearer rilasciato da SMSMobileAPI OAuth2. Non inviare un token di aggiornamento o una chiave API come un token Bearer. I gettoni scarsi sono rifiutati.

Quando gli ambiti sono impostati, history:read consente l'anteprima/status e history:delete permette anche la cancellazione. Si applicano restrizioni sia sul token che sul client OAuth. I gettoni legacy senza scopi mantengono il loro accesso al conto esistente.

OAuth2 seleziona la chiave API primaria unica. Se esistono diverse chiavi primarie, inoltre, fornire apikey per selezionare una parte dell'account. Le chiavi secondarie non permettono mai l'accesso alla storia principale chiave.

Leggi la risposta prima di continuare

count_delete è il numero cumulativo rimosso da questa operazione. selected_at_start è la selezione iniziale; protected_at_start conta record esclusi. Utilizzare preview.linked_or_processing per contare i record collegati anche quando 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 con completed=true: finito. Una sola risposta di stato o di anteprima 200 non prova il completamento.
  • 400 INVALID_REQUEST_ID: controlla il formato. 404 REQUEST_NOT_FOUND: non esiste alcuna operazione per questo ID, chiave API e storia.
  • 401: credenziali non valide o scadute. 403: insufficiente campo OAuth o conto non autorizzato.
  • 409 HISTORY_BUSY: un'altra pulizia è in esecuzione; continuare dal client originale. 409 INCLUDE_LINKED_CONFLICT: ripristinare il valore originale include_linked.
  • 409 OAUTH_ACCOUNT_AMBIGUOUS: fornire una chiave API appartenente a questo account.
  • 503 o interruzione di rete: alcuni lotti possono già essere completati. Controllare la configurazione, quindi riprova con l'originale request_id. Non creare automaticamente un'operazione di sostituzione.
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

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

NomeTypeRequirementDescription
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

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

NomeTypeRequirementDescription
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

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

NomeTypeRequirementDescription
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

NomeTypeRequirementDescription
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

Eliminare la cronologia dei messaggi WhatsApp inviati

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

Cancella i record di server dei messaggi inviati WhatsApp. Non elimina messaggi da conversazioni WhatsApp.

When to use it

Usa prima l'anteprima, controlla i conti, quindi richiedi esplicitamente la cancellazione. Questo cancella l'intera cronologia selezionata per la chiave API, senza data, telefono o filtri di messaggio.

Parameters

NomeTypeRequirementDescription
apikey string Facoltativo Richiesto senza OAuth2. Con OAuth2, seleziona in modo facoltativo una chiave API appartenente allo stesso account.
action preview | delete | status Facoltativo preview conta senza eliminare; delete avvia o prosegue l’eliminazione; status consulta l’avanzamento senza proseguire. L’API usa delete come valore predefinito; questo strumento usa preview.
include_linked 0 | 1 Facoltativo Default 0: mantenere i record di connessione o di elaborazione. Impostare 1 per includerli, con il rischio di rompere le integrazioni. Mantenere questo valore invariato quando si continua a una cancellazione.
request_id string Facoltativo Obbligatorio per delete e status, facoltativo per preview. Usare da 16 a 128 lettere ASCII, cifre, trattini (-) o trattini bassi (_). Generare un ID univoco per ogni nuova eliminazione e conservarlo per tutti i tentativi. Non è l’ID di un messaggio né una chiave API.

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"
Esempi di cancellazione e stato

Sostituire il campione request_id con il proprio valore unico prima di iniziare. Le seguenti richieste di cancellazione cambiano la cronologia del conto reale; non sono anteprime.

POST · API chiave
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"
Stato di GET ·
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
  • L'esempio sopra è un'anteprima, non una cancellazione. I conti sono illustrativi; la selezione definitiva è fissata quando la cancellazione inizia.
  • include_linked=1 può interrompere GHL, Zapier, automazione, unsubscribe link o il monitoraggio della consegna. Non bypassa mai la proprietà dell'account o i controlli di integrità di archiviazione.
POST · GET

Eliminare la cronologia dei messaggi WhatsApp ricevuti

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

Cancella i record di server dei messaggi WhatsApp ricevuti. Non disconnette WhatsApp o cancella conversazioni.

When to use it

Usa prima l'anteprima, controlla i conti, quindi richiedi esplicitamente la cancellazione. Questo cancella l'intera cronologia selezionata per la chiave API, senza data, telefono o filtri di messaggio.

Parameters

NomeTypeRequirementDescription
apikey string Facoltativo Richiesto senza OAuth2. Con OAuth2, seleziona in modo facoltativo una chiave API appartenente allo stesso account.
action preview | delete | status Facoltativo preview conta senza eliminare; delete avvia o prosegue l’eliminazione; status consulta l’avanzamento senza proseguire. L’API usa delete come valore predefinito; questo strumento usa preview.
include_linked 0 | 1 Facoltativo Default 0: mantenere i record di connessione o di elaborazione. Impostare 1 per includerli, con il rischio di rompere le integrazioni. Mantenere questo valore invariato quando si continua a una cancellazione.
request_id string Facoltativo Obbligatorio per delete e status, facoltativo per preview. Usare da 16 a 128 lettere ASCII, cifre, trattini (-) o trattini bassi (_). Generare un ID univoco per ogni nuova eliminazione e conservarlo per tutti i tentativi. Non è l’ID di un messaggio né una chiave API.

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"
Esempi di cancellazione e stato

Sostituire il campione request_id con il proprio valore unico prima di iniziare. Le seguenti richieste di cancellazione cambiano la cronologia del conto reale; non sono anteprime.

POST · API chiave
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"
Stato di GET ·
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
  • L'esempio sopra è un'anteprima, non una cancellazione. I conti sono illustrativi; la selezione definitiva è fissata quando la cancellazione inizia.
  • include_linked=1 può interrompere GHL, Zapier, automazione, unsubscribe link o il monitoraggio della consegna. Non bypassa mai la proprietà dell'account o i controlli di integrità di archiviazione.

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.