Error Codes

Every Voicebip API error returns a consistent JSON envelope:

1{
2 "error_code": "NOT_FOUND",
3 "message": "Agent agt_WXYZ_abc123def456 not found",
4 "request_id": "req_k7m2n9p4q1",
5 "documentation_url": "https://docs.voicebip.com/errors/NOT_FOUND"
6}
FieldTypeDescription
error_codestringMachine-readable error code (use this for programmatic handling)
messagestringHuman-readable description of what went wrong
request_idstringUnique request identifier — include this when contacting support
documentation_urlstringDirect link to troubleshooting guidance for this error

Error Code Reference

Authentication & Authorization

Error CodeHTTP StatusDescriptionCommon Cause
UNAUTHENTICATED401Missing or invalid API keyNo Authorization header, malformed key, or key has been revoked
PERMISSION_DENIED403Valid key but insufficient permissionsAttempting to access a resource in another workspace (RLS violation)
RATE_LIMITED429Too many requestsExceeded your tier’s per-minute request limit. Check the Retry-After header

Resource Errors

Error CodeHTTP StatusDescriptionCommon Cause
NOT_FOUND404Resource does not existWrong ID, resource was deleted, or it belongs to a different workspace
ALREADY_EXISTS409Duplicate resourceCreating an agent or key with a label that already exists in the workspace
INVALID_ARGUMENT400Request validation failedMissing required field, invalid E.164 phone number, unsupported enum value

Quota & Billing

Error CodeHTTP StatusDescriptionCommon Cause
QUOTA_EXCEEDED402Tier limit reachedHit your plan’s agent count, voice minute, SMS, or WhatsApp conversation limit. Upgrade your tier or wait for the billing cycle to reset
WORKSPACE_BLOCKED402Workspace has no balance — all billable operations are suspendedBalance reached zero. Top up via POST /v1/billing/checkout to unblock immediately
INSUFFICIENT_BALANCE402Account balance is too low for the requested operationUpgrading to a higher plan requires a prorated charge. Top up first, then retry the plan change
TIER_SWITCH_TOO_FREQUENT429Plan changes are limited to once every 24 hoursA plan change was already made in the last 24 hours. Wait until the cooldown expires, then retry

Subscription

Error CodeHTTP StatusDescriptionCommon Cause
NO_ACTIVE_SUBSCRIPTION400Workspace has no active subscriptionAttempt to switch plans on a workspace that has never subscribed. Start a subscription first
NO_OP400Requested plan matches the current planNo change was made
TIER_SWITCH_UNSUPPORTED400Plan switching is not available for this workspace typePAYG workspaces cannot use tier switching
WORKSPACE_NOT_FOUND404Workspace does not existWorkspace was deleted, or the request is missing a valid workspace context
INVALID_PLAN400Unrecognized plan nameValid plans are starter, builder, and scale

Telephony & Messaging

Error CodeHTTP StatusDescriptionCommon Cause
NUMBER_UNAVAILABLE409Number cannot be provisionedNumber was claimed by another workspace between listing and provisioning (race condition). Retry with a different number
CHANNEL_MISMATCH409Number does not support the requested channelTrying to assign a voice-only DID to a WhatsApp channel, or vice versa
CALL_FAILED502Voice call could not be establishedAll MNO routes failed (MTN, Glo, Airtel, 9mobile failover exhausted) or destination unreachable
CALL_WINDOW_RESTRICTED422Call blocked by the agent’s call-window configurationThe call was attempted outside the agent’s configured operating hours. CBN compliance requirement for financial institutions
MESSAGE_FAILED502SMS or WhatsApp message delivery failedSMPP session down, MNO rejected the message, or WhatsApp conversation window expired
OPT_OUT_ENFORCED422Recipient has opted out of messages from this workspaceRecipient previously sent STOP/UNSUBSCRIBE. Sending to opted-out numbers is blocked
WEBHOOK_FAILED502Webhook delivery failedYour webhook endpoint returned a non-2xx status or timed out. Check delivery logs

Infrastructure

