curl --request POST \
--url 'https://api.voice.stateset.com/test-function' \
--header "Authorization: Bearer $STATESET_VOICE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"args": {
"order_id": "12345"
},
"context": {
"agent_name": "Front Desk",
"authenticated": true,
"customer_id": "cust-789",
"customer_phone": "+15555555678",
"org_id": "org-456",
"session_id": "sess-abc123"
},
"name": "get_order"
}'
{
"ok": true,
"result": {
"order": {
"id": "12345",
"status": "shipped"
}
}
}
Test Function
Automation endpoint used by voice agents and trusted clients to execute workflow actions or retrieve evaluation results.
POST
/
test-function
curl --request POST \
--url 'https://api.voice.stateset.com/test-function' \
--header "Authorization: Bearer $STATESET_VOICE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"args": {
"order_id": "12345"
},
"context": {
"agent_name": "Front Desk",
"authenticated": true,
"customer_id": "cust-789",
"customer_phone": "+15555555678",
"org_id": "org-456",
"session_id": "sess-abc123"
},
"name": "get_order"
}'
{
"ok": true,
"result": {
"order": {
"id": "12345",
"status": "shipped"
}
}
}
Automation endpoint used by voice agents and trusted clients to execute workflow actions or retrieve evaluation results.
Request body
FunctionTestRequest
Response
FunctionTestResponse
Status codes
| Code | Meaning |
|---|---|
200 | Function executed |
401 | Unauthorized |
500 | Function execution failed |
curl --request POST \
--url 'https://api.voice.stateset.com/test-function' \
--header "Authorization: Bearer $STATESET_VOICE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"args": {
"order_id": "12345"
},
"context": {
"agent_name": "Front Desk",
"authenticated": true,
"customer_id": "cust-789",
"customer_phone": "+15555555678",
"org_id": "org-456",
"session_id": "sess-abc123"
},
"name": "get_order"
}'
{
"ok": true,
"result": {
"order": {
"id": "12345",
"status": "shipped"
}
}
}
Last modified on August 31, 2026