---
title: "Create Contact Rule"
method: POST
path: "/api/v1/phone/numbers/{phone_number_id}/contact-rules"
tags: ["Contact Rules"]
deprecated: true
---

# Create Contact Rule

`POST /api/v1/phone/numbers/{phone_number_id}/contact-rules`

## Request

- Base URL: `https://api.inkbox.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.inkbox.ai/api/v1/phone/numbers/{phone_number_id}/contact-rules`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

> **Deprecated.**

## Path parameters

- `phone_number_id` string, uuid, required

## Request body

- PhoneContactRuleCreate
  - `direction` 'inbound' | 'outbound' | 'both'
  - `action` 'allow' | 'block', required
  - `match_type` 'exact_number'
  - `match_target` string, required: Phone number to match, in E.164 format.

## Response `201`

Successful Response

- PhoneContactRuleResponse
  - `id` string, uuid, required
  - `phone_number_id` string, uuid, required
  - `direction` 'inbound' | 'outbound' | 'both'
  - `action` 'allow' | 'block', required
  - `match_type` 'exact_number', required
  - `match_target` string, required
  - `status` 'active' | 'paused' | 'deleted', required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `422`: Validation Error
- `4XX`: Client error with Support Agent information.
- `5XX`: Server error with Support Agent information.

## Changes

- **2026-09-22** `f3dcdb50fbaa`: 2 info
  - added the new optional request property `direction`
  - added the optional property `direction` to the response with the `201` status

[Operation history](https://skmtc.dev/inkbox/apis/inkbox-api/changes/api/v1/phone/numbers/:phone_number_id/contact-rules/post.md)

---

[API](https://skmtc.dev/inkbox/apis/inkbox-api.md) - [All operations](https://skmtc.dev/inkbox/apis/inkbox-api/llms.txt) - [OpenAPI document](https://skmtc.dev/inkbox/apis/inkbox-api/revisions/3e862146bf53?raw)
