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

# Listar webhooks de línea

> Devuelve `{ "webhooks": [ … ], "events": [ … ] }`: todos los webhooks de líneas telefónicas de tu workspace, **del más antiguo al más reciente**, y el catálogo de eventos a los que puedes suscribirte. **El secreto de firma nunca se devuelve aquí**: solo una vez, en `POST /v1/phone-lines/webhooks`.

Permisos: con una clave de cuenta (`ps_account_`) o un token OAuth / MCP, el usuario debe ser **Owner o Admin** (`phone_lines:webhooks`); en otro caso, `403 PERMISSION_DENIED`.

Todo endpoint `/v1/phone-lines` acepta solo una clave **con alcance de tenant**: los webhooks de líneas telefónicas pertenecen al workspace, no a un número de WhatsApp, así que una clave con alcance de número (o un permiso OAuth por número) recibe `403 NUMBER_SCOPE_NOT_ALLOWED` antes de revisar cualquier rol. Un `403 PERMISSION_DENIED` / `WORKSPACE_MEMBERSHIP_REQUIRED` se envía con `Cache-Control: no-store`.

Estos son los **webhooks de líneas telefónicas**, un registro separado de `/v1/webhooks`: reciben solo eventos `phone_line.*`, y un webhook de número nunca recibe uno.

**Requiere una clave con alcance de tenant.**



## OpenAPI

