Skip to main content

Error Codes

This reference documents all error codes and messages returned by the SFVoPI API.

Authentication Errors

401 Unauthorized

MessageCauseFix
UnAuthorized, Please LoginUser session not found or expiredLog in again with valid credentials
UnAuthorized, Please Login to OrganisationOrganization session not foundSelect an organization after login
UnAuthorized, Please Provide API KeyMissing x-api-key header in requestInclude x-api-key header with valid API key
UnAuthorized, Please Provide Valid API KeyAPI key is invalid or revokedVerify API key is correct and active
UnAuthorizedGeneric authentication failureCheck credentials and session status
tip

Always include the x-api-key header for API requests. Session-based auth requires valid login.

App Management Errors

404 Not Found

MessageCauseFix
SFVoPI app not foundApp ID does not exist or belongs to different orgVerify app ID and organization ownership

500 Internal Server Error

MessageCauseFix
Failed to create SFVoPI app: {error}Server error during app creationCheck request payload and retry
Failed to get SFVoPI apps: {error}Server error retrieving appsRetry request or contact support
Failed to get SFVoPI app: {error}Server error retrieving specific appVerify app exists and retry
Failed to update SFVoPI app: {error}Server error during updateCheck request payload and retry
Failed to delete SFVoPI app: {error}Server error during deletionVerify app exists and retry

Number Management Errors

400 Bad Request

MessageCauseFix
VoIP number not found or does not belong to this orgNumber doesn't exist or belongs to different orgVerify number ownership and organization

404 Not Found

MessageCauseFix
SFVoPI app not foundApp ID does not existVerify app ID is correct
Number not linked to this appNumber is not associated with the appLink number to app first

409 Conflict

MessageCauseFix
VoIP number is already linked to another SFVoPI appNumber is already linked to different appUnlink from previous app first

500 Internal Server Error

MessageCauseFix
Failed to link number: {error}Server error during linkingVerify number and app exist, retry
Failed to unlink number: {error}Server error during unlinkingVerify link exists and retry
Failed to get numbers: {error}Server error retrieving numbersRetry request or contact support
Failed to get available numbers: {error}Server error retrieving available numbersRetry request or contact support
Failed to get app by number: {error}Server error looking up appRetry request or contact support

Call Errors

400 Bad Request

MessageCauseFix
VoIP number {number} is not linked to any SFVoPI app for this orgSource number not linked to active appLink number to app with ACTIVE status

500 Internal Server Error

MessageCauseFix
Service temporarily unavailableSuperfone service is temporarily unavailableCheck service status and retry
Failed to initiate outbound callCall could not be placed at this timeRetry after a few seconds or contact support
Failed to initiate outbound call: {error}General error during call initiationCheck request payload and retry

Webhook Errors

502 Bad Gateway

MessageCauseFix
Both answer_url and fallback_answer_url failedBoth webhook URLs failed to respondVerify webhook endpoints are accessible and responding
Webhook response failed schema validationWebhook response doesn't match expected formatReturn valid stream response JSON
answer_url timeoutWebhook URL took too long to respondOptimize webhook handler or increase timeout
answer_url returned HTTP {status}Webhook URL returned error statusCheck webhook implementation and fix errors
answer_url connection failed: {error}Cannot connect to webhook URLVerify URL is accessible and firewall allows connections
Invalid webhook response from answer_urlWebhook response is malformedReturn valid JSON response
info

Webhook URLs must respond within 10 seconds. Implement fallback_answer_url for reliability.

Best Practices

Error Handling

  1. Always check HTTP status codes - 4xx errors are client issues, 5xx are server issues
  2. Implement exponential backoff - Retry 5xx errors with increasing delays
  3. Log error messages - Store error details for debugging and monitoring
  4. Use fallback URLs - Configure fallback_answer_url for webhook reliability

Common Issues

IssueSolution
401 errors on API callsVerify API key is included in x-api-key header
404 app not foundCheck app ID and ensure it belongs to your organization
409 number already linkedUnlink number from previous app before linking to new one
502 webhook errorsEnsure webhook URL is publicly accessible and responds within 10 seconds
Outbound calls failVerify source number is linked to active app and provider is configured
tip

Enable detailed logging in your webhook handlers to quickly identify and fix integration issues.