For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Request featuresContact support
DocsAPI ReferenceGraphQLIntegrationsDeveloper Tools
DocsAPI ReferenceGraphQLIntegrationsDeveloper Tools
    • Getting started
  • Authentication
    • Application tokens
    • User credentials
    • Multi-factor authentication
    • JWTs
  • Work with the API
    • Conventions
    • Rate limits
    • Collections and pagination
    • Concatenated SMS
    • User management
    • Error handling
  • Connectivity
    • Register SIMs
    • Create endpoints
    • Manage devices
    • Configure DNS settings
    • Factory test mode
    • SMS operations
    • Advanced eSIM
  • Callbacks
    • API
    • SMS
  • Examples
    • Endpoint toggle (JS)
    • Device status (JS)
    • curl
  • Reference
    • Data Streamer
    • Events
    • IMSI
    • SIM
    • Endpoint
    • Service profile
    • Organization
    • Tariff plan
    • Tariff profile
LogoLogo
Request featuresContact support
Connectivity

SMS operations

Was this page helpful?

Last updated September 26, 2024

Previous

Factory test mode

Next

Advanced eSIM

Built with

You can perform the following SMS-related operations using the endpoint API:

  • List sent and received SMS
    GET
    /api/v1/endpoint/:endpoint_id/sms
    1curl https://cdn.emnify.net/api/v1/endpoint/endpoint_id/sms \
    2 -H "Authorization: Bearer <token>"
    Try it
  • Send SMS to a device
    POST
    /api/v1/endpoint/:endpoint_id/sms
    1curl -X POST https://cdn.emnify.net/api/v1/endpoint/12345/sms \
    2 -H "Authorization: Bearer <token>" \
    3 -H "Content-Type: application/json" \
    4 -d '{
    5 "payload": "This is the message text",
    6 "source_address": "12345689"
    7}'
    Try it
  • Get details about a device SMS
    GET
    /api/v1/endpoint/:endpoint_id/sms/:sms_id
    1curl https://cdn.emnify.net/api/v1/endpoint/endpoint_id/sms/sms_id \
    2 -H "Authorization: Bearer <token>"
    Try it
  • Cancel a buffered SMS
    DELETE
    /api/v1/endpoint/:endpoint_id/sms/:sms_id
    1curl -X DELETE https://cdn.emnify.net/api/v1/endpoint/endpoint_id/sms/sms_id \
    2 -H "Authorization: Bearer <token>"
    Try it

Example

To send SMS directly from your application to a device, make the following API call: POST https://cdn.emnify.net/api/v1/endpoint/{endpoint_id}/sms

The required headers are Content-Type and Authorization with the respective values application/json and Bearer TOKEN. Replace TOKEN with your auth_token and make sure there’s a non-breaking space between Bearer and the token value.

Request body for Mobile terminated (MT) SMS:

1{
2 "source_address": 12345,
3 "payload": "This is the message text"
4}

Successful response:

1201

The source address is the sender number that appears on the receiving device. The payload is the actual text sent as an SMS.

To receive SMS on your application from the device, you need to first set up a callback URL in the service profile assigned to the device. For more information, see Receive MO SMS via API Callback.