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

# Get a list of sessions

GET https://api.airtop.ai/api/v1/sessions

Get a paginated list of sessions filtered by ID or status

Reference: https://docs.airtop.ai/api-reference/airtop-api/sessions/list

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Query parameters

- `sessionIds` (string, optional) — A comma-separated list of IDs of the sessions to retrieve.
- `status` (enum, optional) — Status of the session to get.
  - Allowed values: `awaitingCapacity`, `initializing`, `running`, `ended`, `completed`, `cancelled`, `all`
- `offset` (long, optional, default: -1) — Offset for pagination.
- `limit` (long, optional, default: 10) — Limit for pagination.

## Response

### 200

OK

- `data` (SessionsWithPagination, required)
- `meta` (EnvelopeDefaultMeta, required)
- `errors` (list of Issue, optional)
- `warnings` (list of Issue, optional)

## Errors

### 404 Sessions List Request Not Found Error

Not Found

- `detail` (string, optional) — A human-readable explanation specific to this occurrence of the problem.
- `errors` (list of ErrorDetail, optional) — Optional list of individual error details
- `instance` (string, optional) — A URI reference that identifies the specific occurrence of the problem.
- `status` (long, optional) — HTTP status code
- `title` (string, optional) — A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
- `type` (string, optional, default: about:blank) — A URI reference to human-readable documentation for the error.

### 422 Sessions List Request Unprocessable Entity Error

Unprocessable Entity

- `detail` (string, optional) — A human-readable explanation specific to this occurrence of the problem.
- `errors` (list of ErrorDetail, optional) — Optional list of individual error details
- `instance` (string, optional) — A URI reference that identifies the specific occurrence of the problem.
- `status` (long, optional) — HTTP status code
- `title` (string, optional) — A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
- `type` (string, optional, default: about:blank) — A URI reference to human-readable documentation for the error.

### 500 Sessions List Request Internal Server Error

Internal Server Error

- `detail` (string, optional) — A human-readable explanation specific to this occurrence of the problem.
- `errors` (list of ErrorDetail, optional) — Optional list of individual error details
- `instance` (string, optional) — A URI reference that identifies the specific occurrence of the problem.
- `status` (long, optional) — HTTP status code
- `title` (string, optional) — A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
- `type` (string, optional, default: about:blank) — A URI reference to human-readable documentation for the error.

## Types

### SessionsWithPagination

- `pagination` (Pagination, required) — Pagination details.
- `sessions` (list of ExternalSessionWithConnectionInfo, optional) — List of sessions.

### EnvelopeDefaultMeta

- `requestId` (string, optional)

### Issue

- `message` (string, required) — Message describing the issue.
- `code` (string, optional) — Issue code.
- `details` (map from string to any, optional) — Any associated details.
- `reason` (string, optional) — Underlying reason for the issue.

### ErrorDetail

- `location` (string, optional) — Where the error occurred, e.g. 'body.items[3].tags' or 'path.thing-id'
- `message` (string, optional) — Error message text
- `value` (any, optional)

### Pagination

- `currentLimit` (long, required) — The number of items to return
- `currentPage` (long, required) — The current page number
- `finalCount` (long, required) — The final count of items displayed on the current page
- `hasMore` (boolean, required) — Whether there are more items
- `initialCount` (long, required) — The initial count of items displayed on the current page
- `nextOffset` (long, required) — The number of items to skip
- `numberOfPages` (long, required) — The total number of pages
- `totalItems` (long, required) — The total number of items

### ExternalSessionWithConnectionInfo

- `configuration` (ExternalSessionConfig, required) — Session configuration details. DEPRECATED
- `id` (string, required) — Id of the session.
- `status` (string, required) — Session status.
- `cdpUrl` (string, optional) — Url to connect to chrome devtools protocol port on the Airtop browser. Include the header 'Authorization: Bearer \<api-key>.'
- `cdpWsUrl` (string, optional) — Websocket url to connect to the Airtop browser for CDP-based automation frameworks (e.g. Puppeteer or Playwright). Include the header 'Authorization: Bearer \<airtop-api-key>.'
- `chromedriverUrl` (string, optional) — Websocket url to connect to the Airtop browser for webdriver-based automation frameworks (e.g. Selenium). Include the header 'Authorization: Bearer \<airtop-api-key>.'
- `currentUsage` (long, optional) — Current usage in minutes.
- `dateCreated` (datetime, optional) — Date the session was created.
- `lastActivity` (datetime, optional) — Date of the last activity.
- `viceUrl` (string, optional) — -
- `profileId` (string, optional, deprecated) — Id of a newly persisted profile. DEPRECATED: Use profileName.

### ExternalSessionConfig

- `baseProfileId` (string, optional) — Id of a profile to load into the session.
- `persistProfile` (boolean, optional) — Persist the profile.
- `timeoutMinutes` (integer, optional, default: 10) — Max length of session in minutes, after which it will terminate if not already deleted.

## Examples

**Response**

```json
{
  "data": {
    "pagination": {
      "currentLimit": 1000000,
      "currentPage": 1000000,
      "finalCount": 1000000,
      "hasMore": true,
      "initialCount": 1000000,
      "nextOffset": 1000000,
      "numberOfPages": 1000000,
      "totalItems": 1000000
    },
    "sessions": [
      {
        "configuration": {
          "baseProfileId": "a13c6f73-bd89-4a76-ab32-5a6c422e8224",
          "persistProfile": true,
          "timeoutMinutes": 10
        },
        "id": "6aac6f73-bd89-4a76-ab32-5a6c422e8b0b",
        "status": "active",
        "profileId": "427c6f73-bd89-4a76-ab32-5a6c422e8b0b"
      }
    ]
  },
  "meta": {
    "requestId": "requestId"
  },
  "errors": [
    {
      "message": "message",
      "code": "code",
      "details": {
        "key": "value"
      },
      "reason": "reason"
    }
  ],
  "warnings": [
    {
      "message": "message",
      "code": "code",
      "details": {
        "key": "value"
      },
      "reason": "reason"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.airtop.ai/api/v1/sessions"

querystring = {"offset":"1","limit":"10"}

headers = {"Authorization": "Bearer <apiKey>"}

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

print(response.json())
```

```typescript
import { AirtopClient } from "@airtop/sdk";

const client = new AirtopClient({ apiKey: "YOUR_API_KEY" });
await client.sessions.list({
    offset: 1,
    limit: 10
});

```

```go
package main

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

func main() {

	url := "https://api.airtop.ai/api/v1/sessions?offset=1&limit=10"

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

	req.Header.Add("Authorization", "Bearer <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.airtop.ai/api/v1/sessions?offset=1&limit=10")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <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.airtop.ai/api/v1/sessions?offset=1&limit=10")
  .header("Authorization", "Bearer <apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.airtop.ai/api/v1/sessions?offset=1&limit=10', [
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.airtop.ai/api/v1/sessions?offset=1&limit=10");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.airtop.ai/api/v1/sessions?offset=1&limit=10")! 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()
```