Docs · Mac API

Mac API reference

Everything the MCP tools and the CLI do goes through this REST API, so anything that speaks HTTP can drive a Mac.

Terminal
curl -s https://nomac.app/api/v1/me \
  -H "Authorization: Bearer $NOMAC_API_KEY"

Basics

Base URL
https://nomac.app/api/v1
Auth
Authorization: Bearer nmk_…, with a key from nomac.app/dash/keys, nomac login or POST /api-keys.
Errors
Always { "error": { "code", "message" } } with a meaningful status. 402 is no credit left (or Mac use paused for the account); 422 is a failed precondition, such as no Apple connection or invalid input.
Retries
Where an endpoint takes an Idempotency-Key, keep the same key and body when retrying: you get the original operation back, never a second one.

Credit

$0.90 an hour, charged on each session's ready time in whole minutes, one minute at least. Credit comes in $10 packs of 11.1 hours, 1 to 100 at a time, and never expires. There is no subscription and nothing is charged automatically.

GET/mac/credits

The credits left (spendable, paid, promotional and reserved, as microdollar strings), the spendable_seconds of Mac time they buy, and recent purchases. spent_this_month_microunits is what Macs and phones were charged since the start of the month in UTC, less what NoMac took off those charges for sessions it interrupted (a session's credited_microunits); purchases, promotional credit and refunds do not count. last_purchase { amount_cents, at } is the last purchase not fully refunded: the credit bought before any bonus, and when it arrived; null if none.

POST/mac/credits/checkout

Body { "packs": 1-100 }, with a stable Idempotency-Key. Answers an action: open_checkout_url with a url for the person to pay, check_payment while a payment is verified, or checkout_ended, with a message an agent can relay.

A person pays; an agent never enters payment details. Only a verified payment adds credit. Reuse the key after a lost answer: a new key is a new purchase.

GET/mac/credits/checkout/{checkout_id}

What came of a checkout: state is credited (with the credit_cents it added, bonus included, and the spendable_microunits now), processing while the payment is confirmed, or not_paid.

GET/mac/credits/statement

The account's statement for a month in UTC (?month=2026-11, this month by default): lines_microunits for Macs, Simulators, CI jobs, drive saves, what was credited back, and the credit bought, given, refunded or moved within a team, each as it moved the credit, and the month's spent_microunits. ?format=csv answers the month's entries instead, one a row, in dollars: each session's use as one row, every purchase and refund as its own.

Sessions

POST/mac/sessions

Starts a Mac, with a stable Idempotency-Key. Answers session; read it until it is ready. With no credit, it answers 402 insufficient_credit with a buy_url for the person.

limits
max_duration_seconds (7,200 by default, with no longest), idle_timeout_seconds (600) and spend_cap_microunits ($5).
access
prompts: "ask" keeps macOS's usual prompts; by default the Mac is fully open to the agent, its login password in $NOMAC_MAC_PASSWORD. gatekeeper: "on" | "off".
permissions
{ "com.example.App": ["camera", "microphone"] } or "all": privacy permissions granted at start.
public_key
An SSH public key. Leave it out for HTTPS-only access.
access.drive
The drive at ~/drive: left out (or "account"), the account's default, or a new drive of the Mac's own while another Mac has the default; a name, that drive, made empty the first time ("default" is the default itself); "none", no drive. A named drive on a running Mac answers 409 drive_in_use with that Mac's id. A named drive is always made; past the account's 10 included, its saves are charged per GB changed. At the limit of drives NoMac makes by itself, with none free to replace, a start that names none runs without a drive.
access.drive_from
A drive of the account to copy into the drive made for this Mac (its last save); 404 drive_not_found if there is none of that name.
reuse
With a drive name: when that drive is on a running Mac, answers that Mac (reused: true) instead of drive_in_use.
parallel
A second Mac beside the account's running one, for an account that has bought credit.
queue_seconds
300 to 3,600: wait in line, free, instead of a 409, while the account runs as many Macs as it may, the drive asked for is on another Mac, or no Mac is free. The answer is the queued session, which starts in its turn; one not started in time ends failed with queue_expired (or capacity_unavailable), with nothing charged. An account has at most 5 starts in line (409 queue_full).

The account's saved defaults apply first. The session's account.gatekeeper shows what the Mac has, and drive.name which drive it has.

Drives

GET/mac/drives

The account's drives, the default first: name, space used, the Mac using each, recent versions and when each is deleted unused. 10 are included; a drive named past them is kept, and each save of it is charged per GB of changed data.

GET / DELETE / PATCH/mac/drives/:name

Reads one drive, empties it (no Mac may be using it; the next Mac that names it gets a new, empty one, and for a drive-N a new drive under a new number), or renames it with { "name": "new-name" } (never the default).

GET/mac/sessions

The account's sessions, to find a Mac again after a lost answer.

GET / DELETE/mac/sessions/:id

Reads a session, or stops it. Stopping deletes the Mac and every file outside ~/drive; read it until cleanup_confirmed. Waiting and setup are free; ready time counts, including time between commands. While another API key sent the Mac a command or opened SSH to it in the last 5 minutes, an API key's stop answers 409 confirm_required; DELETE ?confirm=true stops it anyway. A session says where it was started from (started_from) and when it last ran a command (last_command_at); the list adds same_api_key. A refused start (session_limit_reached, drive_in_use) lists the Macs in its way in macs, each with started_from, same_api_key and last_command_at.

GET/mac/capabilities

Supported interfaces and profiles. A session's own image lists its macOS, Xcode, Simulator runtimes and tools.

GET / PUT / DELETE/mac/defaults

What every new Mac starts with: { prompts?, gatekeeper?, permissions? }, as a start's access. PUT replaces them and DELETE goes back to fully open. Answers defaults and effective. A start's own access wins field by field, and its permissions add to the saved ones.

Commands

POST/mac/sessions/:id/jobs?wait=30

Runs a command, with a stable Idempotency-Key. Body { argv: ["/usr/bin/uname", "-a"], cwd?, env?, timeout_seconds? }; for shell syntax, put a shell in argv. timeout_seconds is 300 by default and 3600 at most; for longer, use SSH.

wait (0 to 50 seconds) waits for it. A finished command answers exit_code, stdout and stderr (the first 64 KiB each, with stdout_next_cursor when there is more). One still running answers as a job to follow.

GET/mac/sessions/:id/jobs/:job?wait=30

Reads a job, and with wait, waits up to 50 seconds for it to end. Never retry an unknown command with a new key.

GET/mac/sessions/:id/jobs/:job/output?stream=stdout&cursor=0

The full output: decode data_base64 and continue at next_cursor, for stdout and stderr. Up to 8 MiB is kept, and then the last 64 KiB of each stream (tail_base64, tail_offset). 410 output_expired means old logs were removed, not that the command should run again.

Files and links

POST/mac/sessions/:id/files

Writes a file of up to 3 MiB: { path, content? | content_base64?, executable? }. Relative paths are in the workspace and ~ is home. It makes the folders and replaces the file in one step, so it is safe to repeat.

GET/mac/sessions/:id/files?path=build.log

Reads a file of up to 3 MiB (max_bytes): { path, size, modified_at, truncated, encoding, content | content_base64 }.

POST/mac/sessions/:id/links

A link that moves one file or folder of up to 2 GiB, which anyone holding it can use without an account. Body { direction: "upload", path, executable?, extract?: "zip" | "tar" } or { direction: "download", path, wait_seconds? }, with expires_in_minutes (60 by default, 1440 at most).

An upload link also answers upload_url for curl -T. A ready download answers download_url, a folder as a zip, and keeps working after the Mac stops.

GET / POST/mac/links/:token?wait=20

No API key: the link is the credential. Answers its state, from waiting_for_upload to ready, failed or expired, and moves an arrived upload onto the Mac. POST does the same right after an upload. GET /mac/links/:token/file redirects to a ready download.

Screen and input

POST/mac/sessions/:id/screenshot

Body { target?: "screen" | "simulator" }. A JPEG of the desktop (1440×900, where image pixels are screen coordinates) or of the booted Simulator, at most 1568 pixels long, with front_app, screen_locked and any open dialog with its text and buttons. simulator_not_booted (409) when no Simulator runs.

POST/mac/sessions/:id/input

A real keyboard and mouse, which macOS takes as a person's, also on the lock screen, the login window and password dialogs. Body { action, text?, keys?, x?, y?, steps?, button?, double?, screenshot? }, where action is type, key, click, move, scroll, password (types the login password), unlock or size.

Answers what was done and a screenshot taken right after. Not idempotent: a retry types again.

POST / DELETE/mac/sessions/:id/recording

POST { target?, resolution?, max_seconds?: 300, path? } starts a video that stops by itself after max_seconds (1800 at most). target is screen or simulator; for the Simulator, resolution is window (the default, small) or device (the device's own pixels, about 7 times the file). DELETE stops it, saves the MP4 and answers it with its width and height and a download link; safe to repeat. One recording at a time.

Access

GET/mac/sessions/:id/password

The Mac's login password for this session: { user, password, variable }, also $NOMAC_MAC_PASSWORD on the Mac. Each read is audited, and the password is erased when the session ends. password_not_set (409) until the Mac is ready.

POST/mac/sessions/:id/access

A short-lived gateway token and the verified SSH host key, for SSH over WSS on port 443, which the CLI handles. Use nomac sync, nomac pull or SSH for project files. A Mac that is stopping, has stopped or failed answers 410 session_ended, with its state and why it ended: it never runs again, so start a new one.

Secrets

Values are encrypted and no endpoint returns them. Every Mac receives the every-Mac secrets when it becomes ready: variables in every command's environment, files at their path, values masked in output.

GET/secrets

Names, kinds, where each goes, sizes, delivery and recent activity, the requests still waiting for a value (pending_requests) and those the person declined in the last day (declined_requests). Never values.

PUT / DELETE/secrets/:name

{ kind: "variable", value } or { kind: "file", value_base64, destination? }, with delivery every_mac (the default) or on_request. Up to 100 secrets, 32 KiB per variable, 1 MiB per file and 4 MiB in all. Running Macs get a change within a minute. DELETE removes it from running Macs too.

POST/secrets/requests

{ name, kind, description, destination?, delivery? }. Answers a url where a person enters the value in the browser within 24 hours, so it never passes through a chat. The account's owner can also answer or decline it on the Secrets page.

POST/mac/sessions/:id/secrets

{ names?: [] }. Installs the every-Mac secrets, the on-request ones named and the signing files on a running Mac now, and answers what went where.

Signing

The App Store Connect key stays on NoMac's server. Signing, TestFlight and notarization use it there and give the Mac only what Apple returns for one operation.

GET/apple

Connected Apple accounts, the signing identities every Mac receives and the NoMac profiles, with any notice. Never a key.

POST/apple/signing

{ issuer_id? }. Sets up a distribution identity: an uploaded certificate, the one Apple already issued for NoMac's key, or a new one.

POST / DELETE/apple/certificates

POST { p12_base64, password } adds a certificate you already sign with, Developer ID included. DELETE /apple/certificates/:id removes it from your Macs; nothing is revoked at Apple.

POST/mac/sessions/:id/signing

{ path?, scheme?, container?, issuer_id? }. Reads the project on the Mac, makes and installs the App Store profiles its app and extensions need, and answers files (an .xcconfig and export options), build_number, commands for xcodebuild, Flutter and fastlane, and the changes made at Apple. The project is not changed. needs_human (409) carries the steps only a person can take, with a link.

TestFlight and notarization

POST/mac/sessions/:id/testflight

{ path: "build/export/App.ipa", notes?, uses_non_exempt_encryption?, request_key?, wait_seconds? }. Sends a signed .ipa on the Mac to TestFlight; the Mac sends only the file. state goes sending, processing, then on_testflight or failed, with the project_id and, once Apple has it, the build_id for /publish.

The same request_key follows the same send. encryption_answer_required (409) asks for the person's answer once per app; build_number_used (409) gives next_build_number.

GET/testflight/:id?wait_seconds=50

Follows a send, waiting up to 50 seconds for progress.

POST/mac/sessions/:id/notarize

{ path: "build/App.app", request_key?, wait_seconds? }, for a Developer ID-signed .app, .dmg, .pkg or .zip. The Mac sends it to Apple's notary service, then staples the ticket. state ends accepted (with stapled), invalid or rejected (with Apple's issues), or failed.

GET/notarizations/:id?wait_seconds=50

Follows a notarization, waiting up to 50 seconds for progress.

Account

GET/me

Your organization, how you signed in, and counts of projects and connections.

GET / PUT/account

The account: id, created_at, limits { macs, phones, ci, drives } (Macs, phones and CI jobs at once, drives kept), running { macs, phones, ci } against them now, and email_updates. Signed in to the dashboard, it also gives the owner's email, name and sign_in (apple, google, github, and always email_code); an API key never gets them.

PUT { "email_updates": false } turns off news, offers and low-credit reminders (receipts always come), signed in to the dashboard only.

GET / POST/api-keys

GET lists active keys (id, label, the token's last four characters as last4, created, last used). POST { "label"? } answers { id, label, last4, token }; the token is shown once. DELETE /api-keys/:id revokes one.

POST/device/start, then /device/token

The sign-in nomac login uses, with no key: the code is the secret. /device/start answers { device_code, user_code, verification_uri, interval }; the person approves in the browser while the client polls /device/token until { status: "approved", api_key }.

Apple connections and apps

For every account with Apple connected, on an app NoMac knows, such as one a TestFlight send made. None of this is needed to use a Mac.

POST/connections

{ p8, key_id, issuer_id }: an App Store Connect key, checked with Apple before anything is stored and encrypted at rest.

GET/connections

Connections, with status, team name and signing certificate expiry. GET /connections/:id checks one; DELETE removes it.

POST/connections/:id/webhooks

{ asc_app_id, base_url? }. Registers NoMac for Apple's build, version and feedback events, so updates arrive without polling.

GET / DELETE/projects/:id

An app. A TestFlight send makes one and answers its project_id, which every App Store endpoint takes. GET /projects lists them.

GET/projects/:id/feedback

TestFlight testers' crash reports and screenshot feedback, each with device, OS and comment.

App Store

POST/review-lint

{ project_id }. What App Review would reject: live store findings, and source findings when the project has source, each graded red, yellow or green with evidence and a fix. Some come with patches.

GET/metadata-schema

Every listing field with its length limit, and the screenshot display types with their exact pixel sizes.

GET / PUT/projects/:id/metadata

The listing, read live from App Store Connect. PUT { locale?, fields } writes name, subtitle, description, keywords, What's New, promotional text and the URLs, each checked against Apple's limits first (422 with errors per field). It also takes primary_category, age_rating (a person's answers), content_rights, copyright, review_contact and price: "FREE"; paid prices go through the catalog.

POST/projects/:id/screenshots

{ display_type, locale?, images: [{ filename, data }] }, base64 PNGs. Every image is checked for its exact size first, then the set is replaced all at once, so a bad image never leaves half a listing.

POST/publish

{ project_id, build_id?, asc_submission_id?, resolve_rejection?, confirm?, force? }. Without confirm, it stages the version: checks for a ready build and the lint, prepares the submission and answers Apple's blockers. With confirm: true, it submits for review, which needs the person's approval. force: true overrides a red lint. New versions are released by hand; existing ones keep their release setting at Apple.

GET/submissions/:id

A review submission's state after publishing.

App Store Connect catalog

Apple's own operations, scoped to your app: pricing and availability, subscriptions and in-app purchases, offers, customer reviews, phased releases, in-app events, product pages, files, analytics and webhooks. Over MCP: get_store_capabilities, read_store, update_store and upload_store_asset.

GET/store-capabilities

Lists the operations, by category or search, paged with offset. One operation answers Apple's exact body and query schema for it.

POST/projects/:id/store/read

{ operation, scope?, query?, cursor? }. Runs one of Apple's reads. Start from an app relationship with scope: []; every child answered carries a scope to reuse in later reads and writes.

POST/projects/:id/store/write

{ operation, scope?, references?, body?, confirm? }, the body as discovery gives it. Every existing resource it names needs a verified scope in references. It previews by default; with confirm: true, it makes the change and records it. Use prices, messages and statements the owner approved.

POST/projects/:id/store/assets

{ operation, scope?, body, data_base64, confirm? }. Uploads a new screenshot, preview, purchase image or reviewer file, up to 2 MiB inline (the CLI's MCP takes a file_path for larger ones). ready: true means Apple has the file; it may still be processing.

Review and external TestFlight

GET / POST/projects/:id/reviews

GET lists Apple's submissions, also those made outside NoMac, and with asc_submission_id, one in full. POST { asc_submission_id, action, item_id?, confirm? } resolves or removes an item, cancels, resubmits or releases; it previews without confirm.

POST/projects/:id/reviews/reply

Prepares a reply to App Review and answers sent: false with the link: the person sends it in App Store Connect, since Apple has no API for it.

GET / POST/projects/:id/testflight

GET lists groups, test information and recent builds. POST with an action (metadata, create_group, update_group, invite_tester, remove_tester, remove_build, distribute, notify, expire, encryption) previews, and applies with confirm. Distribution needs an exact asc_build_id and the external group_ids.

For a change still pending, repeat the original body and Idempotency-Key. GET /projects/:id/operations recovers the key and the pending actions.

Support

POST / GET/report-issue

POST { description, session_id?, job_id?, email? } files an issue, with the session's state attached. GET reads your tickets and their replies. An email asks for a direct update. Never include keys or passwords.

GET/health

Whether the API is up, with no key.