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

# Update Simulation Draft

> Edit the script of an unpublished draft

> [!NOTE]
>
> AI Simulation needs an active **Pro** or **Business** plan. On another plan, every simulation endpoint returns `403 POLICY_DENY`.

Replace the script of a draft. Only drafts made from your own runs can be edited. The draft stays unpublished.

## Request

### Headers

**Authorization** `string` *required*

Bearer token with your API key (scope `agents`)

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

application/json

### Path

**draftId** `string` *required*

The `draft_id` from [Create simulation draft](https://docs.60db.ai/api-reference/agents/create-simulation-draft.md)

### Body

**script** `string` *required*

1 to 32,000 characters

## Response

**200 OK**.

```json theme={null}
{ "draft_id": "d_8f2", "published": false }
```

## Errors

| Status | Code | Meaning |
| - | - | - |
| 400 | `VALIDATION_ERROR` | `script` is missing or longer than 32,000 characters |
| 403 | `POLICY_DENY` | Your role cannot run simulations, the workspace is not on an active Pro or Business plan, or the API key lacks the `agents` scope |
| 404 | `DRAFT_NOT_FOUND` | No draft with this ID in your workspace |

## Example

```bash cURL theme={null}
curl -X PUT https://api.60db.ai/agents/simulation-drafts/DRAFT_ID \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"script": "You are a polite billing agent…"}'
```


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