Skip to main content
PATCH
Actualizar un agente
Partial update. Only the fields present in the body change; everything else is left alone. To change one prompt section, use PUT /v1/agents/{id}/prompts/{section} instead. Sending prompts here replaces them all, which is what you want when your system owns the whole prompt and a mistake when it does not.

Endpoint

Required scope

agents:write

Headers

Path parameters

Body

Every field is optional.

Example request

Response

200 OK

The full agent, same shape as GET /v1/agents/{id}.

400 Bad Request

A field over its length limit, a malformed ObjectId, an unknown property, or INVALID_MODEL when the new model is not supported.

401 Unauthorized

Missing, invalid, revoked, or expired token.

403 Forbidden

The token does not have the agents:write scope.

404 Not Found

No agent with that id in the token’s company and project.

502 Bad Gateway

The agent service is unreachable.

Operational notes

  • knowledge_node_ids replaces, it does not append. Sending one id leaves the agent with exactly that one. Read the current list from GET /v1/agents/{id} and send the union if you mean to add.
  • The model is only validated when it changes. An agent already configured with a model that has since been retired keeps working through updates that do not touch model, and starts failing validation the moment you send it explicitly.
  • is_active: false is the reversible way to take an agent out of service. It keeps every section, version and knowledge assignment; deleting does not.
  • Changing goal.type changes which tools the agent can use. It is not a rename: an agent moved from informing to booking needs the services and availability behind it to exist.
  • Removing a channel stops it answering there, and a customer who writes gets nothing back.
  • Omitting a field and sending null are not the same. Omit it to leave the value alone. null is not accepted for these fields.
  • A change takes effect within about fifteen minutes at worst. The rendered prompt and bound tools are cached per agent; the cache is dropped on every write, but a request already in flight can still answer with the previous configuration.

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

Body

application/json
name
string
Maximum string length: 150
description
string
Maximum string length: 500
model
string

Identificador del modelo. Se valida solo si cambia respecto del actual.

language
string
Example:

"es-CL"

timezone
string
Example:

"America/Santiago"

goal
object
prompts
object[]

REEMPLAZA todas las secciones. Para cambiar una sola sin tocar el resto, usar PUT /v1/agents/{id}/prompts/{section}.

Maximum array length: 20
channels
string[]
Maximum array length: 10
reengagement
object
tools
string[]
Maximum array length: 100
knowledge_node_ids
string[]
Maximum array length: 200
is_active
boolean

Response

200 - application/json
agent
object
required