Send a text message
A text message, sent from the company’s registered number. Needs outbound_messages.sms.
curl --request POST \
--url https://api.fluid.app/api/company/v2026-10/messages/sms \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contact_id": "58213",
"message_type": "marketing",
"idempotency_key": "fall-sale-2026-contact-58213",
"text": "Our fall sale starts today: 20% off everything through Sunday. Reply STOP to opt out."
}
'import requests
url = "https://api.fluid.app/api/company/v2026-10/messages/sms"
payload = {
"contact_id": "58213",
"message_type": "marketing",
"idempotency_key": "fall-sale-2026-contact-58213",
"text": "Our fall sale starts today: 20% off everything through Sunday. Reply STOP to opt out."
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contact_id: '58213',
message_type: 'marketing',
idempotency_key: 'fall-sale-2026-contact-58213',
text: 'Our fall sale starts today: 20% off everything through Sunday. Reply STOP to opt out.'
})
};
fetch('https://api.fluid.app/api/company/v2026-10/messages/sms', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fluid.app/api/company/v2026-10/messages/sms",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'contact_id' => '58213',
'message_type' => 'marketing',
'idempotency_key' => 'fall-sale-2026-contact-58213',
'text' => 'Our fall sale starts today: 20% off everything through Sunday. Reply STOP to opt out.'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fluid.app/api/company/v2026-10/messages/sms"
payload := strings.NewReader("{\n \"contact_id\": \"58213\",\n \"message_type\": \"marketing\",\n \"idempotency_key\": \"fall-sale-2026-contact-58213\",\n \"text\": \"Our fall sale starts today: 20% off everything through Sunday. Reply STOP to opt out.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.fluid.app/api/company/v2026-10/messages/sms")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contact_id\": \"58213\",\n \"message_type\": \"marketing\",\n \"idempotency_key\": \"fall-sale-2026-contact-58213\",\n \"text\": \"Our fall sale starts today: 20% off everything through Sunday. Reply STOP to opt out.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/company/v2026-10/messages/sms")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contact_id\": \"58213\",\n \"message_type\": \"marketing\",\n \"idempotency_key\": \"fall-sale-2026-contact-58213\",\n \"text\": \"Our fall sale starts today: 20% off everything through Sunday. Reply STOP to opt out.\"\n}"
response = http.request(request)
puts response.read_body{
"message": {
"id": "019a1130-7e21-7a4b-9c3d-5e6f7a8b9c0d",
"channel": "sms",
"message_type": "marketing",
"status": "delivered",
"refusal_code": null,
"provider": "twilio",
"provider_message_id": "SM4f9e2a7c1b8d3e6f0a5c9b2d7e1f4a8c",
"recipient": {
"member_id": null,
"contact_id": 58213,
"contact_method_id": "0199c2e1-6b7c-7d8e-9f0a-1b2c3d4e5f60"
},
"conversation_id": null,
"created_at": "2026-10-23T14:06:40Z",
"updated_at": "2026-10-23T14:06:47Z",
"events": [
{
"status": "accepted",
"detail": null,
"occurred_at": "2026-10-23T14:06:40Z"
},
{
"status": "sent",
"detail": null,
"occurred_at": "2026-10-23T14:06:41Z"
},
{
"status": "delivered",
"detail": null,
"occurred_at": "2026-10-23T14:06:47Z"
}
],
"send_at": null
},
"status": 200,
"meta": {
"request_uuid": "3b8f1d27-6c4e-4a91-8e5d-2f7c9a1b0e64",
"timestamp": "2026-10-23T14:05:12Z"
}
}Authorizations
An admin session, company API token, droplet token or bot token.
Headers
Use this or idempotency_key in the body.
Body
A text message, sent from the company's registered number.
1 - 1600An email address (email) or an E.164 phone number (sms, whatsapp). Use this or one of the ids.
A contact's id or uuid. Fluid uses the contact's best email or phone for the channel.
A customer's id, as the customers API returns it. Customers and members are the same people.
A member's uuid.
marketing needs the recipient's marketing consent for the channel.
transactional, marketing A key you choose. Sending again with the same key answers with the first message instead of sending twice. You can send it as the Idempotency-Key header instead.
200A marketing message asked for during the recipient's quiet hours (21:00 to 08:00 in their time zone by default) waits and goes out when they end. Pass true to have it refused as quiet_hours with send_at instead.
Response
A repeat of an earlier request with the same idempotency key; the first message is returned and nothing is sent again.
curl --request POST \
--url https://api.fluid.app/api/company/v2026-10/messages/sms \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contact_id": "58213",
"message_type": "marketing",
"idempotency_key": "fall-sale-2026-contact-58213",
"text": "Our fall sale starts today: 20% off everything through Sunday. Reply STOP to opt out."
}
'import requests
url = "https://api.fluid.app/api/company/v2026-10/messages/sms"
payload = {
"contact_id": "58213",
"message_type": "marketing",
"idempotency_key": "fall-sale-2026-contact-58213",
"text": "Our fall sale starts today: 20% off everything through Sunday. Reply STOP to opt out."
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contact_id: '58213',
message_type: 'marketing',
idempotency_key: 'fall-sale-2026-contact-58213',
text: 'Our fall sale starts today: 20% off everything through Sunday. Reply STOP to opt out.'
})
};
fetch('https://api.fluid.app/api/company/v2026-10/messages/sms', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fluid.app/api/company/v2026-10/messages/sms",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'contact_id' => '58213',
'message_type' => 'marketing',
'idempotency_key' => 'fall-sale-2026-contact-58213',
'text' => 'Our fall sale starts today: 20% off everything through Sunday. Reply STOP to opt out.'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fluid.app/api/company/v2026-10/messages/sms"
payload := strings.NewReader("{\n \"contact_id\": \"58213\",\n \"message_type\": \"marketing\",\n \"idempotency_key\": \"fall-sale-2026-contact-58213\",\n \"text\": \"Our fall sale starts today: 20% off everything through Sunday. Reply STOP to opt out.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.fluid.app/api/company/v2026-10/messages/sms")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contact_id\": \"58213\",\n \"message_type\": \"marketing\",\n \"idempotency_key\": \"fall-sale-2026-contact-58213\",\n \"text\": \"Our fall sale starts today: 20% off everything through Sunday. Reply STOP to opt out.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/company/v2026-10/messages/sms")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contact_id\": \"58213\",\n \"message_type\": \"marketing\",\n \"idempotency_key\": \"fall-sale-2026-contact-58213\",\n \"text\": \"Our fall sale starts today: 20% off everything through Sunday. Reply STOP to opt out.\"\n}"
response = http.request(request)
puts response.read_body{
"message": {
"id": "019a1130-7e21-7a4b-9c3d-5e6f7a8b9c0d",
"channel": "sms",
"message_type": "marketing",
"status": "delivered",
"refusal_code": null,
"provider": "twilio",
"provider_message_id": "SM4f9e2a7c1b8d3e6f0a5c9b2d7e1f4a8c",
"recipient": {
"member_id": null,
"contact_id": 58213,
"contact_method_id": "0199c2e1-6b7c-7d8e-9f0a-1b2c3d4e5f60"
},
"conversation_id": null,
"created_at": "2026-10-23T14:06:40Z",
"updated_at": "2026-10-23T14:06:47Z",
"events": [
{
"status": "accepted",
"detail": null,
"occurred_at": "2026-10-23T14:06:40Z"
},
{
"status": "sent",
"detail": null,
"occurred_at": "2026-10-23T14:06:41Z"
},
{
"status": "delivered",
"detail": null,
"occurred_at": "2026-10-23T14:06:47Z"
}
],
"send_at": null
},
"status": 200,
"meta": {
"request_uuid": "3b8f1d27-6c4e-4a91-8e5d-2f7c9a1b0e64",
"timestamp": "2026-10-23T14:05:12Z"
}
}