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

# List wallet transactions

> Transaction history of one wallet in every active vault, or in one vault with `slug`, with the request statuses the Kamui app shows.

- Rows are newest first: by timestamp, then log index (higher first), then transaction hash (higher first). `types` keeps only the listed types.
- Amounts are integer strings in base units: `assets` in the deposit asset (USDC, 6 decimals), `shares` in vault shares (18 decimals). A field the event does not carry is null.
- A request row is `pending` until settled, then `awaiting_shares` (deposit) or `claimable` (redeem request) until claimed, then `completed`. A canceled request and its cancel row are `canceled`. Every other row is `completed`.
- Paging: send `nextCursor` back as `cursor`, with the same `address`, `slug` and `types`. Stop when `nextCursor` is null. A page can hold fewer rows than `limit`, even none. A cursor that does not decode, or that comes from other filters, answers 400 `invalid_cursor`.
- The rows of one cursor chain stop at `snapshotAt`, so an event indexed late never repeats or shifts a row. Request statuses read the chain at `blockNumber`, the latest block when the page is read, so a status can change between pages.
- A wallet with more than 1,000 request, cancel and claim rows, or more than 1,000 rows at one timestamp, answers 503 `history_unavailable`. Any data source failure answers the same 503, never a partial page.
- A legacy slug resolves to its canonical vault, and rows carry the canonical slug.



## OpenAPI

