OAuth for iCloud developer guide

Self-Hosted or Managed iMessage Connections

Self-host if you already run a Mac, need data on-premises, or build personal tooling. Choose managed ($29/month per connected Apple Account, free sandbox) for multi-user products or when you lack Mac ops capacity.

Figment editorial teamPublished Updated Facts checked November 12, 2026

Self-host an iMessage bridge if you already operate a Mac, need data on your own hardware, or are building personal tooling. Choose a managed connection if you are building a multi-user product or have no capacity to run Macs. Managed pricing with OAuth for iCloud is $29 per month per connected Apple Account, and the sandbox is free. There is no official Apple iMessage API. Apple's documented third-party iCloud authorization covers Mail, Calendar, and Contacts, not iMessage, so every integration routes through a Mac running the native Messages app. The question is who owns that Mac and everything attached to it.

Self-hosted means you buy or rent the hardware, keep macOS current, configure the network, maintain the bridge software, and handle reconnection whenever Apple's session expires or the hardware fails.

Managed means a provider handles that infrastructure layer. You wire up an API after a user-consent flow and own the application logic, and nothing below it.

What does running your own bridge demand?

A self-run bridge is software on a Mac that reads the Messages database and sends through the Messages app.

It needs a Mac with iMessage already activated, and it polls chat.db for new messages. Deeper integration means private framework calls in Objective-C, which add maintenance.

The Mac must stay powered and online around the clock with sleep disabled. Remote access means forwarding a port on your router or running a relay, and macOS asks for an explicit Automation permission before any app can control Messages.

Either way, the Mac is a single point of failure. When it restarts, loses connectivity, or Apple refreshes the iMessage session, your integration goes offline until someone fixes it. You also keep bridge versions current, rotate credentials when an Apple Account changes, and monitor uptime across the bridge, the forwarded port, and any relay service.

How does a managed connection work?

In a managed model the provider runs the Mac infrastructure, and you configure the application-level integration.

With Figment, a user approves access through Figment's hosted consent screen, producing a scoped grant for your application. Your app receives a Figment access token and never sees the user's Apple password. iMessage history and search both use messages:read. Sending needs a separate messages:send scope and is limited to conversations the user explicitly authorizes.

Messages is part of the Full iCloud suite, which costs $29 per month per connected Apple Account. Sandbox access is free and uses synthetic data that cannot reach real recipients. For live access, request a demo.

Connections move through a defined lifecycle: connecting, needs_approval, syncing, ready, offline, reconnect_required, revoked. Read and send operations are rejected on any non-ready connection, and syncing is not a partial-success state. Even at ready, native history may be incomplete, so check historyComplete and hasMore in responses rather than assuming full coverage.

For the full OAuth flow, see OAuth for iCloud: Connect Apple Data to Your App.

Who is responsible for what?

This table shows who owns each infrastructure and product layer.

ResponsibilitySelf-HostedManaged (Figment)
Mac hardware procurementDeveloperProvider
macOS version & security updatesDeveloperProvider
iMessage account activationDeveloperAccount owner (via setup flow)
Network relay / port forwardingDeveloperProvider
Bridge software installation & updatesDeveloperProvider
Infrastructure reconnection monitoringDeveloperProvider
Apple account re-authentication†DeveloperAccount owner
API authentication & token lifecycleDeveloperProvider
Per-user consent & scoped grantsDeveloper (custom build)Built-in
Idempotency & delivery receiptsDeveloper (custom build)Built-in
Uptime monitoringDeveloperProvider
Application logicDeveloperDeveloper

† When a connection enters reconnect_required or needs_approval, the account owner must complete Apple sign-in or trusted-device approval again. The provider monitors connection state and surfaces these statuses, but it cannot perform Apple authentication on the account owner's behalf.

Application logic is the only row that never moves. Everything else either transfers to the provider or shifts to the account owner in the managed model.

Which should I choose?

Self-host for personal tooling, on-premises data or an existing Mac; choose managed for a multi-user product. The reasons follow.

Self-hosting fits when:

  • You already operate a Mac fleet. If a dedicated Mac is already on the shelf, the marginal cost of running a bridge is low.
  • Data must stay on-premises. Some regulated environments restrict cloud-hosted message proxies, and a bridge on internal hardware may satisfy that in ways a managed provider cannot.
  • Single-user personal tooling. A personal automation that reads your own iMessages rarely justifies a monthly connection fee or a production-grade consent flow.
  • Budget is the binding constraint. Open-source bridge software is free. If occasional reconnection interruptions are acceptable, the cost is time rather than money.

Managed fits when the product grows beyond a single developer or account:

  • Multi-user products. Per-user consent and scoped grants, essential for any iMessage CRM, AI agent, or team inbox, are built into the managed flow. Self-hosting means designing and building that layer yourself.
  • No Mac ops capacity. A team without macOS infrastructure experience should not spend engineering weeks building and maintaining one.
  • Idempotency and receipts included. A send accepted at the bridge is not proof of delivery. Managed providers supply receipt tracking and idempotency enforcement so your application does not implement them itself.
  • Lower setup burden. Managed setup needs no Mac procurement, network configuration, or bridge installation. You can reach the free sandbox through developer registration and a consent flow, and you request a demo for live access.

For the full cost and staffing trade-off, see Build or Buy Your iMessage Connection Service.

How do I migrate from a self-hosted bridge?

Work through these steps before you cut over. This is a planning checklist based on the supplied API specification, so complete sandbox validation before switching any production traffic.

  1. Inventory your current bridge. Record the bridge software name and version, macOS version, relay or port-forwarding configuration, and every webhook URL your existing integrations call.
  2. Register on the Figment developer dashboard at /icloud/developers and note your client_id.
  3. Run sandbox tests first. Sandbox is free and uses synthetic data. Exercise GET /v1/connections/{connection_id}/chats and POST /v1/connections/{connection_id}/messages/send before touching any live connection.
  4. Check the chatGuid format. ChatGuids returned by the Figment API are specific to the connected Mac and are not portable from your existing bridge. Update any hard-coded values.
  5. Audit your idempotency key strategy. Generate one key per intended action before the first request, and reuse it only for that exact action and body. A body-hash strategy can silently merge two separately intended identical messages.
  6. Confirm scope coverage. Ensure messages:send is included in the user grant for every conversation you need to write to. A conversation visible in read results is not automatically authorized for sends.
  7. Run the old bridge and new connection in parallel for a brief test period. Compare read results and note any history gaps from sync lag on the new connection.
  8. Cut over reads first. Redirect history and search calls to the Figment endpoints, and check historyComplete and hasMore before assuming complete coverage.
  9. Cut over sends. Migrate send calls last. Verify receipt status (submitted, delivered, read, failed, or unknown) before you retire the old bridge send path. Do not resend an unknown action under a new idempotency key.
  10. Decommission the bridge. Remove port-forwarding rules, revoke bridge automation permissions in macOS System Settings, and free the hardware.

To try without committing to a live connection, Connect Apple Account and start in the free sandbox.

Connect Apple data to your app

Register your app and start with synthetic sandbox data. Choose the permissions your app needs.

Connect Apple Account

Sandbox is free. Live access is $14 or $29 per connected Apple Account, per month.