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

# Delete leads

> **Delete leads from a campaign**

Delete one or more leads from a campaign. Only pending leads (not yet sent) can be deleted.

## Important Notes

- Only leads with PENDING status can be deleted
- Leads that have already received emails cannot be deleted
- This action cannot be undone

## Example Usage

```python
import requests

campaign_id = "550e8400-e29b-41d4-a716-446655440000"
lead_ids = [
    "650e8400-e29b-41d4-a716-446655440000",
    "750e8400-e29b-41d4-a716-446655440000"
]

response = requests.delete(
    f"https://api.coldsend.io/api/public/v1/campaigns/{campaign_id}/leads",
    headers={"X-API-Key": "your-api-key"},
    json=lead_ids
)

print(response.json())
```



## OpenAPI

````yaml /public_openapi.json delete /api/public/v1/campaigns/{campaign_id}/leads
openapi: 3.0.3
info:
  title: ColdSend Public API
  description: >-
    Programmatic access to ColdSend for managing cold email campaigns and sender
    accounts.
  version: 1.0.0
  contact:
    name: ColdSend Support
    email: support@coldsend.pro
    url: https://coldsend.pro
servers:
  - url: https://api.coldsend.pro
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /api/public/v1/campaigns/{campaign_id}/leads:
    delete:
      tags:
        - Leads
      summary: Delete leads
      description: >-
        **Delete leads from a campaign**


        Delete one or more leads from a campaign. Only pending leads (not yet
        sent) can be deleted.


        ## Important Notes


        - Only leads with PENDING status can be deleted

        - Leads that have already received emails cannot be deleted

        - This action cannot be undone


        ## Example Usage


        ```python

        import requests


        campaign_id = "550e8400-e29b-41d4-a716-446655440000"

        lead_ids = [
            "650e8400-e29b-41d4-a716-446655440000",
            "750e8400-e29b-41d4-a716-446655440000"
        ]


        response = requests.delete(
            f"https://api.coldsend.io/api/public/v1/campaigns/{campaign_id}/leads",
            headers={"X-API-Key": "your-api-key"},
            json=lead_ids
        )


        print(response.json())

        ```
      operationId: delete_leads_api_public_v1_campaigns__campaign_id__leads_delete
      parameters:
        - name: campaign_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Campaign Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                type: string
                format: uuid
              title: Lead Ids
      responses:
        '200':
          description: Leads deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeadDeleteResponse'
        '400':
          description: Cannot delete leads - check campaign status
        '401':
          description: Missing or invalid API key
        '403':
          description: Insufficient permissions - requires 'leads:delete' scope
        '404':
          description: Campaign not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    LeadDeleteResponse:
      properties:
        success:
          type: boolean
          title: Success
        message:
          type: string
          title: Message
        deleted_count:
          type: integer
          title: Deleted Count
          description: Number of leads deleted
        failed_count:
          type: integer
          title: Failed Count
          description: Number of deletions that failed
        errors:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Errors
          description: Errors for failed deletions
      type: object
      required:
        - success
        - message
        - deleted_count
        - failed_count
      title: LeadDeleteResponse
      description: Response for lead deletion.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key with format cs_live_xxx

````