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

# Listar webhooks

> Os webhooks do app, sem o segredo.

**Escopo do app:** `webhooks:write`. Só a chave do app; pelo OAuth, 403.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/webhooks
openapi: 3.1.0
info:
  title: API da Westhetics
  version: 1.0.0
  description: >-
    A API pública da Westhetics: pacientes, anamneses, contratos e assinaturas
    da clínica, com eventos por webhook. Autentique com a chave do app
    (`Authorization: Bearer wx_…`), criada pela gestora em Integrações, ou com o
    token OAuth da pessoa. Respostas em JSON, mensagens em pt-BR. Guias em
    https://docs.westhetics.io.
  contact:
    name: Westhetics
    url: https://docs.westhetics.io
    email: suporte@westhetics.com.br
servers:
  - url: https://api.westhetics.io
    description: Produção
security:
  - apiKey: []
  - oauth2: []
tags:
  - name: Conta
    description: Quem chama e a clínica.
  - name: Pacientes
    description: O cadastro da paciente.
  - name: Anamneses
    description: Enviar, acompanhar e ler a anamnese.
  - name: Catálogo
    description: Procedimentos, prestadores e modelos.
  - name: Contratos e assinaturas
    description: Gerar o contrato e os termos e enviar para assinatura.
  - name: Eventos
    description: O que aconteceu na clínica, por consulta ou por webhook.
  - name: Webhooks
    description: Os endereços que recebem os eventos do app.
paths:
  /v1/webhooks:
    get:
      tags:
        - Webhooks
      summary: Listar webhooks
      description: |-
        Os webhooks do app, sem o segredo.

        **Escopo do app:** `webhooks:write`. Só a chave do app; pelo OAuth, 403.
      operationId: listWebhooks
      parameters: []
      responses:
        '200':
          description: Sucesso.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Webhook'
                  meta:
                    $ref: '#/components/schemas/PageMeta'
                required:
                  - data
                  - meta
              example:
                data:
                  - id: 9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d
                    integrationId: 8d3e2f1a-0b9c-4d7e-a6f5-4e3d2c1b0a99
                    url: https://crm.exemplo.com.br/webhooks/westhetics
                    description: CRM da clínica
                    events:
                      - anamnesis.completed
                      - signature_request.completed
                    status: active
                    disabledReason: null
                    disabledAt: null
                    failingSince: null
                    lastDeliveryAt: '2026-10-15T14:30:00Z'
                    lastSuccessAt: '2026-10-15T14:30:00Z'
                    hasPreviousSecret: false
                    previousSecretValidUntil: null
                    deliveries:
                      pending: 0
                      failed: 0
                    createdAt: '2026-10-15T14:30:00Z'
                    updatedAt: '2026-10-15T14:30:00Z'
                meta:
                  limit: 25
                  nextCursor: null
        '401':
          description: Sem chave, chave que não confere, revogada ou token vencido.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: O app não tem o escopo, ou a pessoa não pode pelo perfil.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Passou de 100 chamadas por minuto; veja `Retry-After`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Webhook:
      type: object
      properties:
        id:
          type: string
        integrationId:
          type: string
        url:
          type: string
        description:
          anyOf:
            - type: string
            - type: 'null'
        events:
          type: array
          items:
            type: string
          description: '`["*"]` = todos os eventos que o app vê.'
        status:
          type: string
          enum:
            - active
            - disabled
        disabledReason:
          anyOf:
            - type: string
              enum:
                - manual
                - failing
            - type: 'null'
        disabledAt:
          anyOf:
            - type: string
              description: Data e hora ISO 8601, em UTC.
            - type: 'null'
        failingSince:
          anyOf:
            - type: string
              description: Data e hora ISO 8601, em UTC.
            - type: 'null'
        lastDeliveryAt:
          anyOf:
            - type: string
              description: Data e hora ISO 8601, em UTC.
            - type: 'null'
        lastSuccessAt:
          anyOf:
            - type: string
              description: Data e hora ISO 8601, em UTC.
            - type: 'null'
        hasPreviousSecret:
          type: boolean
        previousSecretValidUntil:
          anyOf:
            - type: string
              description: Data e hora ISO 8601, em UTC.
            - type: 'null'
        deliveries:
          type: object
          properties:
            pending:
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            failed:
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
          required:
            - pending
            - failed
          additionalProperties: false
        createdAt:
          type: string
          description: Data e hora ISO 8601, em UTC.
        updatedAt:
          type: string
          description: Data e hora ISO 8601, em UTC.
      required:
        - id
        - integrationId
        - url
        - description
        - events
        - status
        - disabledReason
        - disabledAt
        - failingSince
        - lastDeliveryAt
        - lastSuccessAt
        - hasPreviousSecret
        - previousSecretValidUntil
        - deliveries
        - createdAt
        - updatedAt
      additionalProperties: false
      description: Um endereço que recebe os eventos do app.
    PageMeta:
      type: object
      properties:
        limit:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        nextCursor:
          anyOf:
            - type: string
            - type: 'null'
          description: Passe em `cursor` para a próxima página; nulo no fim.
      required:
        - limit
        - nextCursor
      additionalProperties: false
      description: A página de uma lista por cursor.
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - bad_request
                - unauthenticated
                - forbidden
                - not_found
                - conflict
                - validation_failed
                - rate_limited
                - unavailable
                - internal_error
            message:
              type: string
              description: A causa e o caminho, em pt-BR.
            fields:
              description: 'No 422: a mensagem de cada campo.'
              type: object
              propertyNames:
                type: string
              additionalProperties:
                type: string
            requestId:
              type: string
          required:
            - code
            - message
            - requestId
          additionalProperties: false
      required:
        - error
      additionalProperties: false
      description: O envelope de erro.
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: wx_<64 hex>
      description: >-
        A chave do app de integração, criada em Integrações. Escopos:
        `patients:read` (Listar, buscar e ler pacientes; os eventos patient.*.);
        `patients:write` (Criar e editar pacientes. Inclui ler.);
        `anamneses:read` (Listar e ler anamneses, sem as respostas; os eventos
        anamnesis.*.); `anamneses:write` (Enviar, reenviar e cancelar anamnese.
        Inclui ler.); `anamneses:answers` (Ler as respostas da anamnese
        preenchida. É dado de saúde.); `documents:read` (Atendimentos,
        documentos, status da assinatura e o PDF; os eventos appointment.* e
        signature_request.*.); `documents:write` (Gerar contrato e termos e
        enviar para assinatura, reenviar e cancelar. Inclui ler.);
        `catalog:read` (Procedimentos, prestadores e modelos de documento da
        clínica.); `webhooks:write` (Criar, alterar e remover os webhooks do
        próprio app pela API.)
    oauth2:
      type: oauth2
      description: >-
        Token OAuth 2.1 da pessoa (código com PKCE), emitido a um aplicativo
        conectado. Vale o perfil da pessoa na clínica da conexão, por 12 horas.
      flows:
        authorizationCode:
          authorizationUrl: https://zosqwpksgewzphikvgfz.supabase.co/auth/v1/oauth/authorize
          tokenUrl: https://zosqwpksgewzphikvgfz.supabase.co/auth/v1/oauth/token
          refreshUrl: https://zosqwpksgewzphikvgfz.supabase.co/auth/v1/oauth/token
          scopes:
            openid: Identidade.
            email: O e-mail.
            profile: O nome.

````

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