Skip to main content

One key per logical Start

Send an Idempotency-Key header with POST /sessions. Use 16–128 ASCII letters, digits, underscores, or hyphens. A UUID is a suitable value. The key belongs to your account. Replaying the same key with the same parsed JSON body returns the existing session identity instead of allocating another phone. JSON key ordering does not matter; changing fields or adding a formerly omitted default does.
Without this header, each accepted POST can create another session.

Recover an ambiguous result

If your connection drops after sending the request, you may not know whether a phone was created. Look up the key:
Illustrative response
Use the returned id to continue polling. If no receipt is found, retry the original POST with the same key and body. Even if the earlier request arrives late, the key prevents a second allocation for that logical request. Do not immediately generate another key because a request timed out.

Creation replay responses

The receipt remains available after the live session is removed. state: "recorded" is a receipt state, not API readiness. state: "released" and cleanup_complete: true confirm completed cleanup.

Operations are different

There is no general idempotency key for taps, text entry, app launches, or APK installation. A network failure does not prove the operation did not happen. Check the phone’s current state before repeating an action that could have side effects. For read-only polling, use bounded retries with backoff. If creation is refused for capacity, wait before retrying; repeatedly issuing new creation keys does not reserve future capacity.