Skip to content
Inkbox

Inkbox

DocsPricingBlogContact
GuidesAPI ReferenceChangelog

Ctrl K

GuidesAPI ReferenceChangelog

Jump to

Phone Contact Rules

Per-identity allow/block rules for inbound calls and text messages. Rules attach to the agent identity itself and are addressed by agent_handle, covering both voice and SMS on the identity's phone number. The identity's phone_filter_mode field decides how the rule list is interpreted:

  • phone_filter_mode: "whitelist" — only callers and senders matching an allow rule can reach the agent
  • phone_filter_mode: "blacklist" — every caller and sender can reach the agent except those matching a block rule

Set phone_filter_mode on the identity via PATCH /identities/{agent_handle} — see Manage identities. Rules match on exact E.164 phone numbers only in v1 (match_type: "exact_number"); the field is wired in to stay forward-compatible when additional match types are added.

A rule with status: "paused" has no effect, but still counts as the rule for its number. Creating a duplicate returns 409.

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.

The identity needs a phone number. Phone contact rules and phone_filter_mode only apply to an identity that has a phone number. While an identity has no number, creating a rule (or setting phone_filter_mode) returns 422, listing rules returns an empty list, and addressing a specific rule returns 404. Assign a number first — see Phone numbers.

Deprecated. The per-number routes under /numbers/{phone_number_id}/contact-rules are deprecated. Use the handle-keyed routes documented below instead.

Auth. List, get, and create accept admin API keys and claimed agent keys; unclaimed (mid-signup) agent keys are rejected. PATCH, DELETE, and the org-wide list require an admin-scoped API key, or you can manage them as a user in the Inkbox Console.


List contact rules GET

GET /identities/{agent_handle}/phone-contact-rules

List contact rules for an agent identity, newest first. Returns an empty list while the identity has no phone number.

An identity-scoped API key may only address its own identity's agent_handle — any other handle returns 403 (this applies to list, get, and create alike).

Path parameters

ParameterTypeDescription
agent_handlestringThe identity's handle, with or without the leading @

Query parameters

ParameterTypeDefaultDescription
actionstringFilter by "allow" or "block"
match_typestringFilter by match type ("exact_number" is the only value in v1)
limitinteger501–200
offsetinteger0Offset for pagination

Response (200)

JSONJSON

Code examples


Create contact rule POST

POST /identities/{agent_handle}/phone-contact-rules

Add an allow or block rule for an agent identity. New rules are always created active; use update to pause one.

Path parameters

ParameterTypeDescription
agent_handlestringThe identity's handle

Request body

FieldTypeRequiredDescription
actionstringYes"allow" or "block"
match_targetstringYesE.164 phone number to match (e.g. +14155550100)
match_typestringNoDefaults to "exact_number" (the only value in v1)

Request example

JSONJSON

Response (201)

Returns the new rule. See Contact rule object.

Error responses

StatusDescription
403Identity-scoped key addressed a different identity's handle
404Identity not found, or not visible to the caller
409rule_already_exists — a rule with the same (match_type, match_target) already exists on this identity; the response includes existing_rule_id
422Invalid action, match_type, or match_target — or the identity has no phone number

Code examples


Get contact rule GET

GET /identities/{agent_handle}/phone-contact-rules/{rule_id}

Fetch a single rule by ID.

Path parameters

ParameterTypeDescription
agent_handlestringThe identity's handle
rule_idUUIDRule ID

Response (200)

Returns the rule. See Contact rule object.

Error responses

StatusDescription
403Identity-scoped key addressed a different identity's handle
404Rule not found, it belongs to a different identity, or the identity has no phone number

Update contact rule PATCH

PATCH /identities/{agent_handle}/phone-contact-rules/{rule_id}

Change a rule's action or status. 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

ParameterTypeDescription
agent_handlestringThe identity's handle
rule_idUUIDRule ID

Request body

At least one field is required; fields you omit are left unchanged.

FieldTypeRequiredDescription
actionstringNo"allow" or "block"
statusstringNo"active" or "paused"

Request example

JSONJSON

Response (200)

Returns the updated rule.

Error responses

StatusDescription
403Caller is not admin-scoped
404Rule not found, it belongs to a different identity, or the identity has no phone number
422Empty body, or a field explicitly set to null

Delete contact rule DELETE

DELETE /identities/{agent_handle}/phone-contact-rules/{rule_id}

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

Path parameters

ParameterTypeDescription
agent_handlestringThe identity's handle
rule_idUUIDRule ID

Response (204)

No content.

Error responses

StatusDescription
403Caller is not admin-scoped
404Rule not found, it belongs to a different identity, or the identity has no phone number

List org phone contact rules GET

GET /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 ordered created_at descending, with id as a stable tiebreaker so pagination stays consistent when rules from different identities share a timestamp.

Query parameters

ParameterTypeDefaultDescription
agent_identity_idUUIDNarrow to one identity by ID; omit to list across every identity in the org
actionstringFilter by "allow" or "block"
match_typestringFilter by match type ("exact_number" is the only value in v1)
limitinteger501–200
offsetinteger0Offset for pagination

Response (200)

Returns a list[ContactRule] ordered newest first — same shape as the per-identity list.

Code examples


Contact rule object

FieldTypeDescription
idstring (UUID)Rule ID
agent_identity_idstring (UUID)The identity this rule protects
actionstring"allow" or "block"
match_typestring"exact_number" (the only value in v1)
match_targetstringThe matched phone number in E.164 format
statusstring"active" or "paused"
created_atstring (ISO 8601)Creation timestamp
updated_atstring (ISO 8601)Last update timestamp

Additional resources

Inkbox

Copyright © 2026 Inkbox

This site is protected by reCAPTCHA.

Google Privacy Policy and Terms of Service apply.

Website

Inkbox

Copyright © 2026 Inkbox

This site is protected by reCAPTCHA.

Google Privacy Policy and Terms of Service apply.

Website

Y CombinatorBacked by Y Combinator
Phone Contact Rules