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

# Set Agent as Callback

> Configure an inbound agent to handle callbacks from outbound source agents

# Set Agent as Callback

Configure an inbound agent to handle callbacks from one or more outbound source agents. When a contact previously called by a source agent dials back, the call is routed to this agent (assuming the agent owns the dialed number).

## Endpoint

```
POST /api/v1/agents/{agent_id}/callback
```

## Path parameters

<ParamField path="agent_id" type="string" required>UUID of the inbound agent. Must have `direction: "inbound"`.</ParamField>

## Request headers

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

<ParamField header="Content-Type" type="string" required>
  Must be set to `application/json`
</ParamField>

## Request body

<ParamField body="source_agent_ids" type="array" required>
  Array of outbound agent UUIDs whose contacts should route to this callback agent on inbound returns. Must contain at least one entry.
</ParamField>

## Examples

<RequestExample>
  ```bash theme={null}
  curl -X POST "https://app.talkover.ai/api/v1/agents/agent-uuid-1/callback" \
    -H "Authorization: Bearer talq_your_environment_token_here" \
    -H "Content-Type: application/json" \
    -d '{
      "source_agent_ids": ["agent-uuid-2", "agent-uuid-3"]
    }'
  ```
</RequestExample>

## Response

<ResponseExample>
  ```json theme={null}
  {
    "success": true,
    "data": {
      "id": "agent-uuid-1",
      "name": "Callback Handler",
      "direction": "inbound",
      "callback_config": {
        "source_agent_ids": ["agent-uuid-2", "agent-uuid-3"]
      }
    }
  }
  ```
</ResponseExample>

## Error responses

### 422 — Wrong Direction

<ResponseExample>
  ```json theme={null}
  {
    "success": false,
    "message": "Agent must have direction=inbound to serve as a callback",
    "code": "INVALID_AGENT_DIRECTION"
  }
  ```
</ResponseExample>
