Skip to main content

Send SMS

Sends an SMS text message to a user's configured mobile phone number.

Endpoint

POST /v2/users/send-sms
note

The target user must have a cell phone number and cell carrier configured in their account. If either is missing or the carrier is unsupported, the message will not be delivered.

Request Body

FieldTypeRequiredConstraintsDescription
userIdintegerYesMust be an existing userID of the user to receive the SMS
messagestringYesThe text message content to send
{
"userId": 1042,
"message": "Your ECGrid parcel download is ready."
}

Response

Returns a boolean indicating whether the SMS was successfully submitted for delivery.

{
"success": true,
"data": true
}

ENUMs

The user's cell carrier configuration uses the CellCarrier ENUM. This is set on the user's account, not passed in this request. See Appendix: ENUMs for the full list of supported carriers.

  • CellCarrier — the mobile carrier associated with the user's phone number (e.g., ATTCingular, Verizon, TMobile, SprintPCS)

Code Examples

curl -X POST "https://rest.ecgrid.io/v2/users/send-sms" \
-H "X-API-Key: $ECGRID_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "userId": 1042, "message": "Your ECGrid parcel download is ready." }'

See Also

  • Get User — verify the user's contact details before sending
  • Update Config — configure a user's cell phone number and carrier