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

# Add Blocked Numbers

> Add one or more phone numbers to an agent's block list.

Adds phone numbers to an agent's block list. The API key must belong to the supplied user, and that user must have access to the agent.

The response separates numbers that were added from numbers that failed validation or were already blocked. Handle both arrays because a request can partially succeed.


## OpenAPI

````yaml POST /agent-block-list
openapi: 3.0.1
info:
  title: Phonely API
  description: API for Phonely services including agent management and call summaries
  version: 1.0.0
servers:
  - url: https://app.phonely.ai/api
security: []
paths:
  /agent-block-list:
    post:
      summary: Add phone numbers to block list
      description: Adds phone numbers to an agent's block list
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BlockListRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BlockListUpdateResponse'
        '400':
          description: Invalid request body or numbers parameter
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    BlockListRequest:
      type: object
      required:
        - uid
        - agentId
        - numbers
      properties:
        uid:
          type: string
          description: User ID
        agentId:
          type: string
          description: The ID of the agent
        numbers:
          type: array
          minItems: 1
          items:
            type: string
          description: Array of phone numbers to add or remove from the block list
    BlockListUpdateResponse:
      type: object
      required:
        - message
        - added
        - failed
      properties:
        message:
          type: string
          description: Success message
        added:
          type: array
          items:
            type: string
          description: Array of phone numbers that were successfully added
        failed:
          type: array
          items:
            $ref: '#/components/schemas/BlockListFailure'
          description: Array of numbers that failed to be added and the reason
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error code or identifier
        message:
          type: string
          description: Detailed error message
    BlockListFailure:
      type: object
      required:
        - number
        - reason
      properties:
        number:
          type: string
          description: The phone number that failed
        reason:
          type: string
          description: Reason for failure
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Authorization

````