Create sms

Delivers one transactional SMS through the caller org's own provider credential.

POST /v1/notify/send/sms

Addresshttps://api.hanzo.ai/v1/notify/send/sms
MethodPOST
Operationpost_notify_send_sms
AuthAuthorization: Bearer $HANZO_API_KEY

Delivers one transactional SMS through the caller org's own provider credential.

It is the channel-pinned form of the generic send: identical in every respect except that the channel is fixed to sms, OVERRIDING whatever the body names — so a body that says email still goes out as a text message. The provider is the org's own SMS credential from KMS (Twilio, then Plivo), resolved for the validated principal's org; an unauthenticated caller gets 401.

Request

9 fields, body application/json (required).

FieldInTypeRequiredDescription
bodybodystring—Body is the message text, sent verbatim when present — the no-template path.
channelbodystring—Channel selects the delivery channel, sms or email.
eventbodystring—Event is the event name, which doubles as the template id when TemplateID is empty — the IAM OTP path sends event=iam.otp_sent and nothing else.
providerbodystring—Provider pins a provider service name (twilio, plivo, twilio_email, mail).
subjectbodystring—Subject is the message subject, carried on the email channel only.
syncbodystring—Sync must be exactly "true": delivery here is synchronous, and anything else answers 503 because the queue plane that would run an async dispatch is owned elsewhere.
template_idbodystring—TemplateID selects a built-in template when Body is empty.
template_varsbodyany—TemplateVars carries the values the selected template renders against, as a raw JSON object.
tobodystring[]—To is the destination address per recipient — a phone number for sms, an email address for email.

Response

StatusBodyMeaning
200ok
defaultproblem-detailsrefused

200 body — 1 field.

FieldInTypeAlwaysDescription
(body)bodyanyyes

Failure carries the platform error shape — see Errors.

Examples

hanzo notify send sms
import { Configuration, NotifyApi } from 'hanzoai';

const api = new NotifyApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postNotifySendSms({ body: "<body>", channel: "<channel>" });
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import NotifyApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = NotifyApi(client).post_notify_send_sms(body="<body>", channel="<channel>")
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.NotifyAPI.PostNotifySendSms(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::apis::{configuration::Configuration, notify_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = notify_api::post_notify_send_sms(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.NotifyApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new NotifyApi(client).postNotifySendSms();
curl -X POST https://api.hanzo.ai/v1/notify/send/sms \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "body": "<body>",
       "channel": "<channel>"
     }'

MCP reaches notify through the notify tool, which names its 4 operations with its own verbs — this one among them, under a name only MCP declares. describe explains any of them:

curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "get_notify_health"
         }
       }
     }'

Notify API · All Hanzo APIs · Interactive reference

Was this page useful?