# Search the org's sessions, or resolve one by selector

`GET /o/{org}/sessions`

Without `selector`, lists sessions across every Project in the org (and
those with no Project), newest first, filtered by the query parameters.
With `selector`, 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`. A caller that already has the id should read
`GET /o/{org}/p/_/sessions/{session}` instead.

This route's 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). A handle from another org returns no rows. |
| `agent` | query | string | no | Harness as dispatched, e.g. `claude` or `codex`. |
| `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 |  |
| `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.prix.dev/o/$RUSH_ORG/sessions" \
  -H "Authorization: Bearer $RUSH_API_KEY"
```

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

const res = await fetch(`https://api.prix.dev/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.prix.dev/o/{org}/sessions",
    headers={"Authorization": f"Bearer {os.environ['RUSH_API_KEY']}"},
)

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

## Responses

### 200

The matching sessions, or the one session 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 that exists in an org the caller cannot see.

### 409

The selector matched more than one session.

## Example response (200)

```json
{
  "sessions": [
    {
      "id": "3f9c2a71d04b8e65",
      "kind": "cloud",
      "short_id": "3f9c2a71",
      "title": "Fix the flaky checkout test",
      "project": "web",
      "org_id": "0b6f3c52-8d1e-4a7b-9c55-2f1e8d7a6b90",
      "project_id": "7d2e9a14-5b3c-4f60-8e21-9a0b1c2d3e4f",
      "agent": "claude",
      "harness": "claude",
      "harness_version_requested": null,
      "harness_version_resolved": "2.1.291",
      "model": "claude-opus-5-5",
      "mode": "headless",
      "status": "completed",
      "prompt": "Fix the flaky checkout test and open a PR.",
      "branch": "rush/fix-flaky-checkout",
      "pr_url": "https://github.com/acme/web/pull/412",
      "error": null,
      "session_capture": "complete",
      "message_count": 24,
      "input_tokens": 182340,
      "output_tokens": 9120,
      "cache_read_tokens": 1204500,
      "cache_write_tokens": 40210,
      "cost_usd": 1.84,
      "duration_ms": 412000,
      "tool_call_count": 37,
      "started_by": {
        "name": "Dana Lee",
        "avatar_url": null
      },
      "summary": "Pinned the clock in checkout.spec.ts and opened PR",
      "artifacts": [],
      "artifact_count": 0,
      "agent_profile": null,
      "created_at": "2026-10-06T15:02:11.000Z",
      "updated_at": "2026-10-06T15:09:03.000Z"
    }
  ],
  "next_cursor": "NTA="
}
```
