> ## Documentation Index
> Fetch the complete documentation index at: https://docs.weya.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Add to DNC List

> Add a phone number to the Do Not Call (DNC) list for your organization.

## Overview

Add a phone number to your organization's Do Not Call (DNC) list. Once added, this number will be excluded from future outbound calling campaigns. The system automatically sends a notification email to the organization admin when a number is added to the DNC list.

## Prerequisites

* Bearer token for authenticated workspace access
* Valid `batchId` that exists in your workspace
* Valid `requestUUID` from a call record in the specified batch

## Request

<ParamField header="Authorization" type="string" required>
  Bearer token for the authenticated workspace account.
</ParamField>

<ParamField body="phoneNumber" type="string" required>
  Phone number to add to the DNC list with country code (e.g., "12125551234"). The `+` prefix is optional.
</ParamField>

<ParamField body="batchId" type="string" required>
  ID of the batch associated with the call that triggered this DNC request.
</ParamField>

<ParamField body="requestUUID" type="string" required>
  Unique identifier (UUID) of the specific call record from the batch's phone logs.
</ParamField>

<ParamField body="type" type="string">
  Optional classification for the DNC entry (e.g., "customer\_request", "complaint", etc.).
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl --location '{{baseUrl}}/api/dnc/add' \
    --header 'Authorization: Bearer {{authToken}}' \
    --header 'Content-Type: application/json' \
    --data '{
      "phoneNumber": "12125551234",
      "batchId": "64e5f12345abcdef98765432",
      "requestUUID": "550e8400-e29b-41d4-a716-446655440000",
      "type": "customer_request"
    }'
  ```
</RequestExample>

## Response

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "message": "Phone number added to DNC successfully",
    "status": true,
    "code": 200,
    "errorMessage": ""
  }
  ```
</ResponseExample>

<ResponseField name="message" type="string" required>
  Success message confirming the phone number was added to the DNC list.
</ResponseField>

<ResponseField name="status" type="boolean" required>
  Indicates whether the operation was successful.
</ResponseField>

<ResponseField name="code" type="integer" required>
  HTTP status code (200 for success).
</ResponseField>

## Error Handling

* **400 Bad Request** – Missing required fields (`phoneNumber`, `batchId`, or `requestUUID`), or phone number already exists in DNC for this organization.
* **404 Not Found** – Batch not found, user not found for the batch, or call record not found for the given `batchId` and `requestUUID`.
* **500 Internal Server Error** – Server error while processing the request.

<Note>
  When a phone number is added to the DNC list, the system automatically:

  * Links the DNC entry to your organization
  * Associates it with the batch and call record
  * Stores call recording and transcription data (if available)
  * Sends an email notification to your organization's admin
</Note>


## OpenAPI

````yaml POST /api/dnc/add
openapi: 3.1.0
info:
  title: Weya AI Public API
  description: >-
    Public API documentation for Weya AI platform - Call Management and DNC (Do
    Not Call) APIs
  version: 1.0.0
servers:
  - url: >-
      https://nexusdev-wjs-api-dev.mangoforest-291de162.swedencentral.azurecontainerapps.io
    description: Development server
security:
  - bearerAuth: []
  - apiKeyAuth: []
paths:
  /api/dnc/add:
    post:
      tags:
        - DNC (Do Not Call)
      summary: Add to DNC list
      description: Add a phone number to your organization's Do Not Call (DNC) list
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - phoneNumber
                - batchId
                - requestUUID
              properties:
                phoneNumber:
                  type: string
                  example: '12125551234'
                type:
                  type: string
                  example: manual
                batchId:
                  type: string
                  example: 64e5f12345abcdef98765432
                requestUUID:
                  type: string
                  example: some-unique-uuid
      responses:
        '200':
          description: Phone number added to DNC successfully
        '400':
          description: Missing required fields or phone number already exists
        '404':
          description: Batch or Call record not found
        '500':
          description: Internal Server Error
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer token authentication for workspace access
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key used for programmatic calling integrations. Find it under
        Settings → API access in your workspace.

````