Device Management
Toggle phone and SIP device status for users in your WebRTC application. Control whether a user receives calls on their PSTN phone, SIP endpoint, or both.
Base URL
https://integrationscore.mum1.exotel.com/v2/integrations
Update Device Status
Toggle a user's phone or SIP device on/off.
PUT /{customer_id}/apps/{app_id}/users/{user_id}/devices
Headers
| Header | Value |
|---|---|
Authorization | Bearer <app_token> |
Content-Type | application/json |
Request Body
{
"phone": true,
"sip": true
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
phone | Boolean | No | Enable/disable PSTN phone device |
sip | Boolean | No | Enable/disable SIP/WebRTC device |
info
At least one device must remain enabled. The API will reject requests that disable all devices.
Example Request
- cURL
- Python
- Node.js
- PHP
- Go
curl -X PUT \
'https://integrationscore.mum1.exotel.com/v2/integrations/{customer_id}/apps/{app_id}/users/{user_id}/devices' \
-H 'Authorization: Bearer <app_token>' \
-H 'Content-Type: application/json' \
-d '{
"phone": false,
"sip": true
}'
import requests
import json
payload = {"phone": False, "sip": True}
response = requests.put(
'https://integrationscore.mum1.exotel.com/v2/integrations/{customer_id}/apps/{app_id}/users/{user_id}/devices',
headers={
'Authorization': 'Bearer <app_token>',
'Content-Type': 'application/json',
},
data=json.dumps(payload)
)
print(response.json())
const customerId = '{customer_id}';
const appId = '{app_id}';
const userId = '{user_id}';
const url = `https://integrationscore.mum1.exotel.com/v2/integrations/${customerId}/apps/${appId}/users/${userId}/devices`;
const response = await fetch(url, {
method: 'PUT',
headers: {
Authorization: 'Bearer <app_token>',
'Content-Type': 'application/json',
},
body: JSON.stringify({ phone: false, sip: true }),
});
const data = await response.json();
console.log(data);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://integrationscore.mum1.exotel.com/v2/integrations/{customer_id}/apps/{app_id}/users/{user_id}/devices',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS => json_encode(array(
'phone' => false,
'sip' => true
)),
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer <app_token>',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
package main
import (
"fmt"
"io/ioutil"
"net/http"
"strings"
)
func main() {
url := "https://integrationscore.mum1.exotel.com/v2/integrations/{customer_id}/apps/{app_id}/users/{user_id}/devices"
payload := strings.NewReader(`{
"phone": false,
"sip": true
}`)
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <app_token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(string(body))
}
Response
{
"success": true,
"data": {
"user_id": "agent_001",
"devices": {
"phone": {
"enabled": false,
"number": "+919876543210"
},
"sip": {
"enabled": true,
"username": "agent_001@app_abc123.exotel.com"
}
},
"updated_at": "2024-06-15T10:30:00.000Z"
}
}
Get Device Status
GET /{customer_id}/apps/{app_id}/users/{user_id}/devices
Example Request
- cURL
- Python
- Node.js
- PHP
- Go
curl -X GET \
'https://integrationscore.mum1.exotel.com/v2/integrations/{customer_id}/apps/{app_id}/users/{user_id}/devices' \
-H 'Authorization: Bearer <app_token>'
import requests
response = requests.get(
'https://integrationscore.mum1.exotel.com/v2/integrations/{customer_id}/apps/{app_id}/users/{user_id}/devices',
headers={'Authorization': 'Bearer <app_token>'}
)
print(response.json())
const customerId = '{customer_id}';
const appId = '{app_id}';
const userId = '{user_id}';
const url = `https://integrationscore.mum1.exotel.com/v2/integrations/${customerId}/apps/${appId}/users/${userId}/devices`;
const response = await fetch(url, {
headers: { Authorization: 'Bearer <app_token>' },
});
const data = await response.json();
console.log(data);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://integrationscore.mum1.exotel.com/v2/integrations/{customer_id}/apps/{app_id}/users/{user_id}/devices',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer <app_token>'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://integrationscore.mum1.exotel.com/v2/integrations/{customer_id}/apps/{app_id}/users/{user_id}/devices"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <app_token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(string(body))
}
Response
{
"success": true,
"data": {
"user_id": "agent_001",
"devices": {
"phone": {
"enabled": false,
"number": "+919876543210"
},
"sip": {
"enabled": true,
"username": "agent_001@app_abc123.exotel.com",
"registered": true,
"last_seen": "2024-06-15T10:25:00.000Z"
}
}
}
}
Device Behavior
| phone | sip | Behavior |
|---|---|---|
true | true | Calls ring on both PSTN phone and WebRTC client |
true | false | Calls ring only on PSTN phone |
false | true | Calls ring only on WebRTC/SIP client |
false | false | ❌ Not allowed — at least one device must be enabled |
HTTP Status Codes
| Code | Description |
|---|---|
200 | Success |
400 | Bad Request — Invalid parameters or all devices disabled |
401 | Unauthorized — Invalid or expired token |
404 | Not Found — User doesn't exist |
500 | Internal Server Error |