---
docId: doc_973be94c55764685956eb53de308a3c2
title: Update the draft
description: "Edit parts of the draft and publish when you want to apply the changes."
api:
  group: agentes/borrador
  auth: bearer
  operations:
    - operationId: updateDraft
      method: PATCH
      path: '/v1/agents/{agentId}/draft'
      postmanName: Update the draft
---

<script>
  import { Ways } from '$lib/components';
</script>

# Update the draft

Edit the draft by sending only the fields you want to change. If the configuration changes, a new version is created. [Publish it](/api-reference/agents/publications/publish) to apply those settings to your contacts; until then, **the publication does not change**.

## Example

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl -X PATCH https://api.platic.ai/v1/agents/$AGENT_ID/draft \
  -H "Authorization: Bearer $PLATIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "instructions": "Answer in Spanish." }'
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
await platic.agents.draft.update("agent_123", { instructions: "Answer in Spanish." });
```

</Ways.Way>
</Ways>

## Path parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `agentId` | string | Agent id | ✓ |

## Request body

| Field | Type | Description | Required |
|-------|------|-------------|----------|
| `description`, `instructions`, `model`, `modelPriority`, `fallbackModels`, `memory`, `fileAttachments`, `scheduledTasks`, `multilingual`, `workingMessage`, `subagents`, `assistance`, `schedule`, `guardrails`, `followUp` | depends on the section | The [configuration](/api-reference/agents/configuration#sections) sections you want to change, directly in the body. Send only the ones that change. See [partial changes](/api-reference/agents/configuration#partial-changes) | - |
| `note` | string | Version note, up to 500 characters | - |

```json
{
  "instructions": "You are the sales assistant for Acme Store. Answer in under 80 words.",
  "guardrails": { "message": "I can only help with store topics." },
  "note": "Shorter answers"
}
```

Changes are applied as follows:

- An object is merged with the current one: the fields you don't send stay as they are.
- A list, a string or any other value (including `null`) replaces the current one. `instructions` is a string, so it is replaced as a whole. To change a single subagent without sending the list, use [Link a subagent](/api-reference/agents/subagents/link).
- The result is validated as a whole. If anything isn't valid, nothing is saved.

## Response

```json
{
  "status": "success",
  "data": {
    "changed": true,
    "draft": { "versionId": "v5", "number": 5 },
    "version": {
      "versionId": "v5",
      "number": 5,
      "basedOnVersionId": "v4",
      "restoredFromVersionId": null,
      "copiedFrom": null,
      "createdAt": "2026-10-28T12:05:00.000Z",
      "createdBy": { "kind": "api_key", "keyId": "k3yId" },
      "source": "api",
      "via": null,
      "note": "Shorter answers"
    }
  }
}
```

| Field | Description |
|-------|-------------|
| `changed` | `true` if the change created a version. `false` if the configuration ended up the same: no version is created and the draft doesn't move |
| `draft` | The version the draft ended up on after the change |
| `version` | The created version, with the fields from [List versions](/api-reference/agents/versions/list#response-fields). With `changed: false`, the version the draft was already on |

## Errors

| Status | `details.code` | When |
|--------|----------------|------|
| `400` | `INVALID_REQUEST` | The body doesn't have the expected shape, for example it includes an unknown section |
| `403` | `FORBIDDEN` | The credential can't edit this agent |
| `404` | `AGENT_NOT_FOUND` | The agent doesn't exist in the workspace or was deleted |
| `422` | `INVALID_CONFIG` | An unknown field or an invalid value. `details.issues` lists the field path for each problem. Also when `model` isn't a [model Platica knows](/api-reference/agents/configuration#reasoning-level), or when you send a name from the [earlier shape](/api-reference/agents/configuration#if-you-used-the-earlier-shape), such as `runtime`: the message says where it is now |
| `422` | `INVALID_SUBAGENT_LINK` | `subagents` adds a link to an agent that doesn't exist in the workspace or was deleted, or to the same agent. A link the draft already had isn't checked again when saving |
| `422` | `UNSUPPORTED_REASONING_EFFORT` | `model` or a model in `fallbackModels` asks for a [reasoning level](/api-reference/agents/configuration#reasoning-level) it doesn't accept. `details.supportedEfforts` lists the supported values |
| `422` | `MODEL_FALLBACKS_REQUIRE_OWN_KEY` | `fallbackModels` adds a fallback the agent didn't have and the workspace has no own key connected. Keeping, removing or reordering the ones it already has, or emptying the list, doesn't need a key. See [fallback models](/api-reference/agents/configuration#fallback-models) |

## Notes

- If two people edit the draft at once, the last change wins; the previous one stays in the [version history](/api-reference/agents/versions/list).
- To replace the complete configuration, use [Replace the draft](/api-reference/agents/drafts/replace). To check changes without saving them, use [Validate changes](/api-reference/agents/drafts/validate).
- The escalations in `assistance.escalations` are checked when you [publish](/api-reference/agents/publications/publish), not when saving. See [Leave an agent escalating](/api-reference/escalations#set-up-an-agent-to-escalate-step-by-step).
- The format of `details.issues` is in [Validation](/api-reference/agents/configuration#validation). The rest of the errors are in [Errors](/api-reference/errors).
