Skip to navigation

Create a policy

View as Markdown

Create an allow list for inbound calls. With scope: "account" it covers every number on the account, including numbers added later, except numbers that have an allow list of their own. With scope: "numbers" it covers the numbers in numberIds and replaces the account-wide list on them. An account has at most one account-wide list, and a number can be on at most one list of its own.

An enabled list with no entries declines every inbound call on the numbers it covers.

Authentication

AuthorizationBearer

Your Dial API key, sent as Authorization: Bearer sk_live_...

Request

This endpoint expects an object.
namestringRequired1-60 characters
scopeenumRequired
Allowed values:
typeenumOptionalDefaults to allow_list
Allowed values:
appliesToenumOptionalDefaults to inbound_calls
Allowed values:
numberIdslist of stringsOptional

Required, and non-empty, when scope is numbers. Must be omitted or empty for account.

enabledbooleanOptionalDefaults to true
entrieslist of objectsOptional
The callers allowed through, up to 10,000. Duplicates are collapsed. Defaults to empty, which declines every inbound call on the covered numbers while the policy is enabled.

Response

The created policy, with its entries.
policyobjectOptional

Errors

400
Bad Request Error
401
Unauthorized Error
404
Not Found Error
409
Conflict Error