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

# Recover a failed deposit with an owner signature

> Return a failed or rejected deposit's source-chain funds to a user-chosen recipient, authorized by the smart-account owner's EIP-712 signature (not just the API key). The server reconstructs the RecoverDeposit typed data from the stored deposit and verifies it against the account via ERC-1271/ERC-6492, then runs the same claim + transfer path as the refund endpoint. EVM Nexus accounts created by the deposit modal only. Authenticate with an `x-api-key` (write scope).



## OpenAPI

````yaml https://raw.githubusercontent.com/rhinestonewtf/openapi/refs/heads/main/deposit-service.json post /deposits/recover
openapi: 3.1.0
info:
  title: Deposit Service API
  version: 1.0.0
  description: >-
    Cross-chain deposit processing service with automatic token bridging and gas
    sponsorship
servers:
  - url: https://v1.orchestrator.rhinestone.dev/deposit-processor
security: []
paths:
  /deposits/recover:
    post:
      tags:
        - Processing
      summary: Recover a failed deposit with an owner signature
      description: >-
        Return a failed or rejected deposit's source-chain funds to a
        user-chosen recipient, authorized by the smart-account owner's EIP-712
        signature (not just the API key). The server reconstructs the
        RecoverDeposit typed data from the stored deposit and verifies it
        against the account via ERC-1271/ERC-6492, then runs the same claim +
        transfer path as the refund endpoint. EVM Nexus accounts created by the
        deposit modal only. Authenticate with an `x-api-key` (write scope).
      parameters:
        - schema:
            type: string
            description: API key for authentication (omit when sending Authorization)
            example: your-api-key
          required: false
          description: API key for authentication (omit when sending Authorization)
          name: x-api-key
          in: header
        - schema:
            type: string
            description: >-
              Bearer platform token (e.g. forwarded by user-service). Takes
              precedence over `x-api-key` when both are present.
            example: Bearer eyJhbGciOi...
          required: false
          description: >-
            Bearer platform token (e.g. forwarded by user-service). Takes
            precedence over `x-api-key` when both are present.
          name: authorization
          in: header
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RecoverDepositRequestBody'
      responses:
        '200':
          description: Deposit recovered; funds returned on the source chain
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefundDepositResponse'
        '400':
          description: >-
            Deposit not recoverable (DEPOSIT_NOT_RECOVERABLE), account type
            unsupported (RECOVERY_UNSUPPORTED), or signature expired
            (SIGNATURE_EXPIRED)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecoverDepositErrorResponse'
        '401':
          description: Authentication required or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: API key lacks the deposits:write scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: >-
            The refund may have been submitted and is held for reconciliation
            (REFUND_RECONCILIATION_REQUIRED)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecoverDepositErrorResponse'
        '422':
          description: The signature does not authorize this recovery (SIGNATURE_INVALID)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecoverDepositErrorResponse'
        '500':
          description: Recovery transfer failed (REFUND_FAILED)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecoverDepositErrorResponse'
        '503':
          description: >-
            Smart-account signature verification is temporarily unavailable
            (VERIFICATION_UNAVAILABLE)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecoverDepositErrorResponse'
components:
  schemas:
    RecoverDepositRequestBody:
      type: object
      properties:
        chain:
          type: string
          pattern: ^[a-z0-9]+:[a-zA-Z0-9]+$
          description: CAIP-2 chain identifier of the deposit (e.g. "eip155:8453")
          example: eip155:8453
        txHash:
          type: string
          pattern: ^0x[a-fA-F0-9]+$
          description: Source transaction hash of the failed/rejected deposit
          example: 0xabc123...
        account:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}$
          description: Deposit smart account that received the funds
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f5bE91'
        token:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}$
          description: Source token address. Use the zero address for native transfers.
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f5bE91'
        recipient:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}$
          description: Address to receive the recovered tokens on the source chain
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f5bE91'
        deadline:
          type: integer
          exclusiveMinimum: 0
          description: >-
            Unix timestamp (seconds) after which the signature is no longer
            valid
          example: 1800000000
        signature:
          type: string
          pattern: ^0x[a-fA-F0-9]{130}$
          description: >-
            Raw 65-byte ECDSA signature by the account owner over the
            RecoverDeposit typed data
          example: >-
            0x1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
      required:
        - chain
        - txHash
        - account
        - token
        - recipient
        - deadline
        - signature
    RefundDepositResponse:
      type: object
      properties:
        message:
          type: string
        transactionHash:
          type: string
        amount:
          type: string
      required:
        - message
        - transactionHash
        - amount
    RecoverDepositErrorResponse:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
          enum:
            - DEPOSIT_NOT_RECOVERABLE
            - RECOVERY_UNSUPPORTED
            - SIGNATURE_EXPIRED
            - SIGNATURE_INVALID
            - VERIFICATION_UNAVAILABLE
            - REFUND_RECONCILIATION_REQUIRED
            - REFUND_FAILED
      required:
        - error
        - code
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        details:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
              path:
                type: array
                items:
                  anyOf:
                    - type: string
                    - type: number
              code:
                type: string
            required:
              - message
      required:
        - error

````