We use optional, privacy-safe analytics to understand which pages help visitors. Nothing optional runs until you choose. Privacy policy

Skip to content
Guide AvailableWorkflow + HTTP Request

AI agent workflow library

These are the messaging patterns AI teams build most often. In every one, your application holds the intelligence and SendiMessage is the transport: your agent decides what to send, the API sends it, and the customer's reply returns as a signed webhook.

Each pattern is one POST to send and one webhook to receive. The examples below are real — the same send call and the same signature-verified receive handler, recombined for each workflow.

Request This SetupBook an Integration Review

What this integration enables

1 · AI lead follow-up
A lead arrives → your agent drafts a message → POST /send-message → the customer replies → receive webhook → the agent continues.
2 · Voice AI post-call message
The AI call ends → your backend sends a confirmation or link → the customer replies by text → the workflow continues. See the Voice AI guide.
3 · AI appointment confirmation
A booking is made → send a confirmation → the customer replies to confirm or reschedule → your logic updates the calendar.
4 · Customer reply → AI agent
An inbound reply hits the receive webhook → your app loads thread history (GET /conversations) → the agent generates the next turn → send it.
5 · AI → human handoff
The agent applies a confidence or business rule → below threshold, it stops sending and a person takes over the same thread in the team inbox.

Architecture

How it fits together: Trigger, then Your AI application decides, then SendiMessage API, then Customer, then Signed receive webhook, then Loop or hand off.
  1. TriggerA lead, a call-ended event, a booking, or an inbound reply
  2. Your AI application decidesYour model + guardrails choose whether and what to send
  3. SendiMessage APIPOST /send-message queues the message on your line
  4. CustomeriMessage where supported, SMS fallback where configured; the customer can reply
  5. Signed receive webhookThe reply posts to your endpoint (verify X-SMSBridge-Signature)
  6. Loop or hand offThe agent continues, or a rule routes the thread to a human in the team inbox

Example request

Send (any workflow)
// Your application (not SendiMessage) decides what to say.
const res = await fetch("https://api.sendimessage.com/v1/send-message", {
method: "POST",
headers: {
"X-API-Key": process.env.SENDIMESSAGE_API_KEY,
"X-API-Secret": process.env.SENDIMESSAGE_API_SECRET,
"Content-Type": "application/json",
// Idempotency-Key derived from your own record id keeps a
// retried automation from double-texting the customer.
"Idempotency-Key": callId,
},
body: JSON.stringify({ number: customer.phone, content: agentReply }),
});
const { message_handle } = await res.json(); // store this on your record

Store the message_handle on your record so later events correlate back.

Limitations and honest notes

  • iMessage delivery is available on supported messaging lines and destinations. Recipients without iMessage receive SMS when fallback is configured — never assume universal iMessage availability.
  • Messages are accepted asynchronously — the API returns status QUEUED and final status arrives via webhook or the message endpoints.
  • No official SDK for this ecosystem yet — the example uses plain HTTP against the REST API. Official SDKs are published for JavaScript/TypeScript (npm: sendimessage), Python (PyPI: sendimessage), PHP (Composer: sendimessage/sdk), and Go (github.com/sendimessage/sendimessage-go). Every SDK is dependency-free and covers the full public API surface.
  • SendiMessage does not run your model, choose your AI provider, or make agent decisions — it is the messaging channel only.
  • There is no send-time external_id field; correlate by storing the returned message_handle on your record (or by phone number + line).

Security considerations

  • Do not place SendiMessage API credentials directly in browser code. Send requests through your own server route or backend.
  • Keep your API key server-side, in environment variables or a secrets manager — never in client code, CRM front-end scripts, or repositories.
  • Verify the signature header on every incoming webhook before trusting the event.
  • Scope keys per environment and rotate them if they are ever exposed.

Frequently asked questions

Which AI provider do I need?
Any, or none. SendiMessage is provider-neutral — the AI step in every workflow is your own application. Nothing here mandates a specific model or vendor.
How do I stop automation loops?
Act only on receive events in your webhook handler and ignore outbound/status events, so an outgoing message your automation sent never triggers another send.
Can a human take over mid-conversation?
Yes. The same conversation is visible in the SendiMessage dashboard and team inbox, so a person can step into the thread when your handoff rule fires.

Ready to connect AI Agent Workflows?

Request a messaging line and a SendiMessage integration specialist will review your AI Agent Workflows workflow and guide the setup.