Referencia de la API

Tools

Webhooks que un asistente puede llamar durante una llamada.

GET /v1/tools

List the tools of my organization

Solo para usuarios con sesión iniciada (sin API key) · Rol: viewer o superior

Any signed-in member, as a user. `items` are the webhook tools of the tenant by name; `built_in` names the tools every assistant has without being defined (`end_call`, `transfer_call`). Header values are secrets: they are stored for the call and never returned; a header shows its `name` and a `value_mask`. An assistant attaches them by id in `config.tools.api`. 401 when the token is missing, expired or invalid; 403 when called with an API key; 503 when tools are not available.

Respuestas

  • 200 Successful Response · ToolList
    NombreTipoRequeridoDescripción
    built_instring[]sí
    itemsToolResponse[]sí
    items[].asyncbooleansí
    items[].body_templatestring | nullsí
    items[].created_atstring (date-time)sí
    items[].created_bystringsí
    items[].descriptionstringsí
    items[].failure_messagestring | nullsí
    items[].headersToolHeaderResponse[]sí
    items[].headers[].namestringsí
    items[].headers[].value_maskstringsí
    items[].idstring (uuid)sí
    items[].methodstringsí (GET, POST, PUT, PATCH, DELETE)
    items[].namestringsí
    items[].parametersobjectsí
    items[].sensitivebooleansí
    items[].timeout_secondsintegersí
    items[].updated_atstring (date-time)sí
    items[].urlstringsí
    items[].waiting_messagestring | nullsí
  • 401 Missing, expired or invalid token. · ErrorResponse
  • 403 Role below the one this needs. · ErrorResponse
  • 503 Tools are not available. · ErrorResponse
  • default Default Response · ErrorResponse

POST /v1/tools

Create a webhook tool

Solo para usuarios con sesión iniciada (sin API key) · Rol: editor o superior

An `editor` or above. A webhook tool is a function the assistant may call during a call: `name` (letters, digits and `_`, starting with a letter, up to 64; `end_call` and `transfer_call` are taken), `description` (what it does and when to call it), `parameters` (a JSON Schema object of up to 20 properties of type `string`, `number`, `integer` or `boolean`; `required` lists names of properties), `url` (`https` only, no credentials, not a private address), `method` (default `POST`), `headers` (up to 20), `timeout_seconds` (1 to 30, default 10), `waiting_message` (what the assistant says while it waits) and `failure_message` (what it says when the call fails). `url` and `body_template` may use `{{name}}` placeholders of `parameters`: in the path or query of the URL (percent-encoded) and in a JSON body template (a value that is only a placeholder keeps its type); arguments not used in the URL are sent as the query (`GET`) or the JSON body. `async` makes the call fire and forget and `sensitive` (default `true`) keeps the arguments out of what Talk shows. Header values are secrets: they are stored for the call and never returned; a header shows its `name` and a `value_mask`. Written to the audit log as `tool.create`. 401 when the token is missing, expired or invalid; 403 below `editor` or with an API key; 409 when the name is taken; 422 when a field is invalid; 503 when tools are not available.

Cuerpo de la solicitud

NombreTipoRequeridoDescripción
asyncboolean
body_templatestring | null
descriptionstringsí
failure_messagestring | null
headersToolHeaderInput[]
headers[].namestringsí
headers[].valuestring | null
methodstring (GET, POST, PUT, PATCH, DELETE)
namestringsí
parametersobjectsí
sensitiveboolean
timeout_secondsinteger
urlstringsí
waiting_messagestring | null

Respuestas

  • 201 Successful Response · ToolResponse
    NombreTipoRequeridoDescripción
    asyncbooleansí
    body_templatestring | nullsí
    created_atstring (date-time)sí
    created_bystringsí
    descriptionstringsí
    failure_messagestring | nullsí
    headersToolHeaderResponse[]sí
    headers[].namestringsí
    headers[].value_maskstringsí
    idstring (uuid)sí
    methodstringsí (GET, POST, PUT, PATCH, DELETE)
    namestringsí
    parametersobjectsí
    sensitivebooleansí
    timeout_secondsintegersí
    updated_atstring (date-time)sí
    urlstringsí
    waiting_messagestring | nullsí
  • 401 Missing, expired or invalid token. · ErrorResponse
  • 403 Role below the one this needs. · ErrorResponse
  • 409 Another tool has this name. · ErrorResponse
  • 503 Tools are not available. · ErrorResponse
  • default Default Response · ErrorResponse

GET /v1/tools/{tool_id}

One tool

Solo para usuarios con sesión iniciada (sin API key) · Rol: viewer o superior

Any signed-in member, as a user. Header values are secrets: they are stored for the call and never returned; a header shows its `name` and a `value_mask`. 401 when the token is missing, expired or invalid; 403 when called with an API key; 404 when the tool is not in the caller's tenant; 503 when tools are not available.

Parámetros

NombreEnTipoRequeridoDescripción
tool_idpathstring (uuid)sí

Respuestas

  • 200 Successful Response · ToolResponse
    NombreTipoRequeridoDescripción
    asyncbooleansí
    body_templatestring | nullsí
    created_atstring (date-time)sí
    created_bystringsí
    descriptionstringsí
    failure_messagestring | nullsí
    headersToolHeaderResponse[]sí
    headers[].namestringsí
    headers[].value_maskstringsí
    idstring (uuid)sí
    methodstringsí (GET, POST, PUT, PATCH, DELETE)
    namestringsí
    parametersobjectsí
    sensitivebooleansí
    timeout_secondsintegersí
    updated_atstring (date-time)sí
    urlstringsí
    waiting_messagestring | nullsí
  • 401 Missing, expired or invalid token. · ErrorResponse
  • 403 Role below the one this needs. · ErrorResponse
  • 404 No such tool in the caller's tenant. · ErrorResponse
  • 503 Tools are not available. · ErrorResponse
  • default Default Response · ErrorResponse

