# Get sessions

`GET /sessions`



[Logs API guide](https://docs.contextual.io/legacy/tenants/tenant-apis/logs-api.md)

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Contextual Logs Api",
    "description": " ",
    "version": "1.16.0"
  },
  "security": [
    {
      "jwt": []
    }
  ],
  "servers": [
    {
      "url": "https://logs.{tenantId}.my.contextual.io/api/v1",
      "variables": {
        "tenantId": {
          "default": "YOUR-TENANT-ID"
        }
      }
    }
  ],
  "paths": {
    "/sessions": {
      "get": {
        "tags": [
          "Sessions"
        ],
        "summary": "Get sessions",
        "parameters": [
          {
            "name": "includeTotal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "pageToken",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-org-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "deprecated": false,
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Session"
                      }
                    },
                    "nextPageToken": {
                      "type": "string"
                    },
                    "totalCount": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "items"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid search provided",
            "content": {}
          },
          "401": {
            "description": "Missing or invalid authorization header",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/$ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Invalid permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/$ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "jwt": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "schemas": {
      "Session": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "sessionId": {
            "type": "string"
          },
          "correlationId": {
            "type": "string"
          },
          "kind": {
            "default": "execution",
            "type": "string",
            "enum": [
              "trigger",
              "action",
              "execution"
            ]
          },
          "subKind": {
            "type": "string"
          },
          "typeId": {
            "type": "string"
          },
          "instanceId": {
            "type": "string"
          },
          "startedAt": {
            "type": "string",
            "pattern": "^(?:\\d+(?:\\.\\d+?)?|(?:\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?Z))$",
            "description": "An ISO 8601 date time string",
            "format": "date-time"
          },
          "endedAt": {
            "type": "string",
            "pattern": "^(?:\\d+(?:\\.\\d+?)?|(?:\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?Z))$",
            "description": "An ISO 8601 date time string",
            "format": "date-time"
          },
          "createdAt": {
            "default": "2026-11-15T21:30:33.351Z",
            "type": "string",
            "pattern": "^(?:\\d+(?:\\.\\d+?)?|(?:\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?Z))$",
            "description": "An ISO 8601 date time string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "pattern": "^(?:\\d+(?:\\.\\d+?)?|(?:\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?Z))$",
            "description": "An ISO 8601 date time string",
            "format": "date-time"
          },
          "_metaData": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "createdAt": {
                "type": "string",
                "pattern": "^(?:\\d+(?:\\.\\d+?)?|(?:\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?Z))$",
                "description": "An ISO 8601 date time string",
                "format": "date-time"
              },
              "updatedAt": {
                "type": "string",
                "pattern": "^(?:\\d+(?:\\.\\d+?)?|(?:\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?Z))$",
                "description": "An ISO 8601 date time string",
                "format": "date-time"
              }
            },
            "required": [
              "id",
              "createdAt"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "source",
          "sessionId",
          "kind",
          "typeId",
          "startedAt",
          "createdAt",
          "_metaData"
        ],
        "additionalProperties": false
      },
      "$ErrorResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": [
              "string",
              "number"
            ]
          },
          "message": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "code",
          "message"
        ],
        "additionalProperties": false
      }
    }
  }
}
```