Skip to main content
Interact continues a task you already ran. A Scrape or Agent task ends on a screen of an app. Interact sends the next instruction for that screen in plain words, an AI agent carries it out on the same phone, and you read its answer as text. Send as many turns as you need, then stop. Use interact when one call gets you to the right place and you want to go one step further: open the most recent order after scraping the order list, or read a field on the screen an agent left open. Interact needs an earlier task. There is no interact call on an address. To start at a screen, scrape that screen first and continue its task.
Interact methods aren’t in the published SDKs yet. The examples here use the REST API.

Send a turn

Send the next instruction with POST /v1/interact/{id}, where {id} is the id the scrape or agent task returned:
The request returns 202 at once. The turn continues the task’s own session, so the id it answers is the task’s id:
Read the turn while its status is processing. If it reads awaiting_human, see Status before you read again.

Response

Status

While the scrape is within your plan’s history window, GET /v1/scrape/{id} still returns the scrape’s own document, during a turn and after it. A turn’s answer is read through interact.

Stop

POST /v1/interact/{id}/stop stops the turn running on the task’s phone:
A 200 acknowledges the stop. status says what it did: sessionDurationMs is the time since the stopped run took the phone, or 0 when it never took the phone or the stop answered noop. A turn the stop ended is charged as its run winds down, so read the turn again for the final creditsUsed.

The phone between turns

The phone is not held between calls. Each turn takes the phone again, and no phone time is charged in between. A later turn on the same id still works, as long as the screen the task left is still there: another task on the same phone in between can change it.
  • A phone busy with another task answers 429 device_busy. Try again when it frees.
  • A turn sent while the task’s own run, or an earlier turn, is still going answers 409 task_running. Wait for it to end. If you asked it to stop, keep reading the turn until it ends.

Retry safely

Use a new Idempotency-Key for each new turn. If you can’t tell whether a turn was accepted, retry with the same key. The request is checked again (body, credits, billing), and if it reaches the phone while the first result is still kept, it answers that result instead of starting a second turn. After 409 task_running or 429 device_busy, wait for the task or the phone to free up, then send the turn with a new key.

Options

Errors

Errors are JSON with an error code, and a message when there is one. See Errors.

Known limits

  • Prompts only. A turn takes a plain-words prompt. Scripts with code aren’t available yet.
  • Turns aren’t recorded yet. recordingUrl is the recording of the task that started it.
  • No live view link for a turn.
  • Text answers only. A turn doesn’t return the screen as a document yet. To read a screen in a set format, use Scrape.

Scrape

Read a screen you already know, with no agent.

Agent

Describe a task in plain words and get the answer.