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

# Atualizar webhook

> Altera URL, eventos, instâncias ou status `enabled`. Escopo `webhooks:manage`.



## OpenAPI

````yaml /es/guides/webhooks/api-reference/openapi-webhooks.json put /v1/webhooks/{id}
openapi: 3.0.3
info:
  title: Notifique API. Webhooks
  description: >-
    Cadastre URLs HTTPS para receber eventos da Notifique em tempo real.
    Autentique com `Authorization: Bearer sk_live_...` ou `x-api-key`. Escopos:
    `webhooks:read`, `webhooks:manage`.
  version: 1.0.0
servers:
  - url: https://api.notifique.dev
    description: Produção
security:
  - ntfWhBearerAuth: []
  - ntfWhApiKeyHeader: []
tags:
  - name: Webhooks
    description: CRUD de endpoints de webhook do workspace.
  - name: Entregas
    description: Histórico e reenvio de tentativas de entrega de webhook.
paths:
  /v1/webhooks/{id}:
    put:
      tags:
        - Webhooks
      summary: Atualizar webhook
      description: >-
        Altera URL, eventos, instâncias ou status `enabled`. Escopo
        `webhooks:manage`.
      operationId: ntfWh_updateWebhook
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NtfWh_WebhookInput'
            example:
              name: Meu webhook
              url: https://api.seudominio.com/receive
              events:
                - message.sent
                - message.failed
              instanceIds: []
              domainIds: []
              pushAppIds: []
              enabled: false
      responses:
        '200':
          description: Webhook atualizado.
          content:
            application/json:
              example:
                success: true
                data:
                  id: clwh_01HABC...
                  enabled: false
                  events:
                    - message.sent
                    - message.failed
              schema:
                $ref: '#/components/schemas/ntfWh_UpdateWebhookResponse'
        '400':
          $ref: '#/components/responses/Ntf_BadRequest'
        '401':
          $ref: '#/components/responses/Ntf_Unauthorized'
        '403':
          $ref: '#/components/responses/Ntf_Forbidden'
        '404':
          $ref: '#/components/responses/Ntf_NotFound'
components:
  schemas:
    NtfWh_WebhookInput:
      type: object
      required:
        - name
        - url
        - events
      properties:
        name:
          type: string
          description: Nome interno no painel.
        url:
          type: string
          format: uri
          description: URL HTTPS que recebe POST JSON.
        events:
          type: array
          items:
            type: string
          description: 'Nomes de evento (ex.: `message.sent`).'
        instanceIds:
          type: array
          items:
            type: string
          description: Filtra por instâncias; vazio = todas.
        enabled:
          type: boolean
          default: true
        domainIds:
          type: array
          items:
            type: string
          description: Filtra por domínios de e-mail; vazio = todos.
        pushAppIds:
          type: array
          items:
            type: string
          description: Filtra por apps push; vazio = todos.
      example:
        name: Exemplo
        url: https://example.com/resource
        events:
          - string
        instanceIds:
          - clxx...
        enabled: true
        domainIds:
          - clxx...
        pushAppIds:
          - clxx...
    ntfWh_UpdateWebhookResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          type: object
          properties:
            id:
              type: string
            enabled:
              type: boolean
            events:
              type: array
              items:
                type: string
      example:
        success: true
        data:
          id: clxx...
          enabled: true
          events:
            - string
    Ntf_Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
        message:
          type: string
        code:
          type: string
      example:
        success: false
        error: string
        message: string
        code: string
  responses:
    Ntf_BadRequest:
      description: Body inválido ou campo inesperado.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Ntf_Error'
          examples:
            validation:
              value:
                success: false
                error: Bad Request
                message: url must be HTTPS
                code: VALIDATION_ERROR
            unexpected_fields:
              value:
                success: false
                code: UNEXPECTED_FIELDS
    Ntf_Unauthorized:
      description: Chave ausente, inválida ou revogada.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Ntf_Error'
          example:
            success: false
            error: Unauthorized
            message: Invalid API key
            code: UNAUTHORIZED
    Ntf_Forbidden:
      description: Escopo ausente ou recurso fora da permissão da chave.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Ntf_Error'
          example:
            success: false
            error: Forbidden
            message: Missing scope webhooks:manage
            code: FORBIDDEN
    Ntf_NotFound:
      description: Recurso não encontrado no workspace.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Ntf_Error'
          example:
            success: false
            error: Not Found
            message: Webhook not found
            code: NOT_FOUND
  securitySchemes:
    ntfWhBearerAuth:
      type: http
      scheme: bearer
      description: API key `sk_live_...` ou `sk_test_...`.
    ntfWhApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: Alternativa ao Bearer.

````