Skip to main content
Phone rules attach to the agent identity and cover incoming and outgoing SMS/MMS, calls, and iMessage. For a shared policy, set phone_filter_mode and omit rule direction: new rules apply to both sending and receiving. Standalone number rules and contact permission edits change the same choices. An active exact-number allow or block takes precedence in either mode. Numbers without an applicable exact choice follow the direction’s mode:
  • phone_filter_mode: "whitelist": unmatched numbers are denied.
  • phone_filter_mode: "blacklist": unmatched numbers are permitted.
Set phone_filter_mode on the identity via PATCH /identities/{agent_handle} for both directions. Use phone_inbound_filter_mode and phone_outbound_filter_mode for independent defaults. Inbound is from the external party to the agent; outbound is from the agent to that party. Only rules covering that direction apply. Rules match exact E.164 phone numbers (match_type: "exact_number"). See Manage identities. New directional SDK/CLI options require 0.7.3 or later.

Existing-call transfers and guests

During an existing Voice AI call on a dedicated phone or dedicated iMessage line, a transfer destination or conference guest does not need allowlist membership. An applicable explicit outbound block still prevents the connection. Starting a separate outbound call still follows the identity’s outbound filter mode. Shared iMessage lines cannot transfer calls or add guests. See Voice AI transfers and group calls.

Direction and rule identity

Companion mode can permit a sponsored group MMS conversation without globally allowing its participants. An applicable block on any participant still vetoes Companion permission in that direction. New voice calls and separate private texts remain governed by ordinary rules; group replies still require consent and a ready sender. Activation eligibility requires active exact_number allows covering inbound and outbound for the actual sending number. One both allow or separate one-way allows qualify. Blacklist defaults and contact visibility do not. These rules also determine iMessage sender eligibility, while each channel keeps its resource and group-readiness requirements.
  • Create defaults to direction: "both". PATCH without direction preserves coverage.
  • List filters inbound and outbound include both rules. The both filter selects only bidirectional rules. Omit direction for all rules without duplicates. Action and match-type filters apply independently before pagination. A2A filters remain exact matches with their existing defaults.
  • Compatible new coverage for one number widens the existing rule to both. Matching actions and lifecycle states consolidate on creation or later edits. Previously issued IDs still support get, update, and delete of the consolidated logical rule; lists include it once. IDs do not permanently denote their original direction.
  • POST returns 201 for insertion or widening. Use the returned ID and direction rather than assuming a new ID. PATCH returns 200.
  • Duplicate coverage returns 409 with rule_already_exists and existing_rule_id. Conflicting actions also return 409; create does not overwrite them. Paused coverage is not silently reactivated or combined with active coverage.
  • A both rule has one action. Use separate one-way rules for opposing actions. Receiving permission does not grant permission to reply, and sending permission does not replace consent or channel-readiness requirements.
The deprecated per-number routes retain these same semantics. Shared-line iMessage setup additionally requires both effective permissions. When a caller or sender is blocked: inbound calls are rejected before they connect, and inbound texts are stored but never delivered to the agent. No text.received webhooks fire, identity-scoped keys never see the blocked rows, and admin API keys or the Inkbox Console can audit them with is_blocked=true filters on the calls and texts listings. Phone permissions can be configured without a dedicated phone number. phone_filter_mode and imessage_filter_mode are aliases; conflicting values in one request return 422. Releasing or replacing a number preserves the identity’s permissions. Actual sends and calls still require a ready channel.
Deprecated. The per-number routes under /numbers/{phone_number_id}/contact-rules are deprecated. Use the handle-keyed routes documented below instead.
Auth. Claimed agent keys can read their permitted rules. Creating, updating, or deleting rules requires an admin API key or the Inkbox Console. Agent writes return 403. Org-wide listings require administrative access.

List contact rules

List contact rules for an agent identity, newest first, including identities without a dedicated phone number. An identity-scoped API key may read only its own identity’s agent_handle. Another handle returns 403; agent keys cannot create rules.

Path parameters

Query parameters

Response (200)

JSON

Code examples


Create contact rule

Add an allow or block rule for an agent identity. New rules are always created active.

Path parameters

Request body

Request example

JSON

Response (201)

Returns the saved rule, which may be an existing rule widened to both. See Contact rule object.

Error responses

Code examples


Get contact rule

Fetch a single rule by ID.

Path parameters

Response (200)

Returns the rule. See Contact rule object.

Error responses


Update contact rule

Change a rule’s action or coverage, or atomically edit one covered side. Requires an admin API key, or manage rules from the Inkbox Console. match_type and match_target are immutable; delete the rule and create a new one to change the target.

Path parameters

Request body

Supply action, direction, or both. apply_to requires action and excludes direction. Supplied values cannot be null.

Request example

JSON

Response (200)

Returns the updated rule. Use {"action":"block","apply_to":"inbound"} on a both allow to block inbound while preserving outbound allow. The response contains the addressed inbound rule; refresh the list to see the preserved outbound rule. Applying the current action does not split the rule. By contrast, {"direction":"inbound"} removes outbound coverage; the remaining rules and outbound default decide sending permission. An action-only PATCH changes every direction the rule currently covers.

Error responses


Delete contact rule

Delete a rule. Requires an admin API key, or manage rules from the Inkbox Console.

Path parameters

Response (204)

No content.

Error responses


List org phone contact rules

Org-wide aggregate list of phone contact rules across every identity. Intended for admin dashboards that render rules org-wide without fanning out one request per identity. Requires an admin API key, or browse rules in the Inkbox Console. Results are grouped by matched contact ID, with rules that have no matched contact last. Within each group, rules are ordered by created_at descending and then id ascending. Grouping happens before pagination, and a contact’s rows can span adjacent pages.

Query parameters

Response (200)

Returns a list[ContactRule] grouped by contact, with the same object shape as the per-identity list.

Code examples


Contact rule object

List, get, create, update, and organization-wide list responses include a nullable contact card for an exact target with one resolved owner in the rule’s organization. The card follows the caller’s contact permissions and contains no memories, memory_count, or latest_memory. Unresolved, ambiguous, and inaccessible matches return null. Reads resolve the current contact. An idempotent write replay preserves its original response snapshot. SDK/CLI 0.6.11 supports these cards; CLI tables show contact names and JSON output preserves the card.

Additional resources