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

# Atualiza config

> Atualiza `webhookUrl` e/ou `webhookSecret`. Passe `null` para remover um valor. Pelo menos um campo deve ser fornecido.



## OpenAPI

````yaml PATCH /webhook/config
openapi: 3.1.0
info:
  title: Astron Pay API
  version: 1.0.0
  description: >-
    API B2B para integração de câmbio crypto ↔ BRL via PIX. Autentique com
    `x-api-key` + `x-api-secret`.
  contact:
    name: Astron Pay
    url: https://astronpay.co
    email: dev@astronpay.co
servers:
  - url: https://api.astronpay.co/api/v1
    description: Production
security:
  - apiKey: []
    apiSecret: []
  - bearerAuth: []
tags:
  - name: Fee Tiers
    description: Consulta e atualização das taxas do merchant.
  - name: Receivers
    description: CRUD, KYC, limites e wallet signing dos receivers.
  - name: Quote
    description: Cotações de payin e payout.
  - name: Payin
    description: Ordens de entrada (BRL → crypto).
  - name: Payout
    description: Ordens de saída (crypto → BRL).
  - name: Orders
    description: Consulta genérica de ordens.
  - name: Merchant Wallet
    description: Assinatura de transações com a wallet gerenciada do merchant.
  - name: Ledger
    description: Saldos, entries e liquidações.
  - name: Webhook Config
    description: Configuração de webhook e listagem de eventos.
paths:
  /webhook/config:
    patch:
      tags:
        - Webhook Config
      summary: Atualiza URL e/ou secret de webhook
      description: >-
        Atualiza `webhookUrl` e/ou `webhookSecret`. Passe `null` para remover um
        valor. Pelo menos um campo deve ser fornecido.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                webhookUrl:
                  type: string
                  format: uri
                  nullable: true
                  description: >-
                    URL pública HTTPS para receber eventos. Passe null para
                    remover.
                webhookSecret:
                  type: string
                  minLength: 8
                  nullable: true
                  description: >-
                    Secret para assinar os payloads (HMAC-SHA256). Passe null
                    para remover.
      responses:
        '200':
          description: Atualizado
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookConfig'
        '400':
          description: Nenhum campo fornecido ou URL inválida/privada
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    WebhookConfig:
      type: object
      properties:
        url:
          type: string
          format: uri
          example: https://meuapp.com/webhooks/astronpay
        secretConfigured:
          type: boolean
          example: true
        lastRotatedAt:
          type: string
          format: date-time
          nullable: true
    Error:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: string
          example: VALIDATION_ERROR
        message:
          type: string
          example: Campo 'amountBrl' é obrigatório
        details:
          type: object
          additionalProperties: true
        requestId:
          type: string
          example: req_abc123
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
    apiSecret:
      type: apiKey
      in: header
      name: x-api-secret
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````