````yaml openapi.es.json GET /v1/phone-lines/webhooks
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/phone-lines/webhooks:
    get:
      tags:
        - Phone Lines
      summary: Listar webhooks de líneas telefónicas
      description: >-
        Devuelve `{ "webhooks": [ … ], "events": [ … ] }`: todos los webhooks de
        líneas telefónicas de tu workspace, **del más antiguo al más reciente**,
        y el catálogo de eventos a los que puedes suscribirte. **El secreto de
        firma nunca se devuelve aquí**: solo una vez, en `POST
        /v1/phone-lines/webhooks`.


        Permisos: con una clave de cuenta (`ps_account_`) o un token OAuth /
        MCP, el usuario debe ser **Owner o Admin** (`phone_lines:webhooks`); en
        otro caso, `403 PERMISSION_DENIED`.


        Todo endpoint `/v1/phone-lines` acepta solo una clave **con alcance de
        tenant**: los webhooks de líneas telefónicas pertenecen al workspace, no
        a un número de WhatsApp, así que una clave con alcance de número (o un
        permiso OAuth por número) recibe `403 NUMBER_SCOPE_NOT_ALLOWED` antes de
        revisar cualquier rol. Un `403 PERMISSION_DENIED` /
        `WORKSPACE_MEMBERSHIP_REQUIRED` se envía con `Cache-Control: no-store`.


        Estos son los **webhooks de líneas telefónicas**, un registro separado
        de `/v1/webhooks`: reciben solo eventos `phone_line.*`, y un webhook de
        número nunca recibe uno.


        **Requiere una clave con alcance de tenant.**
      operationId: get_phone_lines_webhooks
      parameters:
        - name: x-workspace-id
          in: header
          required: false
          schema:
            type: string
          description: >-
            Solo con una clave de cuenta (`ps_account_`): el workspace sobre el
            que actuar, de `GET /v1/workspaces`. Sin él, una clave de cuenta
            recibe `400 WORKSPACE_ID_REQUIRED`.
          example: cmh2a9z8y0002ws8example1q
      responses:
        '200':
          description: Los webhooks y el catálogo de eventos
          content:
            application/json:
              schema:
                type: object
                properties:
                  webhooks:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: >-
                            El id del webhook. Úsalo en todas las rutas
                            `/v1/phone-lines/webhooks/{id}`.
                          example: cmh1w8b2k0001wh8example3d
                        name:
                          type: string
                          description: >-
                            Hasta 100 caracteres. **Nunca vacío:** si se crea o
                            edita en blanco, es el host de la URL
                            (`hooks.example.com`). No se envía en las entregas:
                            el `name` de una entrega es el de la línea.
                          example: hooks.example.com
                        url:
                          type: string
                          description: El destino `https`, normalizado.
                          example: https://hooks.example.com/pilot/phone-lines
                        events:
                          type: array
                          items:
                            type: string
                          description: >-
                            Los eventos suscritos, o `["*"]`: todos los eventos
                            de líneas telefónicas, incluidos los que se agreguen
                            después.
                          example:
                            - '*'
                        active:
                          type: boolean
                          description: '`false` = pausado: no recibe entregas.'
                          example: true
                        lastDeliveryAt:
                          type:
                            - string
                            - 'null'
                          format: date-time
                          description: >-
                            ISO 8601: la última entrega **exitosa**, `null`
                            antes de la primera. Un intento fallido no la
                            cambia.
                          example: '2026-10-27T14:11:51.000Z'
                        lastStatusCode:
                          type:
                            - integer
                            - 'null'
                          description: >-
                            El último estado HTTP que respondió tu endpoint,
                            exitoso o no, `null` cuando no hay ninguno.
                          example: 200
                        createdAt:
                          type: string
                          format: date-time
                          description: 'ISO 8601: cuándo se creó el webhook.'
                          example: '2026-10-27T13:58:02.000Z'
                  events:
                    type: array
                    items:
                      type: string
                    description: >-
                      Todos los nombres de eventos de líneas telefónicas. `"*"`
                      no está en la lista, pero se acepta en `events`.
                    example:
                      - phone_line.purchased
                      - phone_line.audio_received
                      - phone_line.code_received
                      - phone_line.code_failed
                      - phone_line.renewed
                      - phone_line.payment_failed
                      - phone_line.suspended
                      - phone_line.returned
                      - phone_line.canceled
                      - phone_line.verification_updated
              example:
                webhooks:
                  - id: cmh1w8b2k0001wh8example3d
                    name: hooks.example.com
                    url: https://hooks.example.com/pilot/phone-lines
                    events:
                      - '*'
                    active: true
                    lastDeliveryAt: '2026-10-27T14:11:51.000Z'
                    lastStatusCode: 200
                    createdAt: '2026-10-27T13:58:02.000Z'
                events:
                  - phone_line.purchased
                  - phone_line.audio_received
                  - phone_line.code_received
                  - phone_line.code_failed
                  - phone_line.renewed
                  - phone_line.payment_failed
                  - phone_line.suspended
                  - phone_line.returned
                  - phone_line.canceled
                  - phone_line.verification_updated
        '401':
          description: >-
            Credencial ausente o inválida (`x-api-key`, `x-api-key-id` o
            `Authorization: Bearer`). El cuerpo trae solo `error`, sin `code`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              examples:
                missing:
                  summary: No credential
                  value:
                    error: >-
                      Missing x-api-key, x-api-key-id or Authorization Bearer
                      token
                invalid:
                  summary: Invalid API key
                  value:
                    error: Invalid API key
        '403':
          description: >-
            Key limitada a un número (`NUMBER_SCOPE_NOT_ALLOWED`), token
            OAuth/MCP de un usuario que no es Owner ni Admin
            (`PERMISSION_DENIED`) o que ya no es miembro activo
            (`WORKSPACE_MEMBERSHIP_REQUIRED`), o workspace archivado
            (`WORKSPACE_ARCHIVED`). `TENANT_REQUIRED`: credencial no ligada a
            ningún workspace
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              examples:
                numberScope:
                  summary: Number-scoped key
                  value:
                    error: This endpoint requires a tenant-scoped API key
                    code: NUMBER_SCOPE_NOT_ALLOWED
                permissionDenied:
                  summary: OAuth/MCP user who is not Owner or Admin
                  value:
                    error: >-
                      Your workspace role does not allow this action
                      (phone_lines:webhooks).
                    code: PERMISSION_DENIED
                notMember:
                  summary: OAuth/MCP user no longer a member
                  value:
                    error: >-
                      The user behind this token is not an active member of this
                      workspace.
                    code: WORKSPACE_MEMBERSHIP_REQUIRED
                archived:
                  summary: Workspace archived
                  value:
                    error: >-
                      This workspace has been archived and its API is closed. |
                      Este workspace foi arquivado e sua API está encerrada.
                    code: WORKSPACE_ARCHIVED
                tenantRequired:
                  summary: Credential not bound to a workspace
                  value:
                    error: This credential is not bound to a workspace.
                    code: TENANT_REQUIRED
        '500':
          description: Falla inesperada (`INTERNAL_ERROR`).
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Unexpected error. | Erro inesperado.
                code: INTERNAL_ERROR
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.