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": "string",      "reissued_at": "2019-08-24T14:15:22Z",      "renewal_error": "string",      "renewal_pending": true,      "resources_used": {        "disk_mib": 0,        "memory_mib": 0,        "vcpus": 0      },      "sandboxes_per_mac": 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*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 reserved model's CPU, memory, and sandbox disk room. Fixed at purchase. Null on reservations bought before Mac models were recorded; such a reservation takes 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 on reservations bought before Mac models were recorded; such a reservation takes no new sandbox.

org_id*string

The organization ID.

Formatuuid
origin*MacReservationOrigin

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

Value in"explicit""auto"
pending_mac_started_at?|

When the reservation last began waiting for a Mac: at its first charge, or when it moved after its Mac was lost. Kept after a Mac claims it.

Formatdate-time
period_end?|

When the reservation ends unless renewed. Absent until a Mac first claims it (period 1 starts at the claim, so waiting 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*string

The reservation region.

reissued_at?|

Set when the reservation moved to another Mac after its Mac was lost.

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*

CPU and memory held by the sandboxes on this reservation's Mac, including paused sandboxes and sandboxes still being deleted, and the disk its sandboxes hold, stopped sandboxes included. Sandboxes that no Mac has claimed yet are not counted.

sandboxes_per_mac*integer

Most sandboxes this reservation's Mac runs at once, subject to CPU, memory, and disk fit. Stopped sandboxes do not count. 0 when the reservation takes no new sandbox: its capacity is null, or fits no minimum-sized sandbox.

Formatint32
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": "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": "string",  "reissued_at": "2019-08-24T14:15:22Z",  "renewal_error": "string",  "renewal_pending": true,  "resources_used": {    "disk_mib": 0,    "memory_mib": 0,    "vcpus": 0  },  "sandboxes_per_mac": 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 but at least min_count, the request reserves as many as are free.

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*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": "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": "string",      "reissued_at": "2019-08-24T14:15:22Z",      "renewal_error": "string",      "renewal_pending": true,      "resources_used": {        "disk_mib": 0,        "memory_mib": 0,        "vcpus": 0      },      "sandboxes_per_mac": 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 reserved model's CPU, memory, and sandbox disk room. Fixed at purchase. Null on reservations bought before Mac models were recorded; such a reservation takes 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 on reservations bought before Mac models were recorded; such a reservation takes no new sandbox.

org_id*string

The organization ID.

Formatuuid
origin*MacReservationOrigin

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

Value in"explicit""auto"
pending_mac_started_at?|

When the reservation last began waiting for a Mac: at its first charge, or when it moved after its Mac was lost. Kept after a Mac claims it.

Formatdate-time
period_end?|

When the reservation ends unless renewed. Absent until a Mac first claims it (period 1 starts at the claim, so waiting 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*string

The reservation region.

reissued_at?|

Set when the reservation moved to another Mac after its Mac was lost.

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*

CPU and memory held by the sandboxes on this reservation's Mac, including paused sandboxes and sandboxes still being deleted, and the disk its sandboxes hold, stopped sandboxes included. Sandboxes that no Mac has claimed yet are not counted.

sandboxes_per_mac*integer

Most sandboxes this reservation's Mac runs at once, subject to CPU, memory, and disk fit. Stopped sandboxes do not count. 0 when the reservation takes no new sandbox: its capacity is null, or fits no minimum-sized sandbox.

Formatint32
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": "string",  "reissued_at": "2019-08-24T14:15:22Z",  "renewal_error": "string",  "renewal_pending": true,  "resources_used": {    "disk_mib": 0,    "memory_mib": 0,    "vcpus": 0  },  "sandboxes_per_mac": 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 reserved model's CPU, memory, and sandbox disk room. Fixed at purchase. Null on reservations bought before Mac models were recorded; such a reservation takes 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 on reservations bought before Mac models were recorded; such a reservation takes no new sandbox.

org_id*string

The organization ID.

Formatuuid
origin*MacReservationOrigin

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

Value in"explicit""auto"
pending_mac_started_at?|

When the reservation last began waiting for a Mac: at its first charge, or when it moved after its Mac was lost. Kept after a Mac claims it.

Formatdate-time
period_end?|

When the reservation ends unless renewed. Absent until a Mac first claims it (period 1 starts at the claim, so waiting 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*string

The reservation region.

reissued_at?|

Set when the reservation moved to another Mac after its Mac was lost.

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*

CPU and memory held by the sandboxes on this reservation's Mac, including paused sandboxes and sandboxes still being deleted, and the disk its sandboxes hold, stopped sandboxes included. Sandboxes that no Mac has claimed yet are not counted.

sandboxes_per_mac*integer

Most sandboxes this reservation's Mac runs at once, subject to CPU, memory, and disk fit. Stopped sandboxes do not count. 0 when the reservation takes no new sandbox: its capacity is null, or fits no minimum-sized sandbox.

Formatint32
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": "string",  "reissued_at": "2019-08-24T14:15:22Z",  "renewal_error": "string",  "renewal_pending": true,  "resources_used": {    "disk_mib": 0,    "memory_mib": 0,    "vcpus": 0  },  "sandboxes_per_mac": 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 reserved model's CPU, memory, and sandbox disk room. Fixed at purchase. Null on reservations bought before Mac models were recorded; such a reservation takes 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 on reservations bought before Mac models were recorded; such a reservation takes no new sandbox.

org_id*string

The organization ID.

Formatuuid
origin*MacReservationOrigin

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

Value in"explicit""auto"
pending_mac_started_at?|

When the reservation last began waiting for a Mac: at its first charge, or when it moved after its Mac was lost. Kept after a Mac claims it.

Formatdate-time
period_end?|

When the reservation ends unless renewed. Absent until a Mac first claims it (period 1 starts at the claim, so waiting 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*string

The reservation region.

reissued_at?|

Set when the reservation moved to another Mac after its Mac was lost.

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*

CPU and memory held by the sandboxes on this reservation's Mac, including paused sandboxes and sandboxes still being deleted, and the disk its sandboxes hold, stopped sandboxes included. Sandboxes that no Mac has claimed yet are not counted.

sandboxes_per_mac*integer

Most sandboxes this reservation's Mac runs at once, subject to CPU, memory, and disk fit. Stopped sandboxes do not count. 0 when the reservation takes no new sandbox: its capacity is null, or fits no minimum-sized sandbox.

Formatint32
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": "string",  "reissued_at": "2019-08-24T14:15:22Z",  "renewal_error": "string",  "renewal_pending": true,  "resources_used": {    "disk_mib": 0,    "memory_mib": 0,    "vcpus": 0  },  "sandboxes_per_mac": 0,  "slots_used": 0,  "status": "pending_charge"}