---
title: "Create DNC"
method: POST
path: "/{sub_domain}/api/dnc"
tags: ["DNCs"]
---

# Create DNC

`POST /{sub_domain}/api/dnc`

## Request

- Base URL: `https://api.commpeak.com/dialer`
- URL: `https://api.commpeak.com/dialer/{sub_domain}/api/dnc`
- Auth: API key in header `Authorization`

Add a phone number to your Do Not Call (DNC) list.

**When to use.** Block a single number from being dialed. To approve or unapprove many numbers at once, or to create several in one call, use `POST /dnc/mass`.

**Request body.**

- `phone` (string, required): the phone number to add.
- `approved` (integer, required): approval status, 0 for unapproved or 1 for approved.
- `country_iso` (string): the two-letter country code (for example `US`) used to normalize the number.
- `permanent` (integer): whether the entry is permanent, 0 for no or 1 for yes. Defaults to 0 when omitted.

**Returns.** `{ "dnc": [ <entry> ] }` with the created entry, and HTTP 201. Returns an error if an entry with the same phone number already exists.

**Example.** `{ "phone": "12125551234", "country_iso": "US", "approved": 1, "permanent": 0 }`

## Path parameters

- `sub_domain` string, required: Dialer Name (subdomain)

## Request body

- CreateDNCInput
  - `phone` string, required: Phone number to add to the DNC list.
  - `country_iso` string, required: Country ISO2 code, used to normalize the phone number.
  - `approved` integer, nullable: Whether the DNC is approved: 0 = unapproved, 1 = approved.
  - `permanent` integer, nullable: Whether the DNC is permanent: 0 = no, 1 = yes. Defaults to 0 when omitted.

## Response `201`

Successful Response

- DNCResponse
  - `dnc` DNCItem[], required
    - `id` integer, nullable: DNC ID.
    - `phone` string, nullable: DNC phone number.
    - `lead_id` integer, nullable: Lead ID that the DNC was created from.
    - `campaign_lead_id` integer, nullable: Campaign Lead ID that the DNC was created from, can be null.
    - `approved` integer, nullable: Whether the DNC is approved: 0 = unapproved, 1 = approved.
    - `approved_by_user_id` integer, nullable: ID of the user who approved the DNC.
    - `permanent` integer, nullable: Whether the DNC is permanent: 0 = no, 1 = yes.
    - `first_name` string, nullable: Lead's first name.
    - `last_name` string, nullable: Lead's last name.
    - `username` string, nullable: Username of the user who approved the DNC.
    - `phone_normalized` string, nullable: Lead's phone number normalized.

## Other responses

- `422`: Validation Error

---

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