# Turn drafting on its own on or off

Source: https://docs.vlayers.ai/reference/agents/set-agent-auto-draft

`PUT /v1/agents/{id}/improvement/auto-draft` · scope `workspace:write`

When on, a problem that reaches enough different contacts gets a drafted fix and its replays without anyone asking, each charged, within the monthly cap you set. The cap is reserved before each draft starts, so two started together cannot pass it. Off until you turn it on.

Requires an API key with the `workspace:write` scope.

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string | yes | The agent id. Example: `"0192f5c2-6f7a-7b9c-8d1e-2f3a4b5c6d78"` |
| `enabled` | body | boolean | yes | Turn it on or off. |
| `monthlyCapUsd` | body | number | no | The most automatic drafts and their replays may cost in a month, in US dollars. `null` for none. |
| `quotedMaxUsd` | body | number | no | The most one proposal can cost, as you saw it. A price that moved is refused `price_changed`. |

## Request

cURL:

```bash
curl -X PUT "https://api.vlayers.ai/v1/agents/$AGENT_ID/improvement/auto-draft" \
  -H "Authorization: Bearer $VOICELAYER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": true,
    "monthlyCapUsd": 5
  }'
```

TypeScript:

```ts
import { VoiceLayer } from '@voicelayer/api';

const voicelayer = new VoiceLayer();

const { improvement } = await voicelayer.agents.setAutoDraft('<agent-id>', {
  enabled: true,
  monthlyCapUsd: 5
});
console.log(improvement.autoDraft.enabled);
```

Python:

```python
from voicelayer import VoiceLayer

vl = VoiceLayer()

result = vl.agents.set_auto_draft("<agent-id>", enabled=True, monthly_cap_usd=5)
print(result.improvement.auto_draft.enabled)
```

## Response `200`

```json
{
  "improvement": {
    "agentId": "0192f5c2-6f7a-7b9c-8d1e-2f3a4b5c6d78",
    "autoDraft": {
      "enabled": true,
      "monthlyCapUsd": 20,
      "committedUsd": 1.4
    },
    "autoShip": {
      "enabled": false,
      "grantId": null,
      "grantedBy": null,
      "grantedByName": null,
      "costCeilingUsdPerSuccess": null,
      "offReason": null,
      "offAt": null
    },
    "textApproval": {
      "enabled": true,
      "grantId": "0192f5c1-5e6f-7a8b-9c0d-1e2f3a4b5c67",
      "mobileConfirmed": true
    },
    "limits": {
      "autoShipMinContacts": 20,
      "autoShipMinOwnerCases": 5,
      "maxEvidenceCases": 20
    },
    "perProposalQuote": {
      "maxUsd": 1.4,
      "typicalUsd": 0.4,
      "draftMaxUsd": 0.2,
      "evidenceMaxUsd": 1.2
    },
    "updatedAt": "2026-10-20T15:04:05.000Z"
  }
}
```
