Lifecycle Hooks
List an agent's lifecycle hooks
Hooks run automatically around a call — PRE_CALL hooks fetch context before the agent speaks, POST_CALL hooks push the result somewhere after it hangs up. Returned ordered by stage, then run position.
These endpoints return a bare object (
{ "hook": … }, { "hooks": [ … ] }) and a bare { "error": … } on failure, rather than the success/data envelope used elsewhere in this API. Validation failures return 422 with an issues array.GET
/
agents
/
{agentId}
/
lifecycle-hooks
List an agent's lifecycle hooks
curl --request GET \
--url https://api.vocobase.com/api/v2/agents/{agentId}/lifecycle-hooks \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.vocobase.com/api/v2/agents/{agentId}/lifecycle-hooks"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.vocobase.com/api/v2/agents/{agentId}/lifecycle-hooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vocobase.com/api/v2/agents/{agentId}/lifecycle-hooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.vocobase.com/api/v2/agents/{agentId}/lifecycle-hooks"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.vocobase.com/api/v2/agents/{agentId}/lifecycle-hooks")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vocobase.com/api/v2/agents/{agentId}/lifecycle-hooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"hooks": [
{
"id": "lh_2b3c4d5e-6f70-8192-a3b4-c5d6e7f80912",
"agentId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"stage": "PRE_CALL",
"position": 0,
"toolSlug": "leadsquared",
"toolFn": "lookup_lead",
"functionId": null,
"name": "Look up lead",
"input": {
"phone": "{{to_number}}"
},
"exposeAs": "lead",
"required": false,
"timeoutMs": 3000,
"enabled": true,
"createdAt": "2026-08-05T11:20:00.000Z",
"updatedAt": "2026-08-05T11:20:00.000Z"
}
]
}{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing API key"
}
}{
"error": "Agent not found"
}{
"success": false,
"error": {
"code": "RATE_LIMITED",
"message": "Rate limit exceeded. Retry after 60 seconds."
}
}{
"success": false,
"error": {
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred"
}
}⌘I
List an agent's lifecycle hooks
curl --request GET \
--url https://api.vocobase.com/api/v2/agents/{agentId}/lifecycle-hooks \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.vocobase.com/api/v2/agents/{agentId}/lifecycle-hooks"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.vocobase.com/api/v2/agents/{agentId}/lifecycle-hooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vocobase.com/api/v2/agents/{agentId}/lifecycle-hooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.vocobase.com/api/v2/agents/{agentId}/lifecycle-hooks"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.vocobase.com/api/v2/agents/{agentId}/lifecycle-hooks")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vocobase.com/api/v2/agents/{agentId}/lifecycle-hooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"hooks": [
{
"id": "lh_2b3c4d5e-6f70-8192-a3b4-c5d6e7f80912",
"agentId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"stage": "PRE_CALL",
"position": 0,
"toolSlug": "leadsquared",
"toolFn": "lookup_lead",
"functionId": null,
"name": "Look up lead",
"input": {
"phone": "{{to_number}}"
},
"exposeAs": "lead",
"required": false,
"timeoutMs": 3000,
"enabled": true,
"createdAt": "2026-08-05T11:20:00.000Z",
"updatedAt": "2026-08-05T11:20:00.000Z"
}
]
}{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing API key"
}
}{
"error": "Agent not found"
}{
"success": false,
"error": {
"code": "RATE_LIMITED",
"message": "Rate limit exceeded. Retry after 60 seconds."
}
}{
"success": false,
"error": {
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred"
}
}