API V2 Migration Guide

A step-by-step guide to migrating from Okto V1 to V2 APIs, which adopt a decentralized architecture for greater flexibility and security. It covers key changes, updated endpoints, and best practices to ensure a smooth transition.

This guide provides a detailed walkthrough for migrating your application from Okto V1 APIs to Okto V2 APIs. While the core API functionality remains unchanged, V2 implements a more decentralized architecture, and offering developers enhanced configurability and control over their integrations.

Key Changes Overview

AreaChanges
ArchitectureMoved to a more decentralized system with smart contracts on the Okto chain
AuthenticationOAuth-first approach with session key implementation
Wallet ManagementAutomated wallet creation across all enabled chains

Client-Side API Migration Table

V1 API RequestsV2 API RequestsChanges
POST /api/v2/authenticatePOST /api/oc/v1/authenticate-
POST /api/v1/authenticate/emailPOST /api/oc/v1/authenticate/email-
POST /api/v1/authenticate/email/verifyPOST /api/oc/v1/authenticate/email/verify-
N/APOST /api/oc/v1/authenticateAdditional email authentication flow after OTP verification
POST /api/v1/authenticate/phoneComing Soon-
POST /api/v1/authenticate/phone/verifyComing Soon-
POST /api/v1/authenticate/whatsappPOST /api/oc/v1/authenticate/whatsapp-
POST /api/v1/authenticate/whatsapp/verifyPOST /api/oc/v1/authenticate/whatsapp/verify-
N/APOST /api/oc/v1/authenticateAdditional WhatsApp authentication flow after OTP verification
POST /api/v1/authenticate/jwtPOST /api/oc/v1/authenticate-
GET /api/v1/walletGET /api/oc/v1/walletsFetches all user wallets
POST /api/v1/walletDeprecatedWallets are auto-created
POST /api/v1/refresh_tokenDeprecated-
POST /api/v1/logoutDeprecatedNow managed through customizable sessions
GET /api/v1/user_from_tokenGET /api/oc/v1/verify-sessionNow returns detailed user information
GET /api/v1/supported/networksGET /api/oc/v1/supported/networksFetches details of all the enabled networks
GET /api/v1/supported/tokensGET /api/oc/v1/supported/tokensFetches details of all available tokens
GET /api/v1/portfolioGET /api/oc/v1/aggregated-portfolioRetrieves the user's aggregated portfolio data
GET /api/v1/portfolio/activityGET /api/oc/v1/portfolio/activityRetrieves user's portfolio activity
POST /api/v1/transfer/tokens/executePOST /api/oc/v1/executeREST endpoint for token transfers with intent-based architecture
GET /api/v1/ordersGET /api/oc/v1/ordersReplaced by Get Order History
GET /api/v1/portfolio/nftGET /api/oc/v1/portfolio/nftRetrieves user's NFT portfolio
POST /api/v1/nft/transferPOST /api/oc/v1/executeREST endpoint for NFT transfers with intent-based architecture
GET /api/v1/nft/order_detailsGET /api/oc/v1/ordersReplaced by Get Order History
POST /api/v1/readContractData POST /api/oc/v1/readContractData-
POST /api/v1/rawtransaction/executePOST /api/oc/v1/executeREST endpoint for EVM raw transactions with intent-based architecture
GET /api/v1/rawtransaction/statusGET /api/oc/v1/ordersReplaced by Get Order History

New V2 Features

V2 introduces several new capabilities not available in V1:

Intent-Based Architecture

Message Signing

Swap Intents

Server API Reference