Response Format
Every JSON response includes anok field that indicates success or failure.
Type Safety: When
ok is true, the data field is always present. When ok is false, there is no data field and the error field is always present.error.code is a stable, machine-readable string. Branch on it. error.message is written for people and can change.
Per-Phone Results
An endpoint that acts on phones returns one Result per phone indata, in the order you listed them in phoneIds. Each result has its own ok:
- The request. The top-level
okisfalsewhen the request itself was rejected: a bad API key, an invalid body, or a phone ID that is not one of yours. In that case nothing was done on any phone. - Each phone. When the top-level
okistrue, the request was carried out on every phone, and each result says how it went on that phone. One phone failing does not stop the others.
ok on each result, even when you sent a single phone.
Conventions
- JSON endpoints use
POSTwithContent-Type: application/json. A request with no parameters can send no body at all. The session view connection instead upgrades aGETto WebSocket and uses its documented message protocol. - Field names are
camelCase. - Timestamps are ISO 8601 strings in UTC, for example
2026-10-01T18:25:43.511Z. - Times and durations are in milliseconds.
- Positions and sizes on the screen are in screenshot pixels.
Responses That Are Not JSON
Appium returns standard WebDriver responses. It still returns the JSON error format above when a request is rejected before reaching the phone.Using the Response Pattern
Error Codes
Request errors
These reject the whole request. The HTTP status is not200 and nothing is done on any phone.
Phone errors
These appear on one phone’s result. The HTTP status of the request is still200.
Codes specific to one endpoint are listed on that endpoint’s page.
One Phone
Every endpoint that takesphoneIds also takes phoneId: one phone, as a string. The answer’s data is then that phone’s result itself instead of a one-element list, and a failure on the phone is the whole request’s ok: false, with the phone’s error and an HTTP status for its code (session_required and in_use 409, phone_offline 503, unsupported 400, timeout 504, target_not_found 404, stale_screen 409). This is the simplest form for a script or a model that drives one phone.
phoneIds answers exactly as before. Give one or the other, not both.
Rate Limits
Each API key can make up to 20 requests per second. A request counts once, however many phones it targets. Requests over the limit return429 with the code rate_limited and a Retry-After header giving the number of seconds to wait.
One Action at a Time
Actions on the same phone run one at a time, in the order they arrive. A request that arrives while another action is still running on that phone waits its turn. Different phones run in parallel, including the phones of a single request. Browser view close is a lifecycle cancellation: it records the view as closed without waiting behind a pending action, then safely tears down the exact session if no other hold remains. Import Status only reads, so it does not wait its turn: a read bymediaId that arrives before an Import Media of the same item has started on that phone reports the earlier import of that item; read by importId to avoid it.
Timeouts
Most actions finish in well under a second. Every request has a hard limit of 120 seconds. A phone that has not finished by then gets the error codetimeout on its result; the other phones’ results are returned as normal. An import that outlives it is reported as importing, not timeout, and finishes on its own.