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 and not currently linked to another app
  • 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)
400Number not found or not owned by organizationThe phone number doesn't exist in your organization's inventory
404App not foundThe specified app_id doesn't exist or doesn't belong to your organization
409Number already linked to another appThe phone number is already linked to a different SFVoPI app. Unlink it first.
401UnAuthorized, Please Provide Valid API KeyMissing or invalid X-API-Key header
500Failed to link number: <error>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