Sign Up

Reservations

List reservations

GET
/reservations

Authorization

headerAuthorizationBearer <token>

Bearer project API key.

Scope: read:sandboxes

Query Parameters

limit?integer

Maximum number of items to return, 1–200 (default 100)

Formatint64
Range1 <= value <= 200
Default100
cursor?string

Opaque continuation token returned as next_cursor by a previous request

Response Body

The page of reservations

application/json
  1. response

GET /reservations response.

next_cursor?|

The cursor for the next page, or null on the last page.

reservations*array<>

The reservations in this page.

curl -X GET 'https://example.com/reservations'
{  "next_cursor": "string",  "reservations": [    {      "activated_at": "2019-08-24T14:15:22Z",      "auto_renew": true,      "capacity": null,      "created_at": "2019-08-24T14:15:22Z",      "end_reason": null,      "ended_at": "2019-08-24T14:15:22Z",      "id": "string",      "model": "string",      "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",      "origin": "explicit",      "pending_mac_started_at": "2019-08-24T14:15:22Z",      "period_end": "2019-08-24T14:15:22Z",      "period_n": 0,      "period_seconds": 0,      "period_started_at": "2019-08-24T14:15:22Z",      "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9",      "region_id": "string",      "reissued_at": "2019-08-24T14:15:22Z",      "renewal_error": "string",      "renewal_pending": true,      "resources_used": {        "cores": 0,        "disk_mib": 0,        "memory_mib": 0      },      "slots_used": 0,      "status": "pending_charge"    }  ]}

Create a reservation

POST
/reservations

Authorization

headerAuthorizationBearer <token>

Bearer project API key.

Scope: write:sandboxes

Header Parameters

Idempotency-Key*string

Unique per organization. A replay with the same body returns the existing reservation

Request Body

application/json
  1. body

POST /reservations body.

auto_renew?|

Renew the reservation near each period end while a macOS sandbox is active on it. Defaults to the organization's auto-reserve setting.

model?|

Mac model slug from GET /mac-models. Omitted, null, or blank uses the region's default model, initially m4-10c-16g. If that model is unavailable, the purchase fails; it never upgrades to another model.

region_id*string

Region slug whose Macs to reserve. Blank or local names no region: when this API serves exactly one region with Macs, the reservation is made there; otherwise the project, organization, then platform default applies.

Response Body

The reservation, unchanged

application/json
  1. response

A Mac reservation.

activated_at?|

When the reservation became active.

Formatdate-time
auto_renew*boolean

The reservation renews itself shortly before period_end (an hour by default) while a macOS sandbox is active on it; an idle reservation lapses instead.

capacity?|

The cores, memory and disk space for sandboxes of this reservation's Mac, set at purchase. Null when unknown; such a reservation accepts no new sandbox.

created_at*string

When the reservation was created.

Formatdate-time
end_reason?|

Why the reservation ended, or null while it is live.

ended_at?|

When the reservation ended.

Formatdate-time
id*string

The reservation ID.

model?|

The reserved Mac model, fixed at purchase, including renewal and replacement. Null when model information is unavailable; such a reservation accepts no new sandbox.

org_id*string

The organization ID.

Formatuuid
origin*MacReservationOrigin

How the reservation was bought: explicit by POST /reservations or a create with reservation: "new", and auto by a macOS create or start under the organization's auto-reserve setting.

Value in"explicit""auto"
pending_mac_started_at?|

When the reservation last began to wait for a Mac: at its first charge, or when it moved after a Mac failure. Kept after a Mac takes it.

Formatdate-time
period_end?|

When the reservation ends unless renewed. Absent until a Mac first takes the reservation; period 1 starts then, so the wait for a Mac is not paid time.

Formatdate-time
period_n*integer

The current paid period (1-based).

Formatint32
period_seconds*integer

The period length in seconds.

Formatint64
period_started_at?|

When the current period started.

Formatdate-time
project_id*string

