Skip to main content
This guide sends a task to an agent on one of your phones and reads back the result. You need: a Lusor workspace with at least one phone: a Lusor Phone, or your own iPhone (connect your iPhone) or Android phone (connect your Android phone). See Phones.
1

Create an API key

In the Lusor app, open Settings → API Keys and create a key. Copy it now: it is shown once.
See Authentication for how keys work.
2

Find your phone

List the phones in the key’s workspace:
Response
Note the id of a phone with "connected": true.
3

Create an agent on that phone

The response is the agent. Keep data.id, the agent id. data.workspaceId is your workspace id, which you will need for direct phone control.
Your workspace may already have agents. GET /v1/agents lists them, so you can reuse one instead of creating one.
4

Send a task

Response (202)
The agent starts working in the background. sessionId identifies the session that records its work. The Idempotency-Key header makes the request safe to retry: sending the same key again returns this turn instead of starting a second one.
5

Wait for it to finish

Poll the session’s status every few seconds:
The session is finished when status is completed (or complete), failed, or cancelled. If it is awaiting_human, the agent has asked you a question. Answer it with POST /v1/sessions/<sessionId>/hitl and it carries on. See Answer the agent.
6

Read the result

The agent’s reply is the turn’s summary. Read the agent to see its newest turns:
Each entry in data.turns has the turn’s sessionId, status and summary. For the session itself, read GET /v1/sessions/<sessionId>: error explains a failure, and output holds data the agent collected, if any. To see each step the agent took, read GET /v1/sessions/<sessionId>/events.

A complete script

The same flow in one script. It stops waiting if the agent asks you a question.

Next steps

Send a turn

Queueing, safe retries, and sessions without an agent.

Follow a session

Statuses, events, artifacts and the session list.

Answer the agent

Reply when the agent asks you a question.

Direct phone control

Drive the phone yourself, action by action.