{
  "openapi": "3.1.0",
  "info": {
    "title": "Daimo API",
    "version": "1.0.0",
    "description": "Create deposit sessions, manage payment methods, and check session status."
  },
  "servers": [
    {
      "url": "https://api.daimo.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "API key passed as a Bearer token"
      }
    },
    "schemas": {
      "SessionId": {
        "type": "string",
        "description": "32-character hex session ID",
        "example": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4"
      },
      "WebhookId": {
        "type": "string",
        "description": "Webhook endpoint ID",
        "example": "02ab4563-07ee-4373-8472-9c7dc1027409"
      },
      "SessionDestinationEvm": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["evm"],
            "description": "Always \"evm\""
          },
          "address": {
            "type": "string",
            "pattern": "^0x[0-9a-fA-F]{40}$",
            "description": "Destination address"
          },
          "chainId": {
            "type": "number",
            "description": "Destination chain ID",
            "example": 8453
          },
          "chainName": {
            "type": "string",
            "description": "Destination chain name",
            "example": "Base"
          },
          "tokenAddress": {
            "type": "string",
            "pattern": "^0x[0-9a-fA-F]{40}$",
            "description": "Destination token address",
            "example": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
          },
          "tokenSymbol": {
            "type": "string",
            "description": "Destination token symbol",
            "example": "USDC"
          },
          "amountUnits": {
            "type": "string",
            "description": "Requested amount in token units",
            "example": "10.00"
          },
          "calldata": {
            "type": "string",
            "pattern": "^0x[0-9a-fA-F]*$",
            "description": "Hex-encoded calldata for contract calls"
          },
          "delivery": {
            "type": "object",
            "properties": {
              "txHash": {
                "type": "string",
                "pattern": "^0x[0-9a-fA-F]*$",
                "description": "Delivery transaction hash"
              },
              "receivedUnits": {
                "type": "string",
                "description": "Amount actually received"
              }
            },
            "required": ["txHash", "receivedUnits"],
            "description": "Set once funds are delivered"
          }
        },
        "required": [
          "type",
          "address",
          "chainId",
          "chainName",
          "tokenAddress",
          "tokenSymbol"
        ]
      },
      "SessionDestinationSolana": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["solana"],
            "description": "Always \"solana\""
          },
          "address": {
            "type": "string",
            "description": "Destination address (base58)",
            "example": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU"
          },
          "tokenAddress": {
            "type": "string",
            "description": "Destination token mint (base58). USDC only.",
            "example": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
          },
          "tokenSymbol": {
            "type": "string",
            "description": "Destination token symbol",
            "example": "USDC"
          },
          "amountUnits": {
            "type": "string",
            "description": "Requested amount in token units",
            "example": "10.00"
          },
          "delivery": {
            "type": "object",
            "properties": {
              "txHash": {
                "type": "string",
                "description": "Delivery transaction signature"
              },
              "receivedUnits": {
                "type": "string",
                "description": "Amount actually received"
              }
            },
            "required": ["txHash", "receivedUnits"],
            "description": "Set once funds are delivered"
          }
        },
        "required": ["type", "address", "tokenAddress", "tokenSymbol"]
      },
      "SessionDestination": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/SessionDestinationEvm"
          },
          {
            "$ref": "#/components/schemas/SessionDestinationSolana"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "evm": "#/components/schemas/SessionDestinationEvm",
            "solana": "#/components/schemas/SessionDestinationSolana"
          }
        }
      },
      "SessionDisplay": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "Title shown in the payment modal"
          },
          "verb": {
            "type": "string",
            "description": "One-word verb for CTAs",
            "example": "Deposit"
          },
          "themeCssUrl": {
            "type": "string",
            "description": "Custom theme CSS URL"
          },
          "themeMode": {
            "type": "string",
            "enum": ["system", "light", "dark"],
            "description": "Org-controlled theme mode. Defaults to system.",
            "example": "system"
          }
        },
        "required": ["title", "verb"]
      },
      "EvmSource": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "pattern": "^0x[0-9a-fA-F]{40}$",
            "description": "Checksummed Ethereum address"
          },
          "chainId": {
            "type": "number"
          },
          "chainName": {
            "type": "string"
          },
          "tokenAddress": {
            "type": "string",
            "pattern": "^0x[0-9a-fA-F]{40}$",
            "description": "Checksummed Ethereum address"
          },
          "tokenSymbol": {
            "type": "string"
          },
          "sentUnits": {
            "type": "string"
          },
          "txHash": {
            "type": "string",
            "pattern": "^0x[0-9a-fA-F]*$",
            "description": "Hex-encoded bytes"
          }
        },
        "required": [
          "chainId",
          "chainName",
          "tokenAddress",
          "tokenSymbol",
          "sentUnits"
        ]
      },
      "PaymentMethodEvm": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["evm"]
          },
          "receiverAddress": {
            "type": "string",
            "pattern": "^0x[0-9a-fA-F]{40}$",
            "description": "Address that receives user's funds"
          },
          "source": {
            "$ref": "#/components/schemas/EvmSource"
          },
          "createdAt": {
            "type": "number"
          }
        },
        "required": ["type", "receiverAddress", "createdAt"]
      },
      "TronSource": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string"
          },
          "chainId": {
            "type": "number",
            "enum": [728126428]
          },
          "chainName": {
            "type": "string",
            "enum": ["tron"]
          },
          "tokenAddress": {
            "type": "string"
          },
          "tokenSymbol": {
            "type": "string"
          },
          "sentUnits": {
            "type": "string"
          },
          "txHash": {
            "type": "string"
          }
        },
        "required": [
          "chainId",
          "chainName",
          "tokenAddress",
          "tokenSymbol",
          "sentUnits"
        ]
      },
      "PaymentMethodTron": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["tron"]
          },
          "receiverAddress": {
            "type": "string",
            "description": "Tron receiver address"
          },
          "source": {
            "$ref": "#/components/schemas/TronSource"
          },
          "createdAt": {
            "type": "number"
          }
        },
        "required": ["type", "receiverAddress", "createdAt"]
      },
      "SolanaSource": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string"
          },
          "chainId": {
            "type": "number",
            "enum": [501]
          },
          "chainName": {
            "type": "string",
            "enum": ["solana"]
          },
          "tokenAddress": {
            "type": "string"
          },
          "tokenSymbol": {
            "type": "string"
          },
          "sentUnits": {
            "type": "string"
          },
          "txHash": {
            "type": "string"
          }
        },
        "required": [
          "chainId",
          "chainName",
          "tokenAddress",
          "tokenSymbol",
          "sentUnits"
        ]
      },
      "PaymentMethodSolana": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["solana"]
          },
          "source": {
            "$ref": "#/components/schemas/SolanaSource"
          },
          "createdAt": {
            "type": "number"
          }
        },
        "required": ["type", "createdAt"]
      },
      "PaymentMethodStripe": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["stripe"]
          },
          "createdAt": {
            "type": "number"
          }
        },
        "required": ["type", "createdAt"]
      },
      "PaymentMethodFiat": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["fiat"]
          },
          "fiatMethod": {
            "type": "string",
            "enum": [
              "interac",
              "ach",
              "sepa",
              "apple_pay",
              "jpyc",
              "ars",
              "breb"
            ],
            "description": "Selected fiat method, when known",
            "example": "interac"
          },
          "createdAt": {
            "type": "number"
          }
        },
        "required": ["type", "createdAt"]
      },
      "PaymentMethod": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/PaymentMethodEvm"
          },
          {
            "$ref": "#/components/schemas/PaymentMethodTron"
          },
          {
            "$ref": "#/components/schemas/PaymentMethodSolana"
          },
          {
            "$ref": "#/components/schemas/PaymentMethodStripe"
          },
          {
            "$ref": "#/components/schemas/PaymentMethodFiat"
          },
          {
            "type": "null"
          }
        ]
      },
      "SessionPublicInfo": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string",
            "description": "Session ID"
          },
          "status": {
            "type": "string",
            "enum": [
              "requires_payment_method",
              "waiting_payment",
              "processing",
              "succeeded",
              "bounced",
              "expired"
            ],
            "description": "Current session status",
            "example": "requires_payment_method"
          },
          "destination": {
            "$ref": "#/components/schemas/SessionDestination"
          },
          "display": {
            "$ref": "#/components/schemas/SessionDisplay"
          },
          "paymentMethod": {
            "$ref": "#/components/schemas/PaymentMethod"
          },
          "createdAt": {
            "type": "number",
            "description": "Unix timestamp (seconds)",
            "example": 1700000000
          },
          "expiresAt": {
            "type": "number",
            "description": "Unix timestamp (seconds)",
            "example": 1700003600
          }
        },
        "required": [
          "sessionId",
          "status",
          "destination",
          "display",
          "paymentMethod",
          "createdAt",
          "expiresAt"
        ]
      },
      "Session": {
        "allOf": [
          {
            "$ref": "#/components/schemas/SessionPublicInfo"
          },
          {
            "type": "object",
            "properties": {
              "metadata": {
                "type": ["object", "null"],
                "additionalProperties": {
                  "type": "string"
                },
                "description": "Key-value metadata set at creation time. For fiat sessions, set `email` to start at email OTP, or `phone` as an E.164 phone hint for Apple Pay.",
                "example": {
                  "email": "account@daimo.com",
                  "phone": "+14155552671",
                  "orderId": "123"
                }
              },
              "clientSecret": {
                "type": "string",
                "description": "Per-session client secret"
              }
            },
            "required": ["metadata", "clientSecret"]
          }
        ]
      },
      "CreateSessionResponse": {
        "type": "object",
        "properties": {
          "session": {
            "$ref": "#/components/schemas/Session"
          }
        },
        "required": ["session"]
      },
      "V1ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "description": "Error category",
                "example": "validation_error"
              },
              "code": {
                "type": "string",
                "description": "Machine-readable error code",
                "example": "invalid_parameter"
              },
              "message": {
                "type": "string",
                "description": "Human-readable description",
                "example": "invalid session create request"
              },
              "param": {
                "type": "string",
                "description": "Parameter that caused the error",
                "example": "body"
              }
            },
            "required": ["type", "code", "message"]
          }
        },
        "required": ["error"]
      },
      "CreateSessionRequest": {
        "type": "object",
        "properties": {
          "destination": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": ["evm"],
                    "description": "Always \"evm\""
                  },
                  "address": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]{40}$",
                    "description": "Checksummed destination address"
                  },
                  "chainId": {
                    "type": "number",
                    "description": "Destination chain ID (e.g. 8453 for Base)",
                    "example": 8453
                  },
                  "tokenAddress": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]{40}$",
                    "description": "Checksummed destination token address",
                    "example": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                  },
                  "amountUnits": {
                    "type": "string",
                    "description": "Fixed deposit amount in token units (e.g. \"10.00\" for $10 USDC)",
                    "example": "10.00"
                  },
                  "calldata": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]*$",
                    "description": "Hex-encoded calldata for a contract call on the destination address"
                  }
                },
                "required": ["type", "address", "chainId", "tokenAddress"]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": ["solana"],
                    "description": "Always \"solana\""
                  },
                  "address": {
                    "type": "string",
                    "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$",
                    "description": "Base58 destination address"
                  },
                  "tokenAddress": {
                    "type": "string",
                    "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$",
                    "description": "Destination token mint (base58). USDC only.",
                    "example": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
                  },
                  "amountUnits": {
                    "type": "string",
                    "description": "Fixed deposit amount in token units (e.g. \"10.00\" for $10 USDC)",
                    "example": "10.00"
                  }
                },
                "required": ["type", "address", "tokenAddress"]
              }
            ]
          },
          "display": {
            "type": "object",
            "properties": {
              "title": {
                "type": "string",
                "description": "Title shown in the deposit modal",
                "example": "Deposit to Acme"
              },
              "verb": {
                "type": "string",
                "description": "One-word verb for CTAs (e.g. \"Deposit\")",
                "example": "Deposit"
              },
              "themeCssUrl": {
                "type": "string",
                "description": "URL to a custom theme CSS file"
              },
              "paymentMethods": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "mode": {
                        "type": "string",
                        "enum": ["auto"]
                      }
                    },
                    "required": ["mode"]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "mode": {
                        "type": "string",
                        "enum": ["fixed"]
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "ConnectedWallet",
                          "Interac",
                          "ACH",
                          "SEPA",
                          "ApplePay",
                          "CashApp",
                          "Coinbase",
                          "Binance",
                          "Lemon",
                          "BitgetExchange",
                          "BybitExchange",
                          "MtPelerin",
                          "Tron",
                          "ARS",
                          "BreB",
                          "JPYC",
                          "Stripe",
                          "RevolutRamp"
                        ]
                      }
                    },
                    "required": ["mode", "type"]
                  }
                ],
                "description": "Payment method selector. `{ \"mode\": \"auto\" }` shows Daimo's localized payment picker. `{ \"mode\": \"fixed\", \"type\": \"Coinbase\" }` pins the session to one payment method. Mutually exclusive with paymentOptions."
              },
              "paymentOptions": {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "AllWallets",
                        "AllExchanges",
                        "AllFiat",
                        "AllBank",
                        "AllAddresses",
                        "ConnectedWallet",
                        "AutoconnectInjectedWallets",
                        "MetaMask",
                        "Trust",
                        "Phantom",
                        "Rainbow",
                        "BaseApp",
                        "Bitget",
                        "BitgetWallet",
                        "OKX",
                        "Zerion",
                        "Rabby",
                        "Backpack",
                        "Solflare",
                        "Coinbase",
                        "Binance",
                        "BinanceUSDC",
                        "BinanceUSDT",
                        "Lemon",
                        "BitgetExchange",
                        "BybitExchange",
                        "MtPelerin",
                        "CashApp",
                        "Stripe",
                        "RevolutRamp",
                        "Tron",
                        "Interac",
                        "ApplePay",
                        "ACH",
                        "SEPA",
                        "JPYC",
                        "ARS",
                        "BreB",
                        "AccountDeposit",
                        "ExternalChains",
                        "Daimo",
                        "World",
                        "Family",
                        "Farcaster",
                        "MiniPay",
                        "Revolut",
                        "Wise",
                        "MercadoPago",
                        "Venmo",
                        "AllPaymentApps",
                        "Solana"
                      ]
                    },
                    {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "AllWallets",
                          "AllExchanges",
                          "AllFiat",
                          "AllBank",
                          "AllAddresses",
                          "ConnectedWallet",
                          "AutoconnectInjectedWallets",
                          "MetaMask",
                          "Trust",
                          "Phantom",
                          "Rainbow",
                          "BaseApp",
                          "Bitget",
                          "BitgetWallet",
                          "OKX",
                          "Zerion",
                          "Rabby",
                          "Backpack",
                          "Solflare",
                          "Coinbase",
                          "Binance",
                          "BinanceUSDC",
                          "BinanceUSDT",
                          "Lemon",
                          "BitgetExchange",
                          "BybitExchange",
                          "MtPelerin",
                          "CashApp",
                          "Stripe",
                          "RevolutRamp",
                          "Tron",
                          "Interac",
                          "ApplePay",
                          "ACH",
                          "SEPA",
                          "JPYC",
                          "ARS",
                          "BreB",
                          "AccountDeposit",
                          "ExternalChains",
                          "Daimo",
                          "World",
                          "Family",
                          "Farcaster",
                          "MiniPay",
                          "Revolut",
                          "Wise",
                          "MercadoPago",
                          "Venmo",
                          "AllPaymentApps",
                          "Solana"
                        ]
                      }
                    }
                  ]
                },
                "description": "Deprecated: use paymentMethods. Control which payment methods appear and in what order",
                "deprecated": true
              }
            },
            "required": ["title", "verb"]
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Key-value string pairs for your own use. For fiat sessions, set `email` to start at email OTP, or `phone` as an E.164 phone hint for Apple Pay.",
            "example": {
              "email": "account@daimo.com",
              "phone": "+14155552671",
              "orderId": "123"
            }
          },
          "refundAddress": {
            "type": "string",
            "pattern": "^0x[0-9a-fA-F]{40}$",
            "description": "Address to receive funds if a contract call reverts"
          }
        },
        "required": ["destination", "display"]
      },
      "RetrieveSessionResponse": {
        "type": "object",
        "properties": {
          "session": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Session"
              },
              {
                "$ref": "#/components/schemas/SessionPublicInfo"
              }
            ]
          }
        },
        "required": ["session"]
      },
      "CheckSessionResponse": {
        "type": "object",
        "properties": {
          "session": {
            "$ref": "#/components/schemas/SessionPublicInfo"
          }
        },
        "required": ["session"]
      },
      "CheckSessionRequest": {
        "type": "object",
        "properties": {
          "clientSecret": {
            "type": "string",
            "description": "Per-session client secret"
          },
          "txHash": {
            "type": "string",
            "description": "Transaction hash to hint for faster detection"
          }
        },
        "required": ["clientSecret"]
      },
      "CreatePaymentMethodResponse": {
        "type": "object",
        "properties": {
          "session": {
            "$ref": "#/components/schemas/SessionPublicInfo"
          },
          "tron": {
            "type": "object",
            "properties": {
              "receiverAddress": {
                "type": "string",
                "description": "Temporary Tron deposit address"
              },
              "expiresAt": {
                "type": "number",
                "description": "Expiration time (unix seconds)"
              },
              "deeplinks": {
                "type": "object",
                "properties": {
                  "trustWallet": {
                    "type": "object",
                    "properties": {
                      "url": {
                        "type": "string",
                        "description": "Trust Wallet Tron USDT send deeplink for this address and amount"
                      },
                      "label": {
                        "type": "string",
                        "enum": ["USDT on Tron"],
                        "description": "Display label for the Trust Wallet deeplink"
                      }
                    },
                    "required": ["url", "label"]
                  }
                },
                "description": "Optional Tron wallet deeplinks"
              }
            },
            "required": ["receiverAddress", "expiresAt"],
            "description": "Tron-specific response data"
          },
          "solana": {
            "type": "object",
            "properties": {
              "serializedTx": {
                "type": "string",
                "description": "Hex-encoded serialized Solana transaction to sign and submit"
              }
            },
            "required": ["serializedTx"],
            "description": "Solana-specific response data"
          },
          "exchange": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string",
                "description": "Hosted exchange or deeplink URL for the user to open"
              },
              "waitingMessage": {
                "type": "string",
                "description": "Copy to show while waiting for the exchange deposit"
              },
              "waitingInstructions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "text": {
                      "type": "string",
                      "description": "Instruction text"
                    },
                    "emphasis": {
                      "type": "string",
                      "description": "Optional emphasized follow-up line displayed separately"
                    }
                  },
                  "required": ["text"]
                },
                "description": "Structured copy to show while waiting for the exchange deposit"
              },
              "expiresAt": {
                "type": "number",
                "description": "Invoice expiry time (unix seconds). Present for Lightning invoices."
              }
            },
            "required": ["url", "waitingMessage"],
            "description": "Exchange-specific response data"
          },
          "fiat": {
            "type": "object",
            "properties": {
              "hostedUrl": {
                "type": "string",
                "description": "Hosted URL where the user completes KYC and the selected fiat flow"
              },
              "fiatMethod": {
                "type": "string",
                "enum": [
                  "interac",
                  "ach",
                  "sepa",
                  "apple_pay",
                  "jpyc",
                  "ars",
                  "breb"
                ],
                "description": "Selected fiat method for the hosted flow, when the payment method is pinned to one method",
                "example": "interac"
              }
            },
            "required": ["hostedUrl"],
            "description": "Fiat-specific response data"
          },
          "stripe": {
            "type": "object",
            "properties": {
              "onrampSessionClientSecret": {
                "type": "string",
                "description": "Stripe OnrampSession client secret scoped to this onramp session. This is not the Stripe API secret key."
              },
              "publishableKey": {
                "type": "string",
                "description": "Stripe publishable key for the onramp SDK"
              },
              "redirectUrl": {
                "type": "string",
                "description": "Stripe-hosted onramp URL"
              }
            },
            "required": [
              "onrampSessionClientSecret",
              "publishableKey",
              "redirectUrl"
            ],
            "description": "Stripe-specific response data"
          }
        },
        "required": ["session"]
      },
      "CreatePaymentMethodRequest": {
        "type": "object",
        "properties": {
          "clientSecret": {
            "type": "string",
            "description": "Per-session client secret"
          },
          "paymentMethod": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": ["evm"]
                  }
                },
                "required": ["type"],
                "description": "EVM payment method"
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": ["tron"]
                  },
                  "amountUsd": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "description": "Deposit amount in USD",
                    "example": 10
                  }
                },
                "required": ["type", "amountUsd"],
                "description": "Tron payment method"
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": ["solana"]
                  },
                  "walletAddress": {
                    "type": "string",
                    "minLength": 1,
                    "description": "User's Solana wallet address"
                  },
                  "inputTokenMint": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Solana token mint address to pay with"
                  },
                  "amountUsd": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "description": "Deposit amount in USD",
                    "example": 10
                  }
                },
                "required": [
                  "type",
                  "walletAddress",
                  "inputTokenMint",
                  "amountUsd"
                ],
                "description": "Solana payment method"
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": ["exchange"]
                  },
                  "exchangeId": {
                    "type": "string",
                    "enum": [
                      "Coinbase",
                      "Binance",
                      "BinanceUSDC",
                      "BinanceUSDT",
                      "CashApp",
                      "Lemon",
                      "BitgetExchange",
                      "BybitExchange",
                      "MtPelerin",
                      "RevolutRamp"
                    ],
                    "description": "Exchange provider"
                  },
                  "amountUsd": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "description": "Deposit amount in USD",
                    "example": 10
                  },
                  "platform": {
                    "type": "string",
                    "enum": ["ios", "android", "other", "desktop", "mobile"],
                    "description": "Client platform for deeplink behavior"
                  }
                },
                "required": ["type", "exchangeId", "amountUsd"],
                "additionalProperties": false,
                "description": "Exchange payment method"
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": ["exchange"]
                  },
                  "exchangeId": {
                    "type": "string",
                    "enum": [
                      "Coinbase",
                      "Binance",
                      "BinanceUSDC",
                      "BinanceUSDT",
                      "CashApp",
                      "Lemon",
                      "BitgetExchange",
                      "BybitExchange",
                      "MtPelerin",
                      "RevolutRamp"
                    ],
                    "description": "Hosted payment provider"
                  },
                  "sourceAmount": {
                    "type": "object",
                    "properties": {
                      "currency": {
                        "type": "string",
                        "pattern": "^[A-Z]{3}$",
                        "description": "ISO 4217 source currency",
                        "example": "EUR"
                      },
                      "units": {
                        "type": "string",
                        "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$",
                        "description": "Decimal source-currency units",
                        "example": "25.50"
                      }
                    },
                    "required": ["currency", "units"]
                  },
                  "platform": {
                    "type": "string",
                    "enum": ["ios", "android", "other", "desktop", "mobile"],
                    "description": "Client platform for deeplink behavior"
                  }
                },
                "required": ["type", "exchangeId", "sourceAmount"],
                "additionalProperties": false,
                "description": "Currency-aware hosted payment method"
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": ["stripe"]
                  },
                  "amountUsd": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "description": "Deposit amount in USD",
                    "example": 10
                  }
                },
                "required": ["type", "amountUsd"],
                "description": "Stripe Onramp payment method"
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": ["fiat"]
                  },
                  "fiatMethod": {
                    "type": "string",
                    "enum": [
                      "interac",
                      "ach",
                      "sepa",
                      "apple_pay",
                      "jpyc",
                      "ars",
                      "breb"
                    ],
                    "description": "Pins the hosted flow to one rail. If omitted, the hosted page shows every fiat method enabled for the org.",
                    "example": "interac"
                  }
                },
                "required": ["type"],
                "description": "Fiat payment method"
              }
            ]
          }
        },
        "required": ["clientSecret", "paymentMethod"]
      },
      "TokenOption": {
        "type": "object",
        "properties": {
          "chainId": {
            "type": "number",
            "description": "Source chain ID",
            "example": 8453
          },
          "tokenAddress": {
            "type": "string",
            "description": "Source token address"
          },
          "tokenSymbol": {
            "type": "string",
            "description": "Source token symbol",
            "example": "USDC"
          },
          "requiredUnits": {
            "type": "string",
            "description": "Amount to send for this option (non-zero for fixed-amount sessions, may be \"0\" otherwise)",
            "example": "10.02"
          },
          "balanceUnits": {
            "type": "string",
            "description": "User's current wallet balance of this token",
            "example": "125.50"
          }
        },
        "required": [
          "chainId",
          "tokenAddress",
          "tokenSymbol",
          "requiredUnits",
          "balanceUnits"
        ]
      },
      "TokenOptionsResponse": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string",
            "description": "Session ID"
          },
          "options": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TokenOption"
            }
          }
        },
        "required": ["sessionId", "options"]
      },
      "RetrySessionResponse": {
        "type": "object",
        "properties": {
          "session": {
            "$ref": "#/components/schemas/Session"
          }
        },
        "required": ["session"]
      },
      "SumsubKycImport": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Daimo KYC import ID"
          }
        },
        "required": ["id"]
      },
      "ImportSumsubKycResponse": {
        "type": "object",
        "properties": {
          "kycImport": {
            "$ref": "#/components/schemas/SumsubKycImport"
          }
        },
        "required": ["kycImport"]
      },
      "ImportSumsubKycRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "description": "User email verified by your product; must match the imported Sumsub applicant email",
            "example": "user@example.com"
          },
          "shareToken": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024,
            "description": "Sumsub reusable-KYC share token (maximum 1 KiB)"
          }
        },
        "required": ["email", "shareToken"]
      },
      "Webhook": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Webhook endpoint ID"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Delivery URL"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "*",
                "session.processing",
                "session.succeeded",
                "session.bounced"
              ],
              "description": "Webhook event type (or * for all events)",
              "example": "session.succeeded"
            },
            "description": "Subscribed event types ([\"*\"] for all)"
          },
          "description": {
            "type": ["string", "null"],
            "description": "Human-readable label"
          },
          "secret": {
            "type": "string",
            "description": "HMAC signing secret (full on create, redacted on list/get)"
          },
          "createdAt": {
            "type": "number",
            "description": "Unix timestamp (seconds)",
            "example": 1700000000
          }
        },
        "required": [
          "id",
          "url",
          "events",
          "description",
          "secret",
          "createdAt"
        ]
      },
      "CreateWebhookResponse": {
        "type": "object",
        "properties": {
          "webhook": {
            "$ref": "#/components/schemas/Webhook"
          }
        },
        "required": ["webhook"]
      },
      "CreateWebhookRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "description": "HTTPS URL that will receive POST requests",
            "example": "https://example.com/webhooks/daimo"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "*",
                "session.processing",
                "session.succeeded",
                "session.bounced"
              ],
              "description": "Webhook event type (or * for all events)",
              "example": "session.succeeded"
            },
            "description": "Event types to subscribe to. Defaults to [\"*\"]."
          },
          "description": {
            "type": "string",
            "description": "Human-readable label for this endpoint"
          }
        },
        "required": ["url"]
      },
      "ListWebhooksResponse": {
        "type": "object",
        "properties": {
          "webhooks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhook"
            }
          }
        },
        "required": ["webhooks"]
      },
      "RetrieveWebhookResponse": {
        "type": "object",
        "properties": {
          "webhook": {
            "$ref": "#/components/schemas/Webhook"
          }
        },
        "required": ["webhook"]
      },
      "DeleteWebhookResponse": {
        "type": "object",
        "properties": {
          "deleted": {
            "type": "boolean",
            "enum": [true]
          },
          "id": {
            "type": "string"
          }
        },
        "required": ["deleted", "id"]
      },
      "TestWebhookResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [true]
          }
        },
        "required": ["success"]
      },
      "TestWebhookRequest": {
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string",
            "enum": [
              "session.processing",
              "session.succeeded",
              "session.bounced"
            ],
            "description": "Event type to simulate."
          }
        },
        "required": ["eventType"]
      }
    },
    "parameters": {
      "SessionId": {
        "schema": {
          "$ref": "#/components/schemas/SessionId"
        },
        "required": true,
        "name": "sessionId",
        "in": "path"
      },
      "WebhookId": {
        "schema": {
          "$ref": "#/components/schemas/WebhookId"
        },
        "required": true,
        "name": "webhookId",
        "in": "path"
      }
    }
  },
  "paths": {
    "/v1/sessions": {
      "post": {
        "summary": "Create session",
        "description": "Creates a new deposit session. Returns the session object including a client secret for client-side operations.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSessionRequest"
              },
              "example": {
                "destination": {
                  "type": "evm",
                  "address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
                  "chainId": 8453,
                  "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                  "amountUnits": "10.00"
                },
                "display": {
                  "title": "Deposit to Acme",
                  "verb": "Deposit"
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Session created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateSessionResponse"
                },
                "example": {
                  "session": {
                    "sessionId": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
                    "status": "requires_payment_method",
                    "destination": {
                      "type": "evm",
                      "address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
                      "chainId": 8453,
                      "chainName": "Base",
                      "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                      "tokenSymbol": "USDC",
                      "amountUnits": "10.00"
                    },
                    "display": {
                      "title": "Deposit to Acme",
                      "verb": "Deposit"
                    },
                    "paymentMethod": null,
                    "metadata": null,
                    "clientSecret": "d7a8f3b2e1c94a6db8f0e2a7c3d5b9f1",
                    "createdAt": 1700000000,
                    "expiresAt": 1700003600
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sessions/{sessionId}": {
      "get": {
        "summary": "Retrieve session",
        "description": "Retrieves a session by ID. With an API key, returns the full Session (including metadata and clientSecret). Without an API key, returns SessionPublicInfo only.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SessionId"
          }
        ],
        "responses": {
          "200": {
            "description": "Session retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetrieveSessionResponse"
                },
                "example": {
                  "session": {
                    "sessionId": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
                    "status": "waiting_payment",
                    "destination": {
                      "type": "evm",
                      "address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
                      "chainId": 8453,
                      "chainName": "Base",
                      "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                      "tokenSymbol": "USDC",
                      "amountUnits": "10.00"
                    },
                    "display": {
                      "title": "Deposit to Acme",
                      "verb": "Deposit"
                    },
                    "paymentMethod": {
                      "type": "evm",
                      "receiverAddress": "0x1234567890abcdef1234567890abcdef12345678",
                      "createdAt": 1700000000
                    },
                    "metadata": {
                      "orderId": "123"
                    },
                    "clientSecret": "d7a8f3b2e1c94a6db8f0e2a7c3d5b9f1",
                    "createdAt": 1700000000,
                    "expiresAt": 1700003600
                  }
                }
              }
            }
          },
          "404": {
            "description": "Session not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sessions/{sessionId}/check": {
      "put": {
        "summary": "Check session",
        "description": "Checks the current status of a session. Optionally pass a txHash to hint that the user has sent a transaction, which can speed up detection.",
        "parameters": [
          {
            "$ref": "#/components/parameters/SessionId"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckSessionRequest"
              },
              "example": {
                "clientSecret": "d7a8f3b2e1c94a6db8f0e2a7c3d5b9f1"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Session status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckSessionResponse"
                },
                "example": {
                  "session": {
                    "sessionId": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
                    "status": "processing",
                    "destination": {
                      "type": "evm",
                      "address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
                      "chainId": 8453,
                      "chainName": "Base",
                      "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                      "tokenSymbol": "USDC",
                      "amountUnits": "10.00"
                    },
                    "display": {
                      "title": "Deposit to Acme",
                      "verb": "Deposit"
                    },
                    "paymentMethod": {
                      "type": "evm",
                      "receiverAddress": "0x1234567890abcdef1234567890abcdef12345678",
                      "createdAt": 1700000000
                    },
                    "createdAt": 1700000000,
                    "expiresAt": 1700003600
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid client secret",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Session not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sessions/{sessionId}/paymentMethods": {
      "post": {
        "summary": "Create payment method",
        "description": "Sets the payment method for a session. Transitions the session from requires_payment_method to waiting_payment and returns payment data for the selected method. EVM and Tron return receiver addresses, Solana returns a serialized transaction to sign, exchanges return a hosted payment URL plus waiting copy, and fiat returns a hosted URL.",
        "parameters": [
          {
            "$ref": "#/components/parameters/SessionId"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePaymentMethodRequest"
              },
              "example": {
                "clientSecret": "d7a8f3b2e1c94a6db8f0e2a7c3d5b9f1",
                "paymentMethod": {
                  "type": "evm"
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Payment method created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatePaymentMethodResponse"
                },
                "example": {
                  "session": {
                    "sessionId": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
                    "status": "waiting_payment",
                    "destination": {
                      "type": "evm",
                      "address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
                      "chainId": 8453,
                      "chainName": "Base",
                      "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                      "tokenSymbol": "USDC",
                      "amountUnits": "10.00"
                    },
                    "display": {
                      "title": "Deposit to Acme",
                      "verb": "Deposit"
                    },
                    "paymentMethod": {
                      "type": "evm",
                      "receiverAddress": "0x1234567890abcdef1234567890abcdef12345678",
                      "createdAt": 1700000000
                    },
                    "createdAt": 1700000000,
                    "expiresAt": 1700003600
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Invalid client secret",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Session not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sessions/{sessionId}/tokenOptions": {
      "get": {
        "summary": "Token options",
        "description": "Returns wallet-based token options for a session. Requires clientSecret and at least one of evmAddress or solanaAddress. If both wallet addresses are provided, options are merged across both wallets and supported chains.",
        "parameters": [
          {
            "$ref": "#/components/parameters/SessionId"
          },
          {
            "schema": {
              "type": "string",
              "description": "Per-session client secret"
            },
            "required": true,
            "name": "clientSecret",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$",
              "description": "User's EVM wallet address"
            },
            "required": false,
            "description": "Checksummed Ethereum address",
            "name": "evmAddress",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$",
              "description": "User's Solana wallet address"
            },
            "required": false,
            "description": "Solana public key (base58)",
            "name": "solanaAddress",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Token options",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenOptionsResponse"
                },
                "example": {
                  "sessionId": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
                  "options": [
                    {
                      "chainId": 8453,
                      "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                      "tokenSymbol": "USDC",
                      "requiredUnits": "10.00",
                      "balanceUnits": "125.50"
                    },
                    {
                      "chainId": 1,
                      "tokenAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
                      "tokenSymbol": "USDC",
                      "requiredUnits": "10.02",
                      "balanceUnits": "50.00"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Invalid client secret",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Session not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sessions/{sessionId}/retry": {
      "post": {
        "summary": "Retry session",
        "description": "Creates a new session based on an existing one. The new session has a fresh expiration and starts in requires_payment_method status.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SessionId"
          }
        ],
        "responses": {
          "201": {
            "description": "New session created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetrySessionResponse"
                },
                "example": {
                  "session": {
                    "sessionId": "f1e2d3c4b5a6f1e2d3c4b5a6f1e2d3c4",
                    "status": "requires_payment_method",
                    "destination": {
                      "type": "evm",
                      "address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
                      "chainId": 8453,
                      "chainName": "Base",
                      "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                      "tokenSymbol": "USDC",
                      "amountUnits": "10.00"
                    },
                    "display": {
                      "title": "Deposit to Acme",
                      "verb": "Deposit"
                    },
                    "paymentMethod": null,
                    "metadata": null,
                    "clientSecret": "a9b8c7d6e5f4a3b2c1d0e9f8a7b6c5d4",
                    "createdAt": 1700010000,
                    "expiresAt": 1700013600
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Session not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sumsub/import": {
      "post": {
        "summary": "Import Sumsub KYC",
        "description": "Imports reusable Sumsub KYC from a share token after matching its applicant email to the email asserted by the caller.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportSumsubKycRequest"
              },
              "example": {
                "email": "user@example.com",
                "shareToken": "sumsub-share-token"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "KYC import created or refreshed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportSumsubKycResponse"
                },
                "example": {
                  "kycImport": {
                    "id": "02ab4563-07ee-4373-8472-9c7dc1027409"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "KYC import is not enabled for this org",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "KYC import conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhooks": {
      "post": {
        "summary": "Create webhook endpoint",
        "description": "Creates a new webhook endpoint. The response includes the full HMAC signing secret (shown only on creation). See [webhook verification](https://docs.daimo.com/guides/webhooks#verify-signatures) for more information.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Webhook endpoint created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateWebhookResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorResponse"
                }
              }
            }
          }
        }
      },
      "get": {
        "summary": "List webhook endpoints",
        "description": "Lists all active webhook endpoints for the authenticated organization. Secrets are redacted.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook endpoints",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListWebhooksResponse"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhooks/{webhookId}": {
      "get": {
        "summary": "Retrieve webhook endpoint",
        "description": "Retrieves a single webhook endpoint by ID. Secret is redacted.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookId"
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook endpoint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetrieveWebhookResponse"
                }
              }
            }
          },
          "404": {
            "description": "Webhook not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete webhook endpoint",
        "description": "Soft-deletes a webhook endpoint. It will no longer receive events.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookId"
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteWebhookResponse"
                }
              }
            }
          },
          "404": {
            "description": "Webhook not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhooks/{webhookId}/test": {
      "post": {
        "summary": "Send test event",
        "description": "Sends a test webhook event to the specified endpoint. Useful for verifying your webhook handler.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookId"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TestWebhookRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Test event queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TestWebhookResponse"
                }
              }
            }
          },
          "404": {
            "description": "Webhook not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "webhooks": {}
}