The project whose key bought the reservation. The reservation serves every project of the organization; this project's monthly budget gates its renewals, manual and automatic, which answer PROJECT_BUDGET_EXCEEDED while the project is held.

Formatuuid
region_id*string

The reservation region.

reissued_at?|

Set when the reservation moved to another Mac after a Mac failure.

Formatdate-time
renewal_error?|

Why the renewal of the next period failed (billing refused it, or the balance was too low); the reservation ends at period_end unless renewed by hand. Null when no renewal has failed.

renewal_pending*boolean

A renewal charge is still waiting for billing's answer.

resources_used*

The cores, memory and disk space in use on this reservation's Mac. Paused sandboxes and sandboxes with status deleting count.

slots_used*integer

macOS sandboxes currently occupying this reservation's Mac.

Formatint64
status*MacReservationStatus

The reservation status.

Value in"pending_charge""pending_mac""active""ending""released""failed"
curl -X POST 'https://example.com/reservations' \  -H 'Idempotency-Key: string' \  -H 'Content-Type: application/json' \  -d '{  "region_id": "string"}'
{  "activated_at": "2019-08-24T14:15:22Z",  "auto_renew": true,  "capacity": null,  "created_at": "2019-08-24T14:15:22Z",  "end_reason": null,  "ended_at": "2019-08-24T14:15:22Z",  "id": "string",  "model": "string",  "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",  "origin": "explicit",  "pending_mac_started_at": "2019-08-24T14:15:22Z",  "period_end": "2019-08-24T14:15:22Z",  "period_n": 0,  "period_seconds": 0,  "period_started_at": "2019-08-24T14:15:22Z",  "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9",  "region_id": "string",  "reissued_at": "2019-08-24T14:15:22Z",  "renewal_error": "string",  "renewal_pending": true,  "resources_used": {    "cores": 0,    "disk_mib": 0,    "memory_mib": 0  },  "slots_used": 0,  "status": "pending_charge"}
POST
/reservations/bulk

Reserves up to 100 Macs of one model in one region. Each reserved Mac is one reservation with its own period and charge.

Authorization

headerAuthorizationBearer <token>

Bearer project API key.

Scope: write:sandboxes

Header Parameters

Idempotency-Key*string

Unique per organization. A replay with the same body returns the same reservations

Request Body

application/json
  1. body

POST /reservations/bulk body.

auto_renew?|

Renew each reservation near each period end while a macOS sandbox is active on it. Defaults to the organization's auto-reserve setting.

count*integer

How many Macs to reserve, 1 to 100.

Formatint32
min_count?|

The fewest Macs to accept, 1 to count. Omitted means count: all or nothing. With fewer than count Macs free, or fewer left under the organization's Mac reservation limit, but at least min_count, the request reserves as many as it can.

Formatint32
model?|

Mac model slug from GET /mac-models. Omitted, null, or blank uses the region's default model, initially m4-10c-16g. If that model is unavailable, the purchase fails; it never upgrades to another model.

region_id*string

Region slug whose Macs to reserve. Blank or local names no region: when this API serves exactly one region with Macs, the reservations are made there; otherwise the project, organization, then platform default applies.

Response Body

The reservation batch, unchanged

application/json
  1. response

The reservations one bulk purchase created.

requested*integer

The request's count.

Formatint32
reservations*array<>

The created reservations, one per reserved Mac, each with its own ID, period and charge.

reserved*integer

How many reservations this request created, from min_count to count. A reservation whose charge did not succeed counts here and shows status failed with end reason charge_failed.

