Skip to main content
In about ten minutes you’ll send a real iMessage from your iBubbl line to your own phone, check that it was delivered, and get your reply pushed to your server. Before you start
  • An iBubbl account with an active line. iBubbl sets up and runs the line for you; you don’t connect a Mac or an Apple ID. Sign up if you haven’t.
  • Your own mobile number, to send the first messages to.
Every request is live. There is no sandbox or test mode, and no test line: each send delivers a real message from your line. Send only to your own phone while you test.
1

Create an API key

In the dashboard, open Settings → API Access and click Create key. Copy the key (ib_pk_ followed by 64 hex characters); this is the only time the full key is shown.Keep it in an environment variable rather than in your code. The examples on this page read it from IBUBBL_API_KEY:
See Authentication for rotation and security practices.
2

Send a message to your own phone

Put your own mobile number in to.
The response is 202 Accepted:
Save the id; you’ll use it in the next step.
202 means accepted, not delivered. iBubbl has taken the message and will send it from your line; it hasn’t reached the phone yet. Track it with the next step or with webhooks.
idempotency_key is required. Use a new one for each message, and send the same key and the same payload again if a request times out or fails with a 5xx: iBubbl returns the original message instead of sending twice. See Idempotency.
to must be in E.164 format: +, the country code, then the number, with no spaces or punctuation (+14155551234). Anything else returns 422 validation_error.
3

Check the status

Fetch the message by its id:
Once your phone has it, status is delivered (or read, if you have read receipts on), and channel says how it went out: imessage, or sms when your number couldn’t be reached on iMessage.
Outside sending hours, the message waits. iBubbl only sends during each contact’s sending hours (by default Monday to Saturday 9 AM–8 PM, Sunday 12–8 PM, in the contact’s timezone). If you’re outside them, the message stays pending with held_reason: "working_hours", and held_until says when it will go out. That’s expected, not an error.
In production, don’t poll: subscribe to webhooks, as in the next step.
4

Receive a reply

Register an HTTPS endpoint you control that logs the request body, subscribed to message.inbound. To test from your laptop, expose a local server with a tunnel such as cloudflared tunnel --url http://localhost:8000 or ngrok http 8000, and use the HTTPS URL it prints.
The 201 Created response includes the signing secret (whsec_…). It is shown only once: store it, because you’ll need it to verify signatures.Now reply to the message on your phone. Your endpoint receives a POST like this:
Return any 2xx within 10 seconds, or iBubbl retries the delivery.
Before you go live: verify the X-iBubbl-Signature header on every request (Signature verification), de-duplicate on the event id, and only ever send automatically in response to message.inbound. Sending in response to message.sent or another status event of your own messages makes a loop.
Subscriptions can’t be edited. When you’re done testing, revoke this one with DELETE /v1/webhooks/{subscription_id} and create your production subscription.

Next steps

Webhook events

Every event type and its payload.

Send messages

All four ways to address a message, including groups.

Receive messages

Replies, attachments, opt-outs, and an auto-reply that can’t loop.

Errors

Every error code, and which ones to retry.

Build with AI

Hand these docs and a ready-made system prompt to your coding agent.