OAuth for iCloud developer guide

Find Decisions and Documents in iMessage History

Use the messages:read search endpoint with specific terms such as a URL host, a vendor name or a file name. Confirm the service is ready and read historyComplete before you trust an empty result.

Figment editorial teamPublished Updated Facts checked November 12, 2026

To find a decision, contract link or shared document in iMessage history, call Figment's messages:read search endpoint with a specific term (a URL host, a vendor name, a file name) and check historyComplete in the response. The search runs against the messages on a signed-in Mac, so an empty result means "not found in locally available history", not "never sent". The worksheet below maps common retrieval tasks to query terms and sync conditions.

What does iMessage history contain?

Apple's Messages in iCloud keeps message history synchronized across every device signed in to the same Apple Account, including the Mac. That history spans iMessage, SMS, MMS, and RCS, not only blue-bubble threads. With Messages in iCloud enabled on the iPhone, text message forwarding is built in and no separate Text Message Forwarding switch is needed. For new carrier messages to arrive, the iPhone must be on, online, signed into the same Apple Account, and able to send and receive messages.

Already-synced carrier history stays available on a paired Mac while the iPhone is offline. The iPhone requirement applies to new SMS, MMS, and RCS messages, not to reading synced history.

How do I check the connection before searching?

Read the per-service state first. A newly connected Mac may still be syncing, and querying a non-ready service returns a partial window or nothing.

GET https://figment.so/api/icloud/v1/connections/{connection_id}
Authorization: Bearer ACCESS_TOKEN
{
  "connection": {
    "id": "con_...",
    "mode": "live",
    "services": {
      "messages": {
        "state": "ready",
        "reason": null,
        "observedAt": 1731456000000
      }
    }
  }
}

Possible states are connecting, needs_approval, syncing, ready, offline, reconnect_required, and revoked. Search only when state is ready. The endpoint enforces authorization, so handle non-2xx responses. Use your account page to monitor connection status and resolve setup issues.

ready means the service is authorized and available. It does not mean all history has finished syncing. Check historyComplete in search results for that.

Which query terms find which kinds of messages?

Start with the most specific term you have: a URL host, a proper noun or a dollar amount, not a generic word like "decision". Exact phrases reduce false matches. Source for SMS, MMS and RCS scope: Apple Messages in iCloud.

Use caseEffective query termsiPhone needed for new messagesGap risk
Shared document linksdocs.google.com, notion.so, dropbox.com, figma.comOnly for new SMS/RCS arrivalsLow for iMessage threads
Go/no-go decisionslet's go, approved, confirmed, let's do itOnly for new SMS/RCS arrivalsMedium: short replies lack standalone context
Contract or vendor referencesVendor name + contract or agreementOnly for new SMS/RCS arrivalsLow: proper nouns match precisely
Action-item assignmentscan you, please handle, by Friday, take care ofOnly for new SMS/RCS arrivalsMedium: forward-looking phrases are brief
File names and project codesExact file name, ticket ID, branch nameOnly for new SMS/RCS arrivalsLow: exact string matches are reliable
Meeting coordinationzoom, calendar invite, call at, rescheduleOnly for new SMS/RCS arrivalsLow: scheduling language is distinctive
Budget or pricing approvalsapproved the budget, go ahead, dollar amountsOnly for new SMS/RCS arrivalsMedium: approval words are common and short

When a hit comes back, use its chatGuid to fetch the surrounding thread.

How do I call the search endpoint?

Send a GET to the search endpoint. The messages:read scope covers both reads and search, and no separate search permission exists.

GET https://figment.so/api/icloud/v1/connections/{connection_id}/messages/search
  ?query=TERM
  &chatGuid=CHAT_GUID   (optional: scope to one conversation)
  &limit=20             (default 20, max 100)
  &offset=0             (max 10000)

Build the URL with a URL constructor. Never interpolate raw chatGuid values into a query string, because unencoded characters are misread by HTTP. If your grant was scoped to a specific conversation (a selected-chat grant), include that conversation's chatGuid.

A design illustration using curl:

BASE_URL="https://figment.so/api/icloud"
curl -G \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  --data-urlencode "query=contract draft" \
  --data-urlencode "limit=20" \
  "$BASE_URL/v1/connections/$CONNECTION_ID/messages/search"

Read credentials from environment variables. The developer app never receives the Apple password. Search scans bounded, locally available history, so it is not a guaranteed full-text index of every message ever sent.

How do I read the results?

Read chatGuid, hasMore, nextOffset and historyComplete from the response:

{
  "data": [
    {
      "guid": "...",
      "text": "...",
      "isFromMe": false,
      "chatGuid": "iMessage;...;..."
    }
  ],
  "mode": "live",
  "offset": 0,
  "nextOffset": 20,
  "hasMore": true,
  "historyComplete": false,
  "scope": "messages:read"
}
  • chatGuid: use this value directly to fetch the full thread. Do not construct the string by hand, because the format varies by conversation type.
  • hasMore and nextOffset: pass nextOffset as offset in the next request. Stop when hasMore is false or nextOffset is null.
  • historyComplete: false: sync is still in progress, so results are a partial window of what will eventually be available.

To pull the thread around a match:

GET /v1/connections/{connection_id}/messages?chatGuid={chatGuid_from_result}&limit=20&offset=0

What if a search returns nothing for a message I know was sent?

Check two things before you conclude the message is gone:

  1. Connection state. If services.messages.state is syncing, wait and retry. The message may not have arrived yet.
  2. Coverage. If historyComplete is false, some older messages may not yet be on the Mac.

Empty results reflect locally available history at query time. They are not proof that a message was never sent.

Where can I read more?

Connect Apple Account to give your app structured search access to message history.

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.