````yaml api-reference/openapi.json POST /users.transactions
openapi: 3.1.0
info:
  title: Kamui External API
  description: >-
    API for Kamui vault data and for the unsigned transactions that deposit into
    a vault or create a redeem request on it, served by a Supabase Edge
    Function. The function never signs or sends a transaction: your users sign
    and send the transactions it builds. It writes no state apart from recording
    when each API key was last used.


    ## Base URL


    `https://api.kamui.finance/functions/v1/external-api`


    ## Requests


    - Call every action as `POST <base URL>/<action>` with a JSON object body
    and `Content-Type: application/json`. The body may be at most 16 KiB.

    - Bodies are strict: an unknown field is a 400, and so is a field named
    twice in one object (`is a duplicate field`).

    - Only POST is allowed. Any other method answers 405 `method_not_allowed`.

    - The function checks the method first, then the API key, then your rate
    limit, then the action. An unknown action counts against your read limit and
    answers 404 `route_not_found` with a valid key, and 401 without one.


    ## Authentication


    - Send your API key in the `x-partner-api-key` header on every request,
    including `health.ping`.

    - A key looks like `kmi_<id>_<secret>`: `kmi_`, 12 lowercase base32
    characters, `_`, then 43 base64url characters (60 characters in total).
    `kmi_<id>` is the key prefix. After creation Kamui sees only the prefix.

    - Kamui issues the keys. The full key is shown once, when it is created, so
    store it in a secret manager. A lost key cannot be recovered; Kamui rotates
    it instead.

    - Rotation issues a new key. The old key keeps working for a grace period
    that Kamui sets when it rotates (24 hours by default), then stops.

    - Kamui can also revoke a key at once.

    - A missing, malformed, unknown, revoked or expired key always answers the
    same 401 `unauthorized`.

    - Call the API from your backend only. The function sends no CORS headers,
    and a browser or mobile app must never hold the key.


    ## Request ids


    - You may send an `x-request-id` header: 1 to 128 letters, digits, `.`, `_`,
    `:` or `-`. Any other value is replaced with a new UUID.

    - Every response carries the id in its `x-request-id` header, and every
    error body in `requestId`. Quote it when you contact Kamui.


    ## Responses


    - Success: `{ "data": …, "asOf": <Unix seconds> }`.

    - Error: `{ "error": "<message>", "code": "<code>", "requestId": "<id>" }`,
    plus `details` (a list of `{ "path", "issue" }`) when the request is
    invalid. Branch on `code`; the message text may change.

    - Responses are never cached (`Cache-Control: no-store`).


    | HTTP | `code` | Meaning |

    | --- | --- | --- |

    | 400 | `invalid_request` | A field is missing, has the wrong type or value,
    or is unknown. See `details`. |

    | 400 | `invalid_amount` | The amount is above the per-request limit. See
    `details`. |

    | 400 | `amount_below_minimum` | The deposit is below the minimum. See
    `details`. |

    | 401 | `unauthorized` | The API key is missing, malformed, unknown, revoked
    or expired. |

    | 403 | `actions_not_enabled` | Transaction building is not enabled for your
    API client. Ask Kamui. |

    | 403 | `wallet_not_allowed` | The vault's allow list (`isAllowed`) does not
    accept the wallet. |

    | 404 | `route_not_found` | The action does not exist. |

    | 404 | `vault_not_found` | No vault has this slug. |

    | 405 | `method_not_allowed` | Use POST. |

    | 409 | `vault_not_active` | The vault exists but is not open yet. |

    | 409 | `vault_paused` | The vault is paused. |

    | 409 | `deposits_unavailable` | The vault does not accept synchronous
    deposits now (sync mode, or the NAV is being updated). |

    | 409 | `deposit_cap_reached` | The deposit would exceed the vault's cap. |

    | 409 | `redeem_request_already_pending` | The wallet already has a redeem
    request waiting for settlement in this vault. |

    | 413 | `payload_too_large` | The body is over 16 KiB. |

    | 415 | `unsupported_media_type` | Send `Content-Type: application/json`. |

    | 422 | `insufficient_balance` | The wallet holds less USDC than the
    deposit. |

    | 422 | `insufficient_shares` | The wallet holds fewer shares than the
    redeem request. |

    | 422 | `simulation_failed` | A built transaction reverts in simulation.
    `details` names the transaction and the error. |

    | 429 | `rate_limited` | Your client is over its per-minute limit. Wait
    `Retry-After` seconds. |

    | 500 | `internal_error` | Unexpected error. Retry later and quote the
    request id. |

    | 502 | `upstream_error` | A data source (the vault indexer or the chain)
    returned an error. Retry with backoff. |

    | 503 | `service_unavailable` | The service is temporarily unavailable.
    Retry with backoff. |

    | 503 | `actions_disabled` | Transaction building is switched off. The read
    actions still answer. |

    | 504 | `upstream_timeout` | A data source did not answer in time. Retry
    with backoff. |


    ## Data conventions


    - Onchain amounts are base-unit integer strings: USDC has 6 decimals, vault
    shares have 18.

    - In `vaults.history`, share prices and TVL are decimal strings in the
    deposit asset, with its decimals (`"1.002182"`).

    - APY and APR values are numbers in percent (`3.55` is 3.55% a year). Fees
    are in basis points (`100` is 1%).

    - USD values are numbers for display. USDC counts as exactly $1.

    - Timestamps are Unix seconds, UTC.

    - Addresses are accepted in lowercase or EIP-55 and returned in EIP-55.
    Other mixed case, all-uppercase hex and a `0X` prefix are a 400.

    - Vault slugs: `stable-vault`, `balanced-vault`, `boosted-vault`. The legacy
    slugs `advanced-vault` and `aggressive-vault` are accepted; responses always
    carry the canonical slug. Slugs are matched exactly: case and whitespace
    count, so `Stable-Vault` is a 400.

    - `users.transactions` cursors are opaque and signed. Send `nextCursor` back
    unchanged, with the same filters; a changed cursor is a 400
    `invalid_cursor`.

    - Ethereum mainnet only (`chainId` 1).


    ## Transactions


    `transaction.quote` and `transaction.build` cover two transaction types, set
    in the body's `type`:


    - `DEPOSIT`: a synchronous deposit of USDC (`syncDeposit`). The shares are
    minted in the same transaction.

    - `REDEEM_REQUEST`: a redeem request (`requestRedeem`). The shares leave the
    wallet at once, and the vault settles the request later. A redeem request is
    the only way out of a Kamui vault.


    Both take the vault's `slug` in the body, like every other action.


    - `transaction.quote` prices the transaction and says whether the vault
    takes it now (`availability`). It builds no transaction.

    - `transaction.build` runs every check in a fixed order (the first failure
    answers), returns the unsigned transactions and simulates them.

    - Send the transactions in `step` order from `from`, and wait for each
    receipt before you send the next. Each `to` is the vault or, for an
    approval, the deposit asset; `value` is always `"0"`. An approval is for the
    exact deposit amount, never unlimited.

    - Every read is pinned to `blockNumber`, and the simulation runs on top of
    it. Build again after a 409, or when more than 10 minutes have passed.

    - Once a redeem request settles, its assets are claimable. The API builds no
    claim: the wallet claims them in the Kamui app, or Lagoon pays them out in
    the wallet's next redeem request (`claimFirst`).

    - Transaction building must be enabled for your API client; until it is,
    both actions answer 403 `actions_not_enabled`.

    - Transaction building can be switched off. It then answers 503
    `actions_disabled`, and the read actions keep answering.


    ## Limits


    - Each client has per-minute request limits, shared by all of its API keys:
    one for the read actions and a lower one for the transaction-building
    actions. By default they are 120 read requests and 20 transaction requests a
    minute; Kamui can set other limits for your client.

    - Every request with a valid API key counts, whatever the answer: a 400, 413
    or 415 counts too, and an unknown action counts against the read limit. A
    request without a valid key (401) or with another method (405) does not
    count.

    - The transaction limit is checked before transaction building's own checks,
    so a 429 can come before a 403 `actions_not_enabled` or a 503
    `actions_disabled`.

    - The windows are fixed UTC minutes. Every counted response carries
    `RateLimit-Policy` (for example `"read";q=120;w=60`: the limit and the
    window in seconds), `RateLimit` (`"read";r=119;t=42`: the requests left and
    the seconds until the window resets), and `X-RateLimit-Limit`,
    `X-RateLimit-Remaining` and `X-RateLimit-Reset` (Unix seconds).

    - Over the limit, the API answers 429 `rate_limited` with `Retry-After` in
    seconds. Wait that long before the next request.

    - If Kamui cannot check the limit for a moment, the read actions still
    answer (without the rate-limit headers), and the transaction actions answer
    503 `service_unavailable`.

    - Avoid tight polling loops.
  version: 1.0.0
  contact:
    name: Kamui
    url: https://kamui.finance
