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

# List agent sessions



## OpenAPI

````yaml /api-reference/membrane-api.json get /agent/sessions
openapi: 3.0.0
info:
  title: Membrane API
  description: API documentation for Membrane Engine
  version: '1.0'
  contact: {}
servers:
  - url: https://api.getmembrane.com
security:
  - bearer: []
tags: []
paths:
  /agent/sessions:
    get:
      tags:
        - Sessions
      summary: List agent sessions
      operationId: listAgentSessions
      parameters:
        - name: limit
          required: false
          in: query
          description: Maximum number of items to return (1-1000)
          schema:
            minimum: 1
            maximum: 1000
            type: integer
        - name: cursor
          required: false
          in: query
          description: Pagination cursor from a previous response
          schema:
            type: string
        - name: workspaceElementType
          required: false
          in: query
          schema:
            type: string
            enum:
              - customer
              - app
              - connector
              - integration
              - flow
              - flow-instance
              - flow-run
              - action
              - package
              - action-instance
              - connection
              - field-mapping
              - field-mapping-instance
              - data-source
              - data-source-instance
              - data-link-table
              - data-link-table-instance
              - app-event-type
              - app-event-subscription
              - app-event-log-record
              - app-data-schema
              - app-data-schema-instance
              - external-event-subscription
              - external-event-log-record
              - external-event-pull
              - external-event-type
              - screen
              - action-run-log-record
              - external-api-log-record
              - incoming-webhook-log-record
              - connected-product
        - name: workspaceElementId
          required: false
          in: query
          schema:
            type: string
        - name: agentHarnessId
          required: false
          in: query
          schema:
            type: string
        - name: startDatetime
          required: false
          in: query
          schema:
            type: string
            format: date-time
            pattern: >-
              ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        - name: endDatetime
          required: false
          in: query
          schema:
            type: string
            format: date-time
            pattern: >-
              ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        - name: status
          required: false
          in: query
          schema:
            type: string
            enum:
              - queued
              - starting
              - running
              - completed
              - failed
              - cancelled
        - name: isExternal
          required: false
          in: query
          schema:
            type: boolean
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentSessionsPaginatedResponseDto'
components:
  schemas:
    AgentSessionsPaginatedResponseDto:
      type: object
      properties:
        items:
          type: array
          items:
            type: object
            properties:
              userId:
                type: string
              tenantId:
                type: string
              id:
                type: string
              workspaceId:
                type: string
              orgWorkspaceId:
                type: string
              workspaceElementType:
                type: string
                enum:
                  - customer
                  - app
                  - connector
                  - integration
                  - flow
                  - flow-instance
                  - flow-run
                  - action
                  - package
                  - action-instance
                  - connection
                  - field-mapping
                  - field-mapping-instance
                  - data-source
                  - data-source-instance
                  - data-link-table
                  - data-link-table-instance
                  - app-event-type
                  - app-event-subscription
                  - app-event-log-record
                  - app-data-schema
                  - app-data-schema-instance
                  - external-event-subscription
                  - external-event-log-record
                  - external-event-pull
                  - external-event-type
                  - screen
                  - action-run-log-record
                  - external-api-log-record
                  - incoming-webhook-log-record
                  - connected-product
              workspaceElementId:
                type: string
              type:
                type: string
              status:
                type: string
                enum:
                  - queued
                  - starting
                  - running
                  - completed
                  - failed
                  - cancelled
              prompt:
                type: string
              error:
                $ref: >-
                  #/components/schemas/AgentSessionsPaginatedResponseDto__schema0
              lastActivityAt:
                type: string
                format: date-time
                pattern: >-
                  ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                description: >-
                  Last meaningful session progress timestamp used for inactivity
                  timeout checks.
              title:
                type: string
              summary:
                type: string
              cost:
                type: number
              state:
                default: busy
                type: string
                enum:
                  - busy
                  - idle
              hasWorker:
                type: boolean
              isExternal:
                type: boolean
              agentName:
                type: string
                enum:
                  - membrane
                  - membrane-core
                  - self-integrating
                  - connection-building
                  - action-building
                  - universe
              agentHarnessId:
                type: string
              agentHarnessSnapshotId:
                type: string
              output:
                type: object
                additionalProperties:
                  type: object
              createdAt:
                type: string
                format: date-time
                pattern: >-
                  ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
              updatedAt:
                type: string
                format: date-time
                pattern: >-
                  ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
            required:
              - id
              - workspaceId
              - type
              - status
              - prompt
              - lastActivityAt
              - hasWorker
              - createdAt
              - updatedAt
        cursor:
          type: string
      required:
        - items
    AgentSessionsPaginatedResponseDto__schema0:
      type: object
      properties:
        type:
          type: string
          enum:
            - bad_request
            - connection
            - configuration
            - dependency_error
            - flow_run
            - flow_instance_setup
            - concurrency
            - internal
            - action_run
            - action_instance_setup
            - unit_run
            - custom_code
            - insufficient_credit
            - openrouter_not_configured
        key:
          type: string
        message:
          type: string
        data:
          type: object
        stack:
          type: object
        causedByError:
          $ref: '#/components/schemas/AgentSessionsPaginatedResponseDto__schema0'
        logs:
          type: array
          items:
            type: object
      required:
        - message
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````