Condition
The Condition object is supported by the MiRTA PBX OpenAPI endpoint. This object is tenant-scoped. Tenant API keys must include tenant=CANISTRACCI; writes require a writable API key.
Object Summary
| Property | Value |
|---|---|
| Object | condition |
| Primary path | /conditions |
| ID field | co_id |
| Label field | co_name |
| Primary source table | co_conditions |
| Required on create | co_type |
| Path aliases | /conditions |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List | GET https://pbx.example.com/pbx/openapi.php/conditions?tenant=CANISTRACCI |
| Get by ID | GET https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI |
| Create | POST https://pbx.example.com/pbx/openapi.php/conditions?tenant=CANISTRACCI |
| Update | PATCH https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI |
| Delete | DELETE https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI |
Accepted Field Aliases
| Request field | Source field |
|---|---|
name | co_name |
type | co_type |
timezone | co_timezone |
Destination Fields
Destination fields accept one destination string or an array of destination strings such as EXT-100, VOICEMAIL-100, or another supported destination type and ID pair.
| Destination type | Accepted aliases |
|---|---|
CONDITION | condition, true, yes, destination |
NOTCONDITION | notcondition, false, no, notdestination |
CONDITION1 | condition1, destination1, destinationmvv1 |
CONDITION2 | condition2, destination2, destinationmvv2 |
CONDITION3 | condition3, destination3, destinationmvv3 |
CONDITION4 | condition4, destination4, destinationmvv4 |
CONDITION5 | condition5, destination5, destinationmvv5 |
CONDITION6 | condition6, destination6, destinationmvv6 |
CONDITION7 | condition7, destination7, destinationmvv7 |
CONDITION8 | condition8, destination8, destinationmvv8 |
CONDITION9 | condition9, destination9, destinationmvv9 |
CONDITION10 | condition10, destination10, destinationmvv10 |
CONDITION11 | condition11, destination11, destinationmvv11 |
CONDITION12 | condition12, destination12, destinationmvv12 |
CONDITION13 | condition13, destination13, destinationmvv13 |
CONDITION14 | condition14, destination14, destinationmvv14 |
CONDITION15 | condition15, destination15, destinationmvv15 |
CONDITION16 | condition16, destination16, destinationmvv16 |
CONDITION17 | condition17, destination17, destinationmvv17 |
CONDITION18 | condition18, destination18, destinationmvv18 |
CONDITION19 | condition19, destination19, destinationmvv19 |
CONDITION20 | condition20, destination20, destinationmvv20 |
Examples
List Conditions
Returns the conditions visible to the key and scope.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/conditions?tenant=CANISTRACCI"
Get Condition
Reads one object by its internal ID.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Create Condition
Creates a new object. Use the short aliases shown above or the source field names.
curl -X POST \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Docs API Office Hours",
"type": "WEEKTIME",
"timezone": "Europe/Rome"
}' \
"https://pbx.example.com/pbx/openapi.php/conditions?tenant=CANISTRACCI"
Edit Condition
Updates only the supplied fields.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"timezone": "UTC"
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Delete Condition
Deletes the object. Check references before deleting configuration used by routing or reporting.
curl -X DELETE \
-H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition Destination
Updates the CONDITION destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"condition": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition Destination
Updates the NOTCONDITION destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"notcondition": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 1 Destination
Updates the CONDITION1 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"condition1": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 2 Destination
Updates the CONDITION2 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"condition2": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 3 Destination
Updates the CONDITION3 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"condition3": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 4 Destination
Updates the CONDITION4 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"condition4": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 5 Destination
Updates the CONDITION5 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"condition5": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 6 Destination
Updates the CONDITION6 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"condition6": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 7 Destination
Updates the CONDITION7 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"condition7": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 8 Destination
Updates the CONDITION8 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"condition8": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 9 Destination
Updates the CONDITION9 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"condition9": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 10 Destination
Updates the CONDITION10 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"condition10": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 11 Destination
Updates the CONDITION11 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"condition11": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 12 Destination
Updates the CONDITION12 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"condition12": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 13 Destination
Updates the CONDITION13 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"condition13": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 14 Destination
Updates the CONDITION14 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"condition14": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 15 Destination
Updates the CONDITION15 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"condition15": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 16 Destination
Updates the CONDITION16 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"condition16": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 17 Destination
Updates the CONDITION17 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"condition17": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 18 Destination
Updates the CONDITION18 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"condition18": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 19 Destination
Updates the CONDITION19 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"condition19": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 20 Destination
Updates the CONDITION20 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"condition20": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition Extended Rows
Supplies the extended rows used by condition types that require additional values.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"extended_infos": [
{
"ce_type": "weekday",
"ce_value": "mon-fri"
},
{
"ce_type": "hours",
"ce_value": "09:00-18:00"
}
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Common Errors
| Error | Meaning |
|---|---|
missing_api_key | No API key was supplied in the query string, X-API-Key, or bearer token. |
invalid_api_key | The supplied key does not match the tenant or global API key. |
tenant_required | A tenant code is required for tenant-scoped writes or tenant-key reads. |
read_only_api_key | The key can read data but cannot create, update, or delete objects. |
missing_required_field | A required create field is missing. |
No comments to display
No comments to display