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

# List all sessions

GET https://example.itential.io/agent-session-manager/sessions

Lists all sessions.

Reference: https://docs.itential.com/itential-cloud/api-reference/agent-session-manager/get-sessions

## Authentication

- `Authorization` header (basic auth, required) — Basic authentication of the form `Basic <base64(username:password)>`.

## Request

### Query parameters

- `filters` (list of any, optional) — Filter criteria — each entry specifies a field, operator, and value
- `offset` (double, optional) — Number of records to skip (0-based)
- `limit` (double, optional) — Number of items per page
- `sortBy` (enum, optional) — Field to sort by
  - Allowed values: `createdAt`, `updatedAt`, `startedAt`, `endedAt`, `status`, `createdBy`, `agentDefinitionId`, `totalOutputTokens`, `totalInputTokens`, `totalTokens`
- `sortOrder` (enum, optional) — Sort order
  - Allowed values: `asc`, `desc`

## Response

### 200

result

- `data` (list of object, required) — Session data
  - `agentDefinitionId` (string, required) — The agent definition ID
  - `status` (enum, required) — Current session status
    - Allowed values: `PENDING`, `RUNNING`, `PAUSING`, `PAUSED`, `COMPLETE`, `FAILED`, `CANCELING`, `CANCELED`
  - `createdAt` (string, required) — Session creation timestamp
  - `createdBy` (string, required) — User who created the session
  - `sessionId` (string, optional) — The session ID assigned by AEE
  - `agentSnapshot` (object, optional) — Snapshot of the agent configuration at session start time
    - `_id` (string, required) — Agent definition ID
    - `name` (string, required) — Agent name
    - `description` (string, required) — Agent description
    - `instructions` (string, required) — Agent instructions
    - `namespace` (object, optional) — Parent project namespace info
      - `_id` (string, required) — Project UUID
      - `name` (string, required) — Project name
  - `startedAt` (string, optional) — Session start timestamp (engine-authoritative)
  - `endTime` (string, optional) — Session end timestamp
  - `duration` (double, optional) — Session duration in milliseconds
  - `provider` (string, optional) — Infrastructure provider (e.g. aws, gcp)
  - `modelVersion` (string, optional) — Model version used
  - `sessionType` (enum, optional) — Session type
    - Allowed values: `root`, `child`
  - `trigger` (object, optional) — Trigger context for trigger-fired sessions. source is the name of the firing user for manual triggers, or set as the name of the trigger for all other trigger types.
    - `type` (enum, required) — Trigger type that started the session
      - Allowed values: `eventSystem`, `endpoint`, `schedule`, `manual`, `job`, `session`
    - `name` (string, required) — Name of the trigger that fired the session
    - `source` (string, required) — For manual and API triggers, the username of the person who started the session. For schedule and event triggers, the name of the trigger.
  - `canceledBy` (string, optional) — User who canceled the session
  - `errorMessage` (string, optional) — Error message if session failed
  - `errorCategory` (string, optional) — Error category if session failed
  - `durationMs` (double, optional) — Session duration in milliseconds
  - `iterationCount` (double, optional) — Number of inference iterations
  - `toolGroupCount` (double, optional) — Number of tool groups dispatched
  - `totalToolCallCount` (double, optional) — Total number of tool calls made
  - `totalInputTokens` (double, optional) — Total input tokens consumed across all inferences
  - `totalOutputTokens` (double, optional) — Total output tokens produced across all inferences
  - `totalTokens` (double, optional) — Combined total tokens consumed across all inferences (input + output)
  - `inputs` (object, optional) — Inputs passed when starting the session
- `total` (double, required) — Total number of sessions
- `offset` (double, required) — Number of records skipped
- `limit` (double, required) — Number of items per page

## Errors

### 500 Internal Server Error

Error response from API

- `any`

## Examples

**Response**

```json
{
  "data": [
    {
      "agentDefinitionId": "string",
      "status": "PENDING",
      "createdAt": "2024-01-15T09:30:00Z",
      "createdBy": "string",
      "sessionId": "string",
      "agentSnapshot": {
        "_id": "string",
        "name": "string",
        "description": "string",
        "instructions": "string",
        "namespace": {
          "_id": "string",
          "name": "string"
        }
      },
      "startedAt": "2024-01-15T09:30:00Z",
      "endTime": "2024-01-15T09:30:00Z",
      "duration": 1.1,
      "provider": "string",
      "modelVersion": "string",
      "sessionType": "root",
      "trigger": {
        "type": "eventSystem",
        "name": "string",
        "source": "string"
      },
      "canceledBy": "string",
      "errorMessage": "string",
      "errorCategory": "string",
      "durationMs": 1.1,
      "iterationCount": 1.1,
      "toolGroupCount": 1.1,
      "totalToolCallCount": 1.1,
      "totalInputTokens": 1.1,
      "totalOutputTokens": 1.1,
      "totalTokens": 1.1,
      "inputs": {}
    }
  ],
  "total": 1.1,
  "offset": 1.1,
  "limit": 1.1
}
```

**SDK Code**

```python
import requests

url = "https://example.itential.io/agent-session-manager/sessions"

response = requests.get(url)

print(response.json())
```

```javascript
const url = 'https://example.itential.io/agent-session-manager/sessions';
const options = {method: 'GET'};

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://example.itential.io/agent-session-manager/sessions"

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

	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://example.itential.io/agent-session-manager/sessions")

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

request = Net::HTTP::Get.new(url)

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://example.itential.io/agent-session-manager/sessions")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://example.itential.io/agent-session-manager/sessions');

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

```csharp
using RestSharp;

var client = new RestClient("https://example.itential.io/agent-session-manager/sessions");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://example.itential.io/agent-session-manager/sessions")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

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()
```