> ## Documentation Index
> Fetch the complete documentation index at: https://infisical.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# List session logs

> Lists a session's logs newest first, as encrypted chunks of [records](/documentation/platform/agent-vault/session-logs#what-gets-recorded). To decrypt them, follow [Reading session logs through the API](/documentation/platform/agent-vault/session-logs#reading-session-logs-through-the-api). To follow new logs as they arrive, use [the endpoint that tails session logs](/api-reference/endpoints/agent-vault-session-logs/tail). If Infisical can't read session logs, the request fails with the error `AgentVaultSessionLogStorageUnavailable`.



## OpenAPI

````yaml GET /api/v1/agent-vault/sessions/{sessionId}/logs
openapi: 3.0.3
info:
  title: Infisical API
  description: List of all available APIs that can be consumed
  version: 0.0.1
servers:
  - url: https://us.infisical.com
    description: Production server (US)
  - url: https://eu.infisical.com
    description: Production server (EU)
  - url: http://localhost:8080
    description: Local server
security: []
paths:
  /api/v1/agent-vault/sessions/{sessionId}/logs:
    get:
      tags:
        - Agent Vault Session Logs
      description: >-
        Lists a session's logs newest first, as encrypted chunks of
        [records](/documentation/platform/agent-vault/session-logs#what-gets-recorded).
        To decrypt them, follow [Reading session logs through the
        API](/documentation/platform/agent-vault/session-logs#reading-session-logs-through-the-api).
        To follow new logs as they arrive, use [the endpoint that tails session
        logs](/api-reference/endpoints/agent-vault-session-logs/tail). If
        Infisical can't read session logs, the request fails with the error
        `AgentVaultSessionLogStorageUnavailable`.
      operationId: listAgentVaultSessionLogs
      parameters:
        - schema:
            type: string
            maxLength: 8192
          in: query
          name: cursor
          required: false
          description: >-
            The `nextCursor` from the previous response. Leave it out to start
            from the newest logs.
        - schema:
            type: string
            format: date-time
          in: query
          name: from
          required: false
          description: >-
            Return only chunks with records at or after this time. A chunk can
            also hold earlier records, so filter records by `ts`.
        - schema:
            type: string
            format: date-time
          in: query
          name: to
          required: false
          description: >-
            Return only chunks with records at or before this time. A chunk can
            also hold later records, so filter records by `ts`.
        - schema:
            type: string
            format: uuid
          in: path
          name: sessionId
          required: true
          description: The ID of the session.
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  sessionLogs:
                    type: object
                    properties:
                      enabled:
                        type: boolean
                        description: Whether session logs are on.
                      isRecordable:
                        type: boolean
                        description: False if this session's requests can't be recorded.
                      sessionKey:
                        type: string
                        nullable: true
                        description: >-
                          The key that decrypts every chunk in this response, as
                          base64. Null if the response has no chunks.
                      disabledReason:
                        type: string
                        enum:
                          - 'off'
                          - not-on-plan
                        nullable: true
                        description: >-
                          Why no logs are returned: `off` when session logs are
                          off, `not-on-plan` when the plan doesn't include the
                          storage they use. Null when logs are returned.
                      storageType:
                        type: string
                        enum:
                          - default
                          - external
                        nullable: true
                        description: >-
                          Where this session's logs are read from: `default` or
                          `external`. Null when session logs are off.
                    required:
                      - enabled
                      - isRecordable
                      - sessionKey
                      - disabledReason
                      - storageType
                    additionalProperties: false
                    description: >-
                      Whether session logs are on, whether this session can be
                      recorded, and the key that decrypts the chunks.
                  chunks:
                    type: array
                    items:
                      type: object
                      properties:
                        chunkId:
                          type: string
                          description: The ID of the chunk.
                        proxyId:
                          type: string
                          description: The ID of the proxy that uploaded the chunk.
                        ciphertextBytes:
                          type: number
                          description: The size of the encrypted chunk in bytes.
                        presignedGetUrl:
                          type: string
                          description: The URL to download the chunk from.
                      required:
                        - chunkId
                        - proxyId
                        - ciphertextBytes
                        - presignedGetUrl
                      additionalProperties: false
                  nextCursor:
                    type: string
                    nullable: true
                    description: >-
                      Pass this as `cursor` to get older logs. Null when there's
                      nothing older. A page can have no chunks and still have a
                      `nextCursor`.
                required:
                  - sessionLogs
                  - chunks
                  - nextCursor
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 400
                  message:
                    type: string
                  error:
                    type: string
                  details: {}
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 401
                  message:
                    type: string
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 403
                  message:
                    type: string
                  details: {}
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 404
                  message:
                    type: string
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '422':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 422
                  message: {}
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - error
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 500
                  message:
                    type: string
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.