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

# Set Sources

> Choose which AI agents and dialer numbers an analyzer watches

Replaces the watched list. New calls from watched sources are analyzed automatically when `auto_new` is `true`. Analysis is paid, so a save never pulls in old calls unless you set `backfill_days`.

> [!NOTE]
>
> Needs `manage` on the analyzer.

## Request

### Headers

**Authorization** `string` *required*

Bearer token with your API key: `Bearer sk_...`

**Content-Type** `string` *required*

application/json

### Path

**agentId** `string` *required*

Analyzer ID (UUID)

### Body

**agent\_ids** `string[]` *required*

Required. Up to 50 IDs of 60db AI agents in this workspace. `[]` watches none. Unknown IDs are rejected

**dialer\_number\_ids** `string[]`

Up to 50 dialer number IDs (digits, from [List dialer numbers](https://docs.60db.ai/api-reference/call-analysis/list-dialer-numbers.md)). Omit to leave unchanged

**auto\_new** `boolean` (default: true)

Analyze new calls automatically

**min\_seconds** `integer` (default: 30)

0–3600. Skip calls shorter than this

**backfill\_days** `integer` (default: 0)

`0`, `7` or `30`. Also analyze recorded calls from the last N days

**self\_heal\_mode** `string`

`off`, `suggest` or `auto`. Omit to keep the current mode. `suggest` and `auto` need at least one watched AI agent; `auto` needs permission to edit agents. Removing the last AI agent while the mode is on sets it to `off`. See [Self healing](https://docs.60db.ai/features/call-analysis.md#self-healing)

## Response

**200** The updated sources. The shape matches [Get Sources](https://docs.60db.ai/api-reference/call-analysis/get-sources.md).

```json theme={null}
{
  "success": true,
  "data": {}
}
```

## Errors

Errors use `{ "success": false, "message": "...", "code": "..." }`. See the [overview](https://docs.60db.ai/api-reference/call-analysis/overview.md#errors) for the codes every route can return.

### This endpoint

| Status | Code | When |
| - | - | - |
| 400 | `UNKNOWN_CALL_AGENT` | One or more agents are not in this workspace |
| 400 | `SELF_HEAL_NEEDS_AI_AGENTS` | `self_heal_mode` is `suggest` or `auto` but no AI agent is watched (`field: self_heal_mode`) |
| 403 | `SELF_HEAL_AUTO_FORBIDDEN` | `self_heal_mode` is `auto` and the caller cannot edit agents |
| 503 | `AUTHZ_UNAVAILABLE` | The permission check for `auto` could not be made |
| 400 | `VALIDATION_ERROR` | A field is invalid |

## Example

```bash cURL theme={null}
curl -X PUT 'https://api.60db.ai/deep-analytics/analysis-agents/3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f/sources' \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"agent_ids": ["<ai-agent-uuid>"], "auto_new": true, "min_seconds": 30, "backfill_days": 0}'
```

```javascript JavaScript theme={null}
const res = await fetch('https://api.60db.ai/deep-analytics/analysis-agents/3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f/sources', {
  method: 'PUT',
  headers: {
    Authorization: 'Bearer your-api-key',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "agent_ids": [
      "<ai-agent-uuid>"
    ],
    "auto_new": true,
    "min_seconds": 30,
    "backfill_days": 0
  }),
});
const { success, data, message, code } = await res.json();
if (!success) throw new Error(`${code}: ${message}`);
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.