{
  "openapi": "3.0.0",
  "paths": {
    "/v1/account": {
      "get": {
        "description": "Client linked to the key, what is enabled and the limits. Scope: `read`.",
        "operationId": "V1AccountController_account",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, IP outside the allowlist, or operation not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Account details",
        "tags": [
          "Account"
        ]
      }
    },
    "/v1/balances": {
      "get": {
        "description": "Current BRL and USDT balance (sum of the statement). Withdrawals in `processando` have not been debited yet (USDT ones in `enviando` already have) — the amount available for a new withdrawal is in GET /v1/withdrawals/fee-preview. Scope: `read`.",
        "operationId": "V1AccountController_balances",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalancesDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, IP outside the allowlist, or operation not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Balances",
        "tags": [
          "Account"
        ]
      }
    },
    "/v1/statement": {
      "get": {
        "description": "Entries in the period (newest first) and the opening balance before `from`. Scope: `read`.",
        "operationId": "V1AccountController_statement",
        "parameters": [
          {
            "name": "from",
            "required": true,
            "in": "query",
            "description": "Period start (ISO 8601)",
            "schema": {
              "example": "2026-11-01T00:00:00-03:00",
              "type": "string"
            }
          },
          {
            "name": "to",
            "required": true,
            "in": "query",
            "description": "Period end (ISO 8601)",
            "schema": {
              "example": "2026-11-30T23:59:59-03:00",
              "type": "string"
            }
          },
          {
            "name": "page",
            "required": false,
            "in": "query",
            "schema": {
              "minimum": 1,
              "default": 1,
              "type": "number"
            }
          },
          {
            "name": "page_size",
            "required": false,
            "in": "query",
            "schema": {
              "minimum": 1,
              "maximum": 500,
              "default": 100,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatementDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, IP outside the allowlist, or operation not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Statement",
        "tags": [
          "Account"
        ]
      }
    },
    "/v1/conversions/time-window": {
      "get": {
        "description": "Whether conversions are open right now. Scope: `read`.",
        "operationId": "V1ConversionsController_timeWindow",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimeWindowDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, IP outside the allowlist, or operation not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Trading window",
        "tags": [
          "Conversions"
        ]
      }
    },
    "/v1/conversions/rate": {
      "get": {
        "description": "Reference price with your spread, refreshed every few seconds. Does not lock a price. Scope: `read`.",
        "operationId": "V1ConversionsController_rate",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IndicativeRateDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, IP outside the allowlist, or operation not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Indicative quote",
        "tags": [
          "Conversions"
        ]
      }
    },
    "/v1/conversions/quotes": {
      "post": {
        "description": "Fetches the best price and locks it for ~15s (`expires_at`). To execute, call POST /v1/conversions with the `id` before it expires. Scope: `trade`. Limit: 20/min.",
        "operationId": "V1ConversionsController_quote",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateQuoteRequestDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, IP outside the allowlist, or operation not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "502": {
            "description": "`quote_unavailable` — no quote right now; try again shortly",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Create firm quote",
        "tags": [
          "Conversions"
        ]
      }
    },
    "/v1/conversions": {
      "post": {
        "description": "Executes the quote. Debits/credits the balance immediately when `status = concluido`; `pendente` = awaiting confirmation (follow it via GET /v1/conversions/{id} or webhook). A quote executes only once. **502 `execution_uncertain`: DO NOT retry** — check GET /v1/conversions?quote_id=… Scope: `trade`.",
        "operationId": "V1ConversionsController_execute",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique operation identifier (UUID v4). Repeating with the same key returns the same response without executing again (24h).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExecuteConversionRequestDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversionDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, IP outside the allowlist, or operation not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "502": {
            "description": "`execution_uncertain` — result not confirmed; do not retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Execute conversion",
        "tags": [
          "Conversions"
        ]
      },
      "get": {
        "description": "Newest first, cursor-paginated. Scope: `read`.",
        "operationId": "V1ConversionsController_list",
        "parameters": [
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "default": 50,
              "type": "number"
            }
          },
          {
            "name": "cursor",
            "required": false,
            "in": "query",
            "description": "Opaque cursor: the `next_cursor` from the previous page",
            "schema": {
              "maxLength": 200,
              "type": "string"
            }
          },
          {
            "name": "from",
            "required": false,
            "in": "query",
            "description": "Created from (ISO 8601)",
            "schema": {
              "example": "2026-11-01T00:00:00-03:00",
              "type": "string"
            }
          },
          {
            "name": "to",
            "required": false,
            "in": "query",
            "description": "Created until (ISO 8601)",
            "schema": {
              "example": "2026-11-30T23:59:59-03:00",
              "type": "string"
            }
          },
          {
            "name": "status",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "pendente",
                "concluido",
                "cancelado",
                "falhou"
              ]
            }
          },
          {
            "name": "quote_id",
            "required": false,
            "in": "query",
            "description": "Filters by the originating quote — use after an `execution_uncertain`",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversionListDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, IP outside the allowlist, or operation not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "List conversions",
        "tags": [
          "Conversions"
        ]
      }
    },
    "/v1/conversions/{id}": {
      "get": {
        "description": "Scope: `read`.",
        "operationId": "V1ConversionsController_get",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversionDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, IP outside the allowlist, or operation not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Get conversion",
        "tags": [
          "Conversions"
        ]
      }
    },
    "/v1/withdrawals/fee-preview": {
      "get": {
        "description": "Fee, total debited, minimum, maximum and available balance for a withdrawal — same rule as the POST. Scope: `read`.",
        "operationId": "V1WithdrawalsController_feePreview",
        "parameters": [
          {
            "name": "kind",
            "required": true,
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "brl_pix",
                "usdt_trc20"
              ]
            }
          },
          {
            "name": "amount",
            "required": true,
            "in": "query",
            "description": "Gross amount; 0 returns only minimum/balance",
            "schema": {
              "minimum": 0,
              "example": 1500,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeePreviewDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, IP outside the allowlist, or operation not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Fee preview",
        "tags": [
          "Withdrawals"
        ]
      }
    },
    "/v1/withdrawals": {
      "post": {
        "description": "Creates the request in `processando`. Pix: the balance is debited when the Rivus team completes it (webhook `withdrawal.completed`). USDT: sending may be automatic — the balance is debited when the request moves to `enviando` (webhook `withdrawal.sent`) and the request becomes `concluido` once the transfer is confirmed on-chain; if sending fails, the amount goes back to the balance and the request stays `falhou` (webhook `withdrawal.failed`) until the Rivus team resends or cancels it. With automatic sending, one USDT withdrawal at a time: with another USDT one in `processando`/`enviando`, it responds 409. Pix (`brl_pix`): `pix_key`, `pix_key_type` and `pix_recipient_name`. USDT (`usdt_trc20`): `wallet_address`. Scope: `withdraw` (requires an IP allowlist on the key).",
        "operationId": "V1WithdrawalsController_create",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique withdrawal identifier (UUID v4). Repeating with the same key does not create another withdrawal (24h).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWithdrawalRequestDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WithdrawalDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, IP outside the allowlist, or operation not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Request withdrawal",
        "tags": [
          "Withdrawals"
        ]
      },
      "get": {
        "description": "Newest first, cursor-paginated. Scope: `read`.",
        "operationId": "V1WithdrawalsController_list",
        "parameters": [
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "default": 50,
              "type": "number"
            }
          },
          {
            "name": "cursor",
            "required": false,
            "in": "query",
            "description": "Opaque cursor: the `next_cursor` from the previous page",
            "schema": {
              "maxLength": 200,
              "type": "string"
            }
          },
          {
            "name": "from",
            "required": false,
            "in": "query",
            "description": "Created from (ISO 8601)",
            "schema": {
              "example": "2026-11-01T00:00:00-03:00",
              "type": "string"
            }
          },
          {
            "name": "to",
            "required": false,
            "in": "query",
            "description": "Created until (ISO 8601)",
            "schema": {
              "example": "2026-11-30T23:59:59-03:00",
              "type": "string"
            }
          },
          {
            "name": "status",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "processando",
                "enviando",
                "concluido",
                "falhou",
                "cancelado"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WithdrawalListDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, IP outside the allowlist, or operation not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "List withdrawals",
        "tags": [
          "Withdrawals"
        ]
      }
    },
    "/v1/withdrawals/{id}": {
      "get": {
        "description": "Scope: `read`.",
        "operationId": "V1WithdrawalsController_get",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WithdrawalDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, IP outside the allowlist, or operation not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Get withdrawal",
        "tags": [
          "Withdrawals"
        ]
      }
    },
    "/v1/transfers/my-code": {
      "get": {
        "description": "Code other clients use to send you funds. Scope: `read`.",
        "operationId": "V1TransfersController_myCode",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransferCodeDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, IP outside the allowlist, or operation not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "My receiving code",
        "tags": [
          "Transfers"
        ]
      }
    },
    "/v1/transfers/recipients/{code}": {
      "get": {
        "description": "Checks a receiving code and returns the recipient with a masked name. Lookups per minute are limited. Scope: `read`.",
        "operationId": "V1TransfersController_recipient",
        "parameters": [
          {
            "name": "code",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransferRecipientDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, IP outside the allowlist, or operation not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Check recipient",
        "tags": [
          "Transfers"
        ]
      }
    },
    "/v1/transfers/preview": {
      "get": {
        "description": "Available balance, per-transfer cap and whether the amount will need approval — same rule as the POST. Scope: `read`.",
        "operationId": "V1TransfersController_preview",
        "parameters": [
          {
            "name": "currency",
            "required": true,
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "BRL",
                "USDT"
              ]
            }
          },
          {
            "name": "amount",
            "required": true,
            "in": "query",
            "description": "0 to only check available balance and limits",
            "schema": {
              "minimum": 0,
              "example": 1500,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransferPreviewDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, IP outside the allowlist, or operation not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Transfer preview",
        "tags": [
          "Transfers"
        ]
      }
    },
    "/v1/transfers": {
      "post": {
        "description": "Sends BRL or USDT to another Rivus client using their receiving code. Up to the approval cap, the transfer comes back `concluida` (webhooks `transfer.sent` for you and `transfer.received` for the recipient). Above the cap, it comes back `pendente` (webhook `transfer.pending`) with the amount reserved in the balance until the Rivus team approves or rejects it. No fee. Scope: `withdraw` (requires an IP allowlist on the key).",
        "operationId": "V1TransfersController_create",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique transfer identifier (UUID v4). Repeating with the same key does not create another transfer (24h).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTransferRequestDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransferDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, IP outside the allowlist, or operation not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Send transfer",
        "tags": [
          "Transfers"
        ]
      },
      "get": {
        "description": "Sent (all statuses) and received (completed), newest first, cursor-paginated. Scope: `read`.",
        "operationId": "V1TransfersController_list",
        "parameters": [
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "default": 50,
              "type": "number"
            }
          },
          {
            "name": "cursor",
            "required": false,
            "in": "query",
            "description": "Opaque cursor: the `next_cursor` from the previous page",
            "schema": {
              "maxLength": 200,
              "type": "string"
            }
          },
          {
            "name": "from",
            "required": false,
            "in": "query",
            "description": "Created from (ISO 8601)",
            "schema": {
              "example": "2026-11-01T00:00:00-03:00",
              "type": "string"
            }
          },
          {
            "name": "to",
            "required": false,
            "in": "query",
            "description": "Created until (ISO 8601)",
            "schema": {
              "example": "2026-11-30T23:59:59-03:00",
              "type": "string"
            }
          },
          {
            "name": "status",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "pendente",
                "concluida",
                "rejeitada",
                "cancelada"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransferListDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, IP outside the allowlist, or operation not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "List transfers",
        "tags": [
          "Transfers"
        ]
      }
    },
    "/v1/transfers/{id}": {
      "get": {
        "description": "Scope: `read`.",
        "operationId": "V1TransfersController_get",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransferDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, IP outside the allowlist, or operation not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Get transfer",
        "tags": [
          "Transfers"
        ]
      }
    },
    "/v1/deposits/config": {
      "get": {
        "description": "Minimum/maximum charge amount and validity. Scope: `read`.",
        "operationId": "V1DepositsController_config",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DepositConfigDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, IP outside the allowlist, or operation not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Deposit limits",
        "tags": [
          "Deposits"
        ]
      }
    },
    "/v1/deposits/static-code": {
      "get": {
        "description": "Account's fixed Pix code (no amount): any Pix received credits the balance (webhook `balance.credited`). Scope: `read`.",
        "operationId": "V1DepositsController_staticCode",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaticCodeDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, IP outside the allowlist, or operation not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Permanent Pix",
        "tags": [
          "Deposits"
        ]
      }
    },
    "/v1/deposits": {
      "post": {
        "description": "Creates a Pix charge with an amount (valid for 30 min). When paid with the exact amount, the balance is credited and the status becomes `pago` (webhook `deposit.paid`). Scope: `trade`.",
        "operationId": "V1DepositsController_create",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique charge identifier (UUID v4). Repeating with the same key returns the same charge (24h).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDepositRequestDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DepositDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, IP outside the allowlist, or operation not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Create Pix charge",
        "tags": [
          "Deposits"
        ]
      },
      "get": {
        "description": "The 50 most recent charges. Scope: `read`.",
        "operationId": "V1DepositsController_list",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DepositDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, IP outside the allowlist, or operation not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "List deposits",
        "tags": [
          "Deposits"
        ]
      }
    },
    "/v1/deposits/{id}": {
      "get": {
        "description": "Scope: `read`.",
        "operationId": "V1DepositsController_get",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DepositDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, IP outside the allowlist, or operation not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Get deposit",
        "tags": [
          "Deposits"
        ]
      }
    },
    "/v1/webhooks": {
      "get": {
        "operationId": "V1WebhooksController_list",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WebhookEndpointDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, IP outside the allowlist, or operation not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "List webhooks",
        "tags": [
          "Webhooks"
        ]
      },
      "post": {
        "description": "Up to 5 per client. The response includes the signing `secret` **only once**.",
        "operationId": "V1WebhooksController_create",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookRequestDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointWithSecretDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, IP outside the allowlist, or operation not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Register webhook",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/v1/webhooks/{id}": {
      "get": {
        "operationId": "V1WebhooksController_get",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, IP outside the allowlist, or operation not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Get webhook",
        "tags": [
          "Webhooks"
        ]
      },
      "patch": {
        "description": "URL, events, description, or enable/disable.",
        "operationId": "V1WebhooksController_update",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWebhookRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, IP outside the allowlist, or operation not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Update webhook",
        "tags": [
          "Webhooks"
        ]
      },
      "delete": {
        "operationId": "V1WebhooksController_remove",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, IP outside the allowlist, or operation not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Delete webhook",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/v1/webhooks/{id}/rotate-secret": {
      "post": {
        "description": "Generates a new signing secret; the previous one stops working immediately.",
        "operationId": "V1WebhooksController_rotate",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSecretDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, IP outside the allowlist, or operation not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Rotate secret",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/v1/webhooks/{id}/test": {
      "post": {
        "description": "Sends a signed `ping` event right now and returns the result (no retries).",
        "operationId": "V1WebhooksController_test",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookTestResultDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, IP outside the allowlist, or operation not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Test webhook",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/v1/webhooks/{id}/deliveries": {
      "get": {
        "description": "Latest deliveries of this webhook (30 days).",
        "operationId": "V1WebhooksController_deliveries",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "default": 50,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WebhookDeliveryDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, IP outside the allowlist, or operation not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Delivery history",
        "tags": [
          "Webhooks"
        ]
      }
    }
  },
  "info": {
    "title": "Rivus API",
    "version": "1.0.0",
    "contact": {
      "name": "Rivus",
      "url": "https://rivusfinance.com",
      "email": ""
    },
    "description": "Reference for every endpoint of the Rivus API v1.\n\nThe **guides** (authentication, idempotency, flows and webhooks) are at [docs.rivusfinance.com/en/docs](https://docs.rivusfinance.com/en/docs/primeiros-passos).\n\nThe **Test Request** button sends real requests to the **sandbox** (`https://api-sandbox.rivusfinance.com`), where brokers and banks are simulated. Use an `rvs_test_…` key. Never paste a production key (`rvs_live_…`) here."
  },
  "tags": [
    {
      "name": "Account"
    },
    {
      "name": "Conversions"
    },
    {
      "name": "Deposits"
    },
    {
      "name": "Withdrawals"
    },
    {
      "name": "Webhooks"
    }
  ],
  "servers": [
    {
      "url": "https://api-sandbox.rivusfinance.com",
      "description": "Sandbox — no real money"
    }
  ],
  "components": {
    "securitySchemes": {
      "apiKey": {
        "scheme": "bearer",
        "bearerFormat": "rvs_<env>_<prefix>_<segredo>",
        "type": "http",
        "description": "API key"
      }
    },
    "schemas": {
      "ErrorDetailDto": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "example": "invalid_request",
            "description": "Stable code: invalid_request, unauthorized, forbidden, not_found, conflict, unprocessable, rate_limited, quote_unavailable, execution_uncertain, idempotency_key_reused, idempotency_in_progress, upstream_error, internal_error"
          },
          "message": {
            "type": "string",
            "example": "Saldo BRL insuficiente. Disponível: R$ 1.234,56"
          },
          "request_id": {
            "type": "string",
            "nullable": true,
            "example": "req_3f2c9b1e8d7a4c6b9e0f1a2b3c4d5e6f"
          },
          "details": {
            "description": "All validation messages, when there is more than one",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "code",
          "message",
          "request_id"
        ]
      },
      "ErrorResponseDto": {
        "type": "object",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ErrorDetailDto"
          }
        },
        "required": [
          "error"
        ]
      },
      "AccountDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "example": "Empresa Exemplo Ltda"
          },
          "is_active": {
            "type": "boolean"
          },
          "conversion_enabled": {
            "type": "boolean",
            "description": "Can buy USDT"
          },
          "conversion_sell_enabled": {
            "type": "boolean",
            "description": "Can sell USDT"
          },
          "conversion_max_per_tx_brl": {
            "type": "number",
            "nullable": true,
            "description": "Per-conversion limit, in BRL"
          },
          "conversion_daily_limit_brl": {
            "type": "number",
            "nullable": true,
            "description": "Daily conversion limit, in BRL"
          },
          "withdrawal_enabled": {
            "type": "boolean"
          },
          "withdrawal_max_per_tx_brl": {
            "type": "number",
            "nullable": true
          },
          "withdrawal_max_per_tx_usdt": {
            "type": "number",
            "nullable": true
          },
          "scopes": {
            "type": "array",
            "description": "Scopes of the key used",
            "items": {
              "type": "string",
              "enum": [
                "read",
                "trade",
                "withdraw"
              ]
            }
          }
        },
        "required": [
          "id",
          "name",
          "is_active",
          "conversion_enabled",
          "conversion_sell_enabled",
          "conversion_max_per_tx_brl",
          "conversion_daily_limit_brl",
          "withdrawal_enabled",
          "withdrawal_max_per_tx_brl",
          "withdrawal_max_per_tx_usdt",
          "scopes"
        ]
      },
      "BalancesDto": {
        "type": "object",
        "properties": {
          "brl": {
            "type": "number",
            "example": 15230.45
          },
          "usdt": {
            "type": "number",
            "example": 2500.12345678
          },
          "as_of": {
            "type": "string",
            "example": "2026-11-09T14:03:11.000Z"
          }
        },
        "required": [
          "brl",
          "usdt",
          "as_of"
        ]
      },
      "StatementEntryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string",
            "example": "credito_brl",
            "description": "credito_brl, debito_brl, saque_brl, credito_usdt, debito_usdt, saque_usdt, transferencia_interna_*, ajuste"
          },
          "amount_brl": {
            "type": "number",
            "example": 250,
            "description": "Positive = inflow; negative = outflow"
          },
          "amount_usdt": {
            "type": "number",
            "example": 0
          },
          "rate": {
            "type": "number",
            "nullable": true,
            "description": "BRL/USDT rate (conversion entries)"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "e2e": {
            "type": "string",
            "nullable": true,
            "description": "Pix end-to-end ID, when available"
          },
          "occurred_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "type",
          "amount_brl",
          "amount_usdt",
          "rate",
          "description",
          "e2e",
          "occurred_at"
        ]
      },
      "StatementDto": {
        "type": "object",
        "properties": {
          "opening_balance": {
            "description": "Balance before `from`",
            "allOf": [
              {
                "$ref": "#/components/schemas/BalancesDto"
              }
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StatementEntryDto"
            }
          },
          "page": {
            "type": "number",
            "example": 1
          },
          "page_size": {
            "type": "number",
            "example": 100
          },
          "total": {
            "type": "number",
            "example": 37
          }
        },
        "required": [
          "opening_balance",
          "data",
          "page",
          "page_size",
          "total"
        ]
      },
      "TimeWindowDto": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "A trading-hours restriction is configured"
          },
          "open": {
            "type": "boolean",
            "description": "Conversions open right now"
          },
          "message": {
            "type": "string",
            "nullable": true,
            "example": "Conversões disponíveis de segunda a sexta, das 09:00 às 17:00"
          }
        },
        "required": [
          "enabled",
          "open",
          "message"
        ]
      },
      "IndicativeRateDto": {
        "type": "object",
        "properties": {
          "buy_rate": {
            "type": "number",
            "nullable": true,
            "example": 5.4321,
            "description": "Indicative USDT buy price (BRL per USDT), already including your spread; null if buying is not enabled. Not a firm quote — use POST /v1/conversions/quotes"
          },
          "sell_rate": {
            "type": "number",
            "nullable": true,
            "example": 5.3987
          },
          "updated_at": {
            "type": "string"
          }
        },
        "required": [
          "buy_rate",
          "sell_rate",
          "updated_at"
        ]
      },
      "CreateQuoteRequestDto": {
        "type": "object",
        "properties": {
          "side": {
            "enum": [
              "buy_usdt",
              "sell_usdt"
            ],
            "type": "string",
            "description": "`buy_usdt`: pays BRL and receives USDT; `sell_usdt`: pays USDT and receives BRL"
          },
          "amount": {
            "type": "number",
            "minimum": 0,
            "example": 10000,
            "exclusiveMinimum": true,
            "description": "Amount, in the `amount_currency` currency"
          },
          "amount_currency": {
            "enum": [
              "brl",
              "usdt"
            ],
            "type": "string",
            "example": "brl"
          }
        },
        "required": [
          "side",
          "amount",
          "amount_currency"
        ]
      },
      "QuoteDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Use in POST /v1/conversions"
          },
          "side": {
            "type": "string",
            "enum": [
              "buy_usdt",
              "sell_usdt"
            ]
          },
          "rate": {
            "type": "number",
            "example": 5.4321,
            "description": "BRL per USDT, already including spread"
          },
          "brl_amount": {
            "type": "number",
            "example": 10000
          },
          "usdt_amount": {
            "type": "number",
            "example": 1840.9
          },
          "expires_at": {
            "type": "string"
          },
          "ttl_seconds": {
            "type": "number",
            "example": 14
          }
        },
        "required": [
          "id",
          "side",
          "rate",
          "brl_amount",
          "usdt_amount",
          "expires_at",
          "ttl_seconds"
        ]
      },
      "ExecuteConversionRequestDto": {
        "type": "object",
        "properties": {
          "quote_id": {
            "type": "string",
            "format": "uuid",
            "description": "Quote `id` (valid for ~15s)"
          }
        },
        "required": [
          "quote_id"
        ]
      },
      "ConversionDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "quote_id": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "side": {
            "type": "string",
            "enum": [
              "buy_usdt",
              "sell_usdt"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "pendente",
              "concluido",
              "cancelado",
              "falhou"
            ],
            "description": "`pendente` = awaiting settlement confirmation; follow it via GET or webhook"
          },
          "brl_amount": {
            "type": "number",
            "example": 10000
          },
          "usdt_amount": {
            "type": "number",
            "example": 1840.9
          },
          "rate": {
            "type": "number",
            "example": 5.4321
          },
          "created_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "quote_id",
          "side",
          "status",
          "brl_amount",
          "usdt_amount",
          "rate",
          "created_at"
        ]
      },
      "ConversionListDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConversionDto"
            }
          },
          "next_cursor": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "FeePreviewDto": {
        "type": "object",
        "properties": {
          "min_amount": {
            "type": "number",
            "example": 10
          },
          "max_per_tx": {
            "type": "number",
            "nullable": true
          },
          "available_balance": {
            "type": "number",
            "example": 15230.45
          },
          "max_amount": {
            "type": "number",
            "nullable": true
          },
          "valid": {
            "type": "boolean"
          },
          "message": {
            "type": "string",
            "nullable": true
          },
          "fee_amount": {
            "type": "number",
            "example": 2.5
          },
          "total_debit": {
            "type": "number",
            "example": 1502.5
          },
          "fee_label": {
            "type": "string",
            "nullable": true,
            "example": "R$ 2,50"
          },
          "usdt_in_progress": {
            "type": "boolean",
            "description": "USDT with automatic sending: a USDT withdrawal is already in progress, and a new USDT request responds 409"
          }
        },
        "required": [
          "min_amount",
          "max_per_tx",
          "available_balance",
          "max_amount",
          "valid",
          "message",
          "fee_amount",
          "total_debit",
          "fee_label",
          "usdt_in_progress"
        ]
      },
      "CreateWithdrawalRequestDto": {
        "type": "object",
        "properties": {
          "kind": {
            "enum": [
              "brl_pix",
              "usdt_trc20"
            ],
            "type": "string"
          },
          "gross_amount": {
            "type": "number",
            "minimum": 0,
            "example": 1500,
            "exclusiveMinimum": true,
            "description": "Gross amount (the fee is calculated server-side and added to the debit)"
          },
          "pix_key": {
            "type": "string",
            "description": "Required for `brl_pix`",
            "example": "12345678000199"
          },
          "pix_key_type": {
            "type": "string",
            "enum": [
              "cpf",
              "cnpj",
              "email",
              "telefone",
              "aleatoria"
            ],
            "description": "Required for `brl_pix`"
          },
          "pix_recipient_name": {
            "type": "string",
            "maxLength": 200,
            "description": "Recipient's full name — required for `brl_pix`",
            "example": "Empresa Exemplo Ltda"
          },
          "wallet_address": {
            "type": "string",
            "description": "TRC-20 wallet — required for `usdt_trc20`",
            "example": "TXYZ1234567890abcdefghijklmnopqrst"
          },
          "expected_fee_amount": {
            "type": "number",
            "minimum": 0,
            "description": "Fee shown to the user (from fee-preview). If the rule has changed, the API responds 409 instead of charging a different fee."
          }
        },
        "required": [
          "kind",
          "gross_amount"
        ]
      },
      "WithdrawalDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "type": "string",
            "enum": [
              "brl_pix",
              "usdt_trc20"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "processando",
              "enviando",
              "concluido",
              "falhou",
              "cancelado"
            ],
            "description": "`processando`: awaiting sending. `enviando`: balance already debited, USDT transfer in progress. `concluido`: paid (USDT: confirmed on-chain). `falhou`: the USDT transfer failed and the amount went back to the balance — the Rivus team resends or cancels. `cancelado`: will not be paid. New statuses may be added: treat unknown values as \"in progress\"."
          },
          "gross_amount": {
            "type": "number",
            "example": 1500
          },
          "fee_amount": {
            "type": "number",
            "example": 2.5
          },
          "total_debit": {
            "type": "number",
            "example": 1502.5
          },
          "pix_key": {
            "type": "string",
            "nullable": true
          },
          "pix_key_type": {
            "type": "string",
            "nullable": true
          },
          "pix_recipient_name": {
            "type": "string",
            "nullable": true
          },
          "wallet_address": {
            "type": "string",
            "nullable": true
          },
          "tx_hash": {
            "type": "string",
            "nullable": true,
            "description": "Transaction link on the network (USDT). May already be filled in `enviando`; only final in `concluido`"
          },
          "has_proof": {
            "type": "boolean",
            "description": "A receipt is attached (completed Pix)"
          },
          "created_at": {
            "type": "string"
          },
          "processed_at": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "id",
          "kind",
          "status",
          "gross_amount",
          "fee_amount",
          "total_debit",
          "pix_key",
          "pix_key_type",
          "pix_recipient_name",
          "wallet_address",
          "tx_hash",
          "has_proof",
          "created_at",
          "processed_at"
        ]
      },
      "WithdrawalListDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WithdrawalDto"
            }
          },
          "next_cursor": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "TransferCodeDto": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "nullable": true,
            "example": "RV-7K3M9Q",
            "description": "Your receiving code"
          }
        },
        "required": [
          "code"
        ]
      },
      "TransferRecipientDto": {
        "type": "object",
        "properties": {
          "recipient_id": {
            "type": "string",
            "format": "uuid",
            "description": "Send it as `expected_recipient_id` in the POST"
          },
          "code": {
            "type": "string",
            "example": "RV-7K3M9Q"
          },
          "name": {
            "type": "string",
            "example": "João d* S****"
          },
          "client_type": {
            "type": "string",
            "enum": [
              "pf",
              "pj"
            ]
          }
        },
        "required": [
          "recipient_id",
          "code",
          "name",
          "client_type"
        ]
      },
      "TransferPreviewDto": {
        "type": "object",
        "properties": {
          "max_per_tx": {
            "type": "number",
            "nullable": true,
            "description": "Client's per-transfer cap"
          },
          "available_balance": {
            "type": "number",
            "example": 15230.45,
            "description": "Balance minus pending withdrawals and transfers"
          },
          "max_amount": {
            "type": "number",
            "nullable": true
          },
          "approval_threshold": {
            "type": "number",
            "nullable": true,
            "description": "Above this amount the transfer stays `pendente` awaiting approval"
          },
          "needs_approval": {
            "type": "boolean"
          },
          "valid": {
            "type": "boolean"
          },
          "message": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "max_per_tx",
          "available_balance",
          "max_amount",
          "approval_threshold",
          "needs_approval",
          "valid",
          "message"
        ]
      },
      "CreateTransferRequestDto": {
        "type": "object",
        "properties": {
          "recipient_code": {
            "type": "string",
            "maxLength": 20,
            "example": "RV-7K3M9Q",
            "description": "Recipient's receiving code (with or without `RV-`)"
          },
          "currency": {
            "enum": [
              "BRL",
              "USDT"
            ],
            "type": "string"
          },
          "amount": {
            "type": "number",
            "minimum": 1,
            "example": 1500,
            "description": "BRL: up to 2 decimals. USDT: up to 6 decimals."
          },
          "note": {
            "type": "string",
            "maxLength": 140,
            "description": "Message shown on both parties' statements"
          },
          "expected_recipient_id": {
            "type": "string",
            "format": "uuid",
            "description": "The `recipient_id` returned by `GET /v1/transfers/recipients/{code}`. If the code no longer belongs to that client, responds 409."
          }
        },
        "required": [
          "recipient_code",
          "currency",
          "amount"
        ]
      },
      "TransferCounterpartDto": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "nullable": true,
            "example": "RV-7K3M9Q"
          },
          "name": {
            "type": "string",
            "example": "João d* S****",
            "description": "Masked when it is the recipient of a sent transfer"
          }
        },
        "required": [
          "code",
          "name"
        ]
      },
      "TransferDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "direction": {
            "type": "string",
            "enum": [
              "sent",
              "received"
            ],
            "description": "From the point of view of the key's client"
          },
          "status": {
            "type": "string",
            "enum": [
              "pendente",
              "concluida",
              "rejeitada",
              "cancelada"
            ],
            "description": "`concluida`: amount debited from the sender and credited to the recipient. `pendente`: above the approval cap, awaiting the Rivus team — the amount stays reserved in the balance. `rejeitada` / `cancelada`: nothing was moved."
          },
          "currency": {
            "type": "string",
            "enum": [
              "BRL",
              "USDT"
            ]
          },
          "amount": {
            "type": "number",
            "example": 1500
          },
          "note": {
            "type": "string",
            "nullable": true
          },
          "counterpart": {
            "$ref": "#/components/schemas/TransferCounterpartDto"
          },
          "reject_reason": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string"
          },
          "decided_at": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "id",
          "direction",
          "status",
          "currency",
          "amount",
          "note",
          "counterpart",
          "reject_reason",
          "created_at",
          "decided_at"
        ]
      },
      "TransferListDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TransferDto"
            }
          },
          "next_cursor": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "DepositConfigDto": {
        "type": "object",
        "properties": {
          "min_brl": {
            "type": "number",
            "example": 10
          },
          "max_brl": {
            "type": "number",
            "example": 50000
          },
          "expires_in_seconds": {
            "type": "number",
            "example": 1800
          },
          "currencies": {
            "example": [
              "BRL"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "min_brl",
          "max_brl",
          "expires_in_seconds",
          "currencies"
        ]
      },
      "StaticPixBankDetailsDto": {
        "type": "object",
        "properties": {
          "bank_name": {
            "type": "string",
            "nullable": true
          },
          "holder_name": {
            "type": "string",
            "nullable": true
          },
          "holder_document": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "bank_name",
          "holder_name",
          "holder_document"
        ]
      },
      "StaticCodeDto": {
        "type": "object",
        "properties": {
          "txid": {
            "type": "string"
          },
          "pix_copia_e_cola": {
            "type": "string",
            "description": "Permanent Pix copy-and-paste code (no fixed amount) — every Pix received credits the balance"
          },
          "qr_code_data_uri": {
            "type": "string"
          },
          "bank_details": {
            "$ref": "#/components/schemas/StaticPixBankDetailsDto"
          }
        },
        "required": [
          "txid",
          "pix_copia_e_cola",
          "qr_code_data_uri",
          "bank_details"
        ]
      },
      "CreateDepositRequestDto": {
        "type": "object",
        "properties": {
          "amount_brl": {
            "type": "number",
            "minimum": 0,
            "example": 250,
            "exclusiveMinimum": true,
            "description": "Pix charge amount, in BRL"
          },
          "description": {
            "type": "string",
            "maxLength": 140,
            "description": "Free-form reference (shown to the payer)",
            "example": "Pedido 4821"
          }
        },
        "required": [
          "amount_brl"
        ]
      },
      "DepositDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "pendente",
              "pago",
              "expirado",
              "divergente",
              "cancelado"
            ],
            "description": "`expirado` is computed on read (30 min without payment)"
          },
          "amount_brl": {
            "type": "number",
            "example": 250
          },
          "paid_amount_brl": {
            "type": "number",
            "nullable": true
          },
          "paid_at": {
            "type": "string",
            "nullable": true
          },
          "txid": {
            "type": "string"
          },
          "e2e": {
            "type": "string",
            "nullable": true
          },
          "payer_name": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "pix_copia_e_cola": {
            "type": "string",
            "nullable": true,
            "description": "Pix copy-and-paste code — only while `pendente`"
          },
          "qr_code_data_uri": {
            "type": "string",
            "nullable": true,
            "description": "QR code (PNG data URI) — only while `pendente`"
          },
          "expires_at": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "status",
          "amount_brl",
          "paid_amount_brl",
          "paid_at",
          "txid",
          "e2e",
          "payer_name",
          "description",
          "pix_copia_e_cola",
          "qr_code_data_uri",
          "expires_at",
          "created_at"
        ]
      },
      "WebhookEndpointDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "url": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "*",
                "conversion.completed",
                "conversion.canceled",
                "conversion.failed",
                "withdrawal.created",
                "withdrawal.sent",
                "withdrawal.completed",
                "withdrawal.failed",
                "withdrawal.canceled",
                "deposit.paid",
                "deposit.divergent",
                "balance.credited",
                "transfer.pending",
                "transfer.sent",
                "transfer.received",
                "transfer.rejected",
                "transfer.canceled"
              ]
            }
          },
          "is_active": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "url",
          "description",
          "events",
          "is_active",
          "created_at",
          "updated_at"
        ]
      },
      "CreateWebhookRequestDto": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 2000,
            "example": "https://api.suaempresa.com.br/webhooks/rivus",
            "description": "https, port 443, public host"
          },
          "events": {
            "type": "array",
            "minItems": 1,
            "maxItems": 20,
            "example": [
              "deposit.paid",
              "withdrawal.completed"
            ],
            "items": {
              "type": "string",
              "enum": [
                "*",
                "conversion.completed",
                "conversion.canceled",
                "conversion.failed",
                "withdrawal.created",
                "withdrawal.sent",
                "withdrawal.completed",
                "withdrawal.failed",
                "withdrawal.canceled",
                "deposit.paid",
                "deposit.divergent",
                "balance.credited",
                "transfer.pending",
                "transfer.sent",
                "transfer.received",
                "transfer.rejected",
                "transfer.canceled"
              ]
            }
          },
          "description": {
            "type": "string",
            "maxLength": 200
          }
        },
        "required": [
          "url",
          "events"
        ]
      },
      "WebhookEndpointWithSecretDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "url": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "*",
                "conversion.completed",
                "conversion.canceled",
                "conversion.failed",
                "withdrawal.created",
                "withdrawal.sent",
                "withdrawal.completed",
                "withdrawal.failed",
                "withdrawal.canceled",
                "deposit.paid",
                "deposit.divergent",
                "balance.credited",
                "transfer.pending",
                "transfer.sent",
                "transfer.received",
                "transfer.rejected",
                "transfer.canceled"
              ]
            }
          },
          "is_active": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "secret": {
            "type": "string",
            "example": "whsec_…",
            "description": "HMAC secret — shown only now; store it"
          }
        },
        "required": [
          "id",
          "url",
          "description",
          "events",
          "is_active",
          "created_at",
          "updated_at",
          "secret"
        ]
      },
      "UpdateWebhookRequestDto": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 2000
          },
          "events": {
            "type": "array",
            "minItems": 1,
            "maxItems": 20,
            "items": {
              "type": "string",
              "enum": [
                "*",
                "conversion.completed",
                "conversion.canceled",
                "conversion.failed",
                "withdrawal.created",
                "withdrawal.sent",
                "withdrawal.completed",
                "withdrawal.failed",
                "withdrawal.canceled",
                "deposit.paid",
                "deposit.divergent",
                "balance.credited",
                "transfer.pending",
                "transfer.sent",
                "transfer.received",
                "transfer.rejected",
                "transfer.canceled"
              ]
            }
          },
          "description": {
            "type": "string",
            "maxLength": 200,
            "nullable": true
          },
          "is_active": {
            "type": "boolean"
          }
        }
      },
      "WebhookSecretDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "secret": {
            "type": "string",
            "example": "whsec_…",
            "description": "New secret — the previous one stops working immediately"
          }
        },
        "required": [
          "id",
          "secret"
        ]
      },
      "WebhookTestResultDto": {
        "type": "object",
        "properties": {
          "delivery_id": {
            "type": "string",
            "format": "uuid"
          },
          "event_id": {
            "type": "string",
            "format": "uuid"
          },
          "success": {
            "type": "boolean"
          },
          "status_code": {
            "type": "number",
            "nullable": true
          },
          "error": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "delivery_id",
          "event_id",
          "success",
          "status_code",
          "error"
        ]
      },
      "WebhookDeliveryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "event_id": {
            "type": "string",
            "format": "uuid"
          },
          "event_type": {
            "type": "string",
            "example": "deposit.paid"
          },
          "status": {
            "type": "string",
            "enum": [
              "pendente",
              "entregue",
              "falhou"
            ]
          },
          "attempts": {
            "type": "number"
          },
          "last_status_code": {
            "type": "number",
            "nullable": true
          },
          "last_error": {
            "type": "string",
            "nullable": true
          },
          "next_attempt_at": {
            "type": "string"
          },
          "delivered_at": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "event_id",
          "event_type",
          "status",
          "attempts",
          "last_status_code",
          "last_error",
          "next_attempt_at",
          "delivered_at",
          "created_at"
        ]
      }
    }
  }
}
