Example AvailableDirect HTTP API
Send messages from Ruby with the SendiMessage API
Ruby's standard Net::HTTP is enough for SendiMessage — no gem required. The example raises on non-2xx responses and parses the queued message.
In a Rails app, call the same code from a job or a model callback; the Ruby on Rails page shows the framework-flavored version.
What this integration enables
Transactional notifications
Order confirmations, payment receipts, and status changes triggered by your backend.
Appointment reminders
Scheduled jobs that message customers before a booking.
Operational alerts
Delivery windows, service updates, and internal notifications.
Two-way conversations
Incoming replies arrive on your webhook endpoint for routing to support or sales.
Architecture
- Your application eventAn order ships, a booking nears, a ticket updates
- Ruby server codeBuilds the request with credentials from the environment
- SendiMessage APIPOST /send-message returns the queued message
- Managed messaging lineSMS, or iMessage on supported lines and destinations
- Webhook eventsDelivery status and incoming replies post back to your endpoint
Example request
require "net/http"require "json"def send_message(to, text)uri = URI("https://api.sendimessage.com/v1/send-message")req = Net::HTTP::Post.new(uri, {"X-API-Key" => ENV.fetch("SENDIMESSAGE_KEY"),"X-API-Secret" => ENV.fetch("SENDIMESSAGE_SECRET"),"Content-Type" => "application/json",})req.body = { number: to, content: text }.to_jsonres = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }raise "SendiMessage error #{res.code}: #{res.body}" unless res.is_a?(Net::HTTPSuccess)JSON.parse(res.body) # {"message_handle" => "4e828182-…", "status" => "QUEUED", …}endmessage = send_message("+15555550123", "Hello from SendiMessage")puts "#{message["message_handle"]} #{message["status"]}"
Delivery events and incoming replies
Delivery status and incoming replies arrive as signed webhook events. Verify the signature, then correlate events with your own records via the message_handle returned when you sent.
// "outbound" event → your ruby endpoint// Verify the SendiMessage-Signature header (t={timestamp},v1=HMAC-SHA256 of// "{timestamp}.{raw body}", keyed with your webhook secret), then use// GET /v2/messages/{message_handle} for authoritative state and match it to// your contact_id in ruby.
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.
Security considerations
- Load the API key pair from the environment — never commit it or embed it in client-side code.
- Verify webhook signatures before processing events.
- Log message handles, not message bodies, in shared logs.
Frequently asked questions
Is there an official Ruby SDK for SendiMessage?
Not yet for Ruby. The SendiMessage API is a plain JSON-over-HTTPS REST API, so the standard HTTP client of your ecosystem is all you need — the example on this page is complete. Official SDKs are published for JavaScript/TypeScript, Python, PHP, and Go.
What does the API return when I send a message?
The API accepts messages asynchronously and responds with status "QUEUED" plus a message_handle and the line_handle it will send from. Track final delivery via GET /status, the message history endpoints, or webhook events.
Can I send iMessage from Ruby?
SendiMessage delivers over iMessage where the destination supports it on your managed line, and falls back to SMS when fallback is configured. iMessage is never guaranteed for every recipient.
Related integrations
Ruby on RailsExample Available
FrameworksActiveJob-friendly service + webhook controller.Appointment Reminder MessagingAPI Integration Guide
Use CasesConnect scheduling systems to reminders that actually arrive.cURLAvailable
LanguagesThe reference request — copy, set your key, and send.JavaScriptAvailable
LanguagesOfficial npm SDK — zero dependencies, full API coverage.TypeScriptAvailable
LanguagesOfficial SDK with full TypeScript definitions included.Node.jsAvailable
LanguagesOfficial SDK on Node 18+, including the media upload flow.Ready to connect Ruby?
Request a messaging line and a SendiMessage integration specialist will review your Ruby workflow and guide the setup.