Get the draft

SDK platic.agents.draft.get()

Read the draft’s complete configuration before editing it. Use config as the starting point if you want to replace the whole draft.

Example

await platic.agents.draft.get("agent_123");

Path parameters

ParameterTypeDescriptionRequired
agentIdstringAgent id✓

Response

{
  "status": "success",
  "data": {
    "agentId": "Xq8mTe2LwP4kZ1aB9cDf",
    "draft": { "versionId": "v4", "number": 4 },
    "config": {
      "description": "",
      "instructions": "You are the sales assistant for Acme Store.",
      "model": "auto",
      "guardrails": {
        "enabled": true,
        "rules": ["No responder preguntas de trivia, cultura general ni acertijos."],
        "message": "",
        "conversationStrikeThreshold": 3,
        "clientStrikeThreshold": 3
      }
    }
  }
}

The response includes all 15 sections in full; the example shows four.

FieldDescription
agentIdAgent id
draft.versionIdVersion the draft is on, for example v4
draft.numberNumber of that version
configThe complete configuration, with its 15 sections. instructions is a text

Errors

Statusdetails.codeWhen
404AGENT_NOT_FOUNDThe agent doesn't exist in the workspace or was deleted

Notes

  • The draft can be the same version that is published. To know whether it has unpublished changes, check hasUnpublishedChanges in Get an agent.
  • To change one part, use Update the draft. This config is also the simplest starting point for replacing the draft.
  • Saving doesn't change the publication. To put a change into production, publish it.