Devices

Provision a new device

Changed on

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.

post/devices

Request

  • Base URL
    https://api.mobilerun.ai
  • URL
    https://api.mobilerun.ai/devices
  • Auth
    HTTP bearer

Query parameters

deviceTypestring

Use android_cloud_phone for a cloud Android phone. Only canonical identifiers are accepted. Other backends are deployment-specific; recognized but unavailable types return DEVICE_TYPE_UNAVAILABLE (422). Retired dedicated_* aliases are rejected with a canonical replacement.

Example:android_cloud_phone
countrystring

ISO 3166-1 alpha-2 country code. If omitted the system picks the country with the most availability.

profileIdstring

Profile ID to use as device spec

templatestring

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.

Example:onboarding
billing'auto' | 'subscription' | 'minute'

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.

Headers

Idempotency-Keystring

Optional. 1-255 printable ASCII characters without spaces. Retrying with the same key and request returns the same device instead of creating another one; see the Idempotency section of the create-device guide.

Request body

$schemastring uri

A URL to the JSON Schema for this object.

androidVersioninteger
appsstring[] nullable
countrystring
filesstring[] nullable
localestring
namestring
timezonestring

Example request

{
  "$schema": "https://example.com/schemas/DeviceSpec.json",
  "location": {
    "$schema": "https://example.com/schemas/Location.json"
  }
}

Response

OK

$schemastring uri

A URL to the JSON Schema for this object.

activeTaskIdstring required
assignedAtstring date-time nullable required
billingStrategystring
createdAtstring date-time required
createdBystring
idstring required
namestring required
ownerIdstring
platform'android' | 'ios' required

Operating system the device runs.

providerIdstring
statestring required
stateMessagestring required
streamTokenstring
streamUrlstring required
taskCountinteger required
terminatesAtstring date-time nullable required
typestring required
updatedAtstring date-time required
userIdstring

Deprecated: use ownerId/createdBy.

Example response

{
  "$schema": "https://example.com/schemas/DeviceInfo.json"
}

Changes

    • info

      added the new optional query request parameter template

    • breaking

      removed the enum value android_cloud_phone from the query request parameter deviceType

    • breaking

      removed the enum value dedicated_emulated_device from the query request parameter deviceType

    • breaking

      removed the enum value dedicated_ios_device from the query request parameter deviceType

    • breaking

      removed the enum value dedicated_physical_device from the query request parameter deviceType

    • breaking

      removed the enum value dedicated_premium_device from the query request parameter deviceType

    • info

      the endpoint scheme security bearerAuth was removed from the API

    • info

      added the new optional header request parameter Idempotency-Key

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the required property to the response with the status