Guardar el contenido de un bloque
Block content
PUT /v1/blocks/{id}/content
Replace a block’s content. Creates a new version and makes it current; the previous one stays in history.
PUT
Guardar el contenido de un bloque
Writes new content for a block. This is where prompts actually get edited.
The write is a replace, not a patch: send the whole text. Nothing is overwritten in storage, though — the content is appended as a new immutable version, the block is pointed at it, and the previous version stays in the history where it can be restored.
Endpoint
Required scope
assistants:write
Headers
Path parameters
Body
Three markdown conventions are recognised, because the portal editor renders them as real elements:
Example request
Response
200 OK
400 Bad Request
Missingcontent, over 100,000 characters, or a property the endpoint does not accept.
401 Unauthorized
Missing, invalid, revoked, or expired token.403 Forbidden
The token does not have theassistants:write scope.
404 Not Found
No block with that id in the token’s company and project.409 Conflict
error.code is BLOCK_TYPE_NOT_WRITABLE. The block is one of the five catalogue types; details.type names it and details.read_only_types lists all five.
502 Bad Gateway
The assistant service is unreachable.Operational notes
- Every save is a new version, so history grows. There is no way to edit a version in place and no way to delete one. A block edited hundreds of times keeps hundreds of versions; the history endpoint is paginated for that reason.
- The write is not idempotent. A retry after a timeout appends a second identical version and bumps
version_numberagain. Harmless, but check the history before retrying if that matters to you. - Assistants pinned to an older version do not see this. A save moves the block’s current version; an assistant with
pinned_version_idset keeps rendering the version it was pinned to until you repin it. - The text you send is what you get back. Reading the content returns the same text, modulo runs of blank lines collapsing to one. Formatting beyond the three conventions above is not preserved because it is not stored.
- The change reaches live conversations within about fifteen minutes at worst. The composed prompt is cached per assistant and the cache is dropped on every save, but a conversation already mid-turn finishes with the previous version.
Authorizations
Personal Access Token con prefijo kbai_pk_. Generar desde el portal con permiso developer.manage_tokens.
Path Parameters
Body
application/json
Contenido completo del bloque en texto. Reemplaza al anterior creando una version nueva.
Maximum string length:
100000Example:
"Sos el asistente de una barberia.\n- Tuteas al cliente."
Response
200 - application/json