Actualizar una funcion de webhook
Functions
PUT /v1/functions/{id}
Update a webhook function. Omitting headers keeps the stored ones; sending them replaces the whole map.
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 asGET /v1/functions/{id}.
400 Bad Request
A field over its limit or an unknown property, plus three specific codes:FUNCTION_MASKED_VALUE_WRITE— aheadersorparamsvalue was the literal***.details.fieldanddetails.keysname them.FUNCTION_URL_NOT_ALLOWED— the URL failed validation.details.reasonnames the rule.FUNCTION_TIMEOUT_NOT_ALLOWED—timeoutoutside 1–30 seconds.
401 Unauthorized
Missing, invalid, revoked, or expired token.403 Forbidden
The token does not have theassistants:write scope.
404 Not Found
No webhook function with that id in the token’s company.409 Conflict
The newname is already taken by another function in the company.
502 Bad Gateway
The assistant service is unreachable.Operational notes
contextis replace-within-merge. Fields you omit insidecontext—method,timeout,body,response_path— go back to their defaults, not to their stored values. Onlyheadersandparamsare preserved on omission, because they are the ones you cannot read back. Send the wholecontextyou 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_paramsandtagsreplace, they do not append. Read the current values first if you mean to add one.
Authorizations
Personal Access Token con prefijo kbai_pk_. Generar desde el portal con permiso developer.manage_tokens.
Path Parameters
Body
application/json
Response
200 - application/json