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

> ## Agent Instructions
> Integrating Pilot Status end to end? Follow https://docs.pilotstatus.com.br/guides/integrate-with-ai.md (pt-BR: https://docs.pilotstatus.com.br/pt-BR/guides/integrate-with-ai.md). No step requires contacting support: every credential is shown in the dashboard or in an API response, and a lost one is regenerated, not recovered.
> Webhook signing secret: shown ONCE in the Signing secret window right after creating the webhook on /webhooks, and in the `secret` field of the POST /v1/webhooks response (MCP: webhooks_create). Lost it: Edit Webhook → Generate a new secret, POST /v1/webhooks/{id}/rotate-secret, or webhooks_rotate_secret (the old one stops working at once). Verify `x-pilot-status-signature` = hex HMAC-SHA256 of the raw request body keyed with that secret.
> Meta verify token (number connected with the user's own Meta app credentials): Meta Number Created! window after connecting, then the number's card on Numbers (workspace Owner), or webhook.verifyToken in the POST /v1/numbers/meta response. It is not the webhook signing secret.
> REST auth: `x-api-key: ps_...` header, never Authorization: Bearer. MCP: https://mcp.pilotstatus.com.br/mcp (148 tools, OAuth 2.1 or x-api-key); Code Mode: https://mcp.pilotstatus.com.br/code. Destructive MCP tools return a preview and a confirm_token: show the preview and call again only after the user's explicit yes. Over OAuth, revealing or creating ps_ API keys is workspace Owner only.

# Resincronizar una página de Lead Ads

> Vuelve a traer los leads de los últimos **90 días** de la página (los leads ya guardados no se duplican: la descarga es idempotente por el `leadgenId` de Meta) y, cuando el vínculo no está suscrito (`subscribedAt: null`), reintenta la suscripción. No recibe cuerpo. Responde `202`: la descarga corre en segundo plano y puede tardar minutos.

**Un resync por vínculo cada 10 minutos:** dentro de esa ventana la respuesta es `429 RESYNC_COOLDOWN` con `retryAfterSeconds`. Si no se puede verificar el periodo de espera, la respuesta es `503 RESYNC_UNAVAILABLE` en lugar de un resync sin límite. La propiedad se verifica de nuevo: una página que ya no es elegible queda marcada en el vínculo (`subscriptionError`) y responde `409 PAGE_NOT_ELIGIBLE` con `reason`.

`subscribedAt` y `subscriptionError` aparecen en la respuesta solo cuando esta llamada reintentó la suscripción. Los tokens OAuth/MCP necesitan `integrations:manage` (ADMIN u OWNER del workspace) en todos los verbos, incluidas las lecturas. Alcance: una key limitada a un número, o una credencial de toda la cuenta con `x-whatsapp-number-id`, actúa solo sobre los vínculos de ese número; una credencial de toda la cuenta sin el header ve todo el workspace.



## OpenAPI

````yaml openapi.es.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: >-
    API REST pública de Pilot Status. Autentícate con el encabezado `x-api-key:
    ps_...` (o `x-api-key-id`). URL base: https://pilotstatus.com.br
servers:
  - url: https://pilotstatus.com.br
security:
  - apiKey: []
  - apiKeyId: []
paths:
  /v1/lead-pages/{pageLinkId}/resync:
    post:
      tags:
        - Ads
      summary: Resincronizar una página de Lead Ads
      description: >-
        Vuelve a traer los leads de los últimos **90 días** de la página (los
        leads ya guardados no se duplican: la descarga es idempotente por el
        `leadgenId` de Meta) y, cuando el vínculo no está suscrito
        (`subscribedAt: null`), reintenta la suscripción. No recibe cuerpo.
        Responde `202`: la descarga corre en segundo plano y puede tardar
        minutos.


        **Un resync por vínculo cada 10 minutos:** dentro de esa ventana la
        respuesta es `429 RESYNC_COOLDOWN` con `retryAfterSeconds`. Si no se
        puede verificar el periodo de espera, la respuesta es `503
        RESYNC_UNAVAILABLE` en lugar de un resync sin límite. La propiedad se
        verifica de nuevo: una página que ya no es elegible queda marcada en el
        vínculo (`subscriptionError`) y responde `409 PAGE_NOT_ELIGIBLE` con
        `reason`.


        `subscribedAt` y `subscriptionError` aparecen en la respuesta solo
        cuando esta llamada reintentó la suscripción. Los tokens OAuth/MCP
        necesitan `integrations:manage` (ADMIN u OWNER del workspace) en todos
        los verbos, incluidas las lecturas. Alcance: una key limitada a un
        número, o una credencial de toda la cuenta con `x-whatsapp-number-id`,
        actúa solo sobre los vínculos de ese número; una credencial de toda la
        cuenta sin el header ve todo el workspace.
      operationId: post_lead-page-resync
      parameters:
        - name: pageLinkId
          in: path
          required: true
          description: >-
            El id del vínculo (`linked[].pageLinkId` de `GET /v1/lead-pages`),
            no el id de la página de Facebook.
          schema:
            type: string
          example: cmgpl0001ab12cd34ef56
        - name: x-whatsapp-number-id
          in: header
          required: false
          description: >-
            Restringe una credencial de toda la cuenta a un número (su id o el
            id de instancia de `GET /v1/numbers`). Sin él, una credencial de
            toda la cuenta ve todo el workspace; una key limitada a un número
            siempre ve solo su propio número.
          schema:
            type: string
          example: num_01HZX...
      responses:
        '202':
          description: Resync iniciado
          content:
            application/json:
              example:
                started: true
                pageLinkId: cmgpl0001ab12cd34ef56
                subscribedAt: '2026-10-21T10:02:44.000Z'
                subscriptionError: null
        '400':
          description: >-
            `NUMBER_REQUIRED` (un permiso OAuth por número sin
            `x-whatsapp-number-id`) o `NUMBER_NOT_FOUND` (una key limitada a un
            número cuyo número fue eliminado)
          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: Encabezado `x-api-key` / `x-api-key-id` ausente o inválido
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Unauthorized
        '403':
          description: >-
            El número está fuera del alcance de la credencial
            (`NUMBER_NOT_IN_GRANT`), o un token OAuth cuyo rol en el workspace
            no tiene `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: >-
            Vínculo de página no encontrado: nunca se vinculó, ya se desvinculó
            o es de otro workspace
          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: >-
            La página ya no es elegible para este workspace
            (`PAGE_NOT_ELIGIBLE`, con `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: >-
            Un resync de este vínculo se ejecutó hace menos de 10 minutos.
            Espera `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: Error interno
          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: No se pudo contactar a Meta. Reintenta.
          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: >-
            La captura de leads no está configurada (`LEADS_NOT_CONFIGURED`), o
            no se pudo verificar el periodo de espera (`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: Tu API key ps_
    apiKeyId:
      type: apiKey
      in: header
      name: x-api-key-id
      description: Id de la API key (alternativa a x-api-key)

````

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