> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.athenaintel.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.athenaintel.com/_mcp/server.

# List sessions

GET https://api.athenaintel.com/api/v0/sessions

Retrieve a paginated list of agent sessions (conversations) with optional title search, state filtering, source channel filtering, date range filtering, and sorting. By default, AOP/workflow runs and branched sub-sessions are excluded, and only sessions in the caller's current workspace are visible — pass `workspace_id` to list sessions in another workspace the caller belongs to.

Reference: https://docs.athenaintel.com/api-reference/sessions/list

## Authentication

- `X-API-KEY` header (required) — API Key authentication via header

## Request

### Query parameters

- `query` (string, optional, nullable) — Keyword to search session titles (case-insensitive)
- `state` (list of string, optional, nullable) — Execution state(s) to filter by (e.g. 'running', 'completed'). Matched against the session's canonical run status (status_v2); 'running' only matches sessions updated within the last 12 hours. Repeat the parameter or pass a comma-separated list.
- `source_channel` (list of string, optional, nullable) — Originating channel(s) to filter by (e.g. 'web', 'api', 'agent_email'). Repeat the parameter or pass a comma-separated list.
- `session_type` (list of string, optional, nullable) — Session kind(s) to include: 'session', 'video_session', 'desktop_session', 'mobile_session'. Repeat the parameter or pass a comma-separated list.
- `app_id` (string, optional, nullable) — Only include sessions belonging to this application identifier
- `include_sub_sessions` (boolean, optional, default: false) — Include branched sub-sessions (excluded by default)
- `include_task_sessions` (boolean, optional, default: false) — Include AOP/workflow task runs (excluded by default)
- `aop_asset_id` (string, optional, nullable) — Only include task sessions originating from this AOP asset identifier
- `workspace_id` (string, optional, nullable) — Workspace to list sessions from. Defaults to the caller's current workspace; any other workspace the caller is a member of can be requested explicitly.
- `trigger_type` (list of string, optional, nullable) — Trigger type(s) to filter by (e.g. 'schedule', 'api', 'email'). Repeat the parameter or pass a comma-separated list.
- `created_after` (datetime, optional, nullable) — Only include sessions created at or after this ISO 8601 timestamp
- `created_before` (datetime, optional, nullable) — Only include sessions created at or before this ISO 8601 timestamp
- `sort_by` (enum, optional, default: updated_at) — Field to sort by
  - Allowed values: `updated_at`, `created_at`, `title`
- `sort_direction` (enum, optional, default: desc) — Sort direction
  - Allowed values: `asc`, `desc`
- `limit` (integer, optional, default: 50) — Maximum number of sessions to return per page (1-500)
- `offset` (integer, optional, default: 0) — Number of sessions to skip for pagination

## Response

### 200

Successfully retrieved paginated list of sessions

- `has_more` (boolean, required) — Whether there are more sessions available beyond this page
- `items` (list of SessionOut, required) — Array of session objects for the current page
- `limit` (integer, required) — Maximum number of sessions returned in this response (1-500)
- `next_offset` (integer, required, nullable) — Offset value to use for the next page request, null if no more pages
- `offset` (integer, required) — Number of sessions skipped from the beginning of the result set
- `total` (integer, required) — Lower bound on the number of sessions matching the query filters: the rows paged through so far plus one when has_more is true, or 0 for an empty page. It is exact once has_more is false and the page is non-empty. Use has_more/next_offset to paginate rather than dividing total by limit.

## Errors

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### SessionOut

An agent session (conversation) asset with flattened metadata.

