> ## Documentation Index
> Fetch the complete documentation index at: https://developers.uvvipay.com.br/llms.txt
> Use this file to discover all available pages before exploring further.

# Atualizar webhook

> Atualiza a URL e os eventos de um endpoint de webhook existente. O id é o identificador retornado na listagem. `events` é obrigatório (ao menos um).

<Note>
  Use o `id` retornado na listagem de webhooks. Informe `webhook_url` e `events`
  (ao menos um) para atualizar o endpoint.
</Note>


## OpenAPI

````yaml PUT /v1/webhooks/{id}
openapi: 3.0.0
info:
  title: UvviPay Public API
  description: >-
    Endpoints públicos da plataforma UvviPay para integração de subcontas
    (submerchants).
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.uvvipay.com.br
    description: Produção
  - url: https://api-staging.uvvipay.com.br
    description: Staging
security:
  - client-id: []
    client-secret: []
tags: []
paths:
  /v1/webhooks/{id}:
    put:
      tags:
        - Webhooks
      summary: Atualizar webhook
      description: >-
        Atualiza a URL e os eventos de um endpoint de webhook existente. O id é
        o identificador retornado na listagem. `events` é obrigatório (ao menos
        um).
      operationId: updateWebhook
      parameters:
        - name: id
          in: path
          description: Identificador (UUID) do endpoint de webhook
          required: true
          schema:
            type: string
            format: uuid
        - name: client-id
          in: header
          description: ID público da credencial do merchant
          required: true
          schema:
            type: string
        - name: client-secret
          in: header
          description: Secret da credencial do merchant
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWebhookRequestDto'
      responses:
        '200':
          description: Webhook atualizado com sucesso
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookMutationResponseDto'
        '400':
          description: URL inválida
        '401':
          description: Credenciais inválidas ou ausentes
        '404':
          description: Webhook não encontrado
        '409':
          description: 'Conflito: a URL já está cadastrada em outro webhook da organização'
components:
  schemas:
    UpdateWebhookRequestDto:
      type: object
      required:
        - webhook_url
        - events
      properties:
        webhook_url:
          type: string
          format: uri
          pattern: ^https://.+
          description: Nova URL HTTPS do endpoint de webhook
          example: https://minhaloja.com.br/webhooks/uvvipay-v2
        events:
          type: array
          minItems: 1
          uniqueItems: true
          description: Eventos em que o endpoint será inscrito
          items:
            type: string
            enum:
              - transaction.status.updated
              - transaction.waiting_payment
              - transaction.paid
              - transaction.refused
              - transaction.refunded
              - transaction.chargedback
              - transaction.cancelled
              - transaction.expired
              - transaction.in_analysis
              - submerchant.status.updated
              - subscription.created
              - subscription.trial_started
              - subscription.activated
              - subscription.past_due
              - subscription.cancelled
              - subscription.reactivated
              - subscription.completed
              - subscription.renewed
          example:
            - transaction.status.updated
    WebhookMutationResponseDto:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/WebhookEndpointDto'
    WebhookEndpointDto:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Identificador do endpoint, usado na atualização
        endpoint:
          type: string
          format: uri
          example: https://minhaloja.com.br/webhooks/uvvipay
        status:
          type: string
          enum:
            - active
          description: >-
            Status operacional do endpoint. Nesta API, endpoints são criados
            como active e apenas registros active aparecem na listagem.
          example: active
        created_at:
          type: string
          format: date-time
        events:
          type: array
          description: Eventos enabled neste endpoint
          items:
            type: string
            enum:
              - transaction.status.updated
              - transaction.waiting_payment
              - transaction.paid
              - transaction.refused
              - transaction.refunded
              - transaction.chargedback
              - transaction.cancelled
              - transaction.expired
              - transaction.in_analysis
              - submerchant.status.updated
              - subscription.created
              - subscription.trial_started
              - subscription.activated
              - subscription.past_due
              - subscription.cancelled
              - subscription.reactivated
              - subscription.completed
              - subscription.renewed
          example:
            - transaction.status.updated
  securitySchemes:
    client-id:
      type: apiKey
      in: header
      name: client-id
    client-secret:
      type: apiKey
      in: header
      name: client-secret

````