OAuth for iCloud developer guide

Read Apple Notes with a Scoped Mac Helper

Apple Notes has no REST API. On a Mac, a helper reads note HTML, metadata and attachments through the Notes scripting dictionary using Apple Events, with Automation permission and no body access for locked notes.

Figment editorial teamPublished Updated Facts checked November 12, 2026

Apple Notes has no public REST endpoint, no CalDAV feed, and no developer SDK that runs outside the user's device. The documented native path to Notes content on macOS is the Notes scripting dictionary, an Apple Events interface the Notes app exposes to authorized processes on the same Mac. Figment's OAuth for iCloud has a notes:read scope (/icloud). This guide covers the native path, where a Mac helper you own does the reading.

Why is there no Apple Notes REST API?

Apple has not published an HTTP or OAuth endpoint for Notes content, and there is no developer-accessible iCloud Notes web API. Calendar and Contacts differ: they use open protocols, CalDAV and CardDAV, that iCloud serves over HTTP. Notes has neither.

What exists instead is Apple Events, macOS's inter-app messaging protocol. A process with the right entitlement and a user-granted Automation permission can send an AppleScript command to the Notes app and receive a structured reply. The query runs entirely on the device, and no network request leaves the machine when a helper reads Notes this way.

What does the Notes scripting dictionary expose?

A five-level hierarchy: Application → Account → Folder → Note → Attachment.

Accounts correspond to storage locations. An iCloud account syncs across a user's Apple devices. An account whose name contains "On My Mac" stores notes locally only. If iCloud Notes is enabled in System Settings, the iCloud account appears alongside any local account. List all accounts before targeting one, because the name can vary between machines.

Folders have a name, id, and container (parent account or folder) and can hold both notes and nested subfolders.

Notes expose these properties:

PropertyType
nametext (read-only)
idtext (read-only)
bodyHTML text (read-write)
creation datedate (read-only)
modification datedate (read-only)
containeraccount or folder (read-only)

The body property returns the full note content as HTML. Bold text, lists, headings, checklists, and inline colors are encoded in that markup, so parse it as HTML and not as plain text. Write operations against body can silently destroy formatting if content is not carefully escaped and round-tripped.

This integration design shows the traversal pattern. In production, list all accounts first instead of hard-coding a name, and recurse into subfolders to reach notes nested below the top level:

-- List account names present on this Mac first:
--   get name of every account of application "Notes"
-- Use the returned name. Do not hard-code "iCloud".

tell application "Notes"
  set targetAccount to account "iCloud"  -- substitute actual account name
  repeat with f in (get folders of targetAccount)
    repeat with n in (get notes of f)
      -- name of n       → note title
      -- id of n         → stable identifier
      -- body of n       → full HTML content
      -- creation date of n
      -- modification date of n
    end repeat
    -- Recurse: (get folders of f) to reach nested subfolders
  end repeat
end tell

This is a design example. Run it on a Mac where Notes is signed in and your helper process has Automation permission for the Notes app in System Settings → Privacy & Security → Automation.

What happens with locked notes?

Their body is withheld. Locked notes are the largest access boundary to understand before you build. Apple Notes lets users lock individual notes with a custom Notes password, the Mac login password (which requires two-factor authentication and iCloud Keychain), or Touch ID on a supported Mac. The lock is per note, not per folder or per account.

When a note is locked, its body is not accessible through Apple Events until the user opens it on the Mac. The note still appears in the account and folder hierarchy, and name and id are readable, but the body is withheld. Build the integration to report that a note is locked, not to skip it silently or treat it as empty.

A note locked with the Mac login password cannot be viewed on iCloud.com. A note locked with a custom Notes password can be viewed on iCloud.com after manual password entry. In both cases the note stays in the hierarchy and only the content is withheld.

How do I get attachments and cloud-only assets?

Retrieve attachments independently of the HTML body. Attachments are elements of the Note object in the scripting dictionary, separate from the markup.

iCloud may keep attachment binaries in cloud storage instead of on the local Mac, particularly for older notes or large files on a Mac with limited storage. When a binary has not been downloaded locally, trigger iCloud sync before you try to access it.

An inline image in a note body may appear as a data URI inside the HTML or as a separate attachment object, depending on how the note was created and the macOS version. A parser should handle both.

Can I export notes as Markdown or PDF?

Yes, one note at a time on macOS 26. Open the note and choose File → Export as → Markdown, or File → Export as → PDF. Both are user-initiated, and the Notes UI has no programmatic batch-export path (Apple support: Import, export, and print notes on Mac).

For programmatic bulk access, the scripting dictionary remains the documented path. Markdown export suits one-off handoffs to writing tools and other Markdown-aware workflows.

Which notes will the helper see?

Whichever accounts and notes are on the connected Mac at query time. iCloud Notes sync must be enabled in System Settings under iCloud for iCloud notes to appear. With sync off, only local "On My Mac" notes are visible. iCloud Notes syncs across iPhone, iPad, Mac, and Apple Vision Pro when enabled on each device (Apple: Use Notes with iCloud).

An "On My Mac" account is local to that machine. Notes in iCloud appear on all signed-in devices when sync is active. Querying a Mac where sync is disabled or temporarily offline returns only locally stored content.

What does OAuth for iCloud offer for Notes?

A read scope, notes:read. OAuth for iCloud provides a user-approved, scoped connection to Apple data from a hosted Mac, and Notes is one of its four scopes, with Passwords, Messages, and Reminders (/icloud). Notes scripting, as described above, is a separate developer-owned integration design.

Developers working with a Figment-hosted Mac can apply the design above on the same connected Mac where the iMessage integration runs. For the full grant model (scopes, approvals, and revocation), see OAuth for iCloud: Connect Apple Data to Your App. For using selected folders as agent memory, see Use Selected Apple Notes as Agent Memory.

Connect Apple Account to register your app 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.