Skip to content
Inkbox

Inkbox

BlogContactDocs
GuidesAPI Reference

Ctrl K

GuidesAPI Reference

Jump to

Phone Contact Rules

Per-phone-number allow/block rules for inbound calls and text messages. The phone number's filter_mode field decides how the rule list is interpreted:

  • filter_mode: "whitelist" — only callers matching an allow rule can reach the number
  • filter_mode: "blacklist" — every caller can reach the number except those matching a block rule

Set filter_mode on the phone number itself via PATCH /numbers/{phone_number_id} — see Phone numbers. 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" reserves the target slot without taking effect, so you can stage policy changes without losing the uniqueness claim.

Auth. List, get, and create accept admin API keys, claimed agent keys, and Clerk JWT; unclaimed (mid-signup) agent keys are rejected. PATCH, DELETE, and the org-wide list are admin + JWT only.


List contact rules GET

GET /numbers/{phone_number_id}/contact-rules

List contact rules for a phone number, newest first.

Path parameters

ParameterTypeDescription
phone_number_idUUIDPhone number ID

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 /numbers/{phone_number_id}/contact-rules

Create an allow or block rule on a phone number.

Path parameters

ParameterTypeDescription
phone_number_idUUIDPhone number ID

Request body

FieldTypeRequiredDescription
actionstringYes"allow" or "block"
match_typestringNo"exact_number" (default, the only value in v1)
match_targetstringYesE.164 phone number (e.g. +15551234567)

New rules always start with status: "active" — to pause a rule use Update contact rule.

Request example

JSONJSON

Response (201)

Returns the created rule.

Error responses

StatusDescription
409A non-deleted rule with the same (match_type, match_target) already exists. Response body contains existing_rule_id.
422match_target is not a valid E.164 phone number

Code examples


Get contact rule GET

GET /numbers/{phone_number_id}/contact-rules/{rule_id}

Fetch a single contact rule by ID.

Path parameters

ParameterTypeDescription
phone_number_idUUIDPhone number ID
rule_idUUIDRule ID

Code examples


Update contact rule PATCH

PATCH /numbers/{phone_number_id}/contact-rules/{rule_id}

Update a rule's action or status.

Auth: admin API key or Clerk JWT only.

match_type and match_target are immutable — delete the rule and create a new one to change the target.

Path parameters

ParameterTypeDescription
phone_number_idUUIDPhone number ID
rule_idUUIDRule ID

Request body

At least one of:

FieldTypeDescription
actionstring"allow" or "block"
statusstring"active" or "paused" (only these two values are accepted on PATCH; use DELETE to remove a rule)

Sending null for either field is a client error (422) — omit the field to leave it unchanged.

Code examples


Delete contact rule DELETE

DELETE /numbers/{phone_number_id}/contact-rules/{rule_id}

Delete a contact rule. Returns 204 No Content on success.

Auth: admin API key or Clerk JWT only.

Path parameters

ParameterTypeDescription
phone_number_idUUIDPhone number ID
rule_idUUIDRule ID

Code examples


List org phone contact rules GET

GET /phone/contact-rules

Org-wide aggregate list of phone contact rules across every phone number the caller can see. Intended for admin dashboards that render rules org-wide without fanning out one per-number request per number.

Auth: admin API key or Clerk JWT only.

Results are ordered created_at descending, with id as a stable tiebreaker so pagination stays consistent when rules from different numbers share a microsecond.

Query parameters

ParameterTypeDefaultDescription
phone_number_idUUIDNarrow to a single phone number; omit to list across every number in the org
actionstringFilter by "allow" or "block"
match_typestringFilter by match type ("exact_number" is the only value in v1)
limitinteger50Max rules (1–200)
offsetinteger0Offset for pagination

Response (200)

Returns an array of contact rule objects — same shape as the per-number list.

Code examples


Contact rule object

FieldTypeDescription
idUUIDUnique rule identifier
phone_number_idUUIDOwning phone number
actionstring"allow" or "block"
match_typestring"exact_number" (v1)
match_targetstringE.164 phone number
statusstring"active", "paused", or "deleted"
created_atstringCreation timestamp (ISO 8601)
updated_atstringLast-updated timestamp (ISO 8601)

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

Phone Contact Rules