Send a text message (SMS) or a picture message (MMS) to a record from one of your Shape phone numbers.
POSThttps://secure-api.setshape.com/api/lead/send-sms/{crmid}
Replace
{crmid} with your CRM ID, the Shape system ID that belongs to your API key. Send the standard headers: Authorization: YOUR_API_AUTHORIZATION_KEY and Content-Type: application/json. See Authentication.The message is sent from the Shape phone number you choose and appears in the record’s communication history in Shape.
Body parameters
| Field | Type | Required | Description |
|---|---|---|---|
lead_id |
string or integer | Required | The ID of the record to send the message to. |
sendFrom |
string | Required | The Shape phone number to send from. It must be a number set up for texting in your system. |
type |
string | Required | sms for a text message, or mms for a message with attachments. |
messageContent |
string | Required | The text of the message. |
media_urls |
list | For MMS | One or more links to the images or files to attach. Each link must be publicly reachable so the message can be delivered. |
SMS and MMS compared
| SMS | MMS | |
|---|---|---|
type |
sms |
mms |
| Text | Yes | Yes |
| Attachments | No | Yes, with media_urls |
Example: send an SMS
curl --request POST \
--url "https://secure-api.setshape.com/api/lead/send-sms/YOUR_CRM_ID" \
--header "Authorization: YOUR_API_AUTHORIZATION_KEY" \
--header "Content-Type: application/json" \
--data '{
"lead_id": "281944",
"sendFrom": "5550100200",
"type": "sms",
"messageContent": "Hi Jordan, thanks for reaching out. When is a good time to talk?"
}'
Example: send an MMS
{
"lead_id": "281944",
"sendFrom": "5550100200",
"type": "mms",
"messageContent": "Here's the flyer we talked about.",
"media_urls": [
"https://example.com/files/open-house-flyer.jpg",
"https://example.com/files/rate-sheet.png"
]
}
Successful response
{
"message": "Messages Sent!",
"messageUUIDs": [
"36b17e5e-d11c-48f4-8938-9576e2d74940"
]
}
| Field | Description |
|---|---|
message |
Confirms the message was sent. |
messageUUIDs |
The ID of each message sent. Save these if you need to track or audit individual messages. |
Good practice
- Keep your API key on your server. Never put it in a web page, mobile app or public code.
- Send from a number that’s set up for texting in your system.
- Make sure every
media_urlslink can be opened without signing in. - Store the
messageUUIDsfrom each response if you need message-level tracking.