ESC
Type to search across all documentation
POST

/send

Send a single SMS message to a phone number via carrier email gateway. On the free tier the carrier parameter is required. Paid plans route automatically through premium providers.

Endpoint

POST  https://coals.ai/api/v1/simcoal/send

Request Body Parameters

Parameter Type Required Description
to string required Recipient phone number, 10–11 digits, no dashes or spaces (e.g. 5551234567)
message string required The SMS body text. Maximum 1600 characters.
carrier string required (free tier) Carrier code for the recipient (e.g. verizon, tmobile). See carrier reference. Optional on paid plans.

Request Body

{
  "to": "5551234567",
  "carrier": "verizon",
  "message": "Hello from SimCoal!"
}

Response — 200 OK

{
  "success": true,
  "id": "abc123",
  "status": "sent",
  "cost": 0.0075,
  "provider": "email_sms",
  "message": "SMS sent successfully"
}
Field Description
id Unique message identifier. Use with /logs/{id} to retrieve status.
status Delivery state: sent, delivered, or failed.
cost Credit amount deducted for this message.
provider email_sms for carrier gateway routing. Paid plans may show premium.

curl Example

curl -X POST https://coals.ai/api/v1/simcoal/send \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "5551234567",
    "carrier": "verizon",
    "message": "Hello from SimCoal!"
}'
// Using Guzzle
$response = $client->post('https://coals.ai/api/v1/simcoal/send', [
  'headers' => ['Authorization' => 'Bearer YOUR_API_KEY'],
  'json' => [
    "to" => "5551234567",
    "carrier" => "verizon",
    "message" => "Hello from SimCoal!"
]
]);
$data = json_decode($response->getBody(), true);
# Using requests
import requests

response = requests.post(
  "https://coals.ai/api/v1/simcoal/send",
  headers={"Authorization": "Bearer YOUR_API_KEY"},
  json={
    "to": "5551234567",
    "carrier": "verizon",
    "message": "Hello from SimCoal!"
}
)
data = response.json()
# Using net/http
require "net/http"
require "json"

uri = URI("https://coals.ai/api/v1/simcoal/send")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer YOUR_API_KEY"
req["Content-Type"] = "application/json"
req.body = '{
    "to": "5551234567",
    "carrier": "verizon",
    "message": "Hello from SimCoal!"
}'

res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)
// Using fetch (Node 18+)
const response = await fetch("https://coals.ai/api/v1/simcoal/send", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "to": "5551234567",
    "carrier": "verizon",
    "message": "Hello from SimCoal!"
})
});
const data = await response.json();

Messages over 160 characters are delivered as concatenated SMS segments. Carriers may split them into separate messages, which can affect cost and formatting. Keep messages concise where possible.