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

# Migrate virtual accounts to v3

> Migrate v2 virtual accounts to v3 and return their v3 public IDs.
Virtual accounts that cannot be found are returned with `v3Id: null` and
`migrated: false` rather than causing the whole request to fail.
Migrating an account that is already on v3 is safe and returns the same
`v3Id`.




## OpenAPI

````yaml https://production.hifi.com/api/v3/openapi.json post /v3/virtual-accounts/v3-migration
openapi: 3.0.0
info:
  title: Hifi API
  version: 3.0.0
  description: API documentation for HIFI
servers:
  - url: https://production.hifi.com
    description: Production server
  - url: https://sandbox.hifi.com
    description: Sandbox server
security:
  - bearerAuth: []
tags:
  - name: Common
    description: Common endpoints
  - name: User
    description: User endpoints
  - name: Counter Party
    description: Counter party endpoints
  - name: Crypto Transfer
    description: Crypto transfer and batch transfer endpoints
  - name: Wallet
    description: Wallet and wallet offer endpoints
  - name: External Account
    description: External bank account endpoints, scoped to a counter party
  - name: External Wallet
    description: External wallet endpoints, scoped to a counter party
  - name: External Card
    description: External card endpoints, scoped to a counter party
  - name: Token Swap
    description: Token swap endpoints
  - name: Bridge
    description: Bridge endpoints
  - name: Virtual Account
    description: Virtual account endpoints
  - name: Compliance
    description: Compliance and compliance link endpoints
  - name: RFI
    description: Request for information (RFI) endpoints
  - name: Webhook Endpoint
    description: Webhook endpoint endpoints
  - name: File
    description: File upload endpoints
  - name: Onramp
    description: Onramp (fiat to crypto) endpoints
  - name: Offramp
    description: Offramp (crypto to fiat) endpoints
  - name: Orchestration Address
    description: Orchestration (liquidation) address endpoints
  - name: KYC Link
    description: Hosted and custom KYC/KYB link endpoints
  - name: Transfer Approval
    description: Transfer approval endpoints
  - name: Corridor
    description: Supported fiat/crypto transfer corridor endpoints
  - name: Migration
    description: v2-to-v3 ID mapping endpoints
paths:
  /v3/virtual-accounts/v3-migration:
    post:
      tags:
        - Virtual Account
      summary: Migrate virtual accounts to v3
      description: |
        Migrate v2 virtual accounts to v3 and return their v3 public IDs.
        Virtual accounts that cannot be found are returned with `v3Id: null` and
        `migrated: false` rather than causing the whole request to fail.
        Migrating an account that is already on v3 is safe and returns the same
        `v3Id`.
      operationId: v3MigrateVirtualAccounts
      requestBody:
        $ref: '#/components/requestBodies/MigrateVirtualAccountsBody'
      responses:
        '200':
          $ref: '#/components/responses/MigrateVirtualAccountsResponse'
        '400':
          $ref: '#/components/responses/BadRequestResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedResponse'
        '500':
          $ref: '#/components/responses/InternalServerErrorResponse'
components:
  requestBodies:
    MigrateVirtualAccountsBody:
      required: true
      description: v2 virtual account IDs to migrate to v3.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/VirtualAccountMigration'
          example:
            v2Ids:
              - 8f14e45f-ceea-467e-adde-0f8d0f5f4b1c
              - c9f0f895-fb98-4b91-a0d3-3c1e2a7b6d54
  responses:
    MigrateVirtualAccountsResponse:
      description: Migration results, one per unique requested ID, in request order.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/VirtualAccountMigrationResultList'
          example:
            data:
              - v2Id: 8f14e45f-ceea-467e-adde-0f8d0f5f4b1c
                v3Id: va_3Kf9dQ2mNpXwZ7bV1aLcs
                migrated: true
                message: migrated
              - v2Id: c9f0f895-fb98-4b91-a0d3-3c1e2a7b6d54
                v3Id: null
                migrated: false
                message: Resource not found
    BadRequestResponse:
      description: Bad Request — the request was malformed or failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            type: VALIDATION_ERROR
            message: One or more fields are invalid or missing.
            fields:
              - code: invalid_value
                message: Must be a valid email address
                field: email
    UnauthorizedResponse:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Unauthorized'
    InternalServerErrorResponse:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InternalServerError'
  schemas:
    VirtualAccountMigration:
      type: object
      description: Up to 100 v2 virtual account IDs to migrate to v3.
      required:
        - v2Ids
      properties:
        v2Ids:
          type: array
          minItems: 1
          maxItems: 100
          items:
            type: string
            format: uuid
            example: 8f14e45f-ceea-467e-adde-0f8d0f5f4b1c
    VirtualAccountMigrationResultList:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/VirtualAccountMigrationResult'
    ApiError:
      type: object
      description: >-
        Standard v3 error shape, returned by validation failures and
        business-logic errors alike.
      properties:
        type:
          type: string
          description: >-
            Machine-readable error type, e.g. VALIDATION_ERROR,
            ACTION_NOT_ALLOWED, RESOURCE_CONFLICT.
          example: VALIDATION_ERROR
        message:
          type: string
          description: Human-readable error message.
          example: One or more fields are invalid or missing.
        fields:
          type: array
          description: >-
            Present on field-level validation errors. One entry per problem
            field.
          items:
            type: object
            properties:
              code:
                type: string
                description: Error code related to the field issue.
              message:
                type: string
                description: Error message for the specific issue.
              field:
                type: string
                description: The name of the field that has an issue.
    Unauthorized:
      type: object
      properties:
        type:
          type: string
          description: Unauthorized enum
          example: UNAUTHORIZED
        message:
          type: string
          description: Unauthorized message
          example: Authentication required
    InternalServerError:
      type: object
      properties:
        type:
          type: string
          example: INTERNAL_SERVER_ERROR
          description: Internal server error enum
        message:
          type: string
          example: An internal server error occurred
          description: Internal server error message
    VirtualAccountMigrationResult:
      type: object
      description: The migration result for a single requested v2 virtual account ID.
      properties:
        v2Id:
          type: string
          format: uuid
          description: The virtual account's v2 ID, as sent in the request.
          example: 8f14e45f-ceea-467e-adde-0f8d0f5f4b1c
        v3Id:
          type: string
          nullable: true
          description: >-
            The virtual account's v3 public ID, or `null` if it could not be
            migrated.
          example: va_3Kf9dQ2mNpXwZ7bV1aLcs
        migrated:
          type: boolean
          description: Whether the virtual account is now on v3.
          example: true
        message:
          type: string
          description: Human-readable outcome, e.g. `migrated` or `Resource not found`.
          example: migrated
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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