Replace the draft
SDK platic.agents.draft.replace()
Replace the whole draft with a complete configuration. First read config with Get the draft, then send it complete, with all 15 sections. The publication does not change.
To change only some fields, use Update the draft.
Example
curl -X PUT https://api.platic.ai/v1/agents/$AGENT_ID/draft \
-H "Authorization: Bearer $PLATIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "config": { ... } }' const { config } = await platic.agents.draft.get("agent_123");
await platic.agents.draft.replace("agent_123", { config }); Path parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
agentId | string | Agent id | ✓ |
Request body
| Field | Type | Description | Required |
|---|---|---|---|
config | object | The complete configuration, with its 15 sections. instructions is a string | ✓ |
note | string | Version note, up to 500 characters | - |
{
"config": {
"description": "Helps people who want to buy",
"instructions": "You are the sales assistant for Acme Store."
},
"note": "Complete configuration"
} The example shows two of the 15 required sections.
Response
The fields are those from Update the draft:
{
"status": "success",
"data": {
"changed": true,
"draft": { "versionId": "v6", "number": 6 },
"version": {
"versionId": "v6",
"number": 6,
"basedOnVersionId": "v5",
"restoredFromVersionId": null,
"copiedFrom": null,
"createdAt": "2026-10-28T12:08:00.000Z",
"createdBy": { "kind": "api_key", "keyId": "k3yId" },
"source": "api",
"via": null,
"note": "Complete configuration"
}
}
} Errors
| Status | details.code | When |
|---|---|---|
400 | INVALID_REQUEST | The body doesn't have the expected shape, for example config is missing |
403 | FORBIDDEN | The credential can't edit this agent |
404 | AGENT_NOT_FOUND | The agent doesn't exist in the workspace or was deleted |
409 | CONFLICT | Someone else changed this at the same time. Try again |
422 | INVALID_CONFIG | The configuration is incomplete, has a name from the earlier shape or contains an invalid value. details.issues lists the field path for each problem |
422 | INVALID_SUBAGENT_LINK | subagents links an agent that doesn't exist in the workspace, or the same agent |
422 | UNSUPPORTED_REASONING_EFFORT | model or a model in fallbackModels asks for a reasoning level it doesn't accept. details.supportedEfforts lists the supported values |
422 | MODEL_FALLBACKS_REQUIRE_OWN_KEY | fallbackModels adds a fallback the draft 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 |
Notes
- If the configuration is the same as the draft's, it answers
changed: falsewithout creating a version. - To see which sections ended up different, use Compare versions.
- The format of
details.issuesis in Validation.