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

# Exclude a contact

> Retires one contact for this campaign with status `excluded`. Terminal — the
contact is never dialed by this campaign again, and re-enrolling does not revive
it. The underlying lead is untouched. Required scope `campaigns:manage`.


Removes one contact from a campaign. The enrollment moves to `excluded` with `stop_hit: true` and `stop_reason: "manual"`, and this campaign never calls that person again.

Exclusion is **terminal for this campaign**. There is no un-exclude: re-enrolling the same lead through `POST /campaigns/{id}/leads` will not resurrect it, because the enrollment still exists in its excluded state. To call that person again, enroll them in a different campaign.

Required scope: `campaigns:manage`.

## Path parameters

| Parameter | Type | Notes                                                                                                                                        |
| --------- | ---- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`      | uuid | Campaign ID. Must belong to the API key's workspace.                                                                                         |
| `lead_id` | uuid | The **lead** ID, not the enrollment ID. This is `lead_id` from `GET /campaigns/{id}/leads`, and it is also the ID you get from `GET /leads`. |

There is no request body.

## What exclusion does and does not do

* **Does** stop this campaign calling the contact, from any state — `pending`, `scheduled`, and mid-flight states alike.
* **Does not** cancel a call already in progress. If the contact is `dialing`, that call completes and gets categorized normally; the exclusion prevents any further attempt.
* **Does not** delete the lead. The lead and its history remain in `GET /leads`.
* **Does not** add the number to the do-not-call list. Excluding is a scheduling decision about one campaign; suppressing a person everywhere is `POST /do-not-call`, which blocks them across every campaign and every direct call.
* **Does not** decrement `total_leads`. `GET /campaigns/{id}/stats` reports the contact under `excluded` so the campaign's history stays complete.

Use `POST /do-not-call` instead when someone asks not to be contacted. A verbal opt-out during a call is added to that list automatically, workspace-wide, without you having to exclude anyone by hand.

## Example request

```bash theme={null}
curl -X DELETE "https://api.goyappr.com/campaigns/CAMPAIGN_ID/leads/LEAD_ID" \
  -H "Authorization: Bearer $YAPPR_API_KEY"
```

## Example response

```json theme={null}
{
  "campaign_id": "b3f1c0d2-5a44-4f0e-9c11-7a2e8d3f0001",
  "lead_id": "a1c3e5f7-0000-4b21-9c30-000000000021",
  "status": "excluded",
  "company_id": "fe493f11-0000-0000-0000-000000000001"
}
```

Excluding a contact that is already excluded returns the same 200 response — the operation is idempotent.

## Errors

| HTTP | Code                 | When                                                                                       |
| ---- | -------------------- | ------------------------------------------------------------------------------------------ |
| 400  | —                    | The lead ID is missing from the path (`DELETE /campaigns/{id}/leads` with no trailing ID). |
| 401  | `INSUFFICIENT_SCOPE` | API key lacks `campaigns:manage`.                                                          |
| 404  | —                    | No campaign with that ID in this workspace, or it has been archived.                       |
| 404  | —                    | That lead is not enrolled in this campaign.                                                |
| 500  | —                    | The exclusion write failed. The enrollment is unchanged; safe to retry.                    |


## OpenAPI

````yaml DELETE /campaigns/{id}/leads/{lead_id}
openapi: 3.1.0
info:
  title: Yappr API
  description: >
    Create and manage AI voice agents, purchase phone numbers, configure tools,
    and initiate calls — all via REST.
  version: 1.0.0
  contact:
    url: https://goyappr.com
servers:
  - url: https://api.goyappr.com
    description: Production
security:
  - apiKey: []
paths:
  /campaigns/{id}/leads/{lead_id}:
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
          format: uuid
      - in: path
        name: lead_id
        required: true
        schema:
          type: string
          format: uuid
        description: Lead ID (not the `CampaignContact.id`).
    delete:
      tags:
        - Campaigns
      summary: Exclude contact
      description: >
        Retires one contact for this campaign with status `excluded`. Terminal —
        the

        contact is never dialed by this campaign again, and re-enrolling does
        not revive

        it. The underlying lead is untouched. Required scope `campaigns:manage`.
      operationId: excludeCampaignContact
      responses:
        '200':
          description: Contact excluded
          content:
            application/json:
              schema:
                type: object
                properties:
                  campaign_id:
                    type: string
                    format: uuid
                  lead_id:
                    type: string
                    format: uuid
                  status:
                    type: string
                    example: excluded
                  company_id:
                    type: string
                    format: uuid
        '400':
          description: No lead ID in the path
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Campaign not found, or that lead is not enrolled in it
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Your Yappr API key (e.g. `ypr_live_...`). Generate one in the dashboard
        under **Settings → API Keys**.

````