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

# Get agent logs

> Search call logs to review agent activity and troubleshoot calls.

All filters are optional and go directly in the request body. Unknown fields and custom-analysis filters return `400`.

Results are sorted by session start time, newest first. Increase `page` while `pagination.has_more` is `true`. Keep the same `size` and filters.

No matches or `size: 0` returns an empty `data` array with `pagination.has_more: false`.

See [review agent logs](https://docs.getkarta.ai/guides/agent-logs.md) for examples.


## OpenAPI

````yaml openapi.json POST /agent/logs
openapi: 3.1.0
info:
  title: Karta Public API
  version: 1.0.0-draft
  description: >-
    Karta API reference for accounts, agents, calls, campaigns, WebSocket
    sessions, and billing.
servers:
  - url: https://api.getkarta.ai/public/v1
    description: Production
security:
  - BearerApiKey: []
tags:
  - name: Account
  - name: Agents
  - name: Calls
  - name: Phone numbers
  - name: Campaigns
  - name: Realtime
  - name: Billing
  - name: Webhooks
    description: Outgoing call events delivered to your server.
paths:
  /agent/logs:
    post:
      tags:
        - Agents
      summary: Get agent logs
      description: Search call logs to review agent activity and troubleshoot calls.
      operationId: listAgentLogs
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentLogsRequest'
            examples:
              filtered:
                summary: Filter call logs
                value:
                  page: 1
                  size: 20
                  agent_id: agentexample
                  call_status: ended
                  call_direction: inbound
                  call_start_timestamp: '2026-10-01T00:00:00Z'
                  call_end_timestamp: '2026-10-06T23:59:59Z'
      responses:
        '200':
          description: Matching call logs, ordered by session start time, newest first.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentLogsPage'
              examples:
                results:
                  summary: Matching calls
                  value:
                    data:
                      - call_id: example-call-id
                        agent_id: agentexample
                        call_status: ended
                        call_direction: inbound
                        session_duration: 58
                        talktime_duration: 47
                        billing_amount: 1.25
                        billed_quantity: 60
                        call_start_timestamp: '2026-10-06T10:00:00Z'
                        call_end_timestamp: '2026-10-06T10:00:47Z'
                    pagination:
                      page: 1
                      size: 20
                      has_more: false
                empty:
                  summary: No matching calls
                  value:
                    data: []
                    pagination:
                      page: 1
                      size: 20
                      has_more: false
                more_results:
                  summary: More pages available
                  value:
                    data:
                      - call_id: example-call-id
                        agent_id: agentexample
                        call_status: ended
                        call_direction: inbound
                        session_duration: 58
                        talktime_duration: 47
                        billing_amount: 1.25
                        billed_quantity: 60
                        call_start_timestamp: '2026-10-06T10:00:00Z'
                        call_end_timestamp: '2026-10-06T10:00:47Z'
                    pagination:
                      page: 1
                      size: 1
                      has_more: true
                zero_size:
                  summary: Size 0
                  value:
                    data: []
                    pagination:
                      page: 1
                      size: 0
                      has_more: false
        '400':
          description: Invalid filters or pagination.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/AgentLogsProblem'
              example:
                type: https://api.karta.com/problems/bad-request
                title: Bad Request
                status: 400
                detail: 'Unknown request fields: filters'
                instance: /v1/agent/logs
                trace_id: example-request-001
          headers:
            X-Request-ID:
              description: Request identifier.
              schema:
                type: string
        '401':
          description: Authentication failed.
          headers:
            X-Request-ID:
              description: Request identifier.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthProblem'
                title: Authentication or account configuration error
              examples:
                authentication:
                  summary: Missing API key
                  value:
                    type: https://httpstatus.es/401
                    title: Invalid API Key
                    status: 401
                    detail: API key is required
                    instance: example-request-001
                    code: invalid_api_key
        '403':
          description: API key not permitted for this operation.
          headers:
            X-Request-ID:
              description: Request identifier.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthProblem'
                title: Authentication or account configuration error
              examples:
                authentication:
                  summary: Wrong key type
                  value:
                    type: https://httpstatus.es/403
                    title: Wrong API Key Type
                    status: 403
                    detail: Widget API keys may only be used on /widget paths
                    instance: example-request-001
                    code: wrong_key_audience
components:
  schemas:
    AgentLogsRequest:
      type: object
      additionalProperties: false
      properties:
        page:
          type: integer
          default: 1
          minimum: 1
          description: Page number.
        size:
          type: integer
          default: 20
          minimum: 0
          maximum: 500
          description: Results per page. Use 0 to return an empty data array.
        call_id:
          type: string
          description: Call identifier.
        batch_id:
          type: string
          description: Batch identifier.
        agent_id:
          type: string
          description: Agent identifier.
          example: agentexample
        branch_id:
          type: string
          description: Agent branch identifier.
        call_status:
          type: string
          description: Call status. Use all to include every value.
          example: ended
        call_direction:
          type: string
          description: Call direction. Use all to include every value.
          example: inbound
        agent_name:
          type: string
          description: Wildcard substring search on the agent name.
        to_number:
          type: string
          description: Wildcard substring search on either phone number.
        call_start_timestamp:
          type: string
          format: date-time
          description: Start of the call-time filter, using session timestamps.
        call_end_timestamp:
          type: string
          format: date-time
          description: End of the call-time filter, using session timestamps.
        session_start_timestamp:
          type: string
          format: date-time
          description: Start of the session-time filter.
        session_end_timestamp:
          type: string
          format: date-time
          description: End of the session-time filter.
        duration_min:
          type: number
          description: Minimum talk time in seconds (inclusive).
        duration_max:
          type: number
          description: Maximum talk time in seconds (inclusive).
        call_disconnected_by:
          type: string
          description: Party that disconnected the call.
        call_transfer_status:
          type: string
          description: Call transfer status.
    AgentLogsPage:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            additionalProperties: true
            properties:
              call_id:
                type: string
                description: Call identifier.
              agent_id:
                type: string
                description: Agent identifier.
              call_status:
                type: string
                description: Call status.
              call_direction:
                type: string
                description: Call direction.
              session_duration:
                type: number
                description: Session duration in seconds.
              talktime_duration:
                type: number
                description: Talk time in seconds.
              billing_amount:
                type: number
                description: Call billing amount.
              billed_quantity:
                type: number
                description: Quantity billed for this call.
              call_start_timestamp:
                type: string
                format: date-time
                description: Call start time.
              call_end_timestamp:
                type: string
                format: date-time
                description: Call end time.
        pagination:
          type: object
          properties:
            page:
              type: integer
              minimum: 1
              description: Current page number.
              example: 1
            size:
              type: integer
              minimum: 0
              maximum: 500
              description: Requested page size.
              example: 20
            has_more:
              type: boolean
              description: Whether another page of results is available.
              example: false
          additionalProperties: false
      additionalProperties: false
    AgentLogsProblem:
      title: Agent log validation error
      type: object
      properties:
        type:
          type: string
          description: Error category.
        title:
          type: string
          description: Error summary.
        status:
          type: integer
          description: HTTP status code.
        detail:
          type: string
          description: Error description.
        instance:
          type: string
          description: Request path.
        trace_id:
          type: string
          description: Request identifier.
    AuthProblem:
      type: object
      properties:
        type:
          type: string
          description: Identifier for this error category.
        title:
          type: string
          description: Short summary of the error.
        status:
          type: integer
          description: HTTP status code for this response.
        detail:
          type: string
          description: Explanation of the failure.
        instance:
          type: string
          description: Request identifier.
        code:
          type: string
          description: Machine-readable error code.
      title: Authentication or account configuration error
  securitySchemes:
    BearerApiKey:
      type: http
      scheme: bearer
      description: 'API key in the format: Bearer YOUR_KARTA_API_KEY.'

````

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