# List sessions (/brain/docs/api/generated/list)

Lists sessions belonging to the caller's tenant in ascending ID order. Pass the last session ID as after to fetch the next page.

## GET /sessions

Bearer authentication is required.

```json
{
  "openapi": "3.1.0",
  "info": {
    "description": "HTTP API for the Brain agent session server.",
    "title": "Brain",
    "version": "current"
  },
  "servers": [
    {
      "description": "Local development",
      "url": "http://127.0.0.1:8080"
    }
  ],
  "paths": {
    "/sessions": {
      "get": {
        "description": "Lists sessions belonging to the caller's tenant in ascending ID order. Pass the last session ID as after to fetch the next page.",
        "operationId": "list",
        "parameters": [
          {
            "description": "Last session ID from the previous page.",
            "in": "query",
            "name": "after",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Maximum number of items to return (JSON mode).",
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 100,
              "maximum": 1000,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionList"
                }
              }
            },
            "description": "List sessions"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Error. 400 invalid_request; 401 missing/invalid Bearer token; 403 forbidden; 404 not_found; 409 conflict or cursor_unavailable; 413 body limit; 422 unsupported; 429 overloaded (Retry-After: 1); 500 brain_error. X-Request-ID is present on every response."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List sessions"
      }
    }
  },
  "components": {
    "schemas": {
      "SessionList": {
        "additionalProperties": false,
        "properties": {
          "sessions": {
            "items": {
              "$ref": "#/components/schemas/Session"
            },
            "type": "array"
          }
        },
        "required": [
          "sessions"
        ],
        "type": "object"
      },
      "Session": {
        "additionalProperties": false,
        "properties": {
          "checkpoint": {
            "$ref": "#/components/schemas/Checkpoint"
          },
          "config": {
            "$ref": "#/components/schemas/SessionConfig"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "credential_bindings": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "descriptors": {
            "items": {
              "$ref": "#/components/schemas/Tool"
            },
            "type": "array"
          },
          "harness": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "harness",
          "config",
          "status",
          "created_at",
          "updated_at",
          "descriptors"
        ],
        "type": "object"
      },
      "Checkpoint": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "offset": {
            "type": "integer"
          },
          "time": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "offset",
          "time"
        ],
        "type": "object"
      },
      "SessionConfig": {
        "additionalProperties": false,
        "properties": {
          "bindings": {
            "items": {
              "$ref": "#/components/schemas/ToolBinding"
            },
            "type": "array"
          },
          "instructions": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "reasoning_effort": {
            "type": "string"
          },
          "tools": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "model",
          "tools"
        ],
        "type": "object"
      },
      "ToolBinding": {
        "additionalProperties": false,
        "properties": {
          "alias": {
            "type": "string"
          },
          "executor": {
            "type": "string"
          },
          "operations": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "parameters": {},
          "provider": {
            "type": "string"
          },
          "runtime": {
            "items": {
              "$ref": "#/components/schemas/Tool"
            },
            "type": "array"
          }
        },
        "required": [
          "alias"
        ],
        "type": "object"
      },
      "Tool": {
        "additionalProperties": false,
        "properties": {
          "description": {
            "type": "string"
          },
          "input_schema": {},
          "name": {
            "type": "string"
          },
          "output_schema": {}
        },
        "required": [
          "name",
          "description",
          "input_schema"
        ],
        "type": "object"
      },
      "ErrorResponse": {
        "additionalProperties": false,
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ErrorDetail"
          },
          "request_id": {
            "type": "string"
          }
        },
        "required": [
          "error",
          "request_id"
        ],
        "type": "object"
      },
      "ErrorDetail": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  }
}
```

[Complete OpenAPI document](/brain/openapi.json)