Generation
Generate SMS Messages
Generate SMS message variants from a prompt
POST
/
api
/
v1
/
generate
/
sms
Generate SMS Messages
curl --request POST \
--url https://api.sequenzy.com/api/v1/generate/sms \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>",
"count": 123
}
'import requests
url = "https://api.sequenzy.com/api/v1/generate/sms"
payload = {
"prompt": "<string>",
"count": 123
}
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({prompt: '<string>', count: 123})
};
fetch('https://api.sequenzy.com/api/v1/generate/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.sequenzy.com/api/v1/generate/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([
'prompt' => '<string>',
'count' => 123
]),
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.sequenzy.com/api/v1/generate/sms"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"count\": 123\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.sequenzy.com/api/v1/generate/sms")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"count\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/generate/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 \"prompt\": \"<string>\",\n \"count\": 123\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"prompt": "Cart reminder with a free-shipping hook",
"messages": [
{
"text": "Hey {{FIRST_NAME}}, your cart is waiting! Complete your order today and shipping is on us.",
"encoding": "gsm7",
"segments": 1,
"characterCount": 94
}
]
}
{
"error": "count must be an integer between 1 and 10"
}
{
"error": "Invalid API key"
}
{
"error": "No companies found. Create a company first using the create_company tool."
}
{
"error": "Failed to generate SMS messages"
}
Generate SMS Messages
Generates draft SMS marketing messages with per-message encoding and segment counts. Use a generated message as thetext of an SMS sequence step.
Messages never include opt-out footers or a brand-name prefix - Sequenzy adds both automatically at send time.
Request
Description of the SMS to generate, e.g. “cart reminder with a free-shipping hook”.
Number of variants to generate (1-10). Defaults to
3.curl -X POST "https://api.sequenzy.com/api/v1/generate/sms" \
-H "Authorization: Bearer seq_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Cart reminder with a free-shipping hook",
"count": 3
}'
Responses
{
"success": true,
"prompt": "Cart reminder with a free-shipping hook",
"messages": [
{
"text": "Hey {{FIRST_NAME}}, your cart is waiting! Complete your order today and shipping is on us.",
"encoding": "gsm7",
"segments": 1,
"characterCount": 94
}
]
}
{
"error": "count must be an integer between 1 and 10"
}
{
"error": "Invalid API key"
}
{
"error": "No companies found. Create a company first using the create_company tool."
}
{
"error": "Failed to generate SMS messages"
}
⌘I
Generate SMS Messages
curl --request POST \
--url https://api.sequenzy.com/api/v1/generate/sms \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>",
"count": 123
}
'import requests
url = "https://api.sequenzy.com/api/v1/generate/sms"
payload = {
"prompt": "<string>",
"count": 123
}
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({prompt: '<string>', count: 123})
};
fetch('https://api.sequenzy.com/api/v1/generate/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.sequenzy.com/api/v1/generate/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([
'prompt' => '<string>',
'count' => 123
]),
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.sequenzy.com/api/v1/generate/sms"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"count\": 123\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.sequenzy.com/api/v1/generate/sms")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"count\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/generate/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 \"prompt\": \"<string>\",\n \"count\": 123\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"prompt": "Cart reminder with a free-shipping hook",
"messages": [
{
"text": "Hey {{FIRST_NAME}}, your cart is waiting! Complete your order today and shipping is on us.",
"encoding": "gsm7",
"segments": 1,
"characterCount": 94
}
]
}
{
"error": "count must be an integer between 1 and 10"
}
{
"error": "Invalid API key"
}
{
"error": "No companies found. Create a company first using the create_company tool."
}
{
"error": "Failed to generate SMS messages"
}