Create Access Control Rule
This request adds a new Access Control Rule (ACR) for the currently logged in partner.
post | /accesscontrol/rules |
Sample
A sample POST request to create an access control rule:
curl -X POST \
'https://api.carrierx.com/core/v2/accesscontrol/rules' \
-H 'Content-Type: application/json' \
--data-binary '{"field":"to", "quantifier":"any", "entries": ["1800","1615"], "operation":"prefix"}' \
-H 'Authorization: Bearer 5ebc03d6-8b2b-44ad-bf65-72d4f1491dda'
Response
200
status code with a serialized copy of the Access Control Rule object:
{
"entries": [
"1800",
"1615"
],
"field": "to",
"name": "N/A",
"operation": "prefix",
"quantifier": "any",
"read_only": false,
"rule_sid": "c9109b54-13f2-4157-ba23-2984b3a207dc"
}
Required Scopes
To create an Access Control Rule object, the partner must have one of the following scopes enabled:
accesscontrol.manage
accesscontrol.create
Body Arguments
JSON representation of the fields and values of the Access Control Rule object to be created.
Required fields to create an access control rule are:
entries
field
operation
quantifier
The field
parameter should contain the value against which messages or calls will be checked.
- The
calling
andcalled
field values are specific for voice calls. - The
from
(some legacy users may still see the old namingfrom_did
),to
(orto_did
) andmessage
field values are specific for SMS.
Refer to this table to view all fields that appear in the Access Control Rule object.