> ## 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.

# Get a scrape's status and document

> `status` is `processing` while the task waits for its phone or
works, and `completed`, `failed` or `cancelled` once it ended.

A completed task answers Firecrawl's document: `markdown`, `json`
(only when the task asked for `{type: "json", schema}`), `screenshot`
(a link to the screen's own picture, valid up to 24 hours, or the
picture itself as a data URL), and `metadata`.

A failed task answers `error`: the reason it stopped, including the
step of the address the screen did not match.




## OpenAPI

````yaml /api-reference/openapi.yaml get /v1/scrape/{id}
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

    `POST /v1/agent` runs one task on a phone and returns its id; read the
    result with `GET /v1/agent/{id}`.

    To keep a conversation with an agent instead, 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: Agent
    description: |
      One call runs a task on a phone and returns its result: the answer
      as `data` (text, or the object a schema describes) and the run's
      recording.
  - name: Scrape
    description: |
      One call reads one screen of an app: the screen as Markdown, fields
      read off it, and its picture.
  - name: Interact
    description: |
      Keep working on the screen an agent or scrape task left open, then
      stop.
  - name: Map
    description: |
      List an app's known screens as `app://` addresses, from the screens
      earlier runs passed through. Never walks a phone.
  - 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. Addresses

      are added and removed through a quote (billed to the workspace's

      Inbox plan). Mail is 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: Billing
    description: The account's plan and the credits it has left.
  - name: Catalog
    description: The catalog of apps that can be installed on a Lusor Phone.
  - name: AppInstalls
    description: |
      Install catalog apps on a phone, follow the installs, and uninstall
      them. Viewers cannot install.
  - name: Notifications
    description: |
      Notifications the workspace's phones forward, the apps each phone
      forwards, and the rules that act on them. Read-only for API keys.
  - name: Files
    description: Files the workspace's agents saved from its phones. Read-only.
  - name: ModelKeys
    description: |
      The workspace's own OpenAI or Anthropic API key, used by its runs
      instead of Lusor's (paid plans).
  - name: Health
    description: Service health check.
