Publish a version

SDK platic.agents.publish()

Apply the draft to your customer conversations. Send the request without a body to publish it, or use versionId to choose another version. The agent uses it from the next incoming message.

Example

await platic.agents.publish("agent_123");

Path parameters

ParameterTypeDescriptionRequired
agentIdstringAgent id✓

Request body

The body is optional. Without a body, it publishes the draft's version. To publish an exact version or leave a note:

FieldTypeDescriptionRequired
versionIdstringVersion to publish, for example v5. Defaults to the draft's-
notestringPublication note, up to 500 characters-
{
  "versionId": "v5",
  "note": "Shorter answers"
}

Response

The new publication, with the fields from Get the publication.

{
  "status": "success",
  "data": {
    "agentId": "Xq8mTe2LwP4kZ1aB9cDf",
    "publication": { "versionId": "v5", "number": 5 },
    "last": {
      "publicationId": "p3",
      "action": "publish",
      "versionId": "v5",
      "previousVersionId": "v3",
      "createdAt": "2026-10-28T12:30:00.000Z",
      "createdBy": { "kind": "api_key", "keyId": "k3yId" },
      "source": "api",
      "via": null,
      "note": "Shorter answers"
    }
  }
}

Errors

Statusdetails.codeWhen
403FORBIDDENThe credential can't edit this agent. Publishing needs the same permission as editing
404AGENT_NOT_FOUNDThe agent doesn't exist in the workspace or was deleted
404VERSION_NOT_FOUNDversionId doesn't exist on that agent
409COPY_INCOMPLETEThe agent is a copy whose files didn't finish connecting. See Copy an agent
409CONFLICTSomeone else changed this at the same time. Try again
422INVALID_SUBAGENT_LINKA link in that version points to an agent that no longer exists, or the links would form a cycle. It isn't published
422INVALID_ESCALATIONAn escalation that version connects or turns on, compared to the published one, doesn't exist in the workspace or is archived. details.escalations lists each one with escalationId and reason: not_found or archived. It isn't published
503SUPPORT_SERVICE_UNAVAILABLEThat version's escalations couldn't be checked. It isn't published; try again

Notes

  • Publishing doesn't move the draft: you can keep editing.
  • If the draft is already the published version, the same version is published again and there is one more entry in the publication history.
  • If you publish from an AI assistant connected to the Platica MCP, do it only when the person asks explicitly. Each publication is recorded with who made it and from where.
  • To evaluate the version with scenarios before publishing it, see Agent evals. To review what changes, compare the versions.
  • If the published version doesn't work as you expected, go back to the previous one with Roll back.