Skip to main content

Link Number to App

Link a phone number to a SFVoPI application. Once linked, incoming calls to this number will be routed to the app's configured answer_url.

Important
  • A phone number can only be linked to one SFVoPI app at a time
  • The number must be owned by your organization, in service, and not linked to another app or attached to an SF trunk
  • Linking a number that is already linked to this app returns the existing link instead of an error
  • Phone numbers are automatically normalized to E.164 format (e.g., +918000000001)

Authentication​

Requires X-API-Key header with a valid API key. See Authentication for details.

Endpoint​

POST /sfvopi/apps/:app_id/numbers

Path Parameters​

ParameterTypeRequiredDescription
app_idstringYesThe unique identifier of the SFVoPI app

Request Body​

FieldTypeRequiredDefaultDescriptionValidation
voip_numberstringYes-Phone number to link to the appMust be a valid phone number. Automatically normalized to E.164 format with country code (e.g., +918000000001)

Code Examples​

curl -X POST https://prod-api.superfone.co.in/superfone/sfvopi/apps/app_abc123/numbers \
-H "X-API-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"voip_number":"+918000000001"}'

Success Response​

Status Code: 200 OK

{
"data": {
"app_id": "app_abc123",
"voip_number": "+918000000001",
"org_id": 456,
"status": "ACTIVE",
"created_at": "2026-02-02T10:30:00.000Z",
"updated_at": null
},
"message": "success"
}

Response Fields​

FieldTypeDescription
dataobjectThe linked number object
data.app_idstringThe SFVoPI app ID this number is linked to
data.voip_numberstringThe phone number in E.164 format
data.org_idnumberYour organization ID
data.statusstringLink status (typically ACTIVE)
data.created_atstringISO 8601 timestamp when the link was created
data.updated_atstring | nullISO 8601 timestamp of last update, or null if never updated
messagestringResponse message (always "success" on success)

Error Responses​

Status CodeMessageWhen It Occurs
400Invalid request bodyRequest body validation failed (invalid phone number format)
400Invalid voip_number: <number>The number is not a valid phone number
400VoIP number not found or does not belong to this orgThe phone number doesn't exist in your organization's inventory
404SFVoPI app not foundThe specified app_id doesn't exist or doesn't belong to your organization
409VoIP number is already attached to an SF trunk: <number>The number is attached to an SF trunk. Detach it from the trunk first.
409VoIP number is already linked to another SFVoPI appThe phone number is already linked to a different SFVoPI app. Unlink it first.
409VoIP number is already linked to this SFVoPI app but the link is inactive; unlink it and link it againThe number is linked to this app, but the link is inactive
409VoIP number is not in a serviceable state: <number>The number is not in service, for example on hold or refunded. Email hello@superfone.in
401UnAuthorized, Please Provide Valid API KeyMissing or invalid X-API-Key header
500Failed to link number. Please try again later.Server error while linking the number

Phone Number Format (E.164)​

Phone numbers are automatically normalized to E.164 format with country code:

  • Input: 8000000001 or +918000000001 or +91 80000 00001
  • Stored as: +918000000001

E.164 format rules:

  • Starts with + followed by country code
  • No spaces, dashes, or parentheses
  • Maximum 15 digits (including country code)

Notes​

  • One number, one app: A phone number can only be linked to one SFVoPI app at a time
  • Automatic normalization: Phone numbers are automatically converted to E.164 format
  • Ownership validation: The API verifies that the number belongs to your organization before linking
  • Unlinking required: To link a number to a different app, you must first unlink it from the current app

Next Steps​