paths:
  /v1/scrape/{id}:
    get:
      tags:
        - Scrape
      summary: Get a scrape's status and document
      description: |
        `status` is `processing` while the task waits for its phone or
        works, and `completed`, `failed` or `cancelled` once it ended.

        A completed task answers Firecrawl's document: `markdown`, `json`
        (only when the task asked for `{type: "json", schema}`), `screenshot`
        (a link to the screen's own picture, valid up to 24 hours, or the
        picture itself as a data URL), and `metadata`.

        A failed task answers `error`: the reason it stopped, including the
        step of the address the screen did not match.
      operationId: getScrape
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The task id returned by `POST /v1/scrape`.
        - $ref: '#/components/parameters/WorkspaceIdQuery'
        - $ref: '#/components/parameters/ViewerLinkTtlQuery'
      responses:
        '200':
          description: The task's status and document
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScrapeTaskStatus'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    WorkspaceIdQuery:
      name: workspaceId
      in: query
      required: false
      schema:
        type: string
        format: uuid
      description: |
        Workspace the request is scoped to. Optional for API keys: a key is
        bound to one workspace when it is created, and naming any other
        workspace returns an opaque 404.
    ViewerLinkTtlQuery:
      name: expiresIn
      in: query
      required: false
      schema:
        type: integer
        minimum: 30
      description: |
        Shortens the viewer link in this response, in seconds (capped at six
        hours). The task's own end still wins, so this only ever makes it
        expire sooner.
  schemas:
    ScrapeTaskStatus:
      type: object
      required:
        - status
        - error
      properties:
        status:
          type: string
          enum:
            - processing
            - completed
            - failed
            - cancelled
        markdown:
          type: string
          description: |
            The page as Markdown: its title, then one line per labelled
            control, top to bottom over every screen read, each row once.
            Present when `markdown` was asked for.
        json:
          type: object
          additionalProperties: true
          description: |
            The asked-for fields, read off the page. A field whose value the
            page's text does not show is `null`. Present when the task asked
            for `{type: "json", schema}`.
        screenshot:
          type: string
          description: |
            The first screen's own picture (the screen the address reached), a
            PNG, in one of two forms. Usually an `https` link, valid for 24
            hours from this read but never past the moment this result leaves
            the task history; read the task again for a fresh link. Otherwise
            the picture itself, inline, as a `data:image/png;base64,…` URL: a
            task whose picture could not be stored is answered that way.
            Present when a screenshot was asked for.
        screenshots:
          type: array
          items:
            type: string
          description: |
            Every screen read, top to bottom, one PNG each, in the same form
            as `screenshot`: all `https` links (valid up to 24 hours, never
            past the result's history deadline) or all inline
            `data:image/png;base64,…` URLs.
            Present when `{type: "screenshot", fullPage: true}` was asked for.
        metadata:
          anyOf:
            - $ref: '#/components/schemas/ScrapeMetadata'
            - $ref: '#/components/schemas/ConcurrencyQueueMetadata'
          description: |
            The document's metadata (`ScrapeMetadata`) once the task completed.
            A task that did not complete (still running, failed or cancelled)
            carries only `concurrencyLimited` and `concurrencyQueueDurationMs`
            (`ConcurrencyQueueMetadata`), once it took its phone after waiting
            for it.
        liveViewUrl:
          type: string
          description: |
            A fresh watch-only link to the phone this scrape is driving.
            Present while the task is live and recording; absent once it ended,
            and on a phone that cannot serve one.
        error:
          type:
            - string
            - 'null'
          description: |
            Why the task failed, when it did, including the step of the
            address the screen did not match.
    ScrapeMetadata:
      type: object
      required:
        - scrapeId
        - url
        - sourceURL
        - durationMs
      properties:
        scrapeId:
          type: string
          description: The task id, which is also the id of its session.
        url:
          type: string
          description: |
            The address of the screen the read ended on. A read that does not
            reach the address it was given fails, so a completed task answers
            the address it followed.
        sourceURL:
          type: string
          description: The address the task was given, as written.
        title:
          type: string
          description: The screen's navigation-bar title, when the read found one.
        app:
          type: string
          description: The foreground app's id, when the read named one.
        device:
          type: string
          description: The phone the task ran on.
        unverified:
          type: array
          items:
            type: string
          description: |
            The `json` fields whose value the page's text did not show, each
            answered as `null` in `json`. A field the read found no value for
            is `null` without being listed here, and a boolean field is never
            listed. Present only when `json` was asked for and at least one
            field is listed.
        screensRead:
          type: integer
          description: |
            How many screens of the page were read: 1 for a page that does
            not scroll, at most `maxScreens`.
        reachedEnd:
          type: boolean
          description: |
            Whether the read reached the page's end: true when a page move
            after the last screen read found the page no longer moving, false
            when `maxScreens` stopped the read first.
        durationMs:
          type: number
          description: How long the read took, in milliseconds.
        concurrencyLimited:
          type: boolean
          description: |
            True when the task waited for its phone, which was running another
            task. Absent when the phone was free.
        concurrencyQueueDurationMs:
          type: number
          description: |
            How long the task waited for its phone, in milliseconds, from the
            request to the phone taking it. Present with `concurrencyLimited`.
        creditsUsed:
          type: integer
          description: |
            Credits this scrape was charged. Lusor cloud phone minutes are
            billed apart.
    ConcurrencyQueueMetadata:
      type: object
      description: |
        Present once a task that waited for its phone has started: the phone
        was running another task, so this one queued.
      required:
        - concurrencyLimited
        - concurrencyQueueDurationMs
      properties:
        concurrencyLimited:
          type: boolean
          description: Always true; the task waited for its phone.
        concurrencyQueueDurationMs:
          type: number
          description: |
            How long the task waited for its phone, in milliseconds, from the
            request to the phone taking it.
    ErrorResponse:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: string
        message:
          type: string
  responses:
    Unauthorized:
      description: Authentication required or invalid credentials.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Resource not found.
      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.