> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lusor.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Press Home key

> Accepts an optional `capture` field.




## OpenAPI

````yaml /api-reference/openapi.yaml post /v1/workspaces/{workspaceId}/devices/{deviceId}/home
openapi: 3.1.0
info:
  title: Lusor API
  version: 0.1.0
  description: |
    Run AI agents on real phones, or drive a phone directly with
    deterministic actions.

    ## Authentication

    Every `/v1/*` endpoint except `GET /v1/health` requires an API key.
    Create one in the Lusor dashboard under **Settings → API Keys**. A key
    is shown once and is bound to one workspace. Revoking it there stops it
    working immediately.

    Send it in either header:

    - `X-Api-Key: <your API key>`
    - `Authorization: Bearer <your API key>`

    Because a key is bound to its workspace, `workspaceId` query and body
    parameters are optional for API-key callers. A request that names a
    different workspace returns an opaque `404`.

    ## Runs

    Use `POST /v1/agents/{id}/turns` to start or continue an agent run.
    Read the run under `/v1/sessions/{id}`; poll
    `GET /v1/sessions/{id}/status` or `GET /v1/sessions/{id}/events` for
    progress.

    ## Errors

    Errors are JSON: `{ "error": "<code>", "message": "<text>" }`. A
    request that fails validation returns `400` in one of two shapes,
    depending on the endpoint: `{ "error": "validation_error", "details":
    { ... } }` (direct phone control actions, for example), or
    `{ "error": "bad_request", "message": "<text>" }` (agent endpoints, for
    example). Branch on `error`.
  contact:
    name: Lusor
    url: https://lusor.ai
  license:
    name: Proprietary
    url: https://lusor.ai/terms
servers:
  - url: https://api.lusor.ai
    description: Production
security:
  - ApiKey: []
  - BearerAuth: []
tags:
  - name: Agents
    description: Persistent agents, the phone each one uses, and their turns (runs).
  - name: Secrets
    description: |
      Secrets saved in a workspace (passwords, sign-in details). A run uses
      them by name through `secrets`; values never travel in a request.
  - name: Sessions
    description: |
      Run records: list, inspect, stop, and read events and artifacts. Start
      a run with `POST /v1/agents/{id}/turns`, or without an agent through
      `POST /v1/workspaces/{workspaceId}/devices/{deviceId}/sessions`.
  - name: LiveView
    description: |
      View-only WebRTC live view of a session's phone: signaling, ICE
      servers, and stream control. API keys get live view only on the
      customer's own phone, not on a Lusor Phone.
  - name: Devices
    description: |
      The phones in your workspace, and reads of their current screen and
      UI tree.
  - name: DeviceVerbs
    description: |
      Direct phone control: deterministic actions (tap, swipe, type, key,
      clear, back, home, recent, screenshot, apps/start, apps/stop) and
      chains of them. On a Lusor Phone, API-key calls meter phone minutes.
  - name: Shell
    description: |
      Restricted shell escape hatch. Commands are checked against a
      denylist and audit-logged. No command output is returned.
  - name: Datasets
    description: Lists a run produced, saved as reusable Datasets.
  - name: Skills
    description: Reusable automation skills (Markdown documents).
  - name: PhoneNumbers
    description: |
      Workspace phone numbers and their stored SMS messages. Read-only for
      API keys.
  - name: Emails
    description: |
      Workspace Agent Mail addresses and stored inbound mail.
      Read-only: there is no compose, reply, or send endpoint, and message
      bodies are returned as raw plain text without HTML execution, remote
      asset fetches, or code extraction.
  - name: Workspaces
    description: The workspace an API key is bound to.
  - name: Catalog
    description: The catalog of apps that can be installed on a Lusor Phone.
  - name: Health
    description: Service health check.
paths:
  /v1/workspaces/{workspaceId}/devices/{deviceId}/home:
    post:
      tags:
        - DeviceVerbs
      summary: Press Home key
      description: |
        Accepts an optional `capture` field.
      operationId: deviceHome
      parameters:
        - $ref: '#/components/parameters/WorkspaceIdPath'
        - $ref: '#/components/parameters/DeviceIdPath'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmptyVerbInput'
      responses:
        '200':
          description: Home dispatched (capture optional)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VerbResultWithOptionalCapture'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/InternetRouteInactive'
        '503':
          $ref: '#/components/responses/MeterUnavailable'
