Update App
Update an existing SFVoPI application's configuration. All fields are optional — only include the fields you want to change.
Authentication Required
Requires X-API-Key header. See Authentication for details.
HTTP Request
PUT /sfvopi/apps/:app_id
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
app_id | string | Yes | Unique app identifier (format: sfv_app_xxxxxxxxxxxx) |
Request Body
All fields are optional. Only include the fields you want to update.
| Field | Type | Required | Description | Validation |
|---|---|---|---|---|
name | string | No | Human-readable name for the app | 1-100 characters |
answer_url | string | No | Webhook URL called when a call is answered | Valid URL |
answer_method | string | No | HTTP method for answer webhook | POST or GET |
hangup_url | string | null | No | Webhook URL called when a call ends | Valid URL, or null to remove |
hangup_method | string | No | HTTP method for hangup webhook | POST or GET |
fallback_answer_url | string | null | No | Fallback URL if answer_url fails | Valid URL, or null to remove |
fallback_answer_method | string | No | HTTP method for fallback webhook | POST or GET |
status | string | No | App status | ACTIVE or INACTIVE |
Removing Optional URLs
To remove hangup_url or fallback_answer_url, set them to null in the request body:
{
"hangup_url": null,
"fallback_answer_url": null
}
Code Examples
- cURL
- JavaScript
- TypeScript
- Python
curl -X PUT https://prod-api.superfone.co.in/superfone/sfvopi/apps/sfv_app_abc123xyz456 \
-H "X-API-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Voice App",
"answer_url": "https://new.example.com/webhook/answer",
"status": "ACTIVE"
}'
const appId = 'sfv_app_abc123xyz456';
const response = await fetch(`https://prod-api.superfone.co.in/superfone/sfvopi/apps/${appId}`, {
method: 'PUT',
headers: {
'X-API-Key': 'your_api_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Updated Voice App',
answer_url: 'https://new.example.com/webhook/answer',
status: 'ACTIVE'
})
});
const result = await response.json();
console.log(result.data);
interface UpdateAppRequest {
name?: string;
answer_url?: string;
answer_method?: 'POST' | 'GET';
hangup_url?: string | null;
hangup_method?: 'POST' | 'GET';
fallback_answer_url?: string | null;
fallback_answer_method?: 'POST' | 'GET';
status?: 'ACTIVE' | 'INACTIVE';
}
interface SfvopiApp {
app_id: string;
org_id: number;
name: string;
answer_url: string;
answer_method: 'POST' | 'GET';
hangup_url: string | null;
hangup_method: 'POST' | 'GET';
fallback_answer_url: string | null;
fallback_answer_method: 'POST' | 'GET';
status: 'ACTIVE' | 'INACTIVE';
created_by: number | null;
created_at: string;
updated_at: string | null;
}
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: 'PUT',
headers: {
'X-API-Key': 'your_api_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Updated Voice App',
answer_url: 'https://new.example.com/webhook/answer',
status: 'ACTIVE'
} as UpdateAppRequest)
});
const result: ApiResponse<SfvopiApp> = 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',
'Content-Type': 'application/json'
}
payload = {
'name': 'Updated Voice App',
'answer_url': 'https://new.example.com/webhook/answer',
'status': 'ACTIVE'
}
response = requests.put(url, headers=headers, json=payload)
result = response.json()
print(result['data'])
Success Response
Status Code: 200 OK
{
"data": {
"app_id": "sfv_app_abc123xyz456",
"org_id": 12345,
"name": "Updated Voice App",
"answer_url": "https://new.example.com/webhook/answer",
"answer_method": "POST",
"hangup_url": "https://example.com/webhook/hangup",
"hangup_method": "POST",
"fallback_answer_url": null,
"fallback_answer_method": "POST",
"status": "ACTIVE",
"created_by": 67890,
"created_at": "2026-02-02T10:30:00.000Z",
"updated_at": "2026-02-02T15:45:00.000Z"
},
"message": "success"
}
Response Fields
| Field | Type | Description |
|---|---|---|
app_id | string | Unique identifier for the app (format: sfv_app_xxxxxxxxxxxx) |
org_id | number | Organization ID that owns this app |
name | string | App name |
answer_url | string | Webhook URL for answered calls |
answer_method | string | HTTP method for answer webhook (POST or GET) |
hangup_url | string | null | Webhook URL for call hangup events |
hangup_method | string | HTTP method for hangup webhook |
fallback_answer_url | string | null | Fallback webhook URL |
fallback_answer_method | string | HTTP method for fallback webhook |
status | string | App status (ACTIVE or INACTIVE) |
created_by | number | null | User ID who created the app |
created_at | string | ISO 8601 timestamp of creation |
updated_at | string | null | ISO 8601 timestamp of last update |
Error Responses
| Status Code | Message | When It Occurs |
|---|---|---|
400 | Invalid request body | Request body fails validation (invalid URL format, name too long, invalid HTTP method, invalid status) |
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 update SFVoPI app: {error} | Server error during app update |
Example Error Response
{
"message": "SFVoPI app not found"
}
Use Cases
Update Webhook URLs
const appId = 'sfv_app_abc123xyz456';
const response = await fetch(`https://prod-api.superfone.co.in/superfone/sfvopi/apps/${appId}`, {
method: 'PUT',
headers: {
'X-API-Key': 'your_api_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
answer_url: 'https://new-server.example.com/webhook/answer',
hangup_url: 'https://new-server.example.com/webhook/hangup'
})
});
const result = await response.json();
console.log('Webhooks updated:', result.data);
Disable an App
const appId = 'sfv_app_abc123xyz456';
const response = await fetch(`https://prod-api.superfone.co.in/superfone/sfvopi/apps/${appId}`, {
method: 'PUT',
headers: {
'X-API-Key': 'your_api_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
status: 'INACTIVE'
})
});
const result = await response.json();
console.log('App disabled:', result.data.status);
Remove Optional Webhooks
const appId = 'sfv_app_abc123xyz456';
const response = await fetch(`https://prod-api.superfone.co.in/superfone/sfvopi/apps/${appId}`, {
method: 'PUT',
headers: {
'X-API-Key': 'your_api_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
hangup_url: null,
fallback_answer_url: null
})
});
const result = await response.json();
console.log('Optional webhooks removed');
Related Endpoints
- Create App — Create a new app
- List Apps — Get all apps for your organization
- Get App — Retrieve a specific app by ID
- Delete App — Remove an app