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

# Put a Lusor Phone on a static IP

> With no body, puts the phone on its own static IP. Each Lusor Phone
includes one; this call does not charge the workspace. Setting it up
can take minutes: the answer is `200` when it is active, otherwise
`202` with an `operationId` to poll with `GET …/static-ip?operation=`.

With `{ proxyId }`, the phone uses a Persistent IP the workspace
already owns (`GET …/static-ip/owned`), free; the IP it used before
lapses once no phone uses it. Answers `200`.

To buy another Persistent IP, quote it with
`POST /internet/persistent-ips/preview`, then confirm with
`POST /internet/persistent-ips`. An API key may use phones in its own
workspace; a signed-in user needs the admin role.

**Retries:** safe within 5 minutes: a repeat answers the same operation, and a phone already on its static IP buys nothing.




## OpenAPI

````yaml /api-reference/openapi.yaml post /v1/workspaces/{workspaceId}/devices/{deviceId}/static-ip
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/workspaces/{workspaceId}/devices/{deviceId}/static-ip:
    post:
      tags:
        - Devices
      summary: Put a Lusor Phone on a static IP
      description: >
        With no body, puts the phone on its own static IP. Each Lusor Phone

        includes one; this call does not charge the workspace. Setting it up

        can take minutes: the answer is `200` when it is active, otherwise

        `202` with an `operationId` to poll with `GET …/static-ip?operation=`.


        With `{ proxyId }`, the phone uses a Persistent IP the workspace

        already owns (`GET …/static-ip/owned`), free; the IP it used before

        lapses once no phone uses it. Answers `200`.


        To buy another Persistent IP, quote it with

        `POST /internet/persistent-ips/preview`, then confirm with

        `POST /internet/persistent-ips`. An API key may use phones in its own

        workspace; a signed-in user needs the admin role.


        **Retries:** safe within 5 minutes: a repeat answers the same operation,
        and a phone already on its static IP buys nothing.
      operationId: enableDeviceStaticIp
      parameters:
        - $ref: '#/components/parameters/WorkspaceIdPath'
        - $ref: '#/components/parameters/DeviceIdPath'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeviceStaticIpEnableInput'
      responses:
        '200':
          description: The phone is on the static IP
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/DeviceStaticIpStatus'
                required:
                  - data
        '202':
          description: The static IP is being set up; poll `GET …/static-ip?operation=`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/DeviceStaticIpStatus'
                required:
                  - data
        '400':
          description: |
            `bad_request`: `proxyId` is not a positive integer.
            `unsupported_country`: a static IP is not available in the
            phone's country.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          description: >-
            `not_entitled`: this phone is not covered by the workspace's current
            Lusor Phone quantity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: >-
            `not_found`: the phone, or the `proxyId`, is not available to this
            workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: |
            `needs_review`: setting up this phone's static IP needs support.
            `ip_order_open`: this phone's Persistent IP order is still being
            set up. `attach_refused`: the Persistent IP could not be attached;
            the phone's connection is unchanged.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: '`cap_busy`: static IPs can''t be set up right now. Try again later.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Busy'
        '503':
          description: >-
            `static_ip_unavailable`: the static IP service is not available
            right now. Retry later.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
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:
    DeviceStaticIpEnableInput:
      type: object
      properties:
        proxyId:
          type: integer
          minimum: 1
          description: >-
            A Persistent IP the workspace owns (`proxyId` in `GET
            …/static-ip/owned`).
    DeviceStaticIpStatus:
      type: object
      required:
        - state
      properties:
        state:
          type: string
          enum:
            - active
            - provisioning
            - needs_review
            - disabled
        static:
          oneOf:
            - $ref: '#/components/schemas/DeviceStaticIp'
            - type: 'null'
          description: Absent while an operation is in progress.
        operationId:
          type: string
          description: >-
            Present while an operation is in progress. Pass it as `operation` to
            poll.
    ErrorResponse:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: string
        message:
          type: string
    Busy:
      type: object
      description: |
        A `429` refusal. `device_busy` carries `currentSessionId` (the run
        holding the phone); `cap_busy` does not. A Persistent IP
        replacement can also answer `replace_limit` (3 in 24 hours) or
        `refund_pending`. Any authenticated request
        can also get `rate_limit_exceeded` when the API's request rate limit
        is exceeded; it comes with a `Retry-After` header in seconds.
      required:
        - error
      properties:
        error:
          type: string
          enum:
            - device_busy
            - cap_busy
            - replace_limit
            - refund_pending
            - rate_limit_exceeded
        currentSessionId:
          type:
            - string
            - 'null'
        message:
          type: string
    DeviceStaticIp:
      type: object
      required:
        - state
        - country
        - publicIp
        - expiresAt
      properties:
        state:
          type: string
          enum:
            - active
            - provisioning
            - needs_review
            - disabled
        country:
          type:
            - string
            - 'null'
          description: ISO 3166-1 alpha-2, lowercase.
        publicIp:
          type:
            - string
            - 'null'
          description: The address the phone's traffic exits from.
        expiresAt:
          type:
            - string
            - 'null'
          format: date-time
          description: End of the paid term.
  responses:
    Unauthorized:
      description: Authentication required or invalid credentials.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: The caller may not perform this action.
      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.