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

# Import Wallet

> Import a wallet with provided private key or mnemonic phrase.

<Snippet file="header-project-id.mdx" />


## OpenAPI

````yaml post /wallets/import
openapi: 3.0.1
info:
  title: WalletKit
  version: 0.0.1
servers:
  - url: https://testnet.walletkit.com
    description: testnet
  - url: https://mainnet.walletkit.com
    description: mainnet
security: []
paths:
  /wallets/import:
    post:
      tags:
        - Wallets
      summary: Import Wallet
      description: Import a wallet with provided private key or mnemonic phrase.
      operationId: wallets_import
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImportWalletRequest'
            examples:
              Example1:
                value:
                  network: Avalanche
                  name: User Wallet
                  owner_id: 58c9095e-24db-43eb-b49d-ddc305c2b6f7
                  type: eoa
                  control_mode: user
                  private_key: >-
                    0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
                  user_pin: '111111'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Wallet'
              examples:
                Example1:
                  value:
                    id: 1427fe1c-226e-4dde-a0a1-d46c4521084b
                    created_at: '2024-01-31T11:36:06.395674-08:00'
                    network: Avalanche
                    name: User Wallet
                    owner_id: 58c9095e-24db-43eb-b49d-ddc305c2b6f7
                    address: '0x1Be31A94361a391bBaFB2a4CCd704F57dc04d4bb'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    ImportWalletRequest:
      title: ImportWalletRequest
      type: object
      properties:
        network:
          $ref: '#/components/schemas/Network'
        name:
          type: string
          example: User Wallet
        owner_id:
          type: string
          nullable: true
          description: >-
            An ID that you can use to associate the wallet with a user in your
            application. e.g. user uuid. When creating wallets for the same
            owner_id across different networks, the same seed phrase will be
            used.
        control_mode:
          $ref: '#/components/schemas/WalletControlMode'
          description: >-
            Defines whether the developer or the user controls the wallet. When
            control_mode is developer, the developer_secret must be provided.
            When control_mode is user, the user_pin must be provided.
        type:
          $ref: '#/components/schemas/WalletType'
          nullable: true
          description: >-
            Defines whether the wallet address is an externally owned address
            (EOA)  derived from the owner's key pair or address of the smart
            contract controlled by the owner's key pair.
        private_key:
          type: string
          nullable: true
        mnemonic_phrase:
          type: string
          nullable: true
        developer_secret:
          $ref: '#/components/schemas/DeveloperSecret'
          nullable: true
        user_pin:
          $ref: '#/components/schemas/UserPin'
          nullable: true
      required:
        - network
        - name
        - control_mode
    Wallet:
      title: Wallet
      type: object
      properties:
        id:
          type: string
          example: 5884bd1d-ecb3-41ea-bcc7-e9e3d229618f
        created_at:
          type: string
          example: '2023-07-21T22:03:16Z'
        network:
          $ref: '#/components/schemas/Network'
        name:
          type: string
          nullable: true
        owner_id:
          type: string
          nullable: true
        address:
          type: string
          example: '0x976Cf57B7EE1D84E73BE9115457889d49a8A1335'
      required:
        - id
        - created_at
        - network
        - address
    ErrorResponse:
      title: ErrorResponse
      type: object
      properties:
        code:
          type: string
          nullable: true
        error:
          type: string
      required:
        - error
    Network:
      title: Network
      type: string
      enum:
        - Ethereum
        - Polygon
        - Base
        - Avalanche
        - Polkadot
        - Vara
    WalletControlMode:
      title: WalletControlMode
      type: string
      enum:
        - developer
        - user
    WalletType:
      title: WalletType
      type: string
      enum:
        - eoa
        - contract
    DeveloperSecret:
      title: DeveloperSecret
      type: string
      nullable: true
      description: >-
        On testnet, the developer_secret is always "testnet-secret". On mainnet,
        the developer_secret is set by the developer during account activation.
    UserPin:
      title: UserPin
      type: string
      nullable: true
      description: >-
        A 6-digit numeric pin that is only known to the user, set during wallet
        creation. This pin is required to sign transactions from this wallet.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````