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

# mobster api

> Serve every app on your iPhone as a local, read-only API.

Serve every app Mobster has an app pack for as an API on this Mac: GET /v1/\<app>/\<thing> reads that app on your iPhone into rows (JSON or CSV), and GET /v1/openapi.json describes every endpoint. Each one is also an MCP tool in `mobster mcp`. Every endpoint only reads, and each client calls it with its own token.

## Usage

```text theme={"theme":"css-variables"}
mobster api <command>
```

```text theme={"theme":"css-variables"}
examples:
  mobster api tokens create n8n
  mobster api serve --phone "Test iPhone"
  mobster api tokens revoke n8n
```

## Commands

| Command | What it does |
| - | - |
| [`mobster api serve`](#mobster-api-serve) | serve the App API on 127.0.0.1 until ctrl+c |
| [`mobster api tokens`](#mobster-api-tokens) | make, list and revoke the tokens clients call the App API with |

## `mobster api serve`

Serve every app Mobster has an app pack for as GET /v1/\<app>/\<thing> on 127.0.0.1. Each request needs a token from `mobster api tokens create`. Every endpoint only reads.

### Options

| Name | Default | Description |
| - | - | - |
| `--port PORT` | 8780; 0 picks a free one | port on 127.0.0.1 |
| `--phone NAME` | none | the iPhone a read uses when it names none: an id, UDID or name from `mobster devices` |
| `--allow-device NAME` | none | read only this real iPhone, never another; repeatable |

```text theme={"theme":"css-variables"}
examples:
  mobster api serve --phone "Test iPhone" --allow-device "Test iPhone"
  curl -H "Authorization: Bearer $TOKEN" http://127.0.0.1:8780/v1/apps
```

## `mobster api tokens`

Make one token for each client you let call the App API, list them, and revoke one. Mobster keeps each token's hash, never the token.

### Commands

| Command | What it does |
| - | - |
| [`mobster api tokens create`](#mobster-api-tokens-create) | make a token for one client and print it once |
| [`mobster api tokens list`](#mobster-api-tokens-list) | list the tokens: name, id, first characters, last use |
| [`mobster api tokens revoke`](#mobster-api-tokens-revoke) | revoke a token, by its id or name |

**`mobster api tokens create`**

Make a token for one client, such as a script or n8n, and print it once. Mobster can't show it again.

| Name | Default | Description |
| - | - | - |
| `NAME` | required | the client's name, 1 to 40 characters |

**`mobster api tokens list`**

List the tokens, never the tokens themselves.

| Name | Default | Description |
| - | - | - |
| `--json` | off | print JSON |

**`mobster api tokens revoke`**

Revoke a token: the next request with it is refused.

| Name | Default | Description |
| - | - | - |
| `ID\|NAME` | required | the token's id or name from `mobster api tokens list` |


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