Formatint32
curl -X POST 'https://example.com/reservations/bulk' \  -H 'Idempotency-Key: string' \  -H 'Content-Type: application/json' \  -d '{  "count": 0,  "region_id": "string"}'
{  "requested": 0,  "reservations": [    {      "activated_at": "2019-08-24T14:15:22Z",      "auto_renew": true,      "capacity": null,      "created_at": "2019-08-24T14:15:22Z",      "end_reason": null,      "ended_at": "2019-08-24T14:15:22Z",      "id": "string",      "model": "string",      "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",      "origin": "explicit",      "pending_mac_started_at": "2019-08-24T14:15:22Z",      "period_end": "2019-08-24T14:15:22Z",      "period_n": 0,      "period_seconds": 0,      "period_started_at": "2019-08-24T14:15:22Z",      "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9",      "region_id": "string",      "reissued_at": "2019-08-24T14:15:22Z",      "renewal_error": "string",      "renewal_pending": true,      "resources_used": {        "cores": 0,        "disk_mib": 0,        "memory_mib": 0      },      "slots_used": 0,      "status": "pending_charge"    }  ],  "reserved": 0}

Get a reservation

GET
/reservations/{id}

Authorization

headerAuthorizationBearer <token>

Bearer project API key.

Scope: read:sandboxes

Path Parameters

id*string

The reservation ID

Response Body

The reservation

application/json
  1. response

A Mac reservation.

activated_at?|

When the reservation became active.

Formatdate-time
auto_renew*boolean

The reservation renews itself shortly before period_end (an hour by default) while a macOS sandbox is active on it; an idle reservation lapses instead.

capacity?|

The cores, memory and disk space for sandboxes of this reservation's Mac, set at purchase. Null when unknown; such a reservation accepts no new sandbox.

created_at*string

When the reservation was created.

Formatdate-time
end_reason?|

Why the reservation ended, or null while it is live.

ended_at?|

When the reservation ended.

Formatdate-time
id*string

The reservation ID.

model?|

The reserved Mac model, fixed at purchase, including renewal and replacement. Null when model information is unavailable; such a reservation accepts no new sandbox.

org_id*string

The organization ID.

Formatuuid
origin*MacReservationOrigin

How the reservation was bought: explicit by POST /reservations or a create with reservation: "new", and auto by a macOS create or start under the organization's auto-reserve setting.

Value in"explicit""auto"
pending_mac_started_at?|

When the reservation last began to wait for a Mac: at its first charge, or when it moved after a Mac failure. Kept after a Mac takes it.

Formatdate-time
period_end?|

When the reservation ends unless renewed. Absent until a Mac first takes the reservation; period 1 starts then, so the wait for a Mac is not paid time.

Formatdate-time
period_n*integer

The current paid period (1-based).

Formatint32
period_seconds*integer

The period length in seconds.

Formatint64
period_started_at?|

When the current period started.

Formatdate-time
project_id*string

The project whose key bought the reservation. The reservation serves every project of the organization; this project's monthly budget gates its renewals, manual and automatic, which answer PROJECT_BUDGET_EXCEEDED while the project is held.

Formatuuid
region_id*string

The reservation region.

reissued_at?|

Set when the reservation moved to another Mac after a Mac failure.

Formatdate-time
renewal_error?|

Why the renewal of the next period failed (billing refused it, or the balance was too low); the reservation ends at period_end unless renewed by hand. Null when no renewal has failed.

renewal_pending*boolean

A renewal charge is still waiting for billing's answer.

resources_used*

The cores, memory and disk space in use on this reservation's Mac. Paused sandboxes and sandboxes with status deleting count.

slots_used*integer

macOS sandboxes currently occupying this reservation's Mac.

Formatint64
status*MacReservationStatus

The reservation status.

Value in"pending_charge""pending_mac""active""ending""released""failed"
curl -X GET 'https://example.com/reservations/string'
{  "activated_at": "2019-08-24T14:15:22Z",  "auto_renew": true,  "capacity": null,  "created_at": "2019-08-24T14:15:22Z",  "end_reason": null,  "ended_at": "2019-08-24T14:15:22Z",  "id": "string",  "model": "string",  "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",  "origin": "explicit",  "pending_mac_started_at": "2019-08-24T14:15:22Z",  "period_end": "2019-08-24T14:15:22Z",  "period_n": 0,  "period_seconds": 0,  "period_started_at": "2019-08-24T14:15:22Z",  "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9",  "region_id": "string",  "reissued_at": "2019-08-24T14:15:22Z",  "renewal_error": "string",  "renewal_pending": true,  "resources_used": {    "cores": 0,    "disk_mib": 0,    "memory_mib": 0  },  "slots_used": 0,  "status": "pending_charge"}

