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

# Create a wallet

> Provisions your wallet. The wallet is co-owned by your passkey (supplied as
`ownerKey` + `credentialId`) and a Circle-provisioned ECDSA key. Circle
derives the MSCA address and signs the setup UserOperation for you.

Asynchronous. Returns an `onchainJob` of `jobType = wallet_setup`. Poll the
job until it reaches `completed`. You can have only one wallet.




## OpenAPI

````yaml openapi/digital-asset-backed-borrowing.yaml post /v1/borrow/wallets
openapi: 3.0.2
info:
  version: ${version}
  title: Digital Asset-Backed Borrowing API
  description: >
    The Digital Asset-Backed Borrowing API lets you borrow stablecoin liquidity
    against onchain collateral. It uses a dedicated wallet to hold collateral
    and borrowed funds, and Circle handles the onchain transactions. Write
    operations are asynchronous and return a job that can be polled for status.
servers:
  - url: https://api-sandbox.circle.com
  - url: https://api.circle.com
security: []
tags:
  - name: Borrow Wallets
    description: >-
      Provision and inspect the per-entity MSCA wallet that holds collateral and
      borrowed funds.
  - name: Borrow Loans
    description: Originate, inspect, repay, and add collateral to borrow positions.
  - name: Borrow Jobs
    description: Observe asynchronous onchain operations.
  - name: Borrow Markets
    description: Discover allowlisted lending markets.
paths:
  /v1/borrow/wallets:
    post:
      tags:
        - Borrow Wallets
      summary: Create a wallet
      description: >
        Provisions your wallet. The wallet is co-owned by your passkey (supplied
        as

        `ownerKey` + `credentialId`) and a Circle-provisioned ECDSA key. Circle

        derives the MSCA address and signs the setup UserOperation for you.


        Asynchronous. Returns an `onchainJob` of `jobType = wallet_setup`. Poll
        the

        job until it reaches `completed`. You can have only one wallet.
      operationId: createBorrowWallet
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OnchainWalletCreationRequest'
      responses:
        '202':
          description: >-
            Request to create a wallet accepted. Poll the returned job to track
            its status.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          content:
            application/json:
              schema:
                title: CreateBorrowWalletResponse
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/OnchainJob'
              examples:
                response:
                  value:
                    data:
                      id: 1a2b3c4d-5e6f-7089-abcd-ef1234567890
                      jobType: wallet_setup
                      status: received
                      createDate: '2026-06-20T14:10:00.000Z'
                      updateDate: '2026-06-20T14:10:00.000Z'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/NotAuthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
      security:
        - bearerAuth: []
