Unlink Number from App
Remove a phone number from a SFVoPI application. After unlinking, the number will no longer route calls to this app and will become available to link to other apps.
info
After unlinking, the number will appear in the available numbers list and can be linked to a different SFVoPI app.
Authentication
Requires X-API-Key header with a valid API key. See Authentication for details.
Endpoint
DELETE /sfvopi/apps/:app_id/numbers/:voip_number
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
app_id | string | Yes | The unique identifier of the SFVoPI app |
voip_number | string | Yes | The phone number to unlink (E.164 format, e.g., +918000000001) |
No request body required.
Code Examples
- cURL
- JavaScript
- TypeScript
- Python
curl -X DELETE https://prod-api.superfone.co.in/superfone/sfvopi/apps/app_abc123/numbers/+918000000001 \
-H "X-API-Key: your_api_key_here"
const appId = 'app_abc123';
const voipNumber = encodeURIComponent('+918000000001');
const response = await fetch(`https://prod-api.superfone.co.in/superfone/sfvopi/apps/${appId}/numbers/${voipNumber}`, {
method: 'DELETE',
headers: {
'X-API-Key': 'your_api_key_here'
}
});
const data = await response.json();
console.log(data.data.deleted); // true
interface UnlinkNumberResponse {
deleted: boolean;
}
interface ApiResponse<T> {
data: T;
message: string;
}
const appId = 'app_abc123';
const voipNumber = encodeURIComponent('+918000000001');
const response = await fetch(`https://prod-api.superfone.co.in/superfone/sfvopi/apps/${appId}/numbers/${voipNumber}`, {
method: 'DELETE',
headers: {
'X-API-Key': 'your_api_key_here'
}
});
const result: ApiResponse<UnlinkNumberResponse> = await response.json();
console.log(result.data.deleted); // true
import requests
from urllib.parse import quote
app_id = 'app_abc123'
voip_number = quote('+918000000001')
url = f'https://prod-api.superfone.co.in/superfone/sfvopi/apps/{app_id}/numbers/{voip_number}'
headers = {
'X-API-Key': 'your_api_key_here'
}
response = requests.delete(url, headers=headers)
data = response.json()
print(data['data']['deleted']) # True
Success Response
Status Code: 200 OK
{
"data": {
"deleted": true
},
"message": "success"
}
Response Fields
| Field | Type | Description |
|---|---|---|
data | object | Deletion confirmation object |
data.deleted | boolean | Always true on successful deletion |
message | string | Response message (always "success" on success) |
Error Responses
| Status Code | Message | When It Occurs |
|---|---|---|
404 | App not found | The specified app_id doesn't exist or doesn't belong to your organization |
404 | Number not linked to this app | The phone number is not currently linked to the specified app |
401 | UnAuthorized, Please Provide Valid API Key | Missing or invalid X-API-Key header |
500 | Failed to unlink number: <error> | Server error while unlinking the number |
URL Encoding
Since phone numbers contain the + character, you must URL-encode the voip_number path parameter:
| Original | URL-Encoded |
|---|---|
+918000000001 | %2B918000000001 |
Most HTTP libraries handle this automatically:
- JavaScript/TypeScript:
encodeURIComponent('+918000000001') - Python:
urllib.parse.quote('+918000000001') - cURL: Use
+directly (cURL handles encoding)
Notes
- Immediate effect: Once unlinked, incoming calls to this number will no longer route to the app
- Availability: The number becomes available to link to other apps immediately
- Idempotent: Attempting to unlink a number that's not linked returns a
404error - E.164 format: The
voip_numberparameter must be in E.164 format (e.g.,+918000000001)
Next Steps
- Link Number — Link the number to a different app
- List Numbers — View remaining numbers linked to the app
- Get Available Numbers — See all unlinked numbers
- Delete App — Delete the entire app (automatically unlinks all numbers)