components:
  parameters:
    WorkspaceIdPath:
      name: workspaceId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Workspace UUID. Caller must have access.
    DeviceIdPath:
      name: deviceId
      in: path
      required: true
      schema:
        type: string
      description: Device id (paired into the workspace).
  schemas:
    EmptyVerbInput:
      type: object
      description: |
        Body shape for empty-body verbs (`clear`, `back`, `home`,
        `recent`, `screenshot/trigger`). The body itself is optional;
        when supplied the only meaningful field is `capture`.
      properties:
        capture:
          $ref: '#/components/schemas/CaptureField'
    VerbResultWithOptionalCapture:
      allOf:
        - $ref: '#/components/schemas/VerbResult'
        - type: object
          properties:
            capture:
              $ref: '#/components/schemas/CaptureResponse'
    CaptureField:
      description: |
        `capture: boolean | CaptureOptions`. `true` captures with
        defaults; an object lets the caller override individual knobs.
        `false` or omitted = no capture.
      oneOf:
        - type: boolean
        - $ref: '#/components/schemas/CaptureOptions'
    VerbResult:
      type: object
      required:
        - ok
        - exit_code
        - status
      properties:
        ok:
          type: boolean
        exit_code:
          type: integer
          description: |
            `0` on success, non-zero on failure. Currently derived from
            `ok`; it does not carry the command's own exit code.
        status:
          type: string
        commandId:
          type: string
        durationMs:
          type:
            - integer
            - 'null'
        message:
          type: string
    CaptureResponse:
      type: object
      description: |
        Capture payload. All inner fields are optional and present iff
        the corresponding source was captured:
          - `elements` / `element_count` / `screen_dimensions` — set iff
            `capture.ui` was true.
          - `screenshot_url` — set iff `capture.screenshot` was true.

        A screenshot-only capture (no UI) returns just `screenshot_url`;
        a UI-only capture returns the tree + count + dimensions; a full
        capture returns everything.

        The action has already run when the capture is taken. On a single
        action endpoint, a failed capture still returns `200` with
        `capture: { failed: true, error }`, so a retry does not repeat a
        non-idempotent action. Inside a chain, a failed capture aborts the
        chain with an error instead (see `POST …/chain`).
      properties:
        failed:
          type: boolean
          description: >-
            Present and `true` only when the capture failed on a single action
            endpoint.
        error:
          type: string
          description: Why the capture failed. Present only with `failed`.
        elements:
          type: string
          description: |
            Formatted element tree. Present iff `capture.ui` was true.
            The exact shape depends on `capture.verbosity`.
        element_count:
          type: integer
          minimum: 0
          description: |
            Number of `[N]`-indexed interactive elements. Present iff
            `capture.ui` was true.
        screen_dimensions:
          type: object
          description: |
            Device screen size derived from the UI walk's bounding box.
            Present iff `capture.ui` was true.
          required:
            - width
            - height
          properties:
            width:
              type: integer
              minimum: 0
            height:
              type: integer
              minimum: 0
        screenshot_url:
          type: string
          description: |
            Present iff `capture.screenshot` was true. Links to the
            `GET /screenshot` endpoint, which needs the same API key and
            takes a new screenshot when fetched (metered on a Lusor Phone
            like any read). Fetch it before the next action if you want the
            screen this action left behind.
    ErrorResponse:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: string
        message:
          type: string
    CaptureOptions:
      type: object
      additionalProperties: false
      properties:
        ui:
          type: boolean
          description: Capture UI element tree (default true when `capture` is set).
        screenshot:
          type: boolean
          description: |
            When true, the response includes `screenshot_url`, a link to
            the `GET /screenshot` endpoint. That endpoint takes a new
            screenshot each time it is fetched, so the image shows the
            screen at fetch time, not the moment after the action.
        verbosity:
          $ref: '#/components/schemas/CaptureVerbosity'
        only:
          $ref: '#/components/schemas/CaptureOnlyFilter'
        min_size_px:
          type: integer
          minimum: 0
          description: Drop elements smaller than N pixels.
        include_keyboard:
          type: boolean
          description: Include the soft-input/keyboard subtree (default false).
        max_depth:
          type: integer
          minimum: 1
          maximum: 50
          description: Cap on the depth of the element tree.
    CaptureVerbosity:
      type: string
      enum:
        - compact
        - default
        - full
      description: |
        Presentation tier for `capture.elements`. `default` is the same
        element tree Lusor's own agent reads. `compact` drops indentation +
        non-interactive nodes for 60-70% fewer tokens. `full` includes every
        flag.
    CaptureOnlyFilter:
      type: string
      enum:
        - all
        - clickable
        - focused
        - editable
      description: |
        Subset filter applied before index assignment.
  responses:
    Unauthorized:
      description: Authentication required or invalid credentials.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    PaymentRequired:
      description: |
        The action was refused for billing and was not sent to the phone.
        `credits_exhausted` (`resource: "phone_minutes"`): the workspace is
        out of credits for Lusor Phone minutes, or reached its plan's
        allowance with overages off. `billing_required`: this Lusor Phone is
        not covered by an active paid plan.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternetRouteInactive:
      description: |
        `internet_route_inactive`: this Lusor Phone's Internet connection is
        not active yet. Retry once it is.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    MeterUnavailable:
      description: |
        `meter_unavailable`: metering for this Lusor Phone could not start,
        so the action was not sent. Safe to retry shortly.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: X-Api-Key
      description: Workspace API key, created in the dashboard under Settings → API Keys.
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        The same workspace API key, sent as `Authorization: Bearer <your API
        key>`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.