Skip to main content
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.
Only the seven free types accept content here. product_info, store_info, reservation_info, tables_info and tags return 409 BLOCK_TYPE_NOT_WRITABLE. Check content_writable on the block before calling, and read why if the refusal is surprising.

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

Missing content, 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 the assistants: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_number again. 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_id set 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

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
content
string
required

Contenido completo del bloque en texto. Reemplaza al anterior creando una version nueva.

Maximum string length: 100000
Example:

"Sos el asistente de una barberia.\n- Tuteas al cliente."

Response

200 - application/json
content
object
required