---
title: "Create a Dynamic Caller ID rule"
method: POST
path: "/dynamic_caller_ids"
tags: ["Dynamic-Caller-IDs"]
---

# Create a Dynamic Caller ID rule

`POST /dynamic_caller_ids`

## Request

- Base URL: `https://api.commpeak.com/portal`
- URL: `https://api.commpeak.com/portal/dynamic_caller_ids`
- Auth: API key in header `Authorization`

Creates a Dynamic Caller ID rule. `condition` and `action` are required; `prefix` is required for the `country` and `prefix` conditions and `caller_id_number` for the `fixed` action. The `blocked` action is available only to accounts allowed to use any Caller ID. Trial accounts can only create a rule for all destinations with their verified phone number. Returns 422 with `errors` when the rule is rejected.

## Request body

- DynamicCallerIdRequest: Body of `POST /portal/dynamic_caller_ids` and `PUT /portal/dynamic_caller_ids/{id}`.
  - `dynamic_caller_id` DynamicCallerIdInput, required: Rule settings. `condition` and `action` are required on create; on update only the fields sent are changed.
    - `name` string, nullable: Rule name.
    - `condition` string, nullable: Destinations the rule applies to: `any`, `country` or `prefix` (required on create).
    - `prefix` string, nullable: Country dialing code (`country`) or destination prefix (`prefix`); required for those conditions.
    - `action` string, nullable: `from` passes the caller's Caller ID, `blocked` makes it anonymous, `fixed` replaces it (required on create).
    - `caller_id_number` string, nullable: Caller ID number for `fixed` (required for it).
    - `caller_id_name` string, nullable: Caller ID name for `fixed`.

## Response `201`

Successful Response

- DynamicCallerIdResponse: Envelope returned by the single-rule methods.
  - `dynamic_caller_id` DynamicCallerIdItem, required: A Dynamic Caller ID rule: which Caller ID is presented for calls of a SIP account.
    - `id` integer, required: Rule identifier.
    - `name` string, nullable: Rule name.
    - `condition` string, nullable: Destinations the rule applies to: `any`, `country` or `prefix`.
    - `prefix` string, nullable: Country dialing code or destination prefix (empty for `any`).
    - `action` string, nullable: `from`, `blocked` or `fixed`.
    - `caller_id_number` string, nullable: Caller ID number for `fixed`.
    - `caller_id_name` string, nullable: Caller ID name for `fixed`.
    - `verified` boolean, nullable: False when the `fixed` Caller ID is not verified; such rules can't be assigned to SIP accounts.
    - `sip_accounts` string[], nullable: Display tokens of the SIP accounts using the rule.

## Other responses

- `422`: Validation Error

---

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