Set an agent's tools
curl --request PUT \
--url https://voice-api.onclarity.com/v1/projects/{projectId}/agents/{id}/tools \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tool_ids": [
"1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
"6e2a4c8d-1b3f-4a5c-9d7e-0f1a2b3c4d5e"
]
}
'import requests
url = "https://voice-api.onclarity.com/v1/projects/{projectId}/agents/{id}/tools"
payload = { "tool_ids": ["1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d", "6e2a4c8d-1b3f-4a5c-9d7e-0f1a2b3c4d5e"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tool_ids: ['1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d', '6e2a4c8d-1b3f-4a5c-9d7e-0f1a2b3c4d5e']
})
};
fetch('https://voice-api.onclarity.com/v1/projects/{projectId}/agents/{id}/tools', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true,
"message": "Agent tools updated"
}{
"error": "Tool(s) \"lookup_account\" are private to another agent and cannot be attached.",
"code": "invalid_tool_scope",
"tool_ids": [
"9f8e7d6c-5b4a-4c3d-8e2f-1a0b9c8d7e6f"
]
}{
"error": "Invalid or revoked token"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "tool_ids: tool_ids must not contain duplicates",
"issues": [
{
"path": "tool_ids",
"code": "custom",
"message": "tool_ids must not contain duplicates"
}
]
}Tools
Set an agent's tools
Replaces the agent’s whole tool set; the array order becomes the attachment order. A tool left out is detached, not deleted. Each id must be a project-wide tool or a tool private to this agent. The change goes to the agent’s draft; live calls get it when the agent is published.
PUT
/
v1
/
projects
/
{projectId}
/
agents
/
{id}
/
tools
Set an agent's tools
curl --request PUT \
--url https://voice-api.onclarity.com/v1/projects/{projectId}/agents/{id}/tools \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tool_ids": [
"1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
"6e2a4c8d-1b3f-4a5c-9d7e-0f1a2b3c4d5e"
]
}
'import requests
url = "https://voice-api.onclarity.com/v1/projects/{projectId}/agents/{id}/tools"
payload = { "tool_ids": ["1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d", "6e2a4c8d-1b3f-4a5c-9d7e-0f1a2b3c4d5e"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tool_ids: ['1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d', '6e2a4c8d-1b3f-4a5c-9d7e-0f1a2b3c4d5e']
})
};
fetch('https://voice-api.onclarity.com/v1/projects/{projectId}/agents/{id}/tools', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true,
"message": "Agent tools updated"
}{
"error": "Tool(s) \"lookup_account\" are private to another agent and cannot be attached.",
"code": "invalid_tool_scope",
"tool_ids": [
"9f8e7d6c-5b4a-4c3d-8e2f-1a0b9c8d7e6f"
]
}{
"error": "Invalid or revoked token"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "tool_ids: tool_ids must not contain duplicates",
"issues": [
{
"path": "tool_ids",
"code": "custom",
"message": "tool_ids must not contain duplicates"
}
]
}Authorizations
Your organization API key (it starts with anek_org_). The same key works on the Voice API and the Support API. See Authentication.
Body
application/json