- `created_at` (datetime, required) — Timestamp when the session was created (ISO 8601)
- `id` (string, required) — Unique identifier of the session asset (e.g., 'asset_abc123')
- `session_status_v2` (string, required) — Canonical user-facing session status: idle, active, needs_input, or error
- `thread_id` (string, required) — LangChain thread ID backing this session's message history
- `updated_at` (datetime, required) — Timestamp when the session was last updated (ISO 8601)
- `agent` (string, optional, nullable) — Agent identity the session ran with, when set
- `aop_asset_id` (string, optional, nullable) — Source AOP asset identifier for an AOP/workflow run
- `aop_execution_error` (string, optional, nullable) — Execution error recorded for a failed AOP run, when present
- `aop_execution_succeeded` (boolean, optional, nullable) — Whether the AOP execution completed successfully, when known
- `app_id` (string, optional, nullable) — Application identifier the session belongs to, when set
- `collab_agent_id` (string, optional, nullable) — Asset ID of the collab agent the session was created with, when one was bound; null for stock-agent sessions
- `created_by_id` (string, optional, nullable) — Unique identifier of the user who created this session
- `failure_reason_v2` (string, optional, nullable) — Canonical failure reason for failed runs; null for non-failed runs
- `is_sub_session` (boolean, optional, default: false) — Whether this is a branched sub-session of another session
- `is_unread` (boolean, optional, default: false) — Whether the session is unread for the calling user: it changed since they last opened it, or they never opened it and it did not originate from the web app
- `last_message_preview` (string, optional, nullable) — Plain-text preview of the most recent message, when available
- `model` (string, optional, nullable) — Model the session ran with, when set
- `num_messages` (integer, optional, nullable) — Number of messages in the session, when tracked
- `parent_session_id` (string, optional, nullable) — Asset ID of the parent session for sub-sessions
- `run_status_v2` (string, optional, nullable) — Canonical latest-run status: scheduled, queued, running, needs_input, completed, failed, or canceled
- `session_type` (string, optional, nullable) — Kind of session: 'session' (chat), 'video_session', 'desktop_session', or 'mobile_session'
- `source_channel` (string, optional, nullable) — Channel the session originated from (e.g., 'web', 'api', 'agent_email', 'agent_slack', 'agent_sms')
- `title` (string, optional, nullable) — Display title of the session
- `total_cost_usd` (double, optional, nullable) — Total LLM cost of the session in USD, when tracked
- `trigger_type` (string, optional, nullable) — Trigger that started an AOP/workflow run, such as schedule or api
- `workspace_id` (string, optional, nullable) — Unique identifier of the workspace this session belongs to
- `state` (string, optional, nullable, deprecated) — Deprecated legacy execution state. Use session_status_v2, run_status_v2, and failure_reason_v2 for status UI.

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `ctx` (ValidationErrorCtx, optional)
- `input` (any, optional)

### ValidationErrorLocItems

### ValidationErrorCtx

## Examples

**Response**

```json
{
  "has_more": false,
  "items": [
    {
      "created_at": "2025-06-01T10:30:00Z",
      "id": "asset_92492920-d118-42d3-95b4-00eccfe0754f",
      "session_status_v2": "string",
      "thread_id": "92492920-d118-42d3-95b4-00eccfe0754f",
      "updated_at": "2025-06-01T11:35:00Z",
      "agent": "athena",
      "created_by_id": "user_123",
      "is_sub_session": false,
      "last_message_preview": "Here is the summary you asked for...",
      "model": "claude-sonnet-5-5",
      "num_messages": 24,
      "session_type": "session",
      "source_channel": "web",
      "title": "Quarterly report deep dive",
      "total_cost_usd": 0.42,
      "workspace_id": "workspace_abc123",
      "state": "completed"
    }
  ],
  "limit": 50,
  "next_offset": 1,
  "offset": 0,
  "total": 42
}
```

**SDK Code**

```python sessions_list_example
import requests

url = "https://api.athenaintel.com/api/v0/sessions"

headers = {"X-API-KEY": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript sessions_list_example
const url = 'https://api.athenaintel.com/api/v0/sessions';
const options = {method: 'GET', headers: {'X-API-KEY': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go sessions_list_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.athenaintel.com/api/v0/sessions"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-API-KEY", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby sessions_list_example
require 'uri'
require 'net/http'

url = URI("https://api.athenaintel.com/api/v0/sessions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java sessions_list_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.athenaintel.com/api/v0/sessions")
  .header("X-API-KEY", "<apiKey>")
  .asString();
```

```php sessions_list_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.athenaintel.com/api/v0/sessions', [
  'headers' => [
    'X-API-KEY' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp sessions_list_example
using RestSharp;

var client = new RestClient("https://api.athenaintel.com/api/v0/sessions");
var request = new RestRequest(Method.GET);
request.AddHeader("X-API-KEY", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift sessions_list_example
import Foundation

let headers = ["X-API-KEY": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.athenaintel.com/api/v0/sessions")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```