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

# Unlink a Lead Ads Page

> Unlinks the Page. ⚠️ **Irreversible for the data: every lead captured through this link is erased** (personal data deleted; the lead stops being listed and counted) **and the link's form configurations are deleted.** `deletedLeads` says how many leads were erased. The Page can be linked again later, but the erased leads do not come back — not even through a resync.

Pilot Status also unsubscribes from the Page's leads on Meta, best effort: if Meta fails, the unlink still goes through and no further lead is stored. OAuth/MCP tokens need `integrations:manage` (workspace ADMIN or OWNER) on every verb, reads included. Scope: a number-scoped key, or an account-wide credential with `x-whatsapp-number-id`, acts only on that number's links; an account-wide credential without the header sees the whole workspace.



## OpenAPI

````yaml openapi.json DELETE /v1/lead-pages/{pageLinkId}
openapi: 3.1.0
info:
  title: Pilot Status API
  version: 1.0.0
  license:
    name: Pilot Status Terms of Service
    url: https://pilotstatus.com.br/terms
  description: >-
    Public REST API for Pilot Status. Authenticate with the `x-api-key: ps_...`
    header (or `x-api-key-id`). Base URL: https://pilotstatus.com.br
servers:
  - url: https://pilotstatus.com.br
security:
  - apiKey: []
  - apiKeyId: []
paths:
  /v1/lead-pages/{pageLinkId}:
    delete:
      tags:
        - Ads
      summary: Unlink a Lead Ads Page
      description: >-
        Unlinks the Page. ⚠️ **Irreversible for the data: every lead captured
        through this link is erased** (personal data deleted; the lead stops
        being listed and counted) **and the link's form configurations are
        deleted.** `deletedLeads` says how many leads were erased. The Page can
        be linked again later, but the erased leads do not come back — not even
        through a resync.


        Pilot Status also unsubscribes from the Page's leads on Meta, best
        effort: if Meta fails, the unlink still goes through and no further lead
        is stored. OAuth/MCP tokens need `integrations:manage` (workspace ADMIN
        or OWNER) on every verb, reads included. Scope: a number-scoped key, or
        an account-wide credential with `x-whatsapp-number-id`, acts only on
        that number's links; an account-wide credential without the header sees
        the whole workspace.
      operationId: delete_lead-page
      parameters:
        - name: pageLinkId
          in: path
          required: true
          description: >-
            The link id (`linked[].pageLinkId` from `GET /v1/lead-pages`), not
            the Facebook Page id.
          schema:
            type: string
          example: cmgpl0001ab12cd34ef56
        - name: x-whatsapp-number-id
          in: header
          required: false
          description: >-
            Narrows an account-wide credential to one number (its id or instance
            id from `GET /v1/numbers`). Without it, an account-wide credential
            sees the whole workspace; a number-scoped key always sees only its
            own number.
          schema:
            type: string
          example: num_01HZX...
      responses:
        '200':
          description: Page unlinked; its leads erased
          content:
            application/json:
              example:
                unlinked: true
                pageLinkId: cmgpl0001ab12cd34ef56
                deletedLeads: 42
        '400':
          description: >-
            `NUMBER_REQUIRED` (a per-number OAuth grant without
            `x-whatsapp-number-id`) or `NUMBER_NOT_FOUND` (a number-scoped key
            whose number was deleted)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: >-
                  Provide x-whatsapp-number-id for a per-number connection |
                  Envie o header x-whatsapp-number-id para uma conexão por
                  número
                code: NUMBER_REQUIRED
        '401':
          description: Missing or invalid `x-api-key` / `x-api-key-id` header
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Unauthorized
        '403':
          description: >-
            The number is outside the credential's scope
            (`NUMBER_NOT_IN_GRANT`), or an OAuth token whose workspace role
            lacks `integrations:manage` (`PERMISSION_DENIED`)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: >-
                  This credential is not granted access to that WhatsApp number
                  | Esta credencial não tem acesso a esse número de WhatsApp
                code: NUMBER_NOT_IN_GRANT
        '404':
          description: >-
            Page link not found: never linked, already unlinked, or another
            workspace's
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Page link not found | Vínculo de página não encontrado
                code: NOT_FOUND
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Internal server error | Erro interno do servidor
                code: INTERNAL_ERROR
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Your ps_ API key
    apiKeyId:
      type: apiKey
      in: header
      name: x-api-key-id
      description: API key id (alternative to x-api-key)

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.