Give your code a real iPhone.
Send iMessage and SMS from real iPhones over REST. Replies come back as signed webhooks.
Hi Dana, it's Lucia's. A table for two opened up tonight. Want it?
DeliveredD
Is the table still free at 8?
The Starter plan is $0. No credit card required.
Your first call
Send one message.
Set ISNAP_API_KEY, pick a line, and send. A 202 means iSnap accepted the message.
- Your server
Calls POST /v1/messages with a line, a number and a body. - iSnap
Answers 202 and queues it behind the line's limits and quiet hours. - The line's iPhone
Sends iMessage, or SMS when the contact isn't on iMessage. - Your webhook
Hears message.delivered, then the reply as message.received.
npm install @isnap/sdksend-message.ts
import { randomUUID } from 'node:crypto'
import { APIError, ISnapClient } from '@isnap/sdk'
const client = new ISnapClient({ apiKey: process.env.ISNAP_API_KEY ?? '', maxRetries: 2 })
const idempotencyKey = randomUUID() // Store it with your record of the message: reuse it to retry.
try {
const message = await client.messages.send(
{
line_id: 'line_8Xk2mQ4vTn7Bw9Rz3Lc6Yp1Hd',
to: '+14155550123',
body: 'Hello from iSnap'
},
{ idempotencyKey }
)
console.log(message.id, message.status, message.scheduled_for, message.schedule_reason)
} catch (err) {
if (!(err instanceof APIError)) throw err
console.error(err.status, err.code, err.message, `trace_id=${err.traceId}`, `request_id=${err.requestId}`)
process.exitCode = 1
}send-message.sh
IDEMPOTENCY_KEY=$(uuidgen) # Store it with your record of the message: reuse it to retry.
curl -sS https://api.isnap.ai/v1/messages \
-H "Authorization: Bearer $ISNAP_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-d '{
"line_id": "line_8Xk2mQ4vTn7Bw9Rz3Lc6Yp1Hd",
"to": "+14155550123",
"body": "Hello from iSnap"
}'pip install requestssend_message.py
import os
import time
import uuid
import requests
idempotency_key = str(uuid.uuid4()) # Store it with your record of the message: reuse it to retry.
for attempt in range(3):
try:
response = requests.post(
"https://api.isnap.ai/v1/messages",
headers={
"Authorization": f"Bearer {os.environ['ISNAP_API_KEY']}",
"Idempotency-Key": idempotency_key,
},
json={
"line_id": "line_8Xk2mQ4vTn7Bw9Rz3Lc6Yp1Hd",
"to": "+14155550123",
"body": "Hello from iSnap",
},
timeout=30,
)
break
except (requests.ConnectionError, requests.Timeout):
# No response: iSnap may have accepted the message. Retry with the same key, up to 2 times.
if attempt == 2:
raise
time.sleep(2**attempt)
body = response.json()
if response.status_code != 202:
error = body["error"]
raise SystemExit(
f"{error['status']} {error['code']}: {error['message']} "
f"(trace_id={body['trace_id']}, request_id={body['request_id']})"
)
message = body["data"]
print(message["id"], message["status"], message["scheduled_for"], message["schedule_reason"])The API at a glance
One host. One key. JSON.
Every operation sits under one base URL and takes the same Bearer key, from any language.
api.isnap.aiOne host for every key. Call it from a server.
REST · v1Base URLhttps://api.isnap.ai/v1
AuthAuthorization: Bearer isnap_live_…
FormatJSON in and out, snake_case fields
Other languagesPlain HTTPS (the docs show Python)
OpenAPIapi.isnap.ai/openapi.json
Request limit100 requests per 60 s, per network address
Message calls60 sends and lists per 60 s
RetriesIdempotency-Key on 8 write operations
Production notes
Built for retries. Honest about limits.
What your code should expect from the API, as the docs state it.
- Retries that never double-text
Send an Idempotency-Key. A repeat with the same key returns the same message for at least 72 hours. - One error shape
Every error carries a code, a trace_id and a request_id. The SDK throws a typed error for each kind. - Signed webhooks
Standard Webhooks signatures: HMAC-SHA256 over the raw body, refused beyond 300 seconds of clock skew. - At-least-once events
Up to 7 attempts over about 14.5 hours, in no guaranteed order. Dedupe on event_id.
- Held, not dropped
Over a line's sending limit, a message waits in the line's queue for up to 48 hours instead of failing. - Quiet hours by default
A line sends from 08:00 to 20:59 in the recipient's local time. Replies to someone who wrote in the last 24 hours skip them. - No sandbox
An isnap_test_ key uses your real lines and billing and sends real messages. Test on a number you own. - 72-hour retention
iSnap deletes each message at least 72 hours after recording it. Keep the history you need in your own store.
Recipes
Five recipes, real code.
One job per recipe, step by step, with code copied from docs.isnap.ai.
Recipe 01 · 8 min · TypeScript, curl, PythonSend your first iMessage from code.
GET /v1/lines/myPOST /v1/messagesGET /v1/messages/{id}Read the recipeRecipe 02 · 10 min · TypeScript, PythonReceive replies with signed webhooks.POST /v1/webhooksmessage.receivedverifyWebhook()Read the recipeRecipe 03 · 9 min · TypeScript, curlGive your AI agent a natural rhythm.POST /v1/chats/{id}/typingPOST /v1/chats/{id}/readPOST /v1/messages/{id}/reactionsRead the recipeRecipe 04 · 7 min · TypeScript, curlCheck iMessage before you send, and plan for SMS.POST /v1/lookupmessage.fallback_triggeredRead the recipeRecipe 05 · 10 min · TypeScript, curlPair a bring-your-own iPhone line.GET /v1/appsPOST /v1/byod/pairGET /v1/lines/{id}/healthRead the recipeReference · docs.isnap.aiEverything else: every operation, all 37 webhook events and every error code.openapi.jsonllms-full.txtOpen the API referenceThe docs
Go deeper on docs.isnap.ai.
Every docs page is also served as Markdown: add .md to its address, or hand your agent llms-full.txt.
Questions
Developer questions.
Something else? The answer is probably in the docs, or write to support@isnap.ai.
Send your first message.
Start on the $0 Starter plan. No credit card required.