PUT /v1/tools/{tool_id}

Replace a tool

Solo para usuarios con sesión iniciada (sin API key) · Rol: editor o superior

An `editor` or above. The body is the same as for creating and replaces the tool. A header sent with no `value` keeps the value stored under that name; a header left out is removed. Written to the audit log as `tool.update`. 401 when the token is missing, expired or invalid; 403 below `editor` or with an API key; 404 when the tool is not in the caller's tenant; 409 when the name is taken; 422 when a field is invalid; 503 when tools are not available.

Parámetros

NombreEnTipoRequeridoDescripción
tool_idpathstring (uuid)sí

Cuerpo de la solicitud

NombreTipoRequeridoDescripción
asyncboolean
body_templatestring | null
descriptionstringsí
failure_messagestring | null
headersToolHeaderInput[]
headers[].namestringsí
headers[].valuestring | null
methodstring (GET, POST, PUT, PATCH, DELETE)
namestringsí
parametersobjectsí
sensitiveboolean
timeout_secondsinteger
urlstringsí
waiting_messagestring | null

Respuestas

  • 200 Successful Response · ToolResponse
    NombreTipoRequeridoDescripción
    asyncbooleansí
    body_templatestring | nullsí
    created_atstring (date-time)sí
    created_bystringsí
    descriptionstringsí
    failure_messagestring | nullsí
    headersToolHeaderResponse[]sí
    headers[].namestringsí
    headers[].value_maskstringsí
    idstring (uuid)sí
    methodstringsí (GET, POST, PUT, PATCH, DELETE)
    namestringsí
    parametersobjectsí
    sensitivebooleansí
    timeout_secondsintegersí
    updated_atstring (date-time)sí
    urlstringsí
    waiting_messagestring | nullsí
  • 401 Missing, expired or invalid token. · ErrorResponse
  • 403 Role below the one this needs. · ErrorResponse
  • 404 No such tool in the caller's tenant. · ErrorResponse
  • 409 Another tool has this name. · ErrorResponse
  • 503 Tools are not available. · ErrorResponse
  • default Default Response · ErrorResponse

DELETE /v1/tools/{tool_id}

Delete a tool

Solo para usuarios con sesión iniciada (sin API key) · Rol: editor o superior

An `editor` or above. Written to the audit log as `tool.delete`. 401 when the token is missing, expired or invalid; 403 below `editor` or with an API key; 404 when the tool is not in the caller's tenant; 503 when tools are not available.

Parámetros

NombreEnTipoRequeridoDescripción
tool_idpathstring (uuid)sí

Respuestas

  • 204 Successful Response
  • 401 Missing, expired or invalid token. · ErrorResponse
  • 403 Role below the one this needs. · ErrorResponse
  • 404 No such tool in the caller's tenant. · ErrorResponse
  • 503 Tools are not available. · ErrorResponse
  • default Default Response · ErrorResponse

POST /v1/tools/{tool_id}/test

Call a tool with sample arguments

Solo para usuarios con sesión iniciada (sin API key) · Rol: editor o superior

An `editor` or above. The control plane calls the tool's URL with `args` (the query for `GET`, a JSON body otherwise) and the stored headers, and answers what came back: `ok` (a 2xx answer), `status_code`, `duration_ms` and the start of the body in `response_body` (`truncated` when cut). A failed call is still a 200 with `error`: `request` shows what was sent (method, URL with placeholders filled, body and header names, never values). `blocked_address` (the host resolves to a private, loopback or link-local address, which is never called), `dns_failure`, `timeout`, `connection_failed`. Redirects are not followed, the wait is at most 10 seconds and 64 KiB of the answer are read. At most 20 tests per minute per organization (`TOOL_TESTS_PER_MINUTE`), shared by tool and webhook tests and counted across replicas when Redis is set. 401 when the token is missing, expired or invalid; 403 below `editor` or with an API key; 404 when the tool is not in the caller's tenant; 422 when `args` is too large; 429 when called too often (see `Retry-After`); 503 when tools are not available or the rate limiter is unavailable.

Parámetros

NombreEnTipoRequeridoDescripción
tool_idpathstring (uuid)sí

Cuerpo de la solicitud

NombreTipoRequeridoDescripción
argsobject

Respuestas

  • 200 Successful Response · ToolTestResponse
    NombreTipoRequeridoDescripción
    duration_msintegersí
    errorstring | nullsí (blocked_address, dns_failure, timeout, connection_failed, response_too_large)
    okbooleansí
    requestToolTestRequestPreview | nullsí
    request.bodyany | nullsí
    request.header_namesstring[]sí
    request.methodstringsí (GET, POST, PUT, PATCH, DELETE)
    request.urlstringsí
    response_bodystringsí
    status_codeinteger | nullsí
    truncatedbooleansí
  • 401 Missing, expired or invalid token. · ErrorResponse
  • 403 Role below the one this needs. · ErrorResponse
  • 404 No such tool in the caller's tenant. · ErrorResponse
  • 429 Too many test calls; see `Retry-After`. · ErrorResponse
  • 503 Tools are not available, or the rate limiter is unavailable. · ErrorResponse
  • default Default Response · ErrorResponse