Provision a new device
Requests a new device from the specification in the request body. Optional query parameters select the canonical device type, country, billing mode, and base profile. Returns the device, its resolved billing strategy, and its stream token.
billingStrategy, and its stream token.
Choose a device type
Useandroid_cloud_phone for the cloud Android phone offering. For example:
android_cloud_phone, ios_phone and
device_slot. Any other value is rejected with HTTP 422. A listed type that
is not available for creation in your deployment returns
DEVICE_TYPE_UNAVAILABLE (HTTP 422). This is different from temporarily
having no free devices.
Choose a billing mode
auto to try minutes. Billing-service failures and
indeterminate responses never trigger fallback. When neither mode is enabled,
creation is denied. Fallback is another admission attempt, not a guarantee that
creation will succeed.
An explicit subscription request without entitlement returns
SUBSCRIPTION_REQUIRED (HTTP 402). When minute billing is enabled, the message
suggests explicitly selecting billing=minute, subject to its own checks.
A minute-billed request whose cloud-phone minute balance is exhausted (the
plan’s minute feature is spent, not a generic credits shortfall) returns
MINUTE_BALANCE_EXHAUSTED (HTTP 402). The remedy is a plan upgrade, a one-off
minute top-up, or the next billing period, not a credits top-up. Minute-billed concurrency limits keep the
generic PAYMENT_REQUIRED (HTTP 402) shape.
Idempotency
Send an optionalIdempotency-Key header (1-255 printable ASCII characters, no
spaces) to make a retry safe. Retrying with the same key and the same request
returns the same device, with the original status, its current state and
Idempotent-Replayed: true; no second device is created or billed.
- The same key with a different request (device type, country, billing, profile
or spec) returns
422 idempotency_key_reused. - While the first request is still running, a retry returns
409 idempotency_request_in_progresswithRetry-After: 1; retry shortly. - If the device has since been terminated, deleted or transferred to another
owner, the retry returns
404(still markedIdempotent-Replayed: true) and never a stream token. - A create that is denied before any device exists (for example a billing or capacity denial) frees the key, so a retry re-evaluates the request.
- A create that fails after the device was announced (for example a provider
error) binds the key to that device instead, so a retry can never create a
second one: the retry is a replay (
404if that device is already terminated). This is a deliberate deviation from “a failed create always frees the key”; use a new key to start over. - A create that is cancelled because it ran too long follows the same rule: the key stays bound only if a device was created, and is otherwise freed.
- A malformed key returns
400 invalid_idempotency_key. Without the header the endpoint behaves exactly as before.
Headers
Query Parameters
Device type: android_cloud_phone (cloud Android phone), ios_phone or device_slot. Any other value is rejected with 422. Not every device type is available for creation; an unavailable type returns DEVICE_TYPE_UNAVAILABLE (422).
android_cloud_phone, ios_phone, device_slot "android_cloud_phone"
Optional device template, e.g. onboarding. The device gets the template's Android version and preinstalled apps and is ready in seconds when a prepared phone is available; otherwise it boots with the same setup. Country, name and proxy still come from this request. Cannot be combined with profileId, apps or androidVersion. Omit it to create from the request alone.
80"onboarding"
Billing mode. 'auto' tries subscription first, then minute billing if no subscription entitlement exists or all subscription slots are in use, provided minute billing is enabled. When subscription billing is disabled, auto uses minutes directly. Billing-service failures never trigger fallback. 'subscription' requires an available subscription slot and never falls back. 'minute' uses minute billing only, subject to balance and concurrency checks. Modes depend on the device type's billing configuration.
auto, subscription, minute Body
Response
OK