Update the draft

SDK platic.agents.draft.update()

Edit the draft by sending only the fields you want to change. If the configuration changes, a new version is created. Publish it to apply those settings to your contacts; until then, the publication does not change.

Example

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

Path parameters

ParameterTypeDescriptionRequired
agentIdstringAgent id✓

Request body

FieldTypeDescriptionRequired
description, instructions, model, modelPriority, fallbackModels, memory, fileAttachments, scheduledTasks, multilingual, workingMessage, subagents, assistance, schedule, guardrails, followUpdepends on the sectionThe configuration sections you want to change, directly in the body. Send only the ones that change. See partial changes-
notestringVersion note, up to 500 characters-
{
  "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.
  • The result is validated as a whole. If anything isn't valid, nothing is saved.

Response

{
  "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"
    }
  }
}
FieldDescription
changedtrue if the change created a version. false if the configuration ended up the same: no version is created and the draft doesn't move
draftThe version the draft ended up on after the change
versionThe created version, with the fields from List versions. With changed: false, the version the draft was already on

Errors

Statusdetails.codeWhen
400INVALID_REQUESTThe body doesn't have the expected shape, for example it includes an unknown section
403FORBIDDENThe credential can't edit this agent
404AGENT_NOT_FOUNDThe agent doesn't exist in the workspace or was deleted
422INVALID_CONFIGAn unknown field or an invalid value. details.issues lists the field path for each problem. Also when model isn't a model Platica knows, or when you send a name from the earlier shape, such as runtime: the message says where it is now
422INVALID_SUBAGENT_LINKsubagents 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
422UNSUPPORTED_REASONING_EFFORTmodel or a model in fallbackModels asks for a reasoning level it doesn't accept. details.supportedEfforts lists the supported values
422MODEL_FALLBACKS_REQUIRE_OWN_KEYfallbackModels 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

Notes