/v1/leasesPOST/v1/leases/{lease}/. Fails at once
with device-leased while another lease holds the iPhone. The problem detail
shows its label, reason, when it was acquired and when it was last used, so the
client can decide to give up instead of retrying. force ends that lease
instead (after its running operation); its next call gets lease-invalid.
waitSeconds waits for the other lease to end instead. Send
Accept: text/event-stream with it, so a closed connection stops the wait
(events log, then result with the Lease, or error).
On the unix socket, a device that is on another Mac of the account (or the only
iPhone of the account, when this Mac has none) is taken on that Mac; the id is then
<mac>:<number>.
Every acquire asks ghosthand.dev if the plan covers this iPhone on this Mac (free:
one iPhone; Pro: every iPhone on each paid Mac). Not covered: subscription-required
with the subscribe and dashboard links. ghosthand.dev unreachable: only an iPhone
allowed in a recent check is leased; any other gets tunnel-offline.ghosthand tunnel url --new-token. The unix socket needs no tokenapplication/jsonrequiredGET /v1/devices and device-leased errors, so they can decide to wait or give up"reply to Anna in Messages"Min length: 1GET /v1/devices, or default when exactly one iPhone is connected"default"Min length: 1mac from GET /v1/devices). On the unix socket,
another Mac's slug sends the acquire straight to that Mac, without listing every Mac
first. Through the tunnel it must be this Mac's slug or omitted."studio"Min length: 1GET /v1/devices and device-leased errors, e.g. an agent session id. Not checked and not unique"ses_123"600Min: 1Max: 86400falsedevice-leased. While it waits, GET /v1/phones lists
the client under waiting. Cannot be combined with force.1Max: 3600studio:42 (42 when that Mac is signed out). Pass it back exactly as returned.
Whoever has it can use the iPhone."42"Pattern: ^([a-z0-9-]+:)?[1-9][0-9]*$force ended, if anytap or screenshot. Absent before the firsttitle and detail are for people.curl -X POST "https://ghosthand.dev/macs/studio/v1/leases" \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{ "reason": "reply to Anna in Messages", "label": "ses_123" }'
{ "id": "42", "device": "7EF219AD-69B4-423E-B8C4-4F4A6140822F", "deviceName": "Tommy's iPhone", "label": "ses_123", "reason": "reply to Anna in Messages", "idleTimeoutSeconds": 600, "expiresAt": "2026-10-07T09:10:00.000Z" }