Update a reservation

PATCH
/reservations/{id}

Authorization

headerAuthorizationBearer <token>

Bearer project API key.

Scope: write:sandboxes

Path Parameters

id*string

The reservation ID

Request Body

application/json
  1. body

PATCH /reservations/{id} body.

auto_renew*boolean

Renew the reservation near each period end while a macOS sandbox is active on it; off lets it lapse at period_end.

Response Body

The reservation

application/json
  1. response

A Mac reservation.

activated_at?|

When the reservation became active.

Formatdate-time
auto_renew*boolean

The reservation renews itself shortly before period_end (an hour by default) while a macOS sandbox is active on it; an idle reservation lapses instead.

capacity?|

The cores, memory and disk space for sandboxes of this reservation's Mac, set at purchase. Null when unknown; such a reservation accepts no new sandbox.

created_at*string

When the reservation was created.

Formatdate-time
end_reason?|

Why the reservation ended, or null while it is live.

ended_at?|

When the reservation ended.

Formatdate-time
id*string

The reservation ID.

model?|

The reserved Mac model, fixed at purchase, including renewal and replacement. Null when model information is unavailable; such a reservation accepts no new sandbox.

org_id*string

The organization ID.

Formatuuid
origin*MacReservationOrigin

How the reservation was bought: explicit by POST /reservations or a create with reservation: "new", and auto by a macOS create or start under the organization's auto-reserve setting.

Value in"explicit""auto"
pending_mac_started_at?|

When the reservation last began to wait for a Mac: at its first charge, or when it moved after a Mac failure. Kept after a Mac takes it.

Formatdate-time
period_end?|

When the reservation ends unless renewed. Absent until a Mac first takes the reservation; period 1 starts then, so the wait for a Mac is not paid time.

Formatdate-time
period_n*integer

The current paid period (1-based).

Formatint32
period_seconds*integer

The period length in seconds.

Formatint64
period_started_at?|

When the current period started.

Formatdate-time
project_id*string

The project whose key bought the reservation. The reservation serves every project of the organization; this project's monthly budget gates its renewals, manual and automatic, which answer PROJECT_BUDGET_EXCEEDED while the project is held.

Formatuuid
region_id*string

The reservation region.

reissued_at?|

Set when the reservation moved to another Mac after a Mac failure.

Formatdate-time
renewal_error?|

Why the renewal of the next period failed (billing refused it, or the balance was too low); the reservation ends at period_end unless renewed by hand. Null when no renewal has failed.

renewal_pending*boolean

A renewal charge is still waiting for billing's answer.

resources_used*

The cores, memory and disk space in use on this reservation's Mac. Paused sandboxes and sandboxes with status deleting count.

slots_used*integer

macOS sandboxes currently occupying this reservation's Mac.

Formatint64
status*MacReservationStatus

The reservation status.

Value in"pending_charge""pending_mac""active""ending""released""failed"
curl -X PATCH 'https://example.com/reservations/string' \  -H 'Content-Type: application/json' \  -d '{  "auto_renew": true}'
{  "activated_at": "2019-08-24T14:15:22Z",  "auto_renew": true,  "capacity": null,  "created_at": "2019-08-24T14:15:22Z",  "end_reason": null,  "ended_at": "2019-08-24T14:15:22Z",  "id": "string",  "model": "string",  "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",  "origin": "explicit",  "pending_mac_started_at": "2019-08-24T14:15:22Z",  "period_end": "2019-08-24T14:15:22Z",  "period_n": 0,  "period_seconds": 0,  "period_started_at": "2019-08-24T14:15:22Z",  "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9",  "region_id": "string",  "reissued_at": "2019-08-24T14:15:22Z",  "renewal_error": "string",  "renewal_pending": true,  "resources_used": {    "cores": 0,    "disk_mib": 0,    "memory_mib": 0  },  "slots_used": 0,  "status": "pending_charge"}
POST
/reservations/{id}/renew

