> ## 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.

# Get an Agent

> Returns the details of a specific agent.

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

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

## Try it

Use the following request to retrieve a specific agent:

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

  <Tab title="JavaScript">
    ```javascript theme={null}
    const agentId = 123;

    const response = await fetch(
      `https://api.revreply.com/v1/agent/${agentId}`,
      {
        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

    agent_id = 123

    response = requests.get(
        f"https://api.revreply.com/v1/agent/{agent_id}",
        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
    $agentId = 123;

    $ch = curl_init("https://api.revreply.com/v1/agent/" . $agentId);

    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/123",
            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
```

### Path parameters

| Parameter | Type      | Required | Description       | Example |
| --------- | --------- | -------- | ----------------- | ------- |
| `agent`   | `integer` | Yes      | Agent/persona ID. | `123`   |

### Request structure

This endpoint does not require a request body or query parameters.

### Request examples

The request is a `GET` request to:

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

## Response

### Response structure

A successful request returns an object containing the requested agent.

| Field     | Type      | Required | Description                                     |
| --------- | --------- | -------- | ----------------------------------------------- |
| `success` | `integer` | Yes      | Indicates whether the operation was successful. |
| `data`    | `object`  | Yes      | The requested agent.                            |

The agent object may include fields such as `id`, `name`, `status`, `agent_objective`, `timezone`, office hours, calendar and meeting links, objective, tone, company information, services, products, and follow-up configuration.

### Response example

```json theme={null}
{
  "success": 1,
  "data": {
    "id": 123,
    "name": "Sales Agent",
    "status": 1,
    "agent_objective": "Schedule Meeting",
    "timezone": "America/New_York",
    "office_hours_from": "09:00",
    "office_hours_to": "17:00",
    "exclude_weekends": true,
    "calendar_link": "https://calendly.com/example",
    "meeting_link": "https://zoom.us/j/123456",
    "objective": "Generate qualified sales meetings",
    "tone": "Professional"
  }
}
```

## Errors

### 404 — Agent not found

Returned when the specified agent does not exist.

```json theme={null}
{
  "success": 0,
  "message": "Something went wrong"
}
```
