Skip to content

textingblue/imessage-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

iMessage API

Send and receive iMessages through a simple REST API. Connect your iPhone, get an API key, and start messaging in minutes.

WebsiteDashboardDocumentationStatus


How it works

  1. Connect your iPhone -- Install the Texting Blue shortcut on your device
  2. Get an API key -- Create one in the dashboard
  3. Send messages -- Use our API or SDKs to send iMessages from your own number

Messages are sent as real iMessages from your iPhone -- blue bubbles, read receipts, and all. Incoming messages are delivered to your server via webhooks in real time.

Quick start

Send a message

curl -X POST https://api.texting.blue/v1/messages/send \
  -H "Content-Type: application/json" \
  -H "x-api-key: tb_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -d '{
    "to": "+14155551234",
    "from": "+14155559876",
    "content": "Hello from the iMessage API!"
  }'

Using an SDK

// Node.js
import TextingBlue from '@textingblue/node';

const client = new TextingBlue('tb_live_xxx');
await client.messages.send({
  to: '+14155551234',
  from: '+14155559876',
  content: 'Hello from the iMessage API!',
});
# Python
from textingblue import TextingBlue

client = TextingBlue("tb_live_xxx")
client.messages.send(
    to="+14155551234",
    from_="+14155559876",
    content="Hello from the iMessage API!",
)
// PHP
$client = new \TextingBlue\TextingBlue('tb_live_xxx');
$client->messages->send([
    'to'      => '+14155551234',
    'from'    => '+14155559876',
    'content' => 'Hello from the iMessage API!',
]);

Receive messages

Register a webhook to get real-time notifications when messages arrive:

curl -X POST https://api.texting.blue/v1/webhooks \
  -H "Content-Type: application/json" \
  -H "x-api-key: tb_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -d '{
    "url": "https://yourapp.com/webhook",
    "events": ["message.received", "message.sent", "message.failed"]
  }'

Your server receives a POST with the event payload:

{
  "id": "evt_xxxxxxxxxxxx",
  "type": "message.received",
  "timestamp": "2026-02-14T12:00:00Z",
  "data": {
    "id": "msg_xxxxxxxxxxxx",
    "from": "+14155551234",
    "to": "+14155559876",
    "content": "Hey, got your message!",
    "media_url": null,
    "received_at": "2026-02-14T12:00:00Z"
  }
}

Official SDKs

Language Package Repository Install
Node.js @textingblue/node textingblue-node npm install @textingblue/node
Python textingblue textingblue-python pip install textingblue
PHP textingblue/textingblue-php textingblue-php composer require textingblue/textingblue-php

All SDKs are zero or minimal dependency, support webhook signature verification, and provide typed error handling.

API overview

Base URL: https://api.texting.blue/v1

Authentication: x-api-key header with your API key (tb_live_xxx)

Endpoints

Method Path Description
Messages
POST /messages/send Send an iMessage
GET /messages List messages (paginated)
GET /messages/:id Get a single message
Numbers
GET /numbers List connected numbers
GET /numbers/:id Get a single number
PUT /numbers/:id Update label or status
DELETE /numbers/:id Remove a number
Webhooks
POST /webhooks Create a webhook
GET /webhooks List webhooks
GET /webhooks/:id Get a single webhook
PUT /webhooks/:id Update a webhook
DELETE /webhooks/:id Delete a webhook

Event types

Event Description
message.received Inbound iMessage received on your number
message.sent Outbound message sent from your iPhone
message.delivered Delivery confirmed
message.failed Message failed to send

API documentation

Detailed documentation with request/response examples for every endpoint:

Guide Description
Authentication API keys, permissions, and base URL
Messages Send, list, and retrieve iMessages
Numbers Manage connected phone numbers
Webhooks Real-time event notifications
Webhook Verification HMAC-SHA256 signature verification
Errors Error format and code reference
Rate Limits Limits per plan and best practices

Plans

Free Starter Pro Enterprise
Monthly messages 100 1,000 10,000 Custom
Phone numbers 1 2 5 Unlimited
Team members 1 3 10 Unlimited
API requests/min 60 300 1,000 5,000
Get started Get started Get started Contact us

Use cases

  • Customer support -- Send and receive iMessages from a shared team inbox
  • Notifications -- Deliver order updates, appointment reminders, and alerts via iMessage
  • Marketing -- Run personalized iMessage campaigns with delivery tracking
  • Automation -- Integrate iMessage into your workflows with n8n, Make, or Zapier
  • Two-way chat -- Build conversational experiences with real-time webhooks

Links

License

MIT -- see LICENSE.

About

Send and receive iMessages through a simple REST API. Connect your iPhone, get an API key, and start messaging in minutes.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages