On-Call API › Message templates
Preview a voice-call template
Renders a template without saving it: spoken is the whole call script,
rendered the template's own part (cut at 200 characters, truncated). The
fields are filled from sample values the organization's alerts have carried.
It also reports names no alert has ever sent (unknown_fields, likely typos),
which integrations send each name, the integrations whose alerts carry every
name (complete_on), and names that were empty in this sample.
Permission (API-key scope): oncall:settings:write.
Authorization
bearerAuth(oncall:settings:write)apiKeyHeader(oncall:settings:write)
Request body required
bodystringPlaceholders in braces, e.g.{alert.title}or{service}.
Responses
200
The preview.
dataVoicePreview requiredShow VoicePreview properties
spokenstringrenderedstringtruncatedbooleanalert_titlestringunknown_fieldsarray of stringfield_sourcesobjectcomplete_onarray of stringblank_fieldsarray of string
successboolean required
400
The body is not valid JSON (INVALID_BODY).
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
401
No API key was sent, or it is unknown, revoked or expired (UNAUTHORIZED).
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
403
The key lacks the scope this endpoint needs (FORBIDDEN).
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
429
Too many requests (RATE_LIMITED). Wait Retry-After seconds.
Retry-AfterintegerSeconds to wait.
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
500
Something went wrong on EvoHub's side (INTERNAL_ERROR). Retry later.
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
Example request
curl -X POST 'https://evohub.io/api/v1/voice-template/preview' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
-d '{
"body": "Service {service} in {env}: {alert.title}."
}'