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

# Suprimir webhooks

> Cria uma regra para suprimir parte das entregas de um evento (anti-flood). Suprime `suppressCount` entregas a cada `interval`.

Cria uma regra de **supressão** (anti-flood): suprime `suppressCount` entregas de um evento a cada `interval`. Útil em cenários de altíssimo volume.

<Info>
  Existem também as rotas `GET`, `PUT` e `DELETE` em `/v1/webhook/suppressions` para listar, atualizar e remover regras.
</Info>


## OpenAPI

````yaml POST /v1/webhook/suppressions
openapi: 3.0.3
info:
  title: API Ephra
  description: >-
    API REST para gerar cobranças (PIX, cartão e boleto), consultar transações e
    gerenciar webhooks.
  version: 1.0.0
servers:
  - url: https://api.ephra.io
    description: Servidor de produção
security:
  - bearerAuth: []
tags:
  - name: Autenticação
    description: Login e obtenção do token de acesso
  - name: Pagamentos
    description: Criação de cobranças PIX, cartão e boleto
  - name: Assinaturas
    description: Cobrança recorrente — iniciar, listar, consultar e cancelar assinaturas
  - name: Transações
    description: Consulta de transações
  - name: Webhooks
    description: Cadastro e gerenciamento de webhooks
paths:
  /v1/webhook/suppressions:
    post:
      tags:
        - Webhooks
      summary: Criar supressão de webhook
      description: >-
        Cria uma regra para suprimir parte das entregas de um evento
        (anti-flood). Suprime `suppressCount` entregas a cada `interval`.
      operationId: createWebhookSuppression
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - event
                - interval
              properties:
                event:
                  $ref: '#/components/schemas/WebhookEvent'
                interval:
                  type: integer
                  minimum: 2
                  example: 10
                suppressCount:
                  type: integer
                  minimum: 1
                  default: 1
                  example: 2
                isActive:
                  type: boolean
                  default: true
      responses:
        '201':
          description: Supressão criada
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      event:
                        $ref: '#/components/schemas/WebhookEvent'
                      interval:
                        type: integer
                        example: 10
                      suppressCount:
                        type: integer
                        example: 2
                      counter:
                        type: integer
                        example: 0
                      isActive:
                        type: boolean
                        example: true
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    WebhookEvent:
      type: string
      enum:
        - transaction_created
        - transaction_paid
        - transaction_refunded
        - transaction_updated
        - transfer_created
        - transfer_completed
        - transfer_canceled
        - transfer_updated
        - infraction
        - card_declined
        - sale_lost
        - cart_abandoned
        - product_canceled
    Error:
      type: object
      properties:
        statusCode:
          type: integer
          example: 400
        error:
          type: string
          example: Bad Request
        message:
          type: string
          example: Mensagem descritiva do erro
  responses:
    BadRequest:
      description: Requisição inválida
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 400
            error: Bad Request
            message: Documento inválido para o tipo selecionado
    Unauthorized:
      description: Token ausente, inválido ou expirado
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 401
            error: Unauthorized
            message: Token inválido ou expirado
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````