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

# Consultar webhook

> Consulta los datos de un webhook concreto

export const EnterpriseText = ({lang = 'pt'}) => ({
  pt: <>Este endpoint requer a role <strong>ENTERPRISE</strong> na sua conta.</>,
  en: <>This endpoint requires the <strong>ENTERPRISE</strong> role on your account.</>,
  es: <>Este endpoint requiere el rol <strong>ENTERPRISE</strong> en tu cuenta.</>
})[lang];

## Conceptos

Devuelve los datos de un webhook concreto. Igual que en el listado, las credenciales de autenticación y el `secret` de firma **no se devuelven** por seguridad.

<Note>
  <EnterpriseText lang="es" />
</Note>

<Note>
  El `webhookId` se obtiene en la respuesta del endpoint [Crear webhook](/es/webhooks/create-webhook) o [Listar webhooks](/es/webhooks/list-webhooks).
</Note>


## OpenAPI

````yaml es/webhooks/openapi.json GET /v1/channels/{channelId}/webhooks/{webhookId}
openapi: 3.1.0
info:
  title: Omni Z-API - API de webhooks
  description: >-
    API para crear y gestionar endpoints de webhook por canal. Requiere el rol
    ENTERPRISE.
  version: 1.0.0
servers:
  - url: https://api.omni.z-api.io
security:
  - bearerAuth: []
paths:
  /v1/channels/{channelId}/webhooks/{webhookId}:
    get:
      tags:
        - Webhooks
      summary: Consultar webhook
      description: >-
        Devuelve los datos de un webhook concreto. Las credenciales y el
        `secret` no se devuelven.
      operationId: getWebhook
      parameters:
        - name: channelId
          in: path
          required: true
          description: ID del canal
          schema:
            type: string
            example: 019E4C54B1B375A28970B605CA9B03C3
        - name: webhookId
          in: path
          required: true
          description: ID del webhook
          schema:
            type: string
            example: A1B2C3D4E5F6789012345678901234AB
      responses:
        '200':
          description: Datos del webhook
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookResponse'
              example:
                id: A1B2C3D4E5F6789012345678901234AB
                channelId: 019E4C54B1B375A28970B605CA9B03C3
                instanceId: 019E4C54B1B375A28970B605CA9B03C3
                url: https://app.suempresa.com/webhooks/omni-zapi
                description: Webhook principal de producción
                events:
                  - MESSAGE_RECEIVED
                  - MESSAGE_STATUS
                status: ENABLED
                signing: true
                auth:
                  type: BEARER
                  configured: true
                payloadFormat: DEFAULT
                customAttributes: {}
                createdAt: 2025-01-15T10:30:00.000+0000
                updatedAt: 2025-01-15T10:30:00.000+0000
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Webhook no encontrado
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: 404
                message: Webhook not found
        '422':
          description: 'Regla de negocio incumplida: cuenta sin el rol ENTERPRISE'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: 422
                message: This action requires ENTERPRISE role
components:
  schemas:
    WebhookResponse:
      type: object
      properties:
        id:
          type: string
          description: ID único del webhook
          example: A1B2C3D4E5F6789012345678901234AB
        channelId:
          type: string
          description: ID del canal al que pertenece el webhook
          example: 019E4C54B1B375A28970B605CA9B03C3
        instanceId:
          type: string
          deprecated: true
          description: 'Obsoleto: usa `channelId`'
          example: 019E4C54B1B375A28970B605CA9B03C3
        url:
          type: string
          description: URL de destino de los eventos
          example: https://app.suempresa.com/webhooks/omni-zapi
        description:
          type: string
          nullable: true
          description: Descripción del webhook
          example: Webhook principal de producción
        events:
          type: array
          description: Tipos de evento configurados
          items:
            type: string
          example:
            - MESSAGE_RECEIVED
            - MESSAGE_STATUS
        status:
          type: string
          enum:
            - ENABLED
            - DISABLED
          description: Estado actual del webhook
          example: ENABLED
        signing:
          type: boolean
          description: Indica si la firma HMAC está habilitada
          example: true
        auth:
          $ref: '#/components/schemas/WebhookAuthInfo'
        payloadFormat:
          type: string
          enum:
            - DEFAULT
            - Z_API
            - CHATWOOT
          description: Formato del payload entregado
          example: DEFAULT
        customAttributes:
          type: object
          additionalProperties: true
          description: Atributos extra configurados
          example: {}
        createdAt:
          type: string
          format: date-time
          description: Fecha de creación
          example: 2025-01-15T10:30:00.000+0000
        updatedAt:
          type: string
          format: date-time
          description: Fecha de la última actualización
          example: 2025-01-15T10:30:00.000+0000
    Error:
      type: object
      properties:
        error:
          type: integer
        message:
          type: string
    WebhookAuthInfo:
      type: object
      description: >-
        Resumen de la autenticación configurada: las credenciales no se
        devuelven por seguridad
      properties:
        type:
          type: string
          enum:
            - NONE
            - BEARER
            - API_KEY
            - BASIC
            - CUSTOM_HEADER
          example: BEARER
        configured:
          type: boolean
          description: '`true` cuando hay credenciales configuradas'
          example: true
  responses:
    Unauthorized:
      description: Token no válido o ausente.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: 401
            message: Unauthorized
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Secret Key generada en el panel de Seguridad de Omni Z-API

````