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

# Get Agent

> Retrieves a specific AI agent by its ID. Returns the complete agent configuration including name, status, actions, and settings.

Retrieves a specific AI agent by its ID. Returns the complete agent configuration including name, status, actions, and settings.

```http theme={null}
GET https://services.leadconnectorhq.com/conversation-ai/agents/{agentId}
```

## Autorización

<ParamField header="Authorization" type="string" required>
  Bearer token generado desde el portal Leadway. Ver [Autenticación](/authentication).
</ParamField>

<ParamField header="Version" type="string" required default="2021-07-28">
  Versión de la API.
</ParamField>

## Path parameters

<ParamField path="agentId" type="string" required default="EmployeeId123">
  Conversations AI agent id
</ParamField>

## Respuestas

<Accordion title="200 - Successful response">
  <ResponseField name="id" type="string" required default="emp_123">
    Unique identifier for the agent.
  </ResponseField>

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

  <ResponseField name="businessName" type="string" default="Tech Corp">
    Name of the business the agent represents.
  </ResponseField>

  <ResponseField name="mode" type="string" required default="auto-pilot">
    Current operating mode of the agent. Posibles valores: 'off', 'suggestive', 'auto-pilot'
  </ResponseField>

  <ResponseField name="channels" type="string[]" required>
    Communication channels the agent operates on.
  </ResponseField>

  <ResponseField name="waitTime" type="number" required default="30">
    Wait time before agent responds.
  </ResponseField>

  <ResponseField name="waitTimeUnit" type="string" required default="seconds">
    Unit for wait time. Posibles valores: 'minutes', 'seconds'
  </ResponseField>

  <ResponseField name="sleepEnabled" type="boolean" required default="False">
    Indicates if sleep functionality is enabled.
  </ResponseField>

  <ResponseField name="sleepTime" type="number" default="2">
    Duration of sleep period.
  </ResponseField>

  <ResponseField name="sleepTimeUnit" type="string" default="hours">
    Unit of sleep time. Posibles valores: 'hours', 'minutes', 'seconds'
  </ResponseField>

  <ResponseField name="actions" type="object[]" required>
    List of actions associated with this agent.

    <Expandable title="cada item">
      <ResponseField name="id" type="string" required default="actionId123">
        Unique identifier for the action.
      </ResponseField>

      <ResponseField name="type" type="string" required default="triggerWorkflow">
        type of action. Posibles valores: 'triggerWorkflow', 'updateContactField', 'appointmentBooking', 'stopBot', 'humanHandOver', 'advancedFollowup', 'transferBot'
      </ResponseField>
    </Expandable>
  </ResponseField>

  <ResponseField name="isPrimary" type="boolean" required default="False">
    Indicates if this agent is a primary agent.
  </ResponseField>

  <ResponseField name="autoPilotMaxMessages" type="number" required default="25">
    Maximum number of messages in auto-pilot mode before requiring human intervention.
  </ResponseField>

  <ResponseField name="goal" type="string" default="Assist customers with inquiries">
    The goal of the agent.
  </ResponseField>

  <ResponseField name="personality" type="string" default="Friendly and helpful">
    Personality traits of the agent.
  </ResponseField>

  <ResponseField name="instructions" type="string" default="Provide excellent customer service">
    Instructions for the agent.
  </ResponseField>

  <ResponseField name="knowledgeBaseIds" type="string[]">
    Array of knowledge base IDs associated with this agent.
  </ResponseField>

  <ResponseField name="sleepOnManualMessage" type="boolean" default="False">
    Whether the bot sleeps on manual outbound messages.
  </ResponseField>

  <ResponseField name="sleepOnWorkflowMessage" type="boolean" default="False">
    Whether the bot sleeps on workflow outbound messages.
  </ResponseField>

  ```json theme={null}
  {
    "id": "emp_123",
    "name": "John Doe",
    "businessName": "Tech Corp",
    "mode": "auto-pilot",
    "channels": [
      "SMS",
      "Live_Chat"
    ],
    "waitTime": 30,
    "waitTimeUnit": "seconds",
    "sleepEnabled": false,
    "sleepTime": 2,
    "sleepTimeUnit": "hours",
    "actions": [
      {
        "id": "actionId123",
        "type": "triggerWorkflow"
      }
    ],
    "isPrimary": false,
    "autoPilotMaxMessages": 25,
    "goal": "Assist customers with inquiries",
    "personality": "Friendly and helpful",
    "instructions": "Provide excellent customer service",
    "knowledgeBaseIds": [
      "kb_123",
      "kb_456"
    ],
    "sleepOnManualMessage": false,
    "sleepOnWorkflowMessage": false
  }
  ```
</Accordion>

<Accordion title="400 - Bad Request">
  ```json theme={null}
  {}
  ```
</Accordion>

<Accordion title="401 - Unauthorized">
  ```json theme={null}
  {}
  ```
</Accordion>

<Accordion title="422 - Unprocessable Entity">
  ```json theme={null}
  {}
  ```
</Accordion>

## Ejemplo

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET 'https://services.leadconnectorhq.com/conversation-ai/agents/YOUR_agentId' \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Version: 2021-07-28'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://services.leadconnectorhq.com/conversation-ai/agents/YOUR_agentId', {
    method: 'GET',
    headers: {
      Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
      Version: '2021-07-28',
    },
  });
  const data = await response.json();
  ```

  ```python Python theme={null}
  import os, requests
  response = requests.request(
      'GET',
      'https://services.leadconnectorhq.com/conversation-ai/agents/YOUR_agentId',
      headers={
          'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
          'Version': '2021-07-28',
      },
  )
  data = response.json()
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://services.leadconnectorhq.com/conversation-ai/agents/YOUR_agentId');
  curl_setopt_array($ch, [
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_CUSTOMREQUEST => 'GET',
      CURLOPT_HTTPHEADER => [
          'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
          'Version: 2021-07-28',
      ],
  ]);
  $data = json_decode(curl_exec($ch), true);
  ```
</CodeGroup>
