DocumentationAPI ReferenceChangelog

Envocal API

API Reference Tools guide MCP server API Changelog

Endpoints

List agents of a tenant GETCreate an agent POSTGet an agent GETDelete an agent DELETEUpdate an agent PUTAssign a phone number to an agent POSTUnassign an agent's phone number DELETEList an agent's knowledge bases GETLink a knowledge base to an agent POSTUnlink a knowledge base from an agent DELETEGet an agent's tools GETSet an agent's tools PUTList agent templates GETCreate an agent from a template POST
Agents

Set an agent's tools

Get an agent's tools GET

The tools the agent uses, as tool ids (GET /v1/tenants/{tenantId}/tools) per phase. before and after are in the order they run.

List agent templates GET

Templates (agents with isTemplate true) that the tenant can use: its own and those of its parent tenants.

PUT
/v1/tenants/{tenantId}/agents/{id}/tools

Replaces all of the agent's tools. Each id is a tool (GET /v1/tenants/{tenantId}/tools) of the agent's tenant, and the tool's availability must include the phase it is placed in:

  • before: run in order when the conversation starts (e.g. look up the caller).
  • during: offered to the AI model as functions it can call during the conversation.
  • after: run in order after the conversation ends (e.g. post a summary to a CRM). Output of earlier tools is available to later ones through dynamic variables, so before and after can form tool chains.

To take a tool away from the agent, send the lists without it. Send three empty lists to remove all.

Required permission: agents:write

Authorization

Bearer
headerAuthorizationBearer <token>

Tenant API key (evk_…), created in Studio → Vault → API keys.

Path Parameters

tenantId*string

Tenant id, or current for the key's own tenant. Must be the key's tenant or one of its sub-tenants.

id*string

Agent id.

Request Body

The agent's tools per phase, complete.

  1. body
  1. body
  2. …

The tools an agent uses, per phase, as tool ids (GET /v1/tenants/{tenantId}/tools). A list left out is empty.

before?array<>

Run in this order when the conversation starts, before the AI speaks (e.g. look up the caller in a CRM).

during?array<>

Offered to the AI model as functions it may call during the conversation. Order does not matter.

after?array<>

Run in this order after the conversation ends (e.g. post a summary or create a ticket).

Response Body

Saved.

Example Request
curl -X PUT 'https://api.envocal.ai/v1/tenants/string/agents/string/tools' \  -H 'Content-Type: application/json' \  -d '{  "before": [    "0b7c2d9e-3a41-4f68-9c25-6d1e8f3a7b52"  ],  "during": [    "5e2a9c14-7d36-4b80-a1f9-2c4d6e8f0a13",    "9f3b1d27-6c58-4e02-b7a4-8d0e2f4a6c35"  ],  "after": []}'
Example Response
Empty
PUT
/v1/tenants/{tenantId}/agents/{id}/tools
Example Request
curl -X PUT 'https://api.envocal.ai/v1/tenants/string/agents/string/tools' \
  -H 'Content-Type: application/json' \
  -d '{
  "before": [
    "0b7c2d9e-3a41-4f68-9c25-6d1e8f3a7b52"
  ],
  "during": [
    "5e2a9c14-7d36-4b80-a1f9-2c4d6e8f0a13",
    "9f3b1d27-6c58-4e02-b7a4-8d0e2f4a6c35"
  ],
  "after": []
}'