{
  "openapi": "3.0.0",
  "paths": {
    "/v2/counterparties": {
      "post": {
        "operationId": "create",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCounterpartyDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CounterpartyDto"
                }
              }
            }
          }
        },
        "summary": "Create a counterparty",
        "tags": [
          "Counterparties"
        ]
      },
      "get": {
        "operationId": "list",
        "parameters": [
          {
            "name": "type",
            "required": false,
            "in": "query",
            "description": "Filter by relationship type",
            "schema": {
              "example": "vendor",
              "type": "string",
              "enum": [
                "vendor",
                "customer",
                "investor",
                "partner",
                "exchange",
                "other"
              ]
            }
          },
          {
            "name": "search",
            "required": false,
            "in": "query",
            "description": "Search by name",
            "schema": {
              "example": "Vercel",
              "type": "string"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "schema": {
              "minimum": 1,
              "maximum": 200,
              "default": 50,
              "example": 50,
              "type": "number"
            }
          },
          {
            "name": "cursor",
            "required": false,
            "in": "query",
            "description": "Pagination cursor",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CounterpartyListResponseDto"
                }
              }
            }
          }
        },
        "summary": "List counterparties",
        "tags": [
          "Counterparties"
        ]
      }
    },
    "/v2/counterparties/{id}": {
      "get": {
        "operationId": "get",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CounterpartyDto"
                }
              }
            }
          }
        },
        "summary": "Get counterparty details",
        "tags": [
          "Counterparties"
        ]
      },
      "patch": {
        "operationId": "update",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCounterpartyDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CounterpartyDto"
                }
              }
            }
          }
        },
        "summary": "Update counterparty fields",
        "tags": [
          "Counterparties"
        ]
      },
      "delete": {
        "operationId": "delete",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Delete counterparty and all associated data",
        "tags": [
          "Counterparties"
        ]
      }
    },
    "/v2/counterparties/{id}/addresses": {
      "put": {
        "operationId": "manageAddresses",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManageAddressesDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CounterpartyAddressDto"
                  }
                }
              }
            }
          }
        },
        "summary": "Manage addresses (add/update/remove)",
        "tags": [
          "Counterparties"
        ]
      }
    },
    "/v2/counterparties/{id}/bank-accounts": {
      "put": {
        "operationId": "manageBankAccounts",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManageBankAccountsDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CounterpartyBankAccountDto"
                  }
                }
              }
            }
          }
        },
        "summary": "Manage bank accounts (add/update/remove)",
        "tags": [
          "Counterparties"
        ]
      }
    },
    "/v2/counterparties/{id}/documents": {
      "post": {
        "operationId": "uploadDocument",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/UploadDocumentDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CounterpartyDocumentDto"
                }
              }
            }
          }
        },
        "summary": "Upload a document (PDF, max 10 MB)",
        "tags": [
          "Counterparties"
        ]
      }
    },
    "/v2/counterparties/{id}/documents/{docId}": {
      "get": {
        "operationId": "downloadDocument",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "docId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Download a document",
        "tags": [
          "Counterparties"
        ]
      },
      "delete": {
        "operationId": "deleteDocument",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "docId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Remove a document",
        "tags": [
          "Counterparties"
        ]
      }
    },
    "/v2/transfers/enrichment/lookup": {
      "get": {
        "operationId": "getLookup",
        "parameters": [
          {
            "name": "transferId",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "txHash",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "network",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TxEnrichmentLookupResponseDto"
                }
              }
            }
          }
        },
        "summary": "Get note and category for a transfer by tx hash and network",
        "tags": [
          "Transfer Enrichments"
        ]
      }
    },
    "/v2/transfers/enrichment/notes": {
      "get": {
        "operationId": "listAllNotes",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListTxNotesResponseDto"
                }
              }
            }
          }
        },
        "summary": "List all notes for workspace",
        "tags": [
          "Transfer Enrichments"
        ]
      },
      "post": {
        "operationId": "upsertNote",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertTxNoteDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TxNoteDto"
                }
              }
            }
          }
        },
        "summary": "Create or update a transfer note",
        "tags": [
          "Transfer Enrichments"
        ]
      }
    },
    "/v2/transfers/enrichment/notes/{transferId}": {
      "get": {
        "operationId": "listNotes",
        "parameters": [
          {
            "name": "transferId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListTxNotesResponseDto"
                }
              }
            }
          }
        },
        "summary": "List transfer notes for workspace",
        "tags": [
          "Transfer Enrichments"
        ]
      },
      "patch": {
        "operationId": "updateNote",
        "parameters": [
          {
            "name": "transferId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTxNoteDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TxNoteDto"
                }
              }
            }
          }
        },
        "summary": "Update note text",
        "tags": [
          "Transfer Enrichments"
        ]
      },
      "delete": {
        "operationId": "deleteNote",
        "parameters": [
          {
            "name": "transferId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "summary": "Delete a transfer note",
        "tags": [
          "Transfer Enrichments"
        ]
      }
    },
    "/v2/transfers/enrichment/categories": {
      "get": {
        "operationId": "listCategories",
        "parameters": [
          {
            "name": "transferId",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "categories",
            "required": false,
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListTxCategoriesResponseDto"
                }
              }
            }
          }
        },
        "summary": "List transfer categories for workspace",
        "tags": [
          "Transfer Enrichments"
        ]
      },
      "post": {
        "operationId": "upsertCategory",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertTxCategoryDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TxCategoryDto"
                }
              }
            }
          }
        },
        "summary": "Create or update a transfer category",
        "tags": [
          "Transfer Enrichments"
        ]
      }
    },
    "/v2/transfers/enrichment/categories/{transferId}": {
      "get": {
        "operationId": "getCategory",
        "parameters": [
          {
            "name": "transferId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TxCategoryDto"
                }
              }
            }
          }
        },
        "summary": "Get category for a specific transfer",
        "tags": [
          "Transfer Enrichments"
        ]
      },
      "delete": {
        "operationId": "deleteCategory",
        "parameters": [
          {
            "name": "transferId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "summary": "Delete a transfer category",
        "tags": [
          "Transfer Enrichments"
        ]
      }
    }
  },
  "info": {
    "title": "Range Platform API",
    "description": "The Range Platform API for workspace management, counterparties, and operational tooling.",
    "version": "1.7.11",
    "contact": {}
  },
  "tags": [
    {
      "name": "Counterparties",
      "description": "Manage external entities, their addresses, bank accounts, and documents."
    },
    {
      "name": "Transfer Enrichments",
      "description": "Attach workspace-scoped notes and categories to transfers."
    }
  ],
  "servers": [
    {
      "url": "https://api.range.org",
      "description": "Range API Server"
    }
  ],
  "components": {
    "securitySchemes": {
      "Authorization": {
        "scheme": "bearer",
        "bearerFormat": "API Key",
        "description": "Use Authorization: Bearer <api-key>",
        "type": "http"
      }
    },
    "schemas": {
      "CursorMetaDto": {
        "type": "object",
        "properties": {
          "next_cursor": {
            "type": "string",
            "nullable": true,
            "description": "Opaque string cursor pointing to the next page of results. null if there is no next page.",
            "example": "eyJpZCI6IjkxeFFlV3Z..."
          },
          "previous_cursor": {
            "type": "string",
            "nullable": true,
            "description": "Opaque string cursor pointing to the previous page of results. null if there is no previous page.",
            "example": "eyJpZCI6IjkxeFFlV3Z..."
          },
          "first_page_cursor": {
            "type": "string",
            "description": "Opaque string cursor pointing to the very first page in the entire dataset with respect to the current filter.",
            "example": "eyJpZCI6IjkxeFFlV3Z..."
          },
          "last_page_cursor": {
            "type": "string",
            "nullable": true,
            "description": "Opaque string cursor pointing to the very last page in the entire dataset with respect to the current filter.",
            "example": "eyJpZCI6IjkxeFFlV3Z..."
          },
          "total_count": {
            "type": "number",
            "nullable": true,
            "description": "Total number of results.",
            "example": 100
          },
          "page_number": {
            "type": "number",
            "description": "Current page number.",
            "example": 1
          }
        }
      },
      "CreateCounterpartyAddressDto": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "example": "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD28"
          },
          "network": {
            "type": "string",
            "example": "ethereum"
          },
          "label": {
            "type": "string",
            "example": "payment wallet"
          }
        },
        "required": [
          "address",
          "network"
        ]
      },
      "CreateCounterpartyBankAccountDto": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string",
            "example": "USD",
            "description": "ISO 4217 currency code"
          },
          "bank_name": {
            "type": "string",
            "example": "Chase"
          },
          "account_name": {
            "type": "string",
            "example": "Vercel Inc"
          },
          "iban": {
            "type": "string",
            "example": "DE89370400440532013000"
          },
          "swift": {
            "type": "string",
            "example": "DEUTDEFF"
          },
          "routing_number": {
            "type": "string",
            "example": "021000021"
          },
          "account_number": {
            "type": "string",
            "example": "12345678"
          },
          "account_type": {
            "type": "string",
            "enum": [
              "checking",
              "savings"
            ],
            "example": "checking"
          },
          "sort_code": {
            "type": "string",
            "example": "60-16-13"
          }
        },
        "required": [
          "currency",
          "bank_name"
        ]
      },
      "CreateCounterpartyDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Vercel"
          },
          "type": {
            "type": "string",
            "enum": [
              "vendor",
              "customer",
              "investor",
              "partner",
              "exchange",
              "other"
            ],
            "example": "vendor"
          },
          "website": {
            "type": "string",
            "format": "uri",
            "example": "https://vercel.com"
          },
          "notes": {
            "type": "string",
            "example": "Infrastructure hosting provider"
          },
          "addresses": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreateCounterpartyAddressDto"
            }
          },
          "bank_accounts": {
            "maxItems": 50,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreateCounterpartyBankAccountDto"
            }
          }
        },
        "required": [
          "name",
          "type"
        ]
      },
      "CounterpartyAddressDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "08846e81-b3a8-7fd9-cc39-d4023a75dcff"
          },
          "address": {
            "type": "string",
            "example": "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD28"
          },
          "network": {
            "type": "string",
            "example": "ethereum"
          },
          "name": {
            "type": "string",
            "example": "Vercel Payment Wallet"
          },
          "label": {
            "type": "string",
            "example": "payment address"
          }
        },
        "required": [
          "id",
          "address",
          "network",
          "name"
        ]
      },
      "CounterpartyBankAccountDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "ba-001"
          },
          "currency": {
            "type": "string",
            "example": "USD"
          },
          "bank_name": {
            "type": "string",
            "example": "Silicon Valley Bank"
          },
          "account_name": {
            "type": "string",
            "example": "Vercel Inc"
          },
          "iban": {
            "type": "string",
            "example": "************1234"
          },
          "swift": {
            "type": "string",
            "example": "CHASUS33"
          },
          "routing_number": {
            "type": "string",
            "example": "*****0248"
          },
          "account_number": {
            "type": "string",
            "example": "****5678"
          },
          "account_type": {
            "type": "string",
            "example": "checking"
          },
          "sort_code": {
            "type": "string",
            "example": "****89"
          }
        },
        "required": [
          "id",
          "currency",
          "bank_name"
        ]
      },
      "CounterpartyDocumentDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "doc-001"
          },
          "name": {
            "type": "string",
            "example": "certificate_of_incorporation.pdf"
          },
          "type": {
            "type": "string",
            "example": "kyb",
            "enum": [
              "kyc",
              "kyb",
              "contract",
              "other"
            ]
          },
          "mime_type": {
            "type": "string",
            "example": "application/pdf"
          },
          "size_bytes": {
            "type": "number",
            "example": 245000
          },
          "uploaded_at": {
            "type": "string",
            "example": "2026-05-10T09:00:00Z"
          }
        },
        "required": [
          "id",
          "name",
          "type",
          "mime_type",
          "size_bytes",
          "uploaded_at"
        ]
      },
      "CounterpartyDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "a1b2c3d4-5678-90ab-cdef-1234567890ab"
          },
          "name": {
            "type": "string",
            "example": "Vercel"
          },
          "type": {
            "type": "string",
            "example": "vendor"
          },
          "website": {
            "type": "string",
            "example": "https://vercel.com"
          },
          "notes": {
            "type": "string",
            "example": "Infrastructure hosting provider"
          },
          "addresses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CounterpartyAddressDto"
            }
          },
          "bank_accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CounterpartyBankAccountDto"
            }
          },
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CounterpartyDocumentDto"
            }
          },
          "created_at": {
            "type": "string",
            "example": "2026-05-01T10:00:00Z"
          },
          "updated_at": {
            "type": "string",
            "example": "2026-05-11T14:30:00Z"
          }
        },
        "required": [
          "id",
          "name",
          "type",
          "addresses",
          "bank_accounts",
          "documents",
          "created_at",
          "updated_at"
        ]
      },
      "CounterpartySummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "a1b2c3d4-5678-90ab-cdef-1234567890ab"
          },
          "name": {
            "type": "string",
            "example": "Vercel"
          },
          "type": {
            "type": "string",
            "example": "vendor"
          },
          "website": {
            "type": "string",
            "example": "https://vercel.com"
          },
          "created_at": {
            "type": "string",
            "example": "2026-05-01T10:00:00Z"
          },
          "updated_at": {
            "type": "string",
            "example": "2026-05-11T14:30:00Z"
          }
        },
        "required": [
          "id",
          "name",
          "type",
          "created_at",
          "updated_at"
        ]
      },
      "CounterpartyListResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CounterpartySummaryDto"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/CursorMetaDto"
          }
        },
        "required": [
          "items",
          "meta"
        ]
      },
      "UpdateCounterpartyDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Vercel Inc."
          },
          "type": {
            "type": "string",
            "enum": [
              "vendor",
              "customer",
              "investor",
              "partner",
              "exchange",
              "other"
            ],
            "example": "vendor"
          },
          "website": {
            "type": "string",
            "format": "uri",
            "example": "https://vercel.com"
          },
          "notes": {
            "type": "string",
            "example": "Updated contract terms"
          }
        }
      },
      "AddressOperationDto": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "add",
              "update",
              "remove"
            ],
            "example": "add"
          },
          "address": {
            "type": "string",
            "example": "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD28",
            "description": "On-chain address (required for add)"
          },
          "network": {
            "type": "string",
            "example": "ethereum",
            "description": "Network identifier (required for add)"
          },
          "label": {
            "type": "string",
            "example": "payment wallet"
          },
          "id": {
            "type": "string",
            "example": "08846e81-b3a8-7fd9-cc39-d4023a75dcff",
            "description": "Account UUID (required for update/remove)"
          }
        },
        "required": [
          "action"
        ]
      },
      "ManageAddressesDto": {
        "type": "object",
        "properties": {
          "operations": {
            "minItems": 1,
            "maxItems": 100,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AddressOperationDto"
            }
          }
        },
        "required": [
          "operations"
        ]
      },
      "BankAccountOperationDto": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "add",
              "update",
              "remove"
            ],
            "example": "add"
          },
          "id": {
            "type": "string",
            "example": "ba-uuid-001",
            "description": "Bank account UUID (required for update/remove)"
          },
          "currency": {
            "type": "string",
            "example": "USD",
            "description": "ISO 4217 currency code (required for add)"
          },
          "bank_name": {
            "type": "string",
            "example": "Chase",
            "description": "Bank / institution name (required for add)"
          },
          "account_name": {
            "type": "string",
            "example": "Vercel Inc"
          },
          "iban": {
            "type": "string",
            "example": "DE89370400440532013000",
            "description": "IBAN (EUR / international)"
          },
          "swift": {
            "type": "string",
            "example": "DEUTDEFF",
            "description": "SWIFT/BIC (EUR / international)"
          },
          "routing_number": {
            "type": "string",
            "example": "021000021",
            "description": "ABA routing number (USD)"
          },
          "account_number": {
            "type": "string",
            "example": "12345678",
            "description": "Account number (USD / GBP)"
          },
          "account_type": {
            "type": "string",
            "enum": [
              "checking",
              "savings"
            ],
            "example": "checking",
            "description": "Account type (USD)"
          },
          "sort_code": {
            "type": "string",
            "example": "60-16-13",
            "description": "Sort code (GBP)"
          }
        },
        "required": [
          "action"
        ]
      },
      "ManageBankAccountsDto": {
        "type": "object",
        "properties": {
          "operations": {
            "minItems": 1,
            "maxItems": 50,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BankAccountOperationDto"
            }
          }
        },
        "required": [
          "operations"
        ]
      },
      "UploadDocumentDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "kyc",
              "kyb",
              "contract",
              "other"
            ],
            "example": "kyb",
            "description": "Document type"
          },
          "name": {
            "type": "string",
            "example": "certificate_of_incorporation.pdf",
            "description": "Override file name"
          }
        },
        "required": [
          "type"
        ]
      },
      "TxEnrichmentLookupResponseDto": {
        "type": "object",
        "properties": {
          "transferId": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "category": {
            "type": "string"
          }
        }
      },
      "TxNoteDto": {
        "type": "object",
        "properties": {
          "workspaceId": {
            "type": "string"
          },
          "transferId": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "required": [
          "workspaceId",
          "transferId",
          "note",
          "createdAt",
          "updatedAt"
        ]
      },
      "ListTxNotesResponseDto": {
        "type": "object",
        "properties": {
          "resources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TxNoteDto"
            }
          }
        },
        "required": [
          "resources"
        ]
      },
      "UpsertTxNoteDto": {
        "type": "object",
        "properties": {
          "transferId": {
            "type": "string"
          },
          "note": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          }
        },
        "required": [
          "transferId",
          "note"
        ]
      },
      "UpdateTxNoteDto": {
        "type": "object",
        "properties": {
          "note": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          }
        },
        "required": [
          "note"
        ]
      },
      "TxCategoryDto": {
        "type": "object",
        "properties": {
          "workspaceId": {
            "type": "string"
          },
          "transferId": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          }
        },
        "required": [
          "workspaceId",
          "transferId",
          "category",
          "createdAt"
        ]
      },
      "ListTxCategoriesResponseDto": {
        "type": "object",
        "properties": {
          "resources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TxCategoryDto"
            }
          }
        },
        "required": [
          "resources"
        ]
      },
      "UpsertTxCategoryDto": {
        "type": "object",
        "properties": {
          "transferId": {
            "type": "string"
          },
          "category": {
            "type": "string",
            "enum": [
              "Transfer",
              "Revenue",
              "Payroll",
              "Contract Services",
              "Software & Subscriptions",
              "Legal & Professional Services",
              "Taxes",
              "Bank Fees",
              "Payment Processing Fees",
              "Interest Earned",
              "Marketing & Advertising",
              "Travel & Transportation",
              "Rent & Utilities",
              "Insurance",
              "Gas Fees",
              "Staking Rewards",
              "Bridge Transfer",
              "DeFi Yield"
            ]
          }
        },
        "required": [
          "transferId",
          "category"
        ]
      }
    }
  },
  "security": [
    {
      "Authorization": []
    }
  ]
}