Skip to main content
PUT
Escribir una seccion del prompt
Replaces the text of that one section and creates it if it was not there. The rest of the agent is untouched, which is the difference between this and sending prompts to the update endpoint — that one replaces them all. Every save that changes the text leaves a version behind, so an integration that writes sections gets an audit trail and an undo for free.

Endpoint

Required scope

agents:write

Path parameters

Body

Example request

Response

200 OK

Returns the whole agent, so you can see the section in place without a second read.

401 Unauthorized

Missing, invalid, revoked, or expired token.

403 Forbidden

The token does not have the agents:write scope.

404 Not Found

ASSISTANT_NOT_FOUND when no agent has that id in the token’s company and project, or PROMPT_SECTION_NOT_FOUND when the section is not in the catalogue. The error lists the valid sections.

400 Bad Request

PROMPT_SECTION_HAS_STEPS when you send markdown to a section written as steps (step_by_step): it is not text, so the write would change nothing. UNKNOWN_ACTION_TARGET when a case action is not in the actions list, and AMBIGUOUS_ACTION_TARGET when one matches two of its groups. The error lists them in targets.

502 Bad Gateway

The agent service is unreachable.

Operational notes

  • Send the whole section, not the new paragraph. The text is replaced. Appending is your job before the call.
  • The functions of a case are what gives the agent its tools. A case that loses its actions takes those tools away from the agent. That is why omitting actions keeps them: only an explicit [] removes them. The other sections, and the steps, rules and status of this one, go back exactly as they were.
  • An unknown section is rejected, on purpose. Storing it would return 200 and change nothing: the agent only reads sections the catalogue declares.
  • Two writes to different sections of the same agent can lose one. The section is written by reading the agent, replacing that entry and saving it back, so simultaneous writes race. Serialise your writes per agent.
  • Saving identical text does not create a version. The history records changes, not calls.
  • This does not restart anything. The agent picks the new text up on its next turn; conversations already in flight finish on what they had.

Authorizations

Authorization
string
header
required

Personal Access Token con prefijo kbai_pk_. Generar desde el portal con permiso developer.manage_tokens.

Path Parameters

id
string
required
section
string
required

Body

application/json
label
string
Maximum string length: 150
markdown
string

El texto completo de la seccion, en markdown.

cases
object[]

Los casos de la seccion cases_possible, uno por elemento.

Response

200 - application/json
agent
object
required