Welcome to the Phones Inc API

The Phones Inc API lets you control the real phones in your organization from your own code: touch and type, read the screen, watch it live, manage apps, move photos, videos and files on and off the phone, and drive the phone with Appium. Your phones are private to your organization. Nobody outside it can see or control them. The API works the same way for Android phones and iPhones. Where a feature exists on only one platform, the endpoint’s page says so.

Base URL

All API requests should be made to:

Authentication

Authenticate every request with an API key in the Authorization header. A signed-in web client can use the user’s login token in the same header:

Getting Your API Key

  1. Sign in at app.phones.inc
  2. Open API Keys and create a key
  3. Copy the key. The full secret (ph_...) is shown exactly once.
A key acts as the user who created it within its organization and can access every phone assigned to that organization. It shares that user’s sessions with their other keys and web login; it cannot take over another user’s session. You can create several keys and revoke any of them at any time from the same page. A revoked key stops working immediately.
Keep your API key secure! Never commit it to version control or expose it in client-side code. Anyone holding the key can control your phones.

Selecting an Organization

A key is already bound to one organization. A login can select one of its current organizations with this optional header on any request, including a file upload:
Selection narrows the request to that existing organization. Administrators may select any existing organization; a key cannot select a different organization. An inaccessible or nonexistent selection returns not_found; an empty header returns invalid_request. Without the header, keys and single-organization logins keep their automatic behavior. Logins in several organizations must choose one for media uploads and organization streams. An administrator without a selection can open the fleet preview through Open Live Stream, with access limited to the requested phones. Selection does not change who owns a session. The client option is organizationId:

How Requests Work

Most endpoints are a POST with a JSON body. You select phones with phoneIds in the body, rather than putting a phone ID in the URL. Media upload also accepts multipart form data; Appium uses WebDriver methods and paths. Browser presence uses the session view WebSocket.
  • Pass one phone or many. The request runs on all of them at the same time and returns one result per phone.
  • Endpoints that change something on a phone (touch, typing, keys, installing an app, writing a file, rebooting) always need phoneIds.
  • Endpoints that only read let you leave phoneIds out to mean every phone you can access. Session endpoints explain whether omission selects all accessible phones or only your active sessions.
Appium is the one endpoint that works differently: it takes the phone from the WebDriver capabilities.

How It Works

  1. Find your phones. Get Phones lists the phones assigned to your organization.
  2. Start a session. A session wakes the phone and connects its network so it is ready to use.
  3. Control it. Touch and type, read the screen, watch it live, manage apps and files, and keep the files you reuse in your media library.
  4. End the session when you are done, or let it expire.

Quick Start

Installation

We provide an official TypeScript/JavaScript client with full type safety:

Direct API Calls

You can also call the endpoints directly with any HTTP client. Every page in this reference shows the raw request.

Platform Support

Asking a phone for a feature its platform does not support gives that phone’s result the error code unsupported.

Versioning

The version is part of the URL (/v1). New endpoints and new response fields can be added to v1 at any time, so ignore fields you do not recognize. A change that would break existing integrations ships under a new version.

Next Steps

  • Response - the response format, per-phone results, error codes and rate limits
  • Sessions - how a phone is made ready for use
  • Screen Coordinates - how x and y map onto the screen
  • Live Streaming - live video of the screen and live touch
  • Data Structures - the Phone, Session, App, File, Media and Result models
  • Touch - tap, long press, swipe and gestures in one endpoint
  • Appium - drive a phone with any WebDriver client