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

# Add Leads to Workspace-Blocklist

> Blocks specific contacts at the workspace level using their LinkedIn public identifiers. Once blocked at workspace level, these leads will not receive messages from any campaign in the workspace.

## Overview

Blocks specific contacts at the workspace level using their LinkedIn public identifiers. Once blocked at workspace level, these leads will not receive messages from any campaign in the workspace.

## Use Cases

* **Global Block List**: Block contacts across all campaigns in your workspace
* **Compliance Management**: Maintain a centralized list of contacts who should not be contacted
* **Protect Relationships**: Prevent outreach to existing clients, partners, or sensitive contacts
* **Quality Control**: Block leads that consistently don't match your targeting criteria

## Authentication

All requests require an API key passed in the `x-api-key` header. You can generate your API key from the WaLead dashboard.

## Example Request

```bash theme={null}
curl -X POST https://app-api.walead.ai/api/v1/blocked-leads \
  -H "x-api-key: YOUR_API_KEY_HERE" \
  -H "Content-Type: application/json" \
  -d '{
    "leads": [
      {
        "publicIdentifier": "john-doe",
        "reason": "Existing client"
      },
      {
        "publicIdentifier": "jane-smith",
        "reason": "Requested opt-out"
      }
    ]
  }'
```

## Request Details

This endpoint requires an API key for authentication and accepts an array of lead objects with their LinkedIn public identifiers and optional blocking reasons.

### Request Body

The body should contain:

* **leads** (required): Array of objects with:
  * **publicIdentifier** (required): LinkedIn public identifier
  * **reason** (optional): Reason for blocking this lead

### Public Identifiers

The `publicIdentifier` field should contain LinkedIn profile identifiers (the username part of a LinkedIn URL). For example, from `linkedin.com/in/john-doe`, the public identifier would be `john-doe`.

## Important Notes

* The `leads` array is required and must not be empty
* You can block multiple leads in a single request
* Blocked leads at workspace level are excluded from **all campaigns** in the workspace
* The `reason` field is optional but recommended for tracking purposes
* This is a public route that requires API key authentication
* Workspace-level blocks take precedence over campaign-specific settings

## Example Request Body

```json theme={null}
{
  "leads": [
    {
      "publicIdentifier": "john-doe",
      "reason": "Existing client"
    },
    {
      "publicIdentifier": "jane-smith",
      "reason": "Requested opt-out"
    }
  ]
}
```


## OpenAPI

````yaml POST /v1/blocked-leads
openapi: 3.1.0
info:
  title: WaLead API
  description: >-
    WaLead Public API for managing LinkedIn outreach campaigns, leads, and
    analytics
  version: 1.0.0
  contact:
    name: WaLead Support
    url: https://walead.ai
servers:
  - url: https://app-api.walead.ai/api
    description: Production server
security:
  - apiKeyAuth: []
paths:
  /v1/blocked-leads:
    post:
      summary: Add Leads to Workspace-Blocklist
      description: >-
        Blocks specific contacts at the workspace level using their LinkedIn
        public identifiers. Once blocked at workspace level, these leads will
        not receive messages from any campaign in the workspace.
      requestBody:
        description: Leads to block with LinkedIn public identifiers
        content:
          application/json:
            schema:
              type: object
              required:
                - leads
              properties:
                leads:
                  type: array
                  items:
                    type: object
                    required:
                      - publicIdentifier
                    properties:
                      publicIdentifier:
                        type: string
                        description: LinkedIn public identifier (e.g., 'john-doe')
                      reason:
                        type: string
                        description: Optional reason for blocking this lead
                  description: Array of lead objects to block
        required: true
      responses:
        '200':
          description: Leads blocked successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Whether the operation was successful
                  message:
                    type: string
                    description: Response message
                  blocked:
                    type: integer
                    description: Number of leads blocked
        '400':
          description: Bad request - leads array is required and must not be empty
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized - Invalid API Key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      required:
        - statusCode
        - message
      properties:
        statusCode:
          type: integer
          description: HTTP status code
        message:
          type: string
          description: Error message
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication. Generate from your WaLead dashboard.

````