Skip to content
中文

Retrieve agent phone

Code Mode: praxis.agent.agents.phone.retrieve

HTTP: GET /agent/v1/agents/{agent_id}/phone

Read the agent’s phone, or learn that it has none: use it before driving the phone or to show its state in a settings page. configured says whether a phone block is saved at all (false is not an error: the phone is off). A cloud phone’s state is one of none, starting, booting, restoring, running, archiving or releasing — none means no instance exists (never built, already released, or gone), archiving means its app state is being packed, and releasing means a release was asked for and the cron has not finished. A BYOD phone (the organization’s own device) has two states instead, online and offline, and reports byod_device as its byd_… id, sku null and no lease. sku and name come from the configuration when one exists. When a cloud phone is reachable, sandbox_id is the public sandbox id of its running instance; for a BYOD phone sandbox_id is the byd_… id itself: take either phone over through POST /sandbox/v1/sandboxes/{id}/act, or open the sandbox page’s screen tab in the Console; lease_ends_at is when a cloud instance’s lease runs out and the sandbox kills it, and is always null for a BYOD phone. archived_at and archive_error describe the last app-state archive, which a fresh instance restores on the next use; both are null for a BYOD phone, which is never archived. Reading never builds a phone. Only a general or assume agent may have one: a service agent, an agent of another organization and a missing agent all answer 404 AGENT_NOT_FOUND. This operation is for people and their tools — the model cannot call it; an agent drives its own phone only through its phone tool, which can act on the device but cannot read this state or release it.

Signature

praxis.agent.agents.phone.retrieve(args:{path:{agent_id:string}}):Promise<{/** Object type, always agent_phone. */ object:"agent_phone";/** The agent's public id (agent_…), the agent this phone belongs to. */ agent_id:string;/** Whether this agent has a phone configured at all. */ configured:boolean;/** What the phone is doing now. */ state:"none"|"starting"|"booting"|"restoring"|"running"|"archiving"|"releasing"|"online"|"offline";/** The sandbox SKU a cloud phone is built from (for example android-2c4g), or null when no phone is configured. */ sku:string|null;/** A BYOD phone's device id (byd_…), or null for a cloud phone. */ byod_device:string|null;/** What people and the model call this phone, or null when no phone is configured. */ name:string|null;/** The public sandbox id of the running instance, or null when there is no instance. */ sandbox_id:string|null;/** When the current instance's lease runs out, in RFC 3339; the sandbox kills the phone then. */ lease_ends_at:string|null;/** When the app state was last packed for this phone, in RFC 3339; null when it never was. */ archived_at:string|null;/** Why the last app-state archive failed, or null. */ archive_error:string|null}>;

Parameters

NameInTypeRequiredDescription
agent_idpathstringyesAgent id from agent creation or listing, the eight character identity number or the handle. A service agent never has a phone and answers not found. Also accepts an 8-character identity number (0–9, A–Z); malformed, absent and foreign references return 404, and response ids always use agent_….

Responses

StatusContent typesDescription
200application/jsonThis agent’s phone: whether one is configured, what it is doing, and the public sandbox id to take it over with.
400INVALID_PARAMS: the agent_id is missing or malformed.
401application/jsonUNAUTHENTICATED (or INVALID_API_KEY, API_KEY_DISABLED, API_KEY_EXPIRED, INVALID_API_TOKEN, API_TOKEN_EXPIRED, API_TOKEN_REVOKED): the API key is missing, invalid or revoked. Send a valid key as X-API-Key or as a Bearer token.
403application/jsonpermission_error: the credential’s role or bound resources do not allow this operation. Use a key with access to the agent domain and its resources.
404AGENT_NOT_FOUND: no agent with this reference belongs to your organization, this credential cannot see it, or it is a service agent (which never has a phone).
502Agent service failed
503Agent service unavailable