POST /v1/agents
Create an agent: its goal, the sections of its prompt, its channels and its tools.
_id.
The goal is the decision that matters. It is what switches the toolkits on, so an agent created to inform cannot later be made to book without changing it. Everything else — sections, channels, tools — can be adjusted afterwards.
You can send the prompt sections here, or create the agent bare and write them one at a time. Valid values for section, goal.type and channels come from the catalogue.
Endpoint
Required scope
agents:write
Body
Example request
Response
201 Created
400 Bad Request
A field over its length limit, a malformedObjectId, an unknown property, or INVALID_MODEL.
401 Unauthorized
Missing, invalid, revoked, or expired token.403 Forbidden
The token does not have theagents:write scope.
502 Bad Gateway
The agent service is unreachable.Operational notes
- An agent created here is not yet answering. The channel has to be connected on the company as well as enabled on the agent, and a goal that uses tools needs the data behind them — services, staff, catalogue — to exist.
- Every section you send is versioned from the start. The creation is version 1 of each.
languagecarries the country and it is not cosmetic. It is what decides how the agent conjugates; getting it wrong is the first thing a customer notices.- Leaving a section out is better than inventing one. An empty section is filled later; an invented one is discovered by a customer.
Authorizations
Personal Access Token con prefijo kbai_pk_. Generar desde el portal con permiso developer.manage_tokens.
Body
150"Agente de ventas"
500Identificador del modelo. Se valida contra los modelos soportados; uno desconocido devuelve 400 INVALID_MODEL.
"gpt-5"
Locale del agente. El pais importa: es-CL y es-MX no conjugan igual.
"es-CL"
"America/Santiago"
Las secciones del prompt. Se pueden mandar aca al crear, o una por una con PUT /v1/agents/{id}/prompts/{section}.
20Canales por los que atiende, del catalogo (GET /v1/prompt-types?kind=channel).
10Reenganche: cuantas veces vuelve sobre una conversacion enfriada y cada cuanto.
ObjectIds de herramientas (GET /v1/tools) que puede usar.
100ObjectIds de nodos de la base de conocimiento a asignar.
200Etapas del embudo, por NOMBRE y en orden. Se crea un pipeline en el CRM con el nombre del agente y esas etapas, y el agente queda habilitado para mover tickets solo entre ellas. Sin esto no se crea ningun pipeline y el agente no mueve tickets.
20