> ## Documentation Index
> Fetch the complete documentation index at: https://kapso-1adbad2d.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# List agent executions

> Returns a list of executions for the specified agent



## OpenAPI

````yaml api/legacy/openapi-agents.yaml get /agents/{agent_id}/executions
openapi: 3.0.3
info:
  title: Kapso External API - Agents & Flows API
  description: >-
    API for programmatically interacting with Kapso agents, executions, and
    WhatsApp conversations. This specification includes only Agents & Flows API
    endpoints.
  version: 1.0.0
  contact:
    name: Kapso Support
servers:
  - url: https://app.kapso.ai/api/v1
    description: Production server
security:
  - ApiKeyAuth: []
paths:
  /agents/{agent_id}/executions:
    get:
      tags:
        - Agent Executions
      summary: List agent executions
      description: Returns a list of executions for the specified agent
      operationId: listAgentExecutions
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
        - name: page
          in: query
          schema:
            type: integer
            minimum: 1
            default: 1
        - name: per_page
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
        - name: q[status_eq]
          in: query
          description: Filter by exact status match
          schema:
            type: string
            enum:
              - started
              - running
              - paused
              - ended
              - handoff
        - name: q[started_at_gteq]
          in: query
          description: Filter by started_at greater than or equal to (ISO 8601 format)
          schema:
            type: string
            format: date-time
        - name: q[started_at_lteq]
          in: query
          description: Filter by started_at less than or equal to (ISO 8601 format)
          schema:
            type: string
            format: date-time
        - name: q[ended_at_gteq]
          in: query
          description: Filter by ended_at greater than or equal to (ISO 8601 format)
          schema:
            type: string
            format: date-time
        - name: q[ended_at_lteq]
          in: query
          description: Filter by ended_at less than or equal to (ISO 8601 format)
          schema:
            type: string
            format: date-time
        - name: q[phone_number_eq]
          in: query
          description: Filter by phone number (normalized format without + sign)
          schema:
            type: string
          example: '1234567890'
      responses:
        '200':
          description: A list of agent executions
          headers:
            Total:
              schema:
                type: integer
              description: Total number of records
            Total-Pages:
              schema:
                type: integer
              description: Total number of pages
            Per-Page:
              schema:
                type: integer
              description: Number of items per page
            Page:
              schema:
                type: integer
              description: Current page number
            Link:
              schema:
                type: string
              description: Links to first, prev, next, and last pages
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/AgentExecution'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Agent not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    AgentExecution:
      type: object
      properties:
        id:
          type: string
          example: execution-789ghi
        agent_id:
          type: string
          example: agent-123abc
        thread_id:
          type: string
          example: thread-101jkl
        status:
          type: string
          enum:
            - started
            - running
            - paused
            - ended
            - handoff
          example: running
        started_at:
          type: string
          format: date-time
        ended_at:
          type: string
          format: date-time
          nullable: true
        duration:
          type: integer
          description: Duration in seconds
          nullable: true
    Error:
      type: object
      properties:
        error:
          type: string
          example: Resource not found
        status:
          type: integer
          example: 404
        message:
          type: string
          example: The requested resource could not be found
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key required for all endpoints

````