servers:
  - url: '{baseUrl}'
    description: Kamui External API
    variables:
      baseUrl:
        default: https://api.kamui.finance/functions/v1/external-api
        description: >-
          The API base URL. It defaults to production; change it only if Kamui
          gave you another base URL.
security: []
tags:
  - name: Health
    description: Check that the API is up and that your key works.
  - name: Vaults
    description: Vault data that is the same for every wallet.
  - name: Users
    description: Data about one wallet.
  - name: Transactions
    description: >-
      Quotes and unsigned transactions that deposit into a vault or create a
      redeem request on it, and the checks behind them.
paths:
  /users.transactions:
    post:
      tags:
        - Users
      summary: List wallet transactions
      description: >-
        Transaction history of one wallet in every active vault, or in one vault
        with `slug`, with the request statuses the Kamui app shows.


        - Rows are newest first: by timestamp, then log index (higher first),
        then transaction hash (higher first). `types` keeps only the listed
        types.

        - Amounts are integer strings in base units: `assets` in the deposit
        asset (USDC, 6 decimals), `shares` in vault shares (18 decimals). A
        field the event does not carry is null.

        - A request row is `pending` until settled, then `awaiting_shares`
        (deposit) or `claimable` (redeem request) until claimed, then
        `completed`. A canceled request and its cancel row are `canceled`. Every
        other row is `completed`.

        - Paging: send `nextCursor` back as `cursor`, with the same `address`,
        `slug` and `types`. Stop when `nextCursor` is null. A page can hold
        fewer rows than `limit`, even none. A cursor that does not decode, or
        that comes from other filters, answers 400 `invalid_cursor`.

        - The rows of one cursor chain stop at `snapshotAt`, so an event indexed
        late never repeats or shifts a row. Request statuses read the chain at
        `blockNumber`, the latest block when the page is read, so a status can
        change between pages.

        - A wallet with more than 1,000 request, cancel and claim rows, or more
        than 1,000 rows at one timestamp, answers 503 `history_unavailable`. Any
        data source failure answers the same 503, never a partial page.

        - A legacy slug resolves to its canonical vault, and rows carry the
        canonical slug.
      operationId: users_transactions
      parameters:
        - $ref: '#/components/parameters/RequestId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              type: object
              properties:
                address:
                  description: >-
                    Ethereum address: `0x` and 40 hex characters, in lowercase
                    or with a valid EIP-55 checksum. Other mixed case,
                    all-uppercase hex, a `0X` prefix and the zero address answer
                    400.
                  type: string
                  minLength: 42
                  maxLength: 42
                  pattern: ^0x[0-9a-fA-F]{40}$
                slug:
                  type: string
                  minLength: 1
                  maxLength: 64
                  pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
                  description: >-
                    Vault slug, matched exactly: lowercase letters, digits and
                    single hyphens (`stable-vault`). Case and whitespace count,
                    so `Stable-Vault` and ` stable-vault` answer 400. A legacy
                    slug works; the response carries the canonical one.
                types:
                  minItems: 1
                  maxItems: 8
                  type: array
                  items:
                    type: string
                    enum:
                      - DEPOSIT
                      - DEPOSIT_REQUEST
                      - DEPOSIT_CLAIM
                      - DEPOSIT_CANCEL
                      - REDEEM_REQUEST
                      - REDEEM_CANCEL
                      - WITHDRAW
                      - WITHDRAW_INSTANT
                limit:
                  type: integer
                  minimum: 1
                  maximum: 100
                cursor:
                  type: string
                  minLength: 1
                  maxLength: 256
                  pattern: ^[A-Za-z0-9_-]+$
                  description: >-
                    The previous page's `nextCursor`, unchanged. It is opaque
                    and signed: a changed cursor, or one sent with another
                    `address`, `slug` or `types`, answers 400 `invalid_cursor`.
              required:
                - address
              additionalProperties: false
            examples:
              firstPage:
                summary: 'First page: every active vault and type, 50 rows'
                value:
                  address: '0x1111111111111111111111111111111111111111'
              filtered:
                summary: One vault, some types, 20 rows per page
                value:
                  address: '0x1111111111111111111111111111111111111111'
                  slug: stable-vault
                  types:
                    - REDEEM_REQUEST
                    - WITHDRAW
                  limit: 20
              nextPage:
                summary: 'Next page: the previous nextCursor with the same filters'
                value:
                  address: '0x1111111111111111111111111111111111111111'
                  cursor: >-
                    eyJ2IjozLCJhc09mIjoxNzkxNDU0ODAwLCJ0cyI6MTc5MDk4NTYwMCwibG9nIjo4NywidHgiOiIweDNjM2MzYzNjM2MzYzNjM2MzYzNjM2MzYzNjM2MzYzNjM2MzYzNjM2MzYzNjM2MzYzNjM2MzYzNjM2MzYzNjM2MiLCJtYWMiOiIxNmNkMGQxNTNjY2ExMWZjODIzNmZhMzNiNzhjNjdjYSJ9
      responses:
        '200':
          description: Success
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
            ratelimit-policy:
              $ref: '#/components/headers/RateLimitPolicy'
            ratelimit:
              $ref: '#/components/headers/RateLimit'
            x-ratelimit-limit:
              $ref: '#/components/headers/XRateLimitLimit'
            x-ratelimit-remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            x-ratelimit-reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      address:
                        type: string
                      chainId:
                        type: number
                        const: 1
                      snapshotAt:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                      blockNumber:
                        anyOf:
                          - type: integer
                            minimum: 0
                            maximum: 9007199254740991
                          - type: 'null'
                      items:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            type:
                              type: string
                              enum:
                                - DEPOSIT
                                - DEPOSIT_REQUEST
                                - DEPOSIT_CLAIM
                                - DEPOSIT_CANCEL
                                - REDEEM_REQUEST
                                - REDEEM_CANCEL
                                - WITHDRAW
                                - WITHDRAW_INSTANT
                            status:
                              type: string
                              enum:
                                - completed
                                - pending
                                - awaiting_shares
                                - claimable
                                - canceled
                            vault:
                              type: object
                              properties:
                                slug:
                                  type: string
                                address:
                                  type: string
                              required:
                                - slug
                                - address
                              additionalProperties: false
                            timestamp:
                              type: integer
                              minimum: 0
                              maximum: 9007199254740991
                            transactionHash:
                              type: string
                            logIndex:
                              type: integer
                              minimum: 0
                              maximum: 9007199254740991
                            requestId:
                              anyOf:
                                - type: string
                                - type: 'null'
                            assets:
                              anyOf:
                                - type: string
                                  pattern: ^[0-9]{1,78}$
                                - type: 'null'
                            shares:
                              anyOf:
                                - type: string
                                  pattern: ^[0-9]{1,78}$
                                - type: 'null'
                          required:
                            - id
                            - type
                            - status
                            - vault
                            - timestamp
                            - transactionHash
                            - logIndex
                            - requestId
                            - assets
                            - shares
                          additionalProperties: false
                      nextCursor:
                        anyOf:
                          - type: string
                          - type: 'null'
                    required:
                      - address
                      - chainId
                      - snapshotAt
                      - blockNumber
                      - items
                      - nextCursor
                    additionalProperties: false
                  asOf:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                required:
                  - data
                  - asOf
                additionalProperties: false
              examples:
                page:
                  summary: Illustrative wallet, amounts and hashes (rows trimmed)
                  value:
                    data:
                      address: '0x1111111111111111111111111111111111111111'
                      chainId: 1
                      snapshotAt: 1791454800
                      blockNumber: 26124800
                      items:
                        - id: >-
                            0x1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a-214
                          type: REDEEM_REQUEST
                          status: claimable
                          vault:
                            slug: stable-vault
                            address: '0xcDA323c2DF692d989B24BA51D0aCCa924cf9a344'
                          timestamp: 1791331200
                          transactionHash: >-
                            0x1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a
                          logIndex: 214
                          requestId: '41'
                          assets: null
                          shares: '250000000000000000000'
                        - id: >-
                            0x2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b-33
                          type: DEPOSIT
                          status: completed
                          vault:
                            slug: balanced-vault
                            address: '0xA5AE405242f42C47996a0C6857ff10a77F9bdeE6'
                          timestamp: 1791158400
                          transactionHash: >-
                            0x2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b
                          logIndex: 33
                          requestId: null
                          assets: '1000000000'
                          shares: '997820000000000000000'
                        - id: >-
                            0x3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c-87
                          type: WITHDRAW
                          status: completed
                          vault:
                            slug: stable-vault
                            address: '0xcDA323c2DF692d989B24BA51D0aCCa924cf9a344'
                          timestamp: 1790985600
                          transactionHash: >-
                            0x3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c
                          logIndex: 87
                          requestId: null
                          assets: '150300000'
                          shares: '150000000000000000000'
                      nextCursor: >-
                        eyJ2IjozLCJhc09mIjoxNzkxNDU0ODAwLCJ0cyI6MTc5MDk4NTYwMCwibG9nIjo4NywidHgiOiIweDNjM2MzYzNjM2MzYzNjM2MzYzNjM2MzYzNjM2MzYzNjM2MzYzNjM2MzYzNjM2MzYzNjM2MzYzNjM2MzYzNjM2MiLCJtYWMiOiIxNmNkMGQxNTNjY2ExMWZjODIzNmZhMzNiNzhjNjdjYSJ9
                    asOf: 1791454901
                empty:
                  summary: A wallet with no history
                  value:
                    data:
                      address: '0x1111111111111111111111111111111111111111'
                      chainId: 1
                      snapshotAt: 1791454800
                      blockNumber: null
                      items: []
                      nextCursor: null
                    asOf: 1791454901
        '400':
          description: The request is not valid. `details` names each failing field.
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalApiError'
              examples:
                invalidAddress:
                  summary: Address of the wrong length
                  value:
                    error: The request is not valid. See details.
                    code: invalid_request
                    requestId: 77a100bc-55a6-40ea-9314-2222f335350e
                    details:
                      - path: body.address
                        issue: must be 42 characters long
                unknownType:
                  summary: Unknown transaction type
                  value:
                    error: The request is not valid. See details.
                    code: invalid_request
                    requestId: 9e700215-0cc9-4f43-ad68-86b0b57d110b
                    details:
                      - path: body.types.0
                        issue: >-
                          Invalid option: expected one of
                          "DEPOSIT"|"DEPOSIT_REQUEST"|"DEPOSIT_CLAIM"|"DEPOSIT_CANCEL"|"REDEEM_REQUEST"|"REDEEM_CANCEL"|"WITHDRAW"|"WITHDRAW_INSTANT"
                limitTooHigh:
                  summary: limit above 100
                  value:
                    error: The request is not valid. See details.
                    code: invalid_request
                    requestId: b4f59ce9-e671-4ab5-ba70-260fa0b9801c
                    details:
                      - path: body.limit
                        issue: 'Too big: expected number to be <=100'
                invalidCursor:
                  summary: >-
                    A cursor that does not decode, or that comes from other
                    filters
                  value:
                    error: The cursor is not valid. Start again from the first page.
                    code: invalid_cursor
                    requestId: 3b8d5f1e-7a24-4c69-9e0b-6d2f8a4c1e75
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/VaultNotFound'
        '409':
          $ref: '#/components/responses/VaultNotActive'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/HistoryUnavailable'
        default:
          description: Error
          content:
            application/json:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                    enum:
                      - invalid_request
                      - invalid_address
                      - invalid_amount
                      - amount_below_minimum
                      - invalid_cursor
                      - unsupported_chain
                      - wallet_not_allowed
                      - vault_not_found
                      - route_not_found
                      - method_not_allowed
                      - vault_not_active
                      - vault_paused
                      - deposits_unavailable
                      - deposit_cap_reached
                      - redeem_request_already_pending
                      - payload_too_large
                      - unsupported_media_type
                      - insufficient_balance
                      - insufficient_shares
                      - simulation_failed
                      - rate_limited
                      - jurisdiction_restricted
                      - internal_error
                      - upstream_error
                      - service_unavailable
                      - actions_disabled
                      - history_unavailable
                      - upstream_timeout
                      - unauthorized
                      - actions_not_enabled
                  requestId:
                    type: string
                  details:
                    maxItems: 10
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                          maxLength: 128
                        issue:
                          type: string
                          maxLength: 200
                      required:
                        - path
                        - issue
                      additionalProperties: false
                required:
                  - error
                  - code
                  - requestId
                additionalProperties: false
      security:
        - partnerApiKey: []
