Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.clearline.me/llms.txt

Use this file to discover all available pages before exploring further.

Overview

The SMS API allows you to send SMS messages and optionally receive real-time delivery status updates by providing a callback URL with each request.

Authentication

Every request must include your API key in the ApiKey header.
HeaderValue
ApiKeyYour secret API key
Keep your API key secure. Never expose it in client-side code or public repositories.

Send SMS Message

POST /MessageSender/sms

Base URL: https://api.clearline.me Sends an SMS message to the specified phone number. Optionally provide a callbackUrl to receive a delivery status notification when the message is delivered.

Request Headers

HeaderRequiredDescription
ApiKeyYesThe API key used for authenticating requests
Content-TypeYesapplication/json

Request Body

{
  "phone": "string",
  "message": "string",
  "callbackUrl": "string"
}
FieldTypeRequiredDescription
phonestringYesRecipient phone number in E.164 format (e.g. +12025551234)
messagestringYesThe text content of the SMS message
callbackUrlstringNoYour HTTPS endpoint that will receive the delivery status notification

Example Request

POST /MessageSender/sms HTTP/1.1
Host: apistage.clearline.me
ApiKey: your-api-key-here
Content-Type: application/json

{
  "phone": "+12025551234",
  "message": "Hello! Your order is ready for pickup.",
  "callbackUrl": "https://yourapp.example.com/webhooks/sms-delivery"
}

Response

{
  "succeed": true,
  "messageId": "string"
}
FieldTypeDescription
succeedbooleantrue when the message was accepted for sending
messageIdstringUnique identifier of the queued message

Delivery Status Callback

When a callbackUrl is provided in the send request, Clearline will call that URL with a POST request once the delivery status is available from the SMS gateway.

Request your callback URL will receive

POST {callbackUrl} HTTP/1.1
Content-Type: application/json

{
  "messageId": "string",
  "deliveryStatus": "string",
  "externalDeliveryStatus": "string",
  "reasonText": "string"
}
FieldTypeDescription
messageIdstringMatches the messageId returned by the send call
deliveryStatusstringFinal resolved delivery status (e.g. Delivered, DeliveredFailed)
externalDeliveryStatusstringRaw delivery status from the SMS gateway (e.g. Delivered, Failed, Expired, Rejected)
reasonTextstringHuman-readable delivery result description provided by the SMS gateway

Delivery Status Values

statusMeaning
DeliveredMessage was successfully delivered
DeliveredFailedMessage was not delivered

Expected Response

Your endpoint must return HTTP 200 OK to acknowledge receipt. Any other status code will be treated as a failed delivery.

Environments

EnvironmentBase URL
Staginghttps://apistage.clearline.me
Productionhttps://api.clearline.me
\