# List sessions

`GET /o/{org}/sessions`

With an API key: the org's sessions the key can read, newest first, at most
100 (`limit`, default 50), optionally only one `status`, each in the shape
`GET /o/{org}/sessions/{session}` returns (`CloudRunSessionList`). A key
takes only `status` and `limit`.

With a signed-in session (the console): a search across every Project in
the org, filtered by the other query parameters, in the console's browsing
shape. With `selector`, it resolves exactly one session by full id, unique
id prefix, or title; when it matches more than one, the answer is `409`
with the `candidates`. These errors use `{code, message}`.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `org` | path | string | yes | The org's slug or id. A caller with no role in the org gets `404`. |
| `selector` | query | string | no | Exact id, a unique id prefix, or a title. Switches the route into resolution mode. |
| `q` | query | array of string | no | Full-text match across title, prompt and content. Repeatable. Ignored with `selector`. |
| `project` | query | string | no | Only this Project (handle or id), or `_` for the sessions with no Project. A handle from another org returns no rows. |
| `source` | query | string | no | Only sessions started from this surface (`Session.source.kind`). |
| `api_key` | query | string | no | Only sessions this API key started (`key_…`), through the API or MCP. |
| `account` | query | string | no | Only sessions whose tokens acted as this connected account (its exact `account`: an email, a QuickBooks realm id, or an MCP connection's id), as `CloudRunSession.accounts` lists it. |
| `agent` | query | string | no | A harness as dispatched, e.g. `claude` or `codex`, or a saved agent's id or exact name for that agent's sessions only. A harness name keeps its meaning; a name two agents you can see share is `422 INVALID_BODY`. |
| `kind` | query | string | no | Every session today is `cloud`; `local` returns an empty list. |
| `harness` | query | string | no |  |
| `mode` | query | string | no |  |
| `model` | query | string | no |  |
| `repo` | query | string | no | `owner/name`. |
| `status` | query | string | no | One status, or several separated by commas (`failed,cancelled`). A key sends one. |
| `since` | query | string | no | Lower time bound. Relative (`2h`, `7d`) or ISO 8601. |
| `until` | query | string | no | Upper time bound. Relative (`2h`, `7d`) or ISO 8601. |
| `sort` | query | string | no |  |
| `count` | query | boolean | no | When `true`, return only `count` and an empty `sessions`. |
| `limit` | query | integer | no | Max rows to return. |
| `cursor` | query | string | no | Opaque pagination cursor from a previous response's `next_cursor`. |

## Example request

```bash
curl "https://api.phoenix.so/o/$RUSH_ORG/sessions" \
  -H "Authorization: Bearer $RUSH_API_KEY"
```

```typescript
const org = process.env.RUSH_ORG;

const res = await fetch(`https://api.phoenix.so/o/${org}/sessions`, {
  headers: {
    Authorization: `Bearer ${process.env.RUSH_API_KEY}`,
  },
});

console.log(res.status, await res.json());
```

```python
import os

import requests

org = os.environ["RUSH_ORG"]

res = requests.get(
    f"https://api.phoenix.so/o/{org}/sessions",
    headers={"Authorization": f"Bearer {os.environ['RUSH_API_KEY']}"},
)

print(res.status_code, res.json())
```

## Responses

### 200

The sessions; for a signed-in session, the matching sessions or the one a selector resolved to.


### 400

Malformed request.

### 401

No bearer, an unknown, revoked or expired one, or an API key on a route keys cannot call.

### 404

No such resource for the caller, including one in an org the caller is not in or a Project that is private to someone else.

### 409

The selector matched more than one session.

### 429

The account is over its request budget, 1,800 a minute shared by the person's API keys and console on every API host (`RATE_LIMITED`). The error names the limit. Wait `Retry-After` seconds.

## Example response (200)

```json
{
  "sessions": [
    {
      "execution_id": "7c1e9a4f-2b6d-4f83-a5c0-9e3d1b8f6a24",
      "org_id": "acme",
      "project_id": "7d2e9a14-5b3c-4f60-8e21-9a0b1c2d3e4f",
      "status": "completed",
      "harness": "claude",
      "model": "claude-opus-5-5",
      "effort": "high",
      "result": "Pinned the clock in checkout.spec.ts and opened PR 412.",
      "repo_owner": "acme",
      "repo_name": "web",
      "branch": "rush/fix-flaky-checkout",
      "pr_url": "https://github.com/acme/web/pull/412",
      "input_tokens": 182340,
      "output_tokens": 9120,
      "cache_read_tokens": 1204500,
      "cache_write_tokens": 40210,
      "total_tokens": 231670,
      "total_cost_usd": 1.84,
      "tool_calls_count": 37,
      "turns_count": 1,
      "artifacts": [
        {
          "name": "coverage-report.html",
          "mime_type": "text/html",
          "url": "https://api.phoenix.so/o/acme/sessions/7c1e9a4f-2b6d-4f83-a5c0-9e3d1b8f6a24/artifacts/coverage-report.html?expires=1791306543&signature=9b1f…",
          "url_expires_at": "2026-10-06T16:09:03.000Z"
        }
      ],
      "created_at": "2026-10-06T15:02:11.000Z",
      "completed_at": "2026-10-06T15:09:03.000Z"
    }
  ]
}
```