components:
  parameters:
    RequestId:
      name: x-request-id
      in: header
      required: false
      description: >-
        Your id for this request: 1 to 128 letters, digits, `.`, `_`, `:` or
        `-`. It is echoed in the response. Any other value is replaced with a
        new UUID.
      schema:
        type: string
        pattern: ^[A-Za-z0-9._:-]{1,128}$
  headers:
    RequestId:
      description: >-
        The request id: yours when it was valid, otherwise a new UUID. Quote it
        when you contact Kamui.
      schema:
        type: string
    RateLimitPolicy:
      description: >-
        Your client's limit for this kind of action, as an IETF RateLimit-Policy
        field: `"read";q=120;w=60` is 120 requests per 60-second window.
        `"actions"` is the transaction-building actions.
      schema:
        type: string
    RateLimit:
      description: >-
        The current window, as an IETF RateLimit field: `"read";r=119;t=42` is
        119 requests left and 42 seconds until the window resets.
      schema:
        type: string
    XRateLimitLimit:
      description: Requests allowed in the current window.
      schema:
        type: integer
    XRateLimitRemaining:
      description: Requests left in the current window.
      schema:
        type: integer
    XRateLimitReset:
      description: When the current window resets, in Unix seconds.
      schema:
        type: integer
    RetryAfter:
      description: Seconds to wait before the next request.
      schema:
        type: integer
  schemas:
    ExternalApiError:
      $schema: https://json-schema.org/draft/2020-12/schema
      type: object
      properties:
        error:
          type: string
        code:
          type: string
          enum:
            - invalid_request
            - invalid_address
            - invalid_amount
            - amount_below_minimum
            - invalid_cursor
            - unsupported_chain
            - wallet_not_allowed
            - vault_not_found
            - route_not_found
            - method_not_allowed
            - vault_not_active
            - vault_paused
            - deposits_unavailable
            - deposit_cap_reached
            - redeem_request_already_pending
            - payload_too_large
            - unsupported_media_type
            - insufficient_balance
            - insufficient_shares
            - simulation_failed
            - rate_limited
            - jurisdiction_restricted
            - internal_error
            - upstream_error
            - service_unavailable
            - actions_disabled
            - history_unavailable
            - upstream_timeout
            - unauthorized
            - actions_not_enabled
        requestId:
          type: string
        details:
          maxItems: 10
          type: array
          items:
            type: object
            properties:
              path:
                type: string
                maxLength: 128
              issue:
                type: string
                maxLength: 200
            required:
              - path
              - issue
            additionalProperties: false
      required:
        - error
        - code
        - requestId
      additionalProperties: false
  responses:
    Unauthorized:
      description: The API key is missing, malformed, unknown, revoked or expired.
      headers:
        x-request-id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ExternalApiError'
          examples:
            unauthorized:
              summary: The API key is missing, malformed, unknown, revoked or expired.
              value:
                error: Unauthorized.
                code: unauthorized
                requestId: ea80702c-a332-4e32-922e-76bcb02e6156
    VaultNotFound:
      description: No vault has this slug.
      headers:
        x-request-id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ExternalApiError'
          examples:
            vault_not_found:
              summary: No vault has this slug.
              value:
                error: No vault exists with this slug.
                code: vault_not_found
                requestId: 3e515e1a-ad93-4506-81fc-aa47575c15f6
    VaultNotActive:
      description: The vault exists but is not open yet.
      headers:
        x-request-id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ExternalApiError'
          examples:
            vault_not_active:
              summary: The vault exists but is not open yet.
              value:
                error: This vault is not open yet.
                code: vault_not_active
                requestId: 6f1d2c3b-8a47-4e59-b0c6-2d9e4f7a1b85
    PayloadTooLarge:
      description: The body is over 16 KiB.
      headers:
        x-request-id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ExternalApiError'
          examples:
            payload_too_large:
              summary: The body is over 16 KiB.
              value:
                error: The request body is too large.
                code: payload_too_large
                requestId: 0c8e5a7d-3f21-4b96-a4d8-7e1b9c2f6a30
    UnsupportedMediaType:
      description: The body was not sent as application/json.
      headers:
        x-request-id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ExternalApiError'
          examples:
            unsupported_media_type:
              summary: The body was not sent as application/json.
              value:
                error: Send the request body as application/json.
                code: unsupported_media_type
                requestId: 9b4f6e2a-1c7d-4a85-8e3f-5d0a2b6c9e17
    RateLimited:
      description: >-
        Your client is over its per-minute limit for this kind of action. Wait
        `Retry-After` seconds before the next request.
      headers:
        x-request-id:
          $ref: '#/components/headers/RequestId'
        retry-after:
          $ref: '#/components/headers/RetryAfter'
        ratelimit-policy:
          $ref: '#/components/headers/RateLimitPolicy'
        ratelimit:
          $ref: '#/components/headers/RateLimit'
        x-ratelimit-limit:
          $ref: '#/components/headers/XRateLimitLimit'
        x-ratelimit-remaining:
          $ref: '#/components/headers/XRateLimitRemaining'
        x-ratelimit-reset:
          $ref: '#/components/headers/XRateLimitReset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ExternalApiError'
          examples:
            rate_limited:
              summary: >-
                Your client is over its per-minute limit for this kind of
                action. Wait `Retry-After` seconds before the next request.
              value:
                error: Too many requests. Wait and try again.
                code: rate_limited
                requestId: 8e2f4a6c-1b3d-4e5f-9a7b-0c2d4e6f8a1b
    InternalError:
      description: Unexpected error. Retry later and quote the request id.
      headers:
        x-request-id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ExternalApiError'
          examples:
            internal_error:
              summary: Unexpected error. Retry later and quote the request id.
              value:
                error: An unexpected error occurred.
                code: internal_error
                requestId: 4a7c9e1f-6b2d-4f83-9c05-8e3a1d7b2f64
    HistoryUnavailable:
      description: >-
        Transaction history is unavailable. Either a data source failed or did
        not answer in time (retry with backoff), or the wallet passes a history
        limit: more than 1,000 request, cancel and claim rows, or more than
        1,000 rows at one timestamp. No partial page is returned.
      headers:
        x-request-id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ExternalApiError'
          examples:
            history_unavailable:
              summary: >-
                Transaction history is unavailable. Either a data source failed
                or did not answer in time (retry with backoff), or the wallet
                passes a history limit: more than 1,000 request, cancel and
                claim rows, or more than 1,000 rows at one timestamp. No partial
                page is returned.
              value:
                error: Transaction history is temporarily unavailable.
                code: history_unavailable
                requestId: cfc8206a-76f3-4ff5-8df4-8a3f46b83035
            service_unavailable:
              summary: The service is temporarily unavailable. Retry with backoff.
              value:
                error: The service is temporarily unavailable.
                code: service_unavailable
                requestId: 28c33b76-86cc-4129-a66f-9e9e1ca3f872
  securitySchemes:
    partnerApiKey:
      type: apiKey
      in: header
      name: x-partner-api-key
      description: >-
        The client's own API key (`kmi_<id>_<secret>`), issued by Kamui. A
        missing, malformed, unknown, revoked or expired key answers 401
        unauthorized.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.