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

# Obtener webhook del espacio de trabajo

> **Webhooks de workspace**: el mismo registro que `/v1/phone-lines/webhooks` (mismas filas, secreto `plwh_`, firma, reintentos y entregas), con un conjunto de eventos más amplio: todos los eventos `phone_line.*` **más `wallet.topup_paid`** (se acreditó una recarga de la billetera). `"*"` significa solo todos los eventos de líneas telefónicas: `wallet.topup_paid` es opcional, inclúyelo por nombre (por ejemplo `["*", "wallet.topup_paid"]`). Esta superficie lista todos los webhooks del workspace. Clave con alcance de tenant (o clave de cuenta con `x-workspace-id`); Owner o Admin (`phone_lines:webhooks`) con una credencial de usuario.

Devuelve `{ "webhook": { … } }`: el mismo objeto que en la lista, **nunca el secreto**. Un webhook de otro workspace responde **404 `WEBHOOK_NOT_FOUND`**, igual que uno que no existe.

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

Todos los endpoints de `/v1/workspace/webhooks` aceptan solo una clave **con alcance de tenant**: los webhooks de workspace pertenecen al workspace, no a un número de WhatsApp, por lo que una clave con alcance de número (o una autorización OAuth por número) recibe `403 NUMBER_SCOPE_NOT_ALLOWED` antes de que se evalúe cualquier rol. Un `403 PERMISSION_DENIED` / `WORKSPACE_MEMBERSHIP_REQUIRED` se envía con `Cache-Control: no-store`.

Estos son los **webhooks de workspace**, un registro separado de `/v1/webhooks`: reciben los eventos `phone_line.*` y `wallet.topup_paid`, y un webhook de número nunca recibe ninguno de ellos.

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



## OpenAPI

````yaml openapi.es.json GET /v1/workspace/webhooks/{id}
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/workspace/webhooks/{id}:
    get:
      tags:
        - Workspace
      summary: Obtener un webhook de workspace
      description: >-
        **Webhooks de workspace**: el mismo registro que
        `/v1/phone-lines/webhooks` (mismas filas, secreto `plwh_`, firma,
        reintentos y entregas), con un conjunto de eventos más amplio: todos los
        eventos `phone_line.*` **más `wallet.topup_paid`** (se acreditó una
        recarga de la billetera). `"*"` significa solo todos los eventos de
        líneas telefónicas: `wallet.topup_paid` es opcional, inclúyelo por
        nombre (por ejemplo `["*", "wallet.topup_paid"]`). Esta superficie lista
        todos los webhooks del workspace. Clave con alcance de tenant (o clave
        de cuenta con `x-workspace-id`); Owner o Admin (`phone_lines:webhooks`)
        con una credencial de usuario.


        Devuelve `{ "webhook": { … } }`: el mismo objeto que en la lista,
        **nunca el secreto**. Un webhook de otro workspace responde **404
        `WEBHOOK_NOT_FOUND`**, igual que uno que no existe.


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


        Todos los endpoints de `/v1/workspace/webhooks` aceptan solo una clave
        **con alcance de tenant**: los webhooks de workspace pertenecen al
        workspace, no a un número de WhatsApp, por lo que una clave con alcance
        de número (o una autorización OAuth por número) recibe `403
        NUMBER_SCOPE_NOT_ALLOWED` antes de que se evalúe cualquier rol. Un `403
        PERMISSION_DENIED` / `WORKSPACE_MEMBERSHIP_REQUIRED` se envía con
        `Cache-Control: no-store`.


        Estos son los **webhooks de workspace**, un registro separado de
        `/v1/webhooks`: reciben los eventos `phone_line.*` y
        `wallet.topup_paid`, y un webhook de número nunca recibe ninguno de
        ellos.


        **Requiere una clave con alcance de tenant.**
      operationId: get_workspace_webhooks_id
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          example: cmh1w8b2k0001wh8example3d
          description: >-
            El `id` del webhook (de `GET /v1/workspace/webhooks` o de la
            respuesta de creación).
        - 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: El webhook
          content:
            application/json:
              schema:
                type: object
                properties:
                  webhook:
                    type: object
                    properties:
                      id:
                        type: string
                        description: >-
                          El id del webhook. Úsalo en todas las rutas
                          `/v1/workspace/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'
              example:
                webhook:
                  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'
        '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
        '404':
          description: >-
            No existe ese webhook en tu workspace (`WEBHOOK_NOT_FOUND`); un
            webhook de otro workspace responde igual
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Webhook not found. | Webhook não encontrado.
                code: WEBHOOK_NOT_FOUND
        '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.