Charges the next period of an active reservation; period_end moves out by one period on the same Mac. A retry with the same idempotency key never charges twice.

Authorization

headerAuthorizationBearer <token>

Bearer project API key.

Scope: write:sandboxes

Path Parameters

id*string

The reservation ID

Header Parameters

Idempotency-Key*string

Unique per reservation renewal. A replay returns the reservation without charging another period

Response Body

The reservation

application/json
  1. response

A Mac reservation.

activated_at?|

When the reservation became active.

Formatdate-time
auto_renew*boolean

The reservation renews itself shortly before period_end (an hour by default) while a macOS sandbox is active on it; an idle reservation lapses instead.

capacity?|

The cores, memory and disk space for sandboxes of this reservation's Mac, set at purchase. Null when unknown; such a reservation accepts no new sandbox.

created_at*string

When the reservation was created.

Formatdate-time
end_reason?|

Why the reservation ended, or null while it is live.

ended_at?|

When the reservation ended.

Formatdate-time
id*string

The reservation ID.

model?|

The reserved Mac model, fixed at purchase, including renewal and replacement. Null when model information is unavailable; such a reservation accepts no new sandbox.

org_id*string

The organization ID.

Formatuuid
origin*MacReservationOrigin

How the reservation was bought: explicit by POST /reservations or a create with reservation: "new", and auto by a macOS create or start under the organization's auto-reserve setting.

Value in"explicit""auto"
pending_mac_started_at?|

When the reservation last began to wait for a Mac: at its first charge, or when it moved after a Mac failure. Kept after a Mac takes it.

Formatdate-time
period_end?|

When the reservation ends unless renewed. Absent until a Mac first takes the reservation; period 1 starts then, so the wait for a Mac is not paid time.

Formatdate-time
period_n*integer

The current paid period (1-based).

Formatint32
period_seconds*integer

The period length in seconds.

Formatint64
period_started_at?|

When the current period started.

Formatdate-time
project_id*string

The project whose key bought the reservation. The reservation serves every project of the organization; this project's monthly budget gates its renewals, manual and automatic, which answer PROJECT_BUDGET_EXCEEDED while the project is held.

Formatuuid
region_id*string

The reservation region.

reissued_at?|

Set when the reservation moved to another Mac after a Mac failure.

Formatdate-time
renewal_error?|

Why the renewal of the next period failed (billing refused it, or the balance was too low); the reservation ends at period_end unless renewed by hand. Null when no renewal has failed.

renewal_pending*boolean

A renewal charge is still waiting for billing's answer.

resources_used*

The cores, memory and disk space in use on this reservation's Mac. Paused sandboxes and sandboxes with status deleting count.

slots_used*integer

macOS sandboxes currently occupying this reservation's Mac.

Formatint64
status*MacReservationStatus

The reservation status.

Value in"pending_charge""pending_mac""active""ending""released""failed"
curl -X POST 'https://example.com/reservations/string/renew' \  -H 'Idempotency-Key: string'
{  "activated_at": "2019-08-24T14:15:22Z",  "auto_renew": true,  "capacity": null,  "created_at": "2019-08-24T14:15:22Z",  "end_reason": null,  "ended_at": "2019-08-24T14:15:22Z",  "id": "string",  "model": "string",  "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",  "origin": "explicit",  "pending_mac_started_at": "2019-08-24T14:15:22Z",  "period_end": "2019-08-24T14:15:22Z",  "period_n": 0,  "period_seconds": 0,  "period_started_at": "2019-08-24T14:15:22Z",  "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9",  "region_id": "string",  "reissued_at": "2019-08-24T14:15:22Z",  "renewal_error": "string",  "renewal_pending": true,  "resources_used": {    "cores": 0,    "disk_mib": 0,    "memory_mib": 0  },  "slots_used": 0,  "status": "pending_charge"}