Skip to main content

Inbound Routing Policies

Inbound Routing Policies are webhook-backed pre-answer routing hooks for inbound phone calls. Vocobase resolves the inbound DID, finds the applicable policy, calls your policy webhook, and only then decides whether to create an AI session, select another agent, transfer the call, or reject it.
Policies run for Vobiz, Plivo, and VoiceLink inbound calls. TRANSFER is not available on VoiceLink (see Provider Support). Runtime scope priority is PHONE_NUMBER -> AGENT -> PARTNER.

API

Policy endpoints

  • GET /api/v2/inbound-route-policies
  • POST /api/v2/inbound-route-policies
  • GET /api/v2/inbound-route-policies/{id}
  • PATCH /api/v2/inbound-route-policies/{id}
  • DELETE /api/v2/inbound-route-policies/{id}

Decision-log endpoint

  • GET /api/v2/inbound-route-decisions
Decision logs are newest-first and scoped to the authenticated account. Query filters:

Scope Resolution

Vocobase evaluates enabled policies in this order:
  1. PHONE_NUMBER: exact policy for the inbound DID row.
  2. AGENT: fallback policy for the agent assigned to the DID.
  3. PARTNER: the account-wide default policy.
PARTNER is a legacy name kept for backward compatibility — it is the account-wide scope, and it applies to every account. Existing integrations that already send "scope": "PARTNER" keep working unchanged.
If no policy matches, Vocobase continues with the normal AI answer path.

Request fields

Response fields

Examples

Create a phone-number policy

For a VoiceLink DID, omit TRANSFER from allowed_actions, or omit the field entirely.

Create an agent fallback policy

Create an account-wide default policy

Query recent decisions

Decision rows include provider, provider_call_id, from_number, to_number, action, decision_source, failure_reason, transfer_to_number, webhook_status, webhook_latency_ms, created_session_id, and created_phone_call_id.

Webhook Event Sent By Vocobase

Vocobase sends this event to webhook_url before creating any session:

Headers

Vocobase computes HMAC over:

Supported Webhook Actions

Provider Support

Policies are evaluated on inbound calls for Vobiz, Plivo, and VoiceLink. TRANSFER is not supported on VoiceLink. A VoiceLink inbound call reaches the policy after the media session has already connected, so there is no point at which Vocobase can hand the call to a carrier. Behaviour:
  • A policy scoped to a VoiceLink DID is rejected at write time (400 VALIDATION_ERROR, allowed_actions must not include TRANSFER for a VoiceLink phone number) if allowed_actions names TRANSFER explicitly. Omitting allowed_actions (all actions permitted) stays valid.
  • If a webhook returns TRANSFER on a VoiceLink call anyway, Vocobase answers with AI instead of dropping the call, and records the decision with failure_reason: "transfer_unsupported_on_voicelink". This overrides failure_action, including REJECT — a transfer that cannot be performed is not a reason to hang up on a caller.
ANSWER_WITH_AI, SELECT_AGENT, and REJECT produce the same outcome across all three providers. One difference in caller experience: on Vobiz and Plivo a REJECT refuses the call before it is answered, while on VoiceLink the call has already been answered by the time the policy runs, so REJECT ends a connected call.

Response Handling And Failure Behavior

  • HTTP 202 or 204 from webhook: continue as ANSWER_WITH_AI.
  • HTTP 2xx with JSON body: use the returned action.
  • Non-2xx response: apply failure_action.
  • Timeout, network failure, invalid JSON, unknown action, disallowed action, or unauthorized selected agent: apply failure_action.
  • Default failure_action is ANSWER_WITH_AI unless explicitly set to REJECT.
If SELECT_AGENT returns an agent outside your account, Vocobase uses the configured failure_action.