components:
  schemas:
    OnchainWalletCreationRequest:
      type: object
      description: |
        Request to create your wallet. Provide your passkey's public key and
        WebAuthn credential ID. Circle derives the MSCA address and signs all
        UserOperations for you.
      required:
        - idempotencyKey
        - ownerKey
        - credentialId
      properties:
        idempotencyKey:
          type: string
          format: uuid
          description: >
            [Idempotency
            key](https://developers.circle.com/api-reference/idempotent-requests)

            (UUID v4) for this request. Reusing it with a different body returns

            `409 Conflict`.
        ownerKey:
          type: string
          description: Hex-encoded raw P256 public key bytes of your passkey.
        credentialId:
          type: string
          description: >
            Hex-encoded WebAuthn credential identifier captured during passkey
            registration.

            Stored on the passkey owner record and returned by `GET
            /v1/borrow/wallets`.
    OnchainJob:
      type: object
      description: >
        An async onchain operation. Each job represents one of: borrow, repay,

        add collateral, wallet setup, owner change, or residual withdraw. Poll

        this resource until the job reaches a terminal status (`completed`,

        `failed`, or `approval_rejected`). Fields that do not apply to the
        current

        status or job type are omitted rather than returned as null.
      required:
        - id
        - jobType
        - status
        - createDate
        - updateDate
      properties:
        id:
          type: string
          format: uuid
          description: Identifier of the job.
        jobType:
          type: string
          enum:
            - borrow
            - repay
            - add_collateral
            - wallet_setup
            - withdraw_residual
            - add_owner
            - remove_owner
          description: The onchain operation this job performs.
        status:
          type: string
          enum:
            - received
            - awaiting_approval
            - submitted
            - confirmed
            - completed
            - failed
            - approval_rejected
          description: >
            Lifecycle state of the job. Typical progression: `received` →

            `awaiting_approval` (for `borrow`, `repay`, and `add_collateral`
            only) →

            `submitted` → `confirmed` → `completed`. Terminal failure states:
            `failed`

            (the underlying onchain operation did not succeed) and
            `approval_rejected`

            (the approval workflow rejected the funds transfer). The `error`
            field

            carries the human-readable reason for either failure.
        amount:
          type: string
          description: >
            The amount this job acts on, in native token units (decimal string).

            Meaning depends on `jobType`: amount borrowed for `borrow`, amount

            repaid for `repay`, collateral added for `add_collateral`, residual

            collateral withdrawn for `withdraw_residual`. Omitted for
            `wallet_setup`.
        asset:
          type: string
          description: |
            Circle currency code of the asset for `amount`, such as `USD` or
            `CIRBTC`. For `add_collateral` and `withdraw_residual`, this is the
            collateral asset. Omitted for `wallet_setup`.
        collateralAmount:
          type: string
          description: >
            Collateral amount in native token units (decimal string). Present
            for `borrow`

            (collateral posted at origination) and `add_collateral` (mirrors
            `amount`); omitted for

            `repay`, `withdraw_residual`, and `wallet_setup`.
        collateralAsset:
          type: string
          description: Circle currency code of `collateralAmount`, such as `CIRBTC`.
        toAddress:
          type: string
          description: >
            The destination address for the transaction, for display in a
            transaction

            view. Varies by `jobType`:

              - `borrow`: the wallet's USDC deposit address, which receives the borrowed funds.
              - `repay`, `add_collateral`: the lending market's contract address.
              - `withdraw_residual`: the wallet's cirBTC deposit address, which receives the residual collateral.
              - `wallet_setup`: omitted.
        loanId:
          type: string
          format: uuid
          description: Identifier of the loan this job targets. Omitted for `wallet_setup`.
        transferId:
          type: string
          format: uuid
          description: >
            Identifier of the transfer that funds this job. Present for jobs
            that

            pass through the approval workflow: `borrow`, `repay`, and

            `add_collateral`. Omitted for other job types.
        oraclePrice:
          type: string
          description: >
            Collateral oracle price at the time of job creation, denominated in
            the

            borrow asset. Decimal string. Present for `borrow`, `repay`,

            `add_collateral`, and `withdraw_residual`. Omitted for
            `wallet_setup`,

            `add_owner`, and `remove_owner`.
        userOpHash:
          type: string
          description: >-
            UserOperation hash returned by the bundler. Present once `status`
            reaches `submitted`.
        txHash:
          type: string
          description: Onchain transaction hash. Present once `status` reaches `confirmed`.
        error:
          type: string
          description: >
            Human-readable failure reason. Present only when `status` is
            `failed` or

            `approval_rejected`.
        createDate:
          type: string
          format: date-time
          description: Date and time when the job was created.
        updateDate:
          type: string
          format: date-time
          description: Date and time when the job was last updated.
      example:
        id: b3d9d2d5-4c12-4946-a09d-953e82fae2b0
        jobType: borrow
        status: completed
        amount: '1000.00'
        asset: USD
        collateralAmount: '0.05'
        collateralAsset: CIRBTC
        toAddress: '0x5a0b4a11d3f9b2c1e8a7d6c5b4a39281f0e1d2c3'
        loanId: fc988ed5-c129-4f70-a064-e5beb7eb8e32
        transferId: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        oraclePrice: '67234.51'
        userOpHash: '0x9f8e7d6c5b4a39281f0e1d2c3b4a5968778695a4b3c2d1e0f9a8b7c6d5e4f3a2'
        txHash: '0x1a2b3c4d5e6f70819293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f9'
        createDate: '2026-06-20T14:20:00.000Z'
        updateDate: '2026-06-20T14:22:00.000Z'
  headers:
    XRequestId:
      description: >-
        Universally unique identifier (UUID v4) for the request. Helpful for
        identifying a request when communicating with Circle support.
      schema:
        type: string
        format: uuid
        example: 2adba88e-9d63-44bc-b975-9b6ae3440dde
  responses:
    BadRequest:
      description: The request cannot be processed due to a client error.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
      content:
        application/json:
          schema:
            type: object
            title: BadRequest
            required:
              - code
              - message
            properties:
              code:
                type: integer
                example: 400
              message:
                type: string
                example: Something went wrong.
            example:
              code: 400
              message: Bad request.
          examples:
            response:
              value:
                code: 400
                message: Bad request.
    NotAuthorized:
      description: >-
        The request has not been applied because it lacks valid authentication
        credentials.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
      content:
        application/json:
          schema:
            type: object
            title: NotAuthorized
            required:
              - code
              - message
            properties:
              code:
                type: integer
                example: 400
              message:
                type: string
                example: Something went wrong.
            example:
              code: 401
              message: Malformed authorization.
          examples:
            response:
              value:
                code: 401
                message: Malformed authorization.
    Forbidden:
      description: >-
        The request provides authentication, but the authenticated user does not
        possess sufficient permissions for accessing this resource.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
      content:
        application/json:
          schema:
            type: object
            title: Forbidden
            required:
              - code
              - message
            properties:
              code:
                type: integer
                example: 400
              message:
                type: string
                example: Something went wrong.
            example:
              code: 3
              message: Forbidden
          examples:
            response:
              value:
                code: 3
                message: Forbidden
    Conflict:
      description: >-
        The request has not been applied because it comes in conflict with
        another request (such as re-using an idempotencyKey for a different
        request).
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
      content:
        application/json:
          schema:
            type: object
            title: Conflict
            required:
              - code
              - message
            properties:
              code:
                type: integer
                example: 400
              message:
                type: string
                example: Something went wrong.
            example:
              code: 409
              message: Conflicts with another request.
          examples:
            response:
              value:
                code: 409
                message: Conflicts with another request.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````