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

MAIL · 4 documented operations

Email API documentation

Send email without sharing mailbox passwords, retrieve mailbox content and check unsubscribe status.

Connected email and messaging channels synchronized through the cloud
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

Configure a mailbox in the dashboard.

2

Copy both apikey and the mailbox apikeybox.

3

Send a simple text email first.

4

Add attachments or embedded images only after the basic request works.

WEBHOOK V2 FOR THIS API

Subscribe only to the mobile events your workflow needs.

2 event types

One destination can receive everything, or you can separate production systems, analytics and operational alerts. Every event has a precise name so your application can handle it predictably.

email.sent

Email sent

An email sending request was created by SMSMobileAPI.

email.received

Email received

A connected mailbox received an email.

Authentication

Keep credentials on your server

Email endpoints require the account apikey and the mailbox-specific apikeybox. Store both credentials server-side and mask them in application logs.

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-email/" \
  --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-email/" \
  -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-email/" \
  --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": "email",
        "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

Send an email

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

Sends plain-text or HTML email through a configured mailbox.

When to use it

Use it for transactional or operational email from your application.

Parameters

NameTypeRequirementDescription
apikey string Required Your account API key.
apikeybox string Required API key of the configured mailbox.
sender_name string Required Display name of the sender.
sender_email email Required Sender email address.
recipient_email email Required Recipient address.
mail_subject string Required Email subject.
mail_body string Required Plain text or HTML body.
allow_self_signed yes | no Required Set to yes only when the configured mail server uses a trusted internal self-signed certificate.
unsubscribe 1 Optional Adds unsubscribe terms and a link.
email_cc1 email Optional First optional CC recipient.
email_cc2 email Optional Second optional CC recipient.
email_cc3 email Optional Third optional CC recipient.
attachmentBase64 base64 Optional Base64-encoded attachment content.
attachmentBase64_name_1 filename Optional Original attachment file name with extension, for example invoice.pdf. Required when attachmentBase64 has a value.
charset string Optional Character set; default UTF-8.
embeddedImage HTTPS URL Optional Image to embed in the email.
embeddedImage_cid string Optional Content-ID referenced from the HTML body.
format string Optional Requested response format.
reply_name string Optional Reply-to display name.
reply_email email Optional Reply-to address.

Request example

cURL
curl -X POST "https://api.smsmobileapi.com/sendemail/" \
  -d "apikey=YOUR_API_KEY" \
  -d "apikeybox=YOUR_MAILBOX_KEY" \
  --data-urlencode "sender_name=Example Team" \
  -d "sender_email=team@example.com" \
  -d "recipient_email=customer@example.net" \
  --data-urlencode "mail_subject=Order confirmation" \
  --data-urlencode "mail_body=Your order has been confirmed." \
  --data-urlencode "attachmentBase64=BASE64_FILE_CONTENT" \
  -d "attachmentBase64_name_1=invoice.pdf" \
  -d "allow_self_signed=no"

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
  • Prefer POST because email bodies can be long.
  • If attachmentBase64 is provided, attachmentBase64_name_1 is required and must include the file extension.
  • Base64 attachments can make requests large; apply sensible size limits in your application.
GET

Retrieve emails

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

Retrieves messages from a configured mailbox folder.

When to use it

Use it to synchronize inbound email into a help desk or application workflow.

Parameters

NameTypeRequirementDescription
apikey string Required Your account API key.
apikeybox string Required Mailbox API key.
mbox string Required Mailbox folder, for example INBOX.
start integer Required Starting index; use 0 for the first page.

Request example

cURL
curl "https://api.smsmobileapi.com/getemail/?apikey=YOUR_API_KEY&apikeybox=YOUR_MAILBOX_KEY&mbox=INBOX&start=0"

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
  • Responses include available subject, sender, recipient, body, timestamp and attachment details.
GET

Check unsubscribed contacts

#
ENDPOINThttps://api.smsmobileapi.com/email/unsubscribed/

Checks unsubscribe records generated by emails sent through the platform.

When to use it

Use it before sending campaigns and when synchronizing suppression lists.

Parameters

NameTypeRequirementDescription
apikey string Required Your account API key.
apikeybox string Required Mailbox API key.
email email Optional Filter one contact. An empty result means no unsubscribe record was found.

Request example

cURL
curl "https://api.smsmobileapi.com/email/unsubscribed/?apikey=YOUR_API_KEY&apikeybox=YOUR_MAILBOX_KEY&email=customer@example.net"

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 your own recipient database synchronized with unsubscribe results.
  • You remain responsible for applicable anti-spam and privacy rules.
POST · GET

Clear sent email history

#
ENDPOINThttps://api.smsmobileapi.com/delete-history-email/

Clears sent email logs for this API key across mailboxes. It does not delete messages in a mailbox. No apikeybox is required.

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-email/" \
  --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-email/" \
  --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-email/" \
  -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-email/" \
  --data-urlencode "apikey=YOUR_API_KEY" \
  -d "action=status" \
  -d "request_id=6d54ac58-41f1-4fbc-9a39-6e6c86089451"

Example response

JSON
{
    "result": {
        "error": 0,
        "history": "email",
        "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 →