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

# List Calls

> Retrieve a list of all calls with filtering and pagination options

# List Calls

Retrieve a list of all calls for the authenticated environment with various filtering options and pagination support.

## Endpoint

```
GET /api/v1/calls
```

## Request headers

<ParamField header="Authorization" type="string" required>
  Bearer token for authentication. Format: `Bearer talq_your_environment_token_here`
</ParamField>

## Query parameters

<ParamField query="status" type="string" required={false}>
  Filter by call status. Options: `initiated`, `ringing`, `answered`, `completed`, `failed`, `busy`, `no-answer`
</ParamField>

<ParamField query="direction" type="string" required={false}>
  Filter by call direction. Options: `inbound`, `outbound`
</ParamField>

<ParamField query="agent_id" type="string" required={false}>
  Filter by agent ID
</ParamField>

<ParamField query="date_from" type="string" required={false}>
  Filter calls from date (YYYY-MM-DD)
</ParamField>

<ParamField query="date_to" type="string" required={false}>
  Filter calls to date (YYYY-MM-DD)
</ParamField>

<ParamField query="search" type="string" required={false}>
  Search in phone numbers or call SID
</ParamField>

<ParamField query="per_page" type="integer" required={false}>
  Number of items per page (default: 20, max: 100)
</ParamField>

<ParamField query="page" type="integer" required={false}>
  Page number (default: 1)
</ParamField>

## Example requests

<RequestExample>
  ```bash theme={null}
  # Request 1: Get all calls
  curl -X GET "https://app.talkover.ai/api/v1/calls" \
    -H "Authorization: Bearer talq_your_environment_token_here"
  ```

  ```javascript theme={null}
  // Request 1: Get all calls
  const response = await fetch('https://app.talkover.ai/api/v1/calls', {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer talq_your_environment_token_here'
    }
  });

  const result = await response.json();
  console.log(result);
  ```
</RequestExample>

<RequestExample>
  ```bash theme={null}
  # Request 2: Get completed calls from specific date
  curl -X GET "https://app.talkover.ai/api/v1/calls?status=completed&date_from=2024-01-01&per_page=50" \
    -H "Authorization: Bearer talq_your_environment_token_here"
  ```

  ```javascript theme={null}
  // Request 2: Get completed calls from specific date
  const response = await fetch('https://app.talkover.ai/api/v1/calls?status=completed&date_from=2024-01-01&per_page=50', {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer talq_your_environment_token_here'
    }
  });

  const result = await response.json();
  console.log(result);
  ```
</RequestExample>

<RequestExample>
  ```bash theme={null}
  # Request 3: Search for specific phone number
  curl -X GET "https://app.talkover.ai/api/v1/calls?search=+1234567890&direction=outbound" \
    -H "Authorization: Bearer talq_your_environment_token_here"
  ```

  ```javascript theme={null}
  // Request 3: Search for specific phone number
  const response = await fetch('https://app.talkover.ai/api/v1/calls?search=+1234567890&direction=outbound', {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer talq_your_environment_token_here'
    }
  });

  const result = await response.json();
  console.log(result);
  ```
</RequestExample>

## Response

### Success Response (200 OK)

<ResponseExample>
  ```json theme={null}
  {
    "success": true,
    "data": [
      {
        "id": "call-uuid-1",
        "sid": "call_sid_123",
        "to": "+1234567890",
        "to_formatted": "(123) 456-7890",
        "from": "+0987654321",
        "from_formatted": "(098) 765-4321",
        "is_testing": false,
        "direction": "outbound",
        "status": "completed",
        "duration": 120,
        "agent": {
          "id": "agent-uuid-1",
          "name": "Sales Agent",
          "label": "Sales Agent Label"
        },
        "created_at": "2024-01-01T00:00:00Z",
        "updated_at": "2024-01-01T00:00:00Z"
      },
      {
        "id": "call-uuid-2",
        "sid": "call_sid_456",
        "to": "+1987654321",
        "to_formatted": "(987) 654-3210",
        "from": "+0987654321",
        "from_formatted": "(098) 765-4321",
        "is_testing": false,
        "direction": "inbound",
        "status": "answered",
        "duration": 180,
        "agent": {
          "id": "agent-uuid-2",
          "name": "Support Agent",
          "label": "Support Agent Label"
        },
        "created_at": "2024-01-01T01:00:00Z",
        "updated_at": "2024-01-01T01:03:00Z"
      }
    ],
    "pagination": {
      "current_page": 1,
      "last_page": 5,
      "per_page": 20,
      "total": 100,
      "from": 1,
      "to": 20
    }
  }
  ```
