> 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.

# Get session by ID

GET https://api.athenaintel.com/api/v0/sessions/{asset_id}

Retrieve a single session by its asset ID, including state, originating channel, agent/model, message count, and cost.

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

## Authentication

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

## Request

### Path parameters

- `asset_id` (string, required) — Unique identifier of the session asset to retrieve

## Response

### 200

Successful Response

- `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.

## Errors

### 401 Unauthorized Error

Unauthorized

- `message` (string, required)

### 404 Not Found Error

Not Found

- `message` (string, required)

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### ValidationError

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

### ValidationErrorLocItems

### ValidationErrorCtx

## Examples

**Response**

```json
{
  "created_at": "2024-01-15T09:30:00Z",
  "id": "string",
  "session_status_v2": "string",
  "thread_id": "string",
  "updated_at": "2024-01-15T09:30:00Z",
  "agent": "string",
  "aop_asset_id": "string",
  "aop_execution_error": "string",
  "aop_execution_succeeded": true,
  "app_id": "string",
  "collab_agent_id": "string",
  "created_by_id": "string",
  "failure_reason_v2": "string",
  "is_sub_session": false,
  "is_unread": false,
  "last_message_preview": "string",
  "model": "string",
  "num_messages": 1,
  "parent_session_id": "string",
  "run_status_v2": "string",
  "session_type": "string",
  "source_channel": "string",
  "title": "string",
  "total_cost_usd": 1.1,
  "trigger_type": "string",
  "workspace_id": "string",
  "state": "string"
}
```

**SDK Code**

```python
import requests

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

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

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

print(response.json())
```

```javascript
const url = 'https://api.athenaintel.com/api/v0/sessions/asset_id';
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
package main

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

func main() {

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

	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
require 'uri'
require 'net/http'

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

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
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

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

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

$client = new \GuzzleHttp\Client();

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

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

```csharp
using RestSharp;

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

```swift
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.athenaintel.com/api/v0/sessions/asset_id")! 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()
```