Custom Tools
Create a custom tool
Creates a custom tool (an API call tool). Requires a USER API key. WhatsApp template tools are not supported in the public API.
post/public/v1/tools
Request body
Example request
{
"type": "API_CALL",
"name": "Fetch contact",
"description": "Fetches a contact from the external CRM",
"method": "GET",
"url": "https://api.example.com/contacts/123",
"body": "{\"name\":\"{contactName}\"}",
"arguments": [
{
"name": "contactId",
"description": "The contact ID to fetch",
"dataType": "STRING",
"required": true,
"defaultValue": "normal"
}
],
"headers": [
{
"key": "Authorization",
"value": "Bearer {apiKey}"
}
],
"queryParams": [
{
"key": "limit",
"value": "10"
}
]
}Response
Created tool
Example response
{
"id": 123,
"name": "Fetch contact",
"description": "Fetches a contact from the external CRM",
"createdAt": "2024-01-01T12:00:00Z",
"updatedAt": "2024-01-01T12:00:00Z",
"status": "ACTIVE",
"method": "GET",
"url": "https://api.example.com/contacts/123",
"body": "example",
"arguments": [
{
"name": "example",
"description": "example",
"dataType": "STRING",
"defaultValue": "example"
}
],
"headers": [
{
"key": "Authorization",
"value": "Bearer {apiKey}"
}
],
"queryParams": [
{
"key": "limit",
"value": "10"
}
],
"type": "API_CALL"
}