Read Call Routing
GET /api/services/{id}/routing shows exactly how a number is configured — every forwarding destination, its position and duration, and whether call recording is on.
Ready to bring your routing under programmatic control?
Log in to the ConsoleThe endpoint
GET https://api.simpletelecom.com.au/v1/api/services/{service_id}/routing
Returns the complete routing configuration for one service. You'll use the service_id you obtained from GET /api/services in the path. This is a read-only view — see Manage forwarding to change routing and Call recording to toggle recording.
Example
curl -X GET "https://api.simpletelecom.com.au/v1/api/services/123/routing" \
-H "Authorization: Bearer st_your_token_here"
Response
{
"service_id": 123,
"service_number": "1300858751",
"call_recording": {
"enabled": false
},
"forwarding_numbers": [
{
"position": 1,
"phone_number": "0412345678",
"display_name": "Reception",
"duration": 15
},
{
"position": 2,
"phone_number": "0298765432",
"display_name": "Backup",
"duration": 180
}
]
}
Response fields
| Field | Type | Description |
|---|---|---|
| service_id | integer | The service you queried |
| service_number | string | The service's phone number |
| call_recording.enabled | boolean | Whether call recording is currently on for this service |
| forwarding_numbers[] | array | Every forwarding destination, in ring order |
| forwarding_numbers[].position | integer | Ring order (1 = tried first) |
| forwarding_numbers[].phone_number | string | The destination number |
| forwarding_numbers[].display_name | string | Human-friendly label |
| forwarding_numbers[].duration | integer | How long (seconds) the system rings this destination before moving to the next |
Errors
| HTTP | Code | Meaning |
|---|---|---|
| 401 | unauthorized | Missing, invalid or expired token |
| 403 | unauthorized_service | The service belongs to a different account |
| 404 | service_not_found | No service with that ID |
What you can learn from this
Because the response mirrors the live configuration, this endpoint is ideal for:
- Auditing — answer "how are our numbers routed right now?" without logging into the console.
- Syncing to your own PBX/CRM — keep a database of the current forwarding destinations per number.
- After-hours verification — confirm the correct overflow number is set before you switch (see Manage forwarding).
- UI for your own dashboard — render each number's ring list to non-technical staff.
Combining read + write for a safe workflow
A robust pattern is to read first, then write. Fetch the current routing, reason about it, then apply a change — rather than assuming the state. For example, before removing a destination you can confirm it isn't the last one (see Manage forwarding and the last_forwarding_number rule).
Related
- Your services — find
service_idvalues. - Manage forwarding — add, update and remove destinations.
- Call recording — toggle recording on and off.
- Error handling —
unauthorized_service,service_not_foundandunsupported_routing_typeerrors.