</ResponseExample>

### Response fields

<ResponseField name="success" type="boolean" required>
  Indicates if the operation was successful.
</ResponseField>

<ResponseField name="data" type="array" required>
  Array of call objects.

  <Expandable title="Call Object">
    <ResponseField name="id" type="string" required>
      Unique identifier for the call.
    </ResponseField>

    <ResponseField name="sid" type="string" required>
      Call SID from the telephony provider.
    </ResponseField>

    <ResponseField name="to" type="string" required>
      Destination phone number in E.164 format.
    </ResponseField>

    <ResponseField name="to_formatted" type="string" required>
      Formatted destination phone number for display.
    </ResponseField>

    <ResponseField name="from" type="string" required>
      Source phone number in E.164 format.
    </ResponseField>

    <ResponseField name="from_formatted" type="string" required>
      Formatted source phone number for display.
    </ResponseField>

    <ResponseField name="is_testing" type="boolean" required>
      Whether this is a test call.
    </ResponseField>

    <ResponseField name="direction" type="string" required>
      Direction of the call. Options: `inbound`, `outbound`.
    </ResponseField>

    <ResponseField name="status" type="string" required>
      Current status of the call. Options: `initiated`, `ringing`, `answered`, `completed`, `failed`, `busy`, `no-answer`.
    </ResponseField>

    <ResponseField name="duration" type="integer" required>
      Call duration in seconds (0 if not completed).
    </ResponseField>

    <ResponseField name="agent" type="object" required>
      Agent information associated with the call.

      <Expandable title="Agent Object">
        <ResponseField name="id" type="string" required>
          Unique identifier for the agent.
        </ResponseField>

        <ResponseField name="name" type="string" required>
          Name of the agent.
        </ResponseField>

        <ResponseField name="label" type="string" required>
          Display label for the agent.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="created_at" type="string" required>
      ISO 8601 timestamp when the call was created.
    </ResponseField>

    <ResponseField name="updated_at" type="string" required>
      ISO 8601 timestamp when the call was last updated.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="pagination" type="object" required>
  Pagination metadata.

  <Expandable title="Pagination Object">
    <ResponseField name="current_page" type="integer" required>
      Current page number.
    </ResponseField>

    <ResponseField name="last_page" type="integer" required>
      Last page number.
    </ResponseField>

    <ResponseField name="per_page" type="integer" required>
      Number of items per page.
    </ResponseField>

    <ResponseField name="total" type="integer" required>
      Total number of items.
    </ResponseField>

    <ResponseField name="from" type="integer" required>
      Starting item number for current page.
    </ResponseField>

    <ResponseField name="to" type="integer" required>
      Ending item number for current page.
    </ResponseField>
  </Expandable>
</ResponseField>

## Error responses

### 401 Unauthorized

<ResponseExample>
  ```json theme={null}
  {
    "success": false,
    "message": "Unauthorized"
  }
  ```
</ResponseExample>

### 422 Validation Error

<ResponseExample>
  ```json theme={null}
  {
    "success": false,
    "message": "The given data was invalid.",
    "errors": {
      "status": [
        "The selected status is invalid."
      ],
      "direction": [
        "The selected direction is invalid."
      ],
      "date_from": [
        "The date from must be a valid date."
      ]
    }
  }
  ```
</ResponseExample>

### 500 Server Error

<ResponseExample>
  ```json theme={null}
  {
    "success": false,
    "message": "Internal server error."
  }
  ```
</ResponseExample>

## Error codes

| Code               | Description                                | HTTP Status |
| ------------------ | ------------------------------------------ | ----------- |
| `INVALID_TOKEN`    | Authentication token is invalid or missing | 401         |
| `VALIDATION_ERROR` | Query parameter validation failed          | 422         |
| `SERVER_ERROR`     | Internal server error occurred             | 500         |

## Important notes

<Info>
  **Pagination support.** All list endpoints support pagination with `page` and `per_page` parameters.
</Info>

<Info>
  **Date filtering.** Use `date_from` and `date_to` to filter calls by date range.
</Info>

<Info>
  **Search functionality.** The search parameter searches in phone numbers and call SIDs.
</Info>

## Related endpoints

* **Get Agent Calls**: `GET /api/v1/agents/{agent_id}/calls`
* **List Campaigns**: `GET /api/v1/campaigns`
* **Make a Call**: `POST /api/v1/calls`
