Create App
Create a new SFVoPI application. An app defines the webhook URLs that will be called when calls are answered or hung up, and can be linked to phone numbers to handle inbound calls.
Authentication Required
Requires X-API-Key header. See Authentication for details.
HTTP Request
POST /sfvopi/apps
Request Body
| Field | Type | Required | Default | Description | Validation |
|---|---|---|---|---|---|
name | string | Yes | - | Human-readable name for the app | 1-100 characters |
answer_url | string | Yes | - | Webhook URL called when a call is answered | Valid URL |
answer_method | string | No | POST | HTTP method for answer webhook | POST or GET |
hangup_url | string | No | null | Webhook URL called when a call ends | Valid URL or omit |
hangup_method | string | No | POST | HTTP method for hangup webhook | POST or GET |
fallback_answer_url | string | No | null | Fallback URL if answer_url fails | Valid URL or omit |
fallback_answer_method | string | No | POST | HTTP method for fallback webhook | POST or GET |
Code Examples
- cURL
- JavaScript
- TypeScript
- Python
curl -X POST https://prod-api.superfone.co.in/superfone/sfvopi/apps \
-H "X-API-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"name": "My Voice App",
"answer_url": "https://example.com/webhook/answer",
"answer_method": "POST",
"hangup_url": "https://example.com/webhook/hangup",
"hangup_method": "POST"
}'
const response = await fetch('https://prod-api.superfone.co.in/superfone/sfvopi/apps', {
method: 'POST',
headers: {
'X-API-Key': 'your_api_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'My Voice App',
answer_url: 'https://example.com/webhook/answer',
answer_method: 'POST',
hangup_url: 'https://example.com/webhook/hangup',
hangup_method: 'POST'
})
});
const result = await response.json();
console.log(result.data);
interface CreateAppRequest {
name: string;
answer_url: string;
answer_method?: 'POST' | 'GET';
hangup_url?: string;
hangup_method?: 'POST' | 'GET';
fallback_answer_url?: string;
fallback_answer_method?: 'POST' | 'GET';
}
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 response = await fetch('https://prod-api.superfone.co.in/superfone/sfvopi/apps', {
method: 'POST',
headers: {
'X-API-Key': 'your_api_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'My Voice App',
answer_url: 'https://example.com/webhook/answer',
answer_method: 'POST',
hangup_url: 'https://example.com/webhook/hangup',
hangup_method: 'POST'
} as CreateAppRequest)
});
const result: ApiResponse<SfvopiApp> = await response.json();
console.log(result.data);
import requests
url = 'https://prod-api.superfone.co.in/superfone/sfvopi/apps'
headers = {
'X-API-Key': 'your_api_key_here',
'Content-Type': 'application/json'
}
payload = {
'name': 'My Voice App',
'answer_url': 'https://example.com/webhook/answer',
'answer_method': 'POST',
'hangup_url': 'https://example.com/webhook/hangup',
'hangup_method': 'POST'
}
response = requests.post(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": "My Voice App",
"answer_url": "https://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": null
},
"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 |