Skip to main content

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

PropertyValue
Objectcondition
Primary path/conditions
ID fieldco_id
Label fieldco_name
Primary source tableco_conditions
Required on createco_type
Path aliases/conditions

Endpoint Patterns

ActionExample pattern
ListGET https://pbx.example.com/pbx/openapi.php/conditions?tenant=CANISTRACCI
Get by IDGET https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI
CreatePOST https://pbx.example.com/pbx/openapi.php/conditions?tenant=CANISTRACCI
UpdatePATCH https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI
DeleteDELETE https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI

Accepted Field Aliases

Request fieldSource field
nameco_name
typeco_type
timezoneco_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 typeAccepted aliases
CONDITIONcondition, true, yes, destination
NOTCONDITIONnotcondition, false, no, notdestination
CONDITION1condition1, destination1, destinationmvv1
CONDITION2condition2, destination2, destinationmvv2
CONDITION3condition3, destination3, destinationmvv3
CONDITION4condition4, destination4, destinationmvv4
CONDITION5condition5, destination5, destinationmvv5
CONDITION6condition6, destination6, destinationmvv6
CONDITION7condition7, destination7, destinationmvv7
CONDITION8condition8, destination8, destinationmvv8
CONDITION9condition9, destination9, destinationmvv9
CONDITION10condition10, destination10, destinationmvv10
CONDITION11condition11, destination11, destinationmvv11
CONDITION12condition12, destination12, destinationmvv12
CONDITION13condition13, destination13, destinationmvv13
CONDITION14condition14, destination14, destinationmvv14
CONDITION15condition15, destination15, destinationmvv15
CONDITION16condition16, destination16, destinationmvv16
CONDITION17condition17, destination17, destinationmvv17
CONDITION18condition18, destination18, destinationmvv18
CONDITION19condition19, destination19, destinationmvv19
CONDITION20condition20, 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

ErrorMeaning
missing_api_keyNo API key was supplied in the query string, X-API-Key, or bearer token.
invalid_api_keyThe supplied key does not match the tenant or global API key.
tenant_requiredA tenant code is required for tenant-scoped writes or tenant-key reads.
read_only_api_keyThe key can read data but cannot create, update, or delete objects.
missing_required_fieldA required create field is missing.