OAuth for iCloud developer guide

Handle iMessage Attachments in Your App

The Figment REST API does not publish an attachment-download route. Messages return `guid`, `text`, `isFromMe`, and `chatGuid` under `messages:read`. This guide shows the Mac attachment states and a size and type filter for building the layer yourself.

Figment editorial teamPublished Updated Facts checked November 12, 2026

The current Figment public REST API covers message text and identifiers. There is no published attachment-download route in the current contract. iMessage itself carries photos, videos, audio clips, documents, and other files, so this guide explains attachment availability on the connected Mac, then gives you a scoped download design, a type filter, and a failure matrix for your own integration layer.

What does the API return today?

The GET /v1/connections/{connection_id}/messages endpoint returns message items with these documented fields: guid, text, isFromMe, and chatGuid. Both history reads and search operate under messages:read. No attachment schema or download route is published in the current API contract.

That boundary does not stop you from designing your integration now. The pattern below applies whether you build a Mac-side adapter over the local message store, evaluate a future dedicated endpoint, or adapt another bridge. The failure states and filter logic are the same regardless of the source.

How does the connected Mac handle attachments?

iMessage stores attachment files in the Mac's local Messages database alongside a small metadata record for each file. When Messages in iCloud is enabled, those attachments sync from the user's devices. The sync state at the moment of access matters, because a database record can reference a file whose payload is not currently on disk.

Four states drive every downstream decision:

StateWhat it meansRetryable
AvailableFile is on disk; payload is accessibleNot applicable
DownloadingiCloud sync for this file is in progressYes, defer
OffloadedFile removed from local disk to free space; record remainsYes, defer after sync
DeletedRemoved by the user; no payload availableNo

iMessage is permissive about content types: you can receive images, video, audio, PDFs, .vcf contact cards, and .ics calendar invites. Apple has not published an exhaustive allowed-type list. SMS and MMS attachments follow separate carrier-imposed size limits, which vary by carrier and are typically much lower than iMessage's practical ceiling.

How do I filter attachments before downloading?

Run a filter pass over the metadata you already have, before requesting any file payload. This avoids queuing large downloads for an integration that only needs PDFs, and it gives a clear reason for every skip.

# Integration design — not a live Figment endpoint.
# Adapt field names and state values to match your actual data source schema.

DOWNLOAD_LIMIT_BYTES = 25 * 1024 * 1024   # Application-level policy; set for your budget

ACCEPTED_TYPES = {
    "image/jpeg", "image/png", "image/heic",
    "video/mp4", "video/quicktime",
    "audio/m4a",
    "application/pdf",
}

def classify_attachment(att):
    state = att.get("state")            # local-availability field from your adapter
    mime  = att.get("mime_type", "")
    size  = att.get("total_bytes")      # may be None during partial sync

    if state == "deleted":
        return "skip_deleted"
    if state != "available":
        return "defer_not_ready"
    if mime not in ACCEPTED_TYPES:
        return "skip_type"
    if size is None:
        return "defer_unknown_size"
    if size > DOWNLOAD_LIMIT_BYTES:
        return "skip_too_large"
    return "download"


def process_attachments(message):
    for att in message.get("attachments", []):
        action = classify_attachment(att)
        guid   = att.get("guid", "")
        if action == "download":
            queue_download(guid)
        else:
            record_skip(guid, reason=action)

Four decisions are built in:

  • Deleted files are classified first. You learn the file is gone before any network call.
  • Unknown size defers, not errors. Metadata gaps happen during partial sync. Record the skip and re-evaluate once the connection reports ready.
  • Type filtering is a product decision. A CRM integration might skip audio and video entirely, and a media archive might accept everything under its size cap.
  • The size limit is configurable. 25 MB is an application-level policy, not an iMessage constraint. Set it to match your storage budget and processing pipeline. Large video files can arrive in bursts.

What should I do for each outcome?

ClassificationRetryableRecommended action
skip_deletedNoRecord skip. Alert if business-critical.
defer_not_readyYesRe-check after services.messages.state = ready.
skip_typeNoRecord skip with MIME type logged.
defer_unknown_sizeYesRe-check after sync completes.
skip_too_largeNoRecord skip with declared size logged.

Do not trigger a blind re-fetch on a failed or deferred outcome. Apply the same principle as the iMessage send model: an unknown outcome should poll, not re-request blindly.

How do I check that the connection is ready?

Confirm the Messages service is ready before trusting query results:

GET https://figment.so/api/icloud/v1/connections/{connection_id}
Authorization: Bearer ACCESS_TOKEN

The response shape is {connection:{id,mode,services,...}}. Check connection.services.messages.state. A ready value means the service is active, and it does not prove all historical attachments have finished syncing. Use the historyComplete flag on message list responses as the specific signal for complete history.

Non-ready states (syncing, needs_approval, reconnect_required) mean operations are rejected. Wait until ready before treating "no attachments found" as authoritative.

Do SMS and MMS attachments work the same way?

Only when an iPhone forwards them to the Mac. iMessage attachments arrive through Apple's protocol because the connected Mac holds the message database, while SMS, MMS, and RCS messages reach the Mac only when an iPhone forwards them.

Apple's forwarding guide (support.apple.com/en-us/102545) describes two paths:

Messages in iCloud
when enabled, SMS, MMS, and RCS sync automatically alongside iMessages. No separate forwarding switch is required. The iPhone must be on, online, and signed into the same Apple Account.
Text Message Forwarding
can be enabled per device in iPhone Settings → Messages → Text Message Forwarding for setups without Messages in iCloud.

If the connected iPhone is unavailable or forwarding is not configured, SMS and MMS messages and their attachments will not appear, even if the Apple Account is signed in on the Mac. Use the service field on the message record to distinguish iMessage from SMS/MMS traffic, and apply separate size policies for MMS.

Which scopes and price apply?

Attachment handling uses messages:read, the same scope that covers message history and search. No separate attachment scope exists in the current API. messages:send is a distinct scope required only for sending, so a read-only integration such as an archivist, CRM enrichment pipeline, or media processing agent does not need it.

The developer price is $29/month per connected Apple Account for the Full iCloud suite, which includes Messages, and sandbox access is free. For live access, request a demo. Register your app and connect an Apple Account to request a scoped grant. Manage existing grants at /icloud/account.

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.