OAuth for iCloud developer guide

Connect an Apple Account and Check Each Service

Connecting the account is one OAuth flow, but each service has its own state. Wait for `ready` on every service your app uses, because a signed-in account does not mean a ready service.

Figment editorial teamPublished Updated Facts checked November 12, 2026

Connecting an Apple Account to Figment is one OAuth flow, but each service then reaches ready on its own. iMessage, Contacts, Calendar, and Reminders each have their own Apple-side approval, sync, and Mac permission sequence. Check each service's state before your app makes requests against it, because a signed-in account does not automatically mean a ready service. For the developer overview, see OAuth for iCloud.

What states can a service be in?

Figment tracks a state for every service on a connection. The state appears in the connection.services map returned by GET /v1/connections/{connection_id}.

StateMeaning
connectingInitial setup in progress
needs_approvalA user action is required before this service can proceed
syncingThe service is active but local data is still downloading
readyThe service is available for requests within your granted scopes
offlineThe Mac worker has lost contact; most cases recover automatically
reconnect_requiredThe user must re-authorize part of the connection
revokedThe user removed access; will not recover without a new grant

Non-ready services reject operations, and a service in syncing is not yet ready, so reads will fail. Check state at the start of each session, not only at connection time.

How do I connect an Apple Account?

Register your app first to get a client_id and to set your exact HTTPS redirect URI. The sandbox is free. Live plans are $14 or $29 per month per connected Apple Account, and you request a demo for live access.

  1. Build an authorization URL to https://figment.so/icloud/authorize. Include client_id, your exact redirect_uri, response_type=code, the scopes you need, a state value, and a fresh PKCE code_challenge with code_challenge_method=S256.
  2. Redirect the user to that URL. Figment's hosted screen signs the user into Figment and presents the app-consent step, where the user selects an Apple Account connection and approves the requested scopes. Apple sign-in and trusted-device approval on the Mac are part of connection setup and happen before the OAuth grant is issued. All codes and tokens are issued by Figment, not Apple.
  3. Figment redirects to your redirect_uri with code and state. Verify state matches before continuing.
  4. Exchange the code at POST https://figment.so/api/icloud/oauth/token with grant_type=authorization_code, client_id, redirect_uri, code, and code_verifier as application/x-www-form-urlencoded.
  5. The response includes access_token, refresh_token, expires_in, scope, and connection_id. Store the connection_id, which identifies this Apple connection in every later API call. Access tokens expire after 900 seconds. Refresh using grant_type=refresh_token with client_id and refresh_token, and store the rotated refresh token. Your app never receives the Apple password.

What should I check for each service the first time?

The table covers the services with a public customer endpoint. After the OAuth flow, confirm each service your app depends on reaches ready before you make data requests.

ServiceAvailabilityApple-side requirementFirst-time note
iMessageLive: requires account setup and approval; live access depends on capacityTrusted-device approval; Messages in iCloud enabled on iPhone and MacHistory can be incomplete even when ready; check historyComplete on list responses (Apple guide)
SMS / MMS / RCSLive: same connection as iMessageiPhone must be on, online, and signed into the same Apple AccountMessages in iCloud includes SMS, MMS, and RCS automatically; a separate forwarding switch is not required when Messages in iCloud is enabled (Apple guide)
ContactsSynthetic sandbox only; live access unavailableNoneSandbox returns invented data; every response includes "scope": "synthetic sandbox data"
CalendarSynthetic sandbox only; live access unavailableSupply both start and end ISO timestamps; range must not exceed 366 daysSandbox calendar items are synthetic; end must follow start
Remindersreminders:read scope in the Full iCloud suite; synthetic data in the sandboxNonecompleted defaults to false; pass completed=true to include completed items

Passwords and Notes are also OAuth for iCloud scopes (credentials:use and notes:read; see /icloud). Other Apple services (Mail, Photos, iCloud Drive, Safari, Voice Memos, Find My, Home, Shortcuts, and Books) sync locally on the connected Mac but have no public Figment customer endpoint. Figment does not currently expose a customer API for them.

How do I check status with the API?

After the OAuth exchange you have a connection_id. Fetch the connection to read per-service state:

GET https://figment.so/api/icloud/v1/connections/con_...
Authorization: Bearer ACCESS_TOKEN

Each entry in connection.services is an object with state, reason, and observedAt (epoch milliseconds). Only services on the granted connection appear:

{
  "connection": {
    "id": "con_...",
    "mode": "sandbox",
    "services": {
      "messages": {
        "state": "ready",
        "reason": null,
        "observedAt": 1731369600000
      },
      "contacts": {
        "state": "syncing",
        "reason": null,
        "observedAt": 1731369590000
      }
    }
  }
}

Proceed with service-specific operations only once that service shows ready. For iMessage, also check historyComplete on list responses, because native history can still be downloading after the service reaches ready. A ready state does not guarantee delivery of outbound messages.

What if a service shows offline or reconnect_required?

offline usually means the Mac has temporarily lost contact. Most cases resolve automatically. If the state persists, confirm the Mac is on and connected to the network.

reconnect_required means the user must re-authorize part of the connection, typically because a trusted-device session expired or a system permission was revoked. Send the user back through the authorization flow to restore it. For Mac system permissions (Full Disk Access, Automation, Contacts, Calendars), see Grant the Mac Permissions Your Connector Needs. For iMessage history that is incomplete after recovery, see Fix Missing iMessage History on a Connected Mac.

Where do I go next?

Register your app and start in the free sandbox. Live plans are $14 or $29 per month per connected Apple Account; request a demo for live access. Manage grants and revocations at your account page. For safe sending and idempotency, see Prevent Duplicate iMessages After a Timeout.

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.