Error CodeHTTP StatusDescriptionCommon Cause
AI_PROVIDER_ERROR502AI provider returned an error or timed outGemini or OpenAI is down. Circuit breaker may have tripped — the system will auto-failover to the secondary provider after 30 seconds
UNAVAILABLE503Service temporarily unavailableInternal service is restarting or under heavy load. Retry with exponential backoff
INTERNAL500Unexpected server errorA bug on our side. Please report with the request_id so we can investigate

Handling Errors in Code

cURL

$curl -s -w "\n%{http_code}" -X GET "https://api.voicebip.com/v1/agents/agt_invalid" \
> -H "Authorization: Bearer pk_live_your_key"

TypeScript (with @voicebip/sdk)

1import { VoicebipClient, VoicebipError } from "@voicebip/sdk";
2
3const client = new VoicebipClient({ apiKey: "pk_live_your_key" });
4
5try {
6 const agent = await client.agents.get("agt_invalid");
7} catch (err) {
8 if (err instanceof VoicebipError) {
9 console.error(`[${err.errorCode}] ${err.message}`);
10 // Handle specific codes
11 if (err.errorCode === "NOT_FOUND") {
12 // Agent doesn't exist
13 } else if (err.errorCode === "RATE_LIMITED") {
14 // Back off and retry
15 }
16 }
17}

Go

1resp, err := http.Get("https://api.voicebip.com/v1/agents/agt_invalid")
2if err != nil {
3 log.Fatal(err)
4}
5defer resp.Body.Close()
6
7if resp.StatusCode != http.StatusOK {
8 var apiErr struct {
9 ErrorCode string `json:"error_code"`
10 Message string `json:"message"`
11 RequestID string `json:"request_id"`
12 }
13 json.NewDecoder(resp.Body).Decode(&apiErr)
14 log.Printf("[%s] %s (request: %s)", apiErr.ErrorCode, apiErr.Message, apiErr.RequestID)
15}

Python

1import requests
2
3resp = requests.get(
4 "https://api.voicebip.com/v1/agents/agt_invalid",
5 headers={"Authorization": "Bearer pk_live_your_key"},
6)
7
8if not resp.ok:
9 error = resp.json()
10 print(f"[{error['error_code']}] {error['message']}")
11 if error["error_code"] == "RATE_LIMITED":
12 retry_after = int(resp.headers.get("Retry-After", 10))
13 time.sleep(retry_after)

Retry Strategy

Not all errors are retryable. Use this as a guide:

Error CodeRetryableStrategy
UNAUTHENTICATEDNoFix your API key
PERMISSION_DENIEDNoCheck workspace ownership
INVALID_ARGUMENTNoFix the request payload
NOT_FOUNDNoVerify the resource ID
ALREADY_EXISTSNoUse a different identifier
RATE_LIMITEDYesWait for Retry-After seconds, then retry
QUOTA_EXCEEDEDNoUpgrade tier or wait for billing cycle reset
WORKSPACE_BLOCKEDNoTop up your balance, then retry
INSUFFICIENT_BALANCENoTop up your balance, then retry the plan change
TIER_SWITCH_TOO_FREQUENTYesWait 24 hours from your last plan change, then retry
NO_ACTIVE_SUBSCRIPTIONNoStart a subscription first
NO_OPNoNo action needed — already on the requested plan
TIER_SWITCH_UNSUPPORTEDNoNot applicable for PAYG workspaces
WORKSPACE_NOT_FOUNDNoVerify workspace credentials
INVALID_PLANNoUse starter, builder, or scale
NUMBER_UNAVAILABLEYesRetry with a different number from the available pool
CHANNEL_MISMATCHNoChoose a number that supports the target channel
CALL_WINDOW_RESTRICTEDNoRetry during the agent’s configured operating hours
OPT_OUT_ENFORCEDNoRecipient has opted out — do not retry
CALL_FAILEDYesRetry after a short delay (MNO may recover)
MESSAGE_FAILEDYesRetry with exponential backoff
WEBHOOK_FAILEDAutoVoicebip retries automatically: 0s, 1m, 5m, 15m, 1h, 4h, 24h (7 attempts)
AI_PROVIDER_ERRORYesRetry after 30s (circuit breaker cooldown)
UNAVAILABLEYesExponential backoff starting at 1s
INTERNALYesRetry once, then report with request_id