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

# List Agents

> Returns the authenticated user's agents.

<Badge color="green">GET</Badge> `https://api.revreply.com/v1/agent`

<Note>
  This endpoint requires authentication.
</Note>

## Try it

Use the following request to retrieve the authenticated user's agents:

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    curl -X GET "https://api.revreply.com/v1/agent" \
      -H "Authorization: Bearer <YOUR_JWT>" \
      -H "Accept: application/json" \
      -H "Content-Type: application/json"
    ```
  </Tab>

  <Tab title="JavaScript">
    ```javascript theme={null}
    const response = await fetch(
      "https://api.revreply.com/v1/agent",
      {
        method: "GET",
        headers: {
          "Authorization": "Bearer <YOUR_JWT>",
          "Accept": "application/json",
          "Content-Type": "application/json"
        }
      }
    );
    const data = await response.json();
    console.log(data);
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    import requests

    response = requests.get(
        "https://api.revreply.com/v1/agent",
        headers={
            "Authorization": "Bearer <YOUR_JWT>",
            "Accept": "application/json",
            "Content-Type": "application/json",
        },
    )
    data = response.json()
    print(data)
    ```
  </Tab>

  <Tab title="PHP">
    ```php theme={null}
    <?php
    $ch = curl_init("https://api.revreply.com/v1/agent");

    curl_setopt_array($ch, [
        CURLOPT_HTTPGET => true,
        CURLOPT_HTTPHEADER => [
            "Authorization: Bearer <YOUR_JWT>",
            "Accept: application/json",
            "Content-Type: application/json",
        ],
        CURLOPT_RETURNTRANSFER => true,
    ]);

    $response = curl_exec($ch);
    curl_close($ch);
    echo $response;
    ```
  </Tab>

  <Tab title="Go">
    ```go theme={null}
    package main

    import (
        "fmt"
        "net/http"
    )

    func main() {
        req, _ := http.NewRequest(
            "GET",
            "https://api.revreply.com/v1/agent",
            nil,
        )

        req.Header.Set("Authorization", "Bearer <YOUR_JWT>")
        req.Header.Set("Accept", "application/json")
        req.Header.Set("Content-Type", "application/json")

        client := &http.Client{}
        response, _ := client.Do(req)
        fmt.Println(response.Status)
    }
    ```
  </Tab>
</Tabs>

## Authentication

This endpoint uses Bearer authentication with a JWT.

## Request

### Headers

| Header          | Type     | Required | Description                                                    |
| --------------- | -------- | -------- | -------------------------------------------------------------- |
| `Authorization` | `string` | Yes      | Bearer token used to authenticate the request.                 |
| `Accept`        | `string` | Yes      | Specifies that the client expects the response in JSON format. |
| `Content-Type`  | `string` | Yes      | Specifies that the request body is formatted as JSON.          |

```http theme={null}
Authorization: Bearer <YOUR_JWT>
Accept: application/json
Content-Type: application/json
```

### Query parameters

| Parameter | Type      | Required | Description                                                            | Default |
| --------- | --------- | -------- | ---------------------------------------------------------------------- | ------- |
| `array`   | `integer` | No       | Set to `1` to return only the agent array without pagination metadata. | `0`     |
| `page`    | `integer` | No       | Page number to retrieve. Must be at least `1`.                         | `1`     |

### Request structure

This endpoint does not require a request body.

The default request returns agents together with pagination information. Supplying `array=1` returns only the agent array.

### Request examples

Default request:

```text theme={null}
https://api.revreply.com/v1/agent
```

Request without pagination metadata:

```text theme={null}
https://api.revreply.com/v1/agent?array=1
```

Request for a specific page:

```text theme={null}
https://api.revreply.com/v1/agent?page=2
```

## Response

### Response structure

A successful request returns either a paginated object containing the user's agents or, when `array=1` is supplied, an array of agents.

#### Paginated response

| Field        | Type     | Description                                |
| ------------ | -------- | ------------------------------------------ |
| `data`       | `array`  | List of agents.                            |
| `pagination` | `object` | Pagination information for the result set. |

The `data` array contains agent objects with fields including `id`, `name`, `status`, `agent_objective`, `timezone`, office hours, links, and follow-up configuration.

#### Array response

When `array=1` is supplied, the response is an array of agent objects without pagination metadata.

### Response example

Paginated response:

```json theme={null}
{
  "data": [
    {
      "id": 123,
      "name": "Sales Agent",
      "status": 1,
      "agent_objective": "Schedule Meeting",
      "timezone": "America/New_York"
    }
  ],
  "pagination": {
    "total": 1,
    "per_page": 100,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": null,
    "prev_page_url": null
  }
}
```

Array response with `array=1`:

```json theme={null}
[
  {
    "id": 123,
    "name": "Sales Agent",
    "status": 1,
    "agent_objective": "Schedule Meeting",
    "timezone": "America/New_York"
  }
]
```
