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

Skip to content
API Integration GuideWorkflow + HTTP Request

Give your AI agent a real messaging line

AI receptionists, sales agents, support agents, and appointment agents all hit the same wall: the model can decide what to say, but it still needs a real, managed channel to say it on — and a way to hear the customer's answer. SendiMessage is that channel.

The loop is simple: your application decides a customer should be contacted and calls POST /send-message. The message goes out on your dedicated managed line — iMessage where supported, SMS fallback where configured. When the customer replies, the receive webhook delivers the event to your application, your agent generates the next response, and the conversation continues — every turn is one API call plus one webhook.

SendiMessage is the communications infrastructure in this architecture, not the intelligence. Your agent's reasoning, guardrails, and hand-off-to-human logic live in your application; SendiMessage provides the lines, delivery, incoming messages, conversation history, and a team inbox where a person can take over the thread.

What this integration enables

AI lead follow-up
A lead arrives, your agent decides to reach out, and POST /send-message starts the conversation.
AI receptionist / appointment agent
Bookings, confirmations, and reschedules negotiated over the customer's native messaging app.
AI support agent
Replies arrive as receive events; your agent answers, and unresolved threads escalate to the team inbox.
Conversation memory
GET /conversations and GET /v2/messages give your agent the full thread history as context.
Human handoff
The dashboard and team inbox show the same conversation, so a person can take over at any point.
Delivery awareness
outbound events tell your agent whether the message actually went out (SENT or ERROR) before it plans the next step.

Architecture

How it fits together: Lead or trigger event, then Your AI agent decides, then SendiMessage API, then Managed messaging line, then Customer replies, then Signed receive webhook, then Agent generates the next turn.
  1. Lead or trigger eventA customer submits a form, books a call, or goes quiet — your application notices
  2. Your AI agent decidesYour application (and its model) chooses whether and what to send
  3. SendiMessage APIPOST /send-message — the message is validated and queued on your line
  4. Managed messaging lineDelivery over iMessage where supported, SMS fallback where configured
  5. Customer repliesThe answer arrives on the same line and thread
  6. Signed receive webhookSendiMessage posts the reply event to your endpoint (verify X-SMSBridge-Signature)
  7. Agent generates the next turnYour application builds context from the thread and calls POST /send-message again

Example request

cURL
curl -sS https://api.sendimessage.com/v1/send-message \
-H "X-API-Key: $SENDIMESSAGE_API_KEY" \
-H "X-API-Secret: $SENDIMESSAGE_API_SECRET" \
-H "Content-Type: application/json" \
-d '{
"number": "+15555550123",
"content": "Your appointment is tomorrow at 10:00 AM."
}'
# → {
# "status": "QUEUED",
# "message_handle": "4e828182-a640-483f-bfe9-17ffcaa51d48",
# "to": "+14155550123",
# "service": null,
# "is_outbound": true,
# "error_message": null,
# "date_sent": null
# }

Delivery events and incoming replies

The receive webhook is the agent's ear: verify the signature, look up the conversation, hand the thread to your model, and send the next message. Acknowledge the webhook fast and generate the reply asynchronously.

webhook event
// "outbound" event → your your agent application endpoint
// Verify the X-SMSBridge-Signature header (HMAC-SHA256 of the raw body
// with your webhook secret), then use GET /v2/messages/{message_handle}
// for authoritative state and match it to your conversation in your agent application.

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.
  • Send messages only to recipients who expect them. Transactional and operational messaging is the primary use case — unsolicited bulk marketing is not.
  • SendiMessage does not provide the AI: no model, prompts, or autonomous behavior are included. Your application owns the agent's decisions and safeguards.
  • Lines carry reasonable-use new-conversation limits that protect deliverability — an agent that opens unbounded new threads will hit them; replies within existing conversations are the designed pattern.

Security considerations

  • Keep API credentials in your agent backend's secret store — never in prompts, model context, or client-side code.
  • Verify the X-SMSBridge-Signature header on every webhook before feeding the content to your model.
  • Rate-limit and review what your agent sends: you are responsible for message content and consent.

Frequently asked questions

Does SendiMessage include an AI agent?
No. SendiMessage is the messaging infrastructure — lines, delivery, replies, webhooks, history, and a team inbox. Your application provides the agent and its logic, which means any model or framework that can make HTTP requests works.
How does my agent keep conversation context?
Store the message_handle each send returns, and read the thread back with GET /conversations/{conversation_handle}/messages or GET /v2/messages. Your application decides how much history to hand the model on each turn.
Can a human take over from the agent?
Yes. The same conversation is visible in the dashboard and team inbox, so escalation is an application-level decision — stop generating replies for the thread and let a person answer from the inbox.
Is iMessage guaranteed for agent messages?
No — iMessage delivery depends on the line and the recipient's service. Where it isn't available, SMS fallback applies when configured; webhook events and history rows show what was actually used.

Ready to connect AI Agent Messaging?

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