Skip to main content
PUT
Actualizar una funcion de webhook
Partial update: only the fields present in the body change. The subtlety is inside context. Because header and query-string values are masked on read, you cannot round-trip them, so this endpoint merges instead. The last row exists so the obvious client pattern — GET, change one field, PUT it all back — fails loudly instead of writing the literal string *** over a live credential.

Endpoint

Required scope

assistants:write

Headers

Path parameters

Body

Every field is optional. context, when present, must carry at least url.

Example request

Response

200 OK

The function, same shape as GET /v1/functions/{id}.

400 Bad Request

A field over its limit or an unknown property, plus three specific codes:
  • FUNCTION_MASKED_VALUE_WRITE — a headers or params value was the literal ***. details.field and details.keys name them.
  • FUNCTION_URL_NOT_ALLOWED — the URL failed validation. details.reason names the rule.
  • FUNCTION_TIMEOUT_NOT_ALLOWEDtimeout outside 1–30 seconds.

401 Unauthorized

Missing, invalid, revoked, or expired token.

403 Forbidden

The token does not have the assistants:write scope.

404 Not Found

No webhook function with that id in the token’s company.

409 Conflict

The new name is already taken by another function in the company.

502 Bad Gateway

The assistant service is unreachable.

Operational notes

  • context is replace-within-merge. Fields you omit inside contextmethod, timeout, body, response_path — go back to their defaults, not to their stored values. Only headers and params are preserved on omission, because they are the ones you cannot read back. Send the whole context you want, minus the secrets.
  • Updates are read-modify-write, so concurrent writers lose each other. Merging the stored secrets requires reading them first; two overlapping updates to one function leave whichever finished last. Serialise them.
  • The URL is only re-validated when you send context. A function created before a validation rule existed keeps working until you next touch its URL.
  • Renaming breaks nothing immediately but changes what the model calls. Blocks reference the function by id, not by name, so the binding survives — but any prompt text mentioning the old name is now wrong.
  • tool_params and tags replace, they do not append. Read the current values first if you mean to add one.

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: 100
display_name
string
Maximum string length: 200
description
string
Maximum string length: 1000
context
object
tool_params
object[]
Maximum array length: 30
tags
string[]
Maximum array length: 20
is_active
boolean

Response

200 - application/json
function
object
required