> ## 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.

# Resync a Lead Ads Page

> Pulls the Page's last **90 days** of leads again (already-stored leads are not duplicated: the pull is idempotent by Meta's `leadgenId`) and, when the link is not subscribed (`subscribedAt: null`), retries the subscription. Takes no body. Answers `202`: the pull runs in the background and can take minutes.

**One resync per link every 10 minutes:** inside that window the answer is `429 RESYNC_COOLDOWN` with `retryAfterSeconds`. If the cooldown cannot be checked, the answer is `503 RESYNC_UNAVAILABLE` rather than an unbounded resync. Ownership is checked again: a Page that is no longer eligible is flagged on the link (`subscriptionError`) and answers `409 PAGE_NOT_ELIGIBLE` with `reason`.

`subscribedAt` and `subscriptionError` are present in the response only when this call retried the subscription. 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 POST /v1/lead-pages/{pageLinkId}/resync
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}/resync:
    post:
      tags:
        - Ads
      summary: Resync a Lead Ads Page
      description: >-
        Pulls the Page's last **90 days** of leads again (already-stored leads
        are not duplicated: the pull is idempotent by Meta's `leadgenId`) and,
        when the link is not subscribed (`subscribedAt: null`), retries the
        subscription. Takes no body. Answers `202`: the pull runs in the
        background and can take minutes.


        **One resync per link every 10 minutes:** inside that window the answer
        is `429 RESYNC_COOLDOWN` with `retryAfterSeconds`. If the cooldown
        cannot be checked, the answer is `503 RESYNC_UNAVAILABLE` rather than an
        unbounded resync. Ownership is checked again: a Page that is no longer
        eligible is flagged on the link (`subscriptionError`) and answers `409
        PAGE_NOT_ELIGIBLE` with `reason`.


        `subscribedAt` and `subscriptionError` are present in the response only
        when this call retried the subscription. 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: post_lead-page-resync
      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:
        '202':
          description: Resync started
          content:
            application/json:
              example:
                started: true
                pageLinkId: cmgpl0001ab12cd34ef56
                subscribedAt: '2026-10-21T10:02:44.000Z'
                subscriptionError: null
        '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
        '409':
          description: >-
            The Page is no longer eligible for this workspace
            (`PAGE_NOT_ELIGIBLE`, with `reason`)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: >-
                  This Page is not available to be linked to this workspace. |
                  Esta página não está disponível para vínculo neste workspace.
                code: PAGE_NOT_ELIGIBLE
                reason: PAGE_NOT_SHARED
        '429':
          description: >-
            A resync of this link ran less than 10 minutes ago. Wait
            `retryAfterSeconds`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                  retryAfterSeconds:
                    type: integer
              example:
                error: >-
                  A sync ran a moment ago. Wait before trying again. |
                  Sincronização feita há pouco. Aguarde para tentar de novo.
                code: RESYNC_COOLDOWN
                retryAfterSeconds: 412
        '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
        '502':
          description: Meta could not be reached. Retry.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: >-
                  Could not reach Meta right now. Try again. | Não foi possível
                  consultar a Meta agora. Tente novamente.
                code: LEADS_LOOKUP_UNAVAILABLE
        '503':
          description: >-
            Lead capture is not configured (`LEADS_NOT_CONFIGURED`), or the
            cooldown could not be checked (`RESYNC_UNAVAILABLE`)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: >-
                  Could not sync right now. Try again in a moment. | Não foi
                  possível sincronizar agora. Tente novamente em instantes.
                code: RESYNC_UNAVAILABLE
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.