Twilio Outgoing Message

From docs
Revision as of 05:25, 21 July 2026 by Ashley DeBon (talk | contribs) (Successful Response (200))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Mobile_API »Send SMS

Base URL

https://apimobile.callproof.com

Endpoint

/api/send-sms

Purpose

Sends an SMS (and optional media) from the authenticated user’s configured Twilio messaging number to a contact phone number. The message is stored and related activity is recorded for the contact.

HTTP Method

POST

Headers

Header Required Description
Authorization Yes Bearer access token

Security

  • Yes – Requires Bearer Token authentication.

Parameters

Path Parameters

None.

Query Parameters

None.

Request Body

Parameter Type Required Description
message string Yes SMS text to send (maximum 140 characters)
contact_phone_number string Yes Destination phone number (exactly 10 digits)
contact_id integer/string Yes Unique identifier of the contact that owns the phone number
media_url string No Optional media URL to include with the message (MMS)

cURL Example for Android

 curl --location 'https://apimobile.callproof.com/api/send-sms' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "message": "YOUR_MESSAGE_TEXT", "contact_phone_number": "1234567890", "contact_id": "YOUR_CONTACT_ID", "media_url": "" }' 

cURL Example for iOS

 curl --location 'https://apimobile.callproof.com/api/send-sms' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "message": "YOUR_MESSAGE_TEXT", "contact_phone_number": "1234567890", "contact_id": "YOUR_CONTACT_ID", "media_url": "" }' 

Successful Response (200)

Indicates that the SMS was sent successfully.

Field Type Description
clientStatusCode integer Status indicator for the client (for example, 200)
user_id integer Identifier of the authenticated user
company_id integer Identifier of the authenticated user’s company
message string Confirmation message (for example, "SMS has been sent successfully.")
uri string Requested resource URI

Error Responses

Status Code Meaning
200 Validation or business-rule failure – response body uses clientStatusCode 401 (validation) or 400 (business errors such as missing contact/Twilio number)
400 Bad Request – the SMS could not be sent
401 Unauthorized – missing, invalid, or expired Bearer token
  • Validation (HTTP 200, clientStatusCode 401) – Missing/invalid message, contact_phone_number, or contact_id (including message longer than 140 characters, or phone not exactly 10 digits).
  • 400 – Contact phone not found ("Contact not found"), Twilio messaging number not configured ("Twilio number not found"), Twilio provider error message, or another send failure (for example, "Error while sending message").
  • 401 – Authentication failed or the access token is missing/expired.

Notes

  • The user must have a valid messaging caller ID (Twilio number) configured.
  • The destination number must exist as a contact phone for the given contact and company.