Delete App
Permanently delete a SFVoPI application. This action cannot be undone.
Permanent Action
Deleting an app is permanent and cannot be reversed. Any phone numbers linked to this app will be automatically unlinked.
Authentication Required
Requires X-API-Key header. See Authentication for details.
HTTP Request
DELETE /sfvopi/apps/:app_id
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
app_id | string | Yes | Unique app identifier (format: sfv_app_xxxxxxxxxxxx) |
Code Examples
- cURL
- JavaScript
- TypeScript
- Python
curl -X DELETE https://prod-api.superfone.co.in/superfone/sfvopi/apps/sfv_app_abc123xyz456 \
-H "X-API-Key: your_api_key_here"
const appId = 'sfv_app_abc123xyz456';
const response = await fetch(`https://prod-api.superfone.co.in/superfone/sfvopi/apps/${appId}`, {
method: 'DELETE',
headers: {
'X-API-Key': 'your_api_key_here'
}
});
const result = await response.json();
console.log(result.data);
interface DeleteAppResponse {
deleted: boolean;
}
interface ApiResponse<T> {
data: T;
message: string;
}
const appId = 'sfv_app_abc123xyz456';
const response = await fetch(`https://prod-api.superfone.co.in/superfone/sfvopi/apps/${appId}`, {
method: 'DELETE',
headers: {
'X-API-Key': 'your_api_key_here'
}
});
const result: ApiResponse<DeleteAppResponse> = await response.json();
console.log(result.data);
import requests
app_id = 'sfv_app_abc123xyz456'
url = f'https://prod-api.superfone.co.in/superfone/sfvopi/apps/{app_id}'
headers = {
'X-API-Key': 'your_api_key_here'
}
response = requests.delete(url, headers=headers)
result = response.json()
print(result['data'])
Success Response
Status Code: 200 OK
{
"data": {
"deleted": true
},
"message": "success"
}
Response Fields
| Field | Type | Description |
|---|---|---|
deleted | boolean | Always true when deletion succeeds |
Error Responses
| Status Code | Message | When It Occurs |
|---|---|---|
404 | SFVoPI app not found | App with the specified app_id does not exist or does not belong to your organization |
401 | UnAuthorized, Please Provide Valid API Key | Missing or invalid X-API-Key header |
500 | Failed to delete SFVoPI app: {error} | Server error during app deletion |
Example Error Response
{
"message": "SFVoPI app not found"
}
Use Cases
Delete with Confirmation
async function deleteApp(appId) {
const confirmed = confirm(`Are you sure you want to delete app ${appId}? This cannot be undone.`);
if (!confirmed) {
console.log('Deletion cancelled');
return;
}
const response = await fetch(`https://prod-api.superfone.co.in/superfone/sfvopi/apps/${appId}`, {
method: 'DELETE',
headers: {
'X-API-Key': 'your_api_key_here'
}
});
const result = await response.json();
if (result.data.deleted) {
console.log('App deleted successfully');
}
}
await deleteApp('sfv_app_abc123xyz456');
Delete with Error Handling
async function deleteAppSafely(appId) {
try {
const response = await fetch(`https://prod-api.superfone.co.in/superfone/sfvopi/apps/${appId}`, {
method: 'DELETE',
headers: {
'X-API-Key': 'your_api_key_here'
}
});
if (response.status === 404) {
console.error('App not found');
return false;
}
if (!response.ok) {
console.error('Failed to delete app');
return false;
}
const result = await response.json();
return result.data.deleted;
} catch (error) {
console.error('Error deleting app:', error);
return false;
}
}
const deleted = await deleteAppSafely('sfv_app_abc123xyz456');
console.log(`Deletion ${deleted ? 'succeeded' : 'failed'}`);
Bulk Delete Apps
async function deleteMultipleApps(appIds) {
const results = await Promise.allSettled(
appIds.map(appId =>
fetch(`https://prod-api.superfone.co.in/superfone/sfvopi/apps/${appId}`, {
method: 'DELETE',
headers: { 'X-API-Key': 'your_api_key_here' }
}).then(res => res.json())
)
);
const deleted = results.filter(r => r.status === 'fulfilled').length;
const failed = results.filter(r => r.status === 'rejected').length;
console.log(`Deleted: ${deleted}, Failed: ${failed}`);
}
await deleteMultipleApps([
'sfv_app_abc123xyz456',
'sfv_app_def789ghi012'
]);
Important Notes
What Happens When You Delete an App
- App is permanently removed from your organization
- Linked phone numbers are automatically unlinked — they become available for linking to other apps
- Active calls using this app continue until they naturally end
- New calls cannot use this app — inbound calls to previously linked numbers will fail until you link them to a new app
Before Deleting
Consider these alternatives:
- Update app status to INACTIVE — Temporarily disable the app without deleting it
- Unlink phone numbers — Remove number associations while keeping the app configuration
Related Endpoints
- Create App — Create a new app
- List Apps — Get all apps for your organization
- Get App — Retrieve a specific app by ID
- Update App — Modify app configuration (including disabling)