diff --git a/embedded-wallets/authentication/security/allowlists/domain-allowlist.mdx b/embedded-wallets/authentication/security/allowlists/domain-allowlist.mdx index a76e6d6..076b761 100644 --- a/embedded-wallets/authentication/security/allowlists/domain-allowlist.mdx +++ b/embedded-wallets/authentication/security/allowlists/domain-allowlist.mdx @@ -160,12 +160,12 @@ To use the programmatic API, you'll need your **Secret Key**: ```bash List Domains icon="list" curl -X GET 'https://api.dashboard.magic.link/v1/admin/access_whitelist' \ --H 'X-Magic-Secret-Key: sk_live_XXXXXXXX' +-H 'X-Magic-Secret-Key: sk_v2_XXXXXXXX' ``` ```bash Add Domains icon="plus" curl -X POST 'https://api.dashboard.magic.link/v1/admin/access_whitelist' \ --H 'X-Magic-Secret-Key: sk_live_XXXXXXXX' \ +-H 'X-Magic-Secret-Key: sk_v2_XXXXXXXX' \ -H 'Content-Type: application/json' \ -d '[ { @@ -177,7 +177,7 @@ curl -X POST 'https://api.dashboard.magic.link/v1/admin/access_whitelist' \ ```bash Remove Domains icon="minus" curl -X DELETE 'https://api.dashboard.magic.link/v1/admin/access_whitelist' \ --H 'X-Magic-Secret-Key: sk_live_XXXXXXXX' \ +-H 'X-Magic-Secret-Key: sk_v2_XXXXXXXX' \ -H 'Content-Type: application/json' \ -d '{ "access_type": "domain", diff --git a/embedded-wallets/authentication/security/allowlists/mobile-allowlist.mdx b/embedded-wallets/authentication/security/allowlists/mobile-allowlist.mdx index 06fbda9..749eaef 100644 --- a/embedded-wallets/authentication/security/allowlists/mobile-allowlist.mdx +++ b/embedded-wallets/authentication/security/allowlists/mobile-allowlist.mdx @@ -200,12 +200,12 @@ To use the programmatic API, you'll need your **Secret Key**: ```bash List App IDs icon="list" curl -X GET 'https://api.dashboard.magic.link/v1/admin/access_whitelist' \ --H 'X-Magic-Secret-Key: sk_live_XXXXXXXX' +-H 'X-Magic-Secret-Key: sk_v2_XXXXXXXX' ``` ```bash Add App IDs icon="plus" curl -X POST 'https://api.dashboard.magic.link/v1/admin/access_whitelist' \ --H 'X-Magic-Secret-Key: sk_live_XXXXXXXX' \ +-H 'X-Magic-Secret-Key: sk_v2_XXXXXXXX' \ -H 'Content-Type: application/json' \ -d '[ { @@ -217,7 +217,7 @@ curl -X POST 'https://api.dashboard.magic.link/v1/admin/access_whitelist' \ ```bash Remove App IDs icon="minus" curl -X DELETE 'https://api.dashboard.magic.link/v1/admin/access_whitelist' \ --H 'X-Magic-Secret-Key: sk_live_XXXXXXXX' \ +-H 'X-Magic-Secret-Key: sk_v2_XXXXXXXX' \ -H 'Content-Type: application/json' \ -d '{ "access_type": "bundle", diff --git a/embedded-wallets/authentication/security/allowlists/redirect-allowlist.mdx b/embedded-wallets/authentication/security/allowlists/redirect-allowlist.mdx index a8085b4..f4147db 100644 --- a/embedded-wallets/authentication/security/allowlists/redirect-allowlist.mdx +++ b/embedded-wallets/authentication/security/allowlists/redirect-allowlist.mdx @@ -140,12 +140,12 @@ To use the programmatic API, you'll need your **Secret Key**: ```bash List Redirects icon="list" curl -X GET 'https://api.dashboard.magic.link/v1/admin/access_whitelist' \ --H 'X-Magic-Secret-Key: sk_live_XXXXXXXX' +-H 'X-Magic-Secret-Key: sk_v2_XXXXXXXX' ``` ```bash Add Redirects icon="plus" curl -X POST 'https://api.dashboard.magic.link/v1/admin/access_whitelist' \ --H 'X-Magic-Secret-Key: sk_live_XXXXXXXX' \ +-H 'X-Magic-Secret-Key: sk_v2_XXXXXXXX' \ -H 'Content-Type: application/json' \ -d '[ { @@ -157,7 +157,7 @@ curl -X POST 'https://api.dashboard.magic.link/v1/admin/access_whitelist' \ ```bash Remove Redirects icon="minus" curl -X DELETE 'https://api.dashboard.magic.link/v1/admin/access_whitelist' \ --H 'X-Magic-Secret-Key: sk_live_XXXXXXXX' \ +-H 'X-Magic-Secret-Key: sk_v2_XXXXXXXX' \ -H 'Content-Type: application/json' \ -d '{ "access_type": "redirect_url", diff --git a/embedded-wallets/wallets/features/wallet-pregen.mdx b/embedded-wallets/wallets/features/wallet-pregen.mdx index 68c34b9..c9050c1 100644 --- a/embedded-wallets/wallets/features/wallet-pregen.mdx +++ b/embedded-wallets/wallets/features/wallet-pregen.mdx @@ -42,7 +42,7 @@ The email address associated with the PreGen wallet. The user must authenticate ```bash cURL icon="square-terminal" curl -X POST 'https://api.magic.link/v1/admin/pregen/wallet' \ - --header 'X-Magic-Secret-Key: sk_live_...' \ + --header 'X-Magic-Secret-Key: sk_v2_...' \ --header 'Content-Type: application/json' \ --data-raw '{ "email": "user@example.com" diff --git a/recipes/server-wallets/alchemy-smart-wallets.mdx b/recipes/server-wallets/alchemy-smart-wallets.mdx index 71a5a82..3cba052 100644 --- a/recipes/server-wallets/alchemy-smart-wallets.mdx +++ b/recipes/server-wallets/alchemy-smart-wallets.mdx @@ -47,7 +47,7 @@ Add the following to your `.env.local`: ```bash .env.local # Magic Server Wallet credentials -SERVER_WALLET_SECRET_KEY=sk_live_XXXXXXXXXXXX +SERVER_WALLET_SECRET_KEY=sk_v2_XXXXXXXXXXXX NEXT_PUBLIC_OIDC_PROVIDER_ID=your-oidc-provider-id # Alchemy diff --git a/server-wallets/core-api/error-handling.mdx b/server-wallets/core-api/error-handling.mdx index 1d8f6e6..5ed057f 100644 --- a/server-wallets/core-api/error-handling.mdx +++ b/server-wallets/core-api/error-handling.mdx @@ -36,7 +36,7 @@ Core API uses standard HTTP status codes. Error responses have this shape: **`MISSING_REQUIRED_HEADER`** (HTTP 403) - **Cause**: The `x-magic-secret-key` header is missing -- **Solution**: Include `x-magic-secret-key: sk_live_XXXXXXXX` on every request +- **Solution**: Include `x-magic-secret-key: sk_v2_XXXXXXXX` on every request **`INVALID_API_KEY`** (HTTP 403) - **Cause**: The secret key is invalid or does not match a known application diff --git a/server-wallets/core-api/getting-started.mdx b/server-wallets/core-api/getting-started.mdx index bec44c9..e2d696b 100644 --- a/server-wallets/core-api/getting-started.mdx +++ b/server-wallets/core-api/getting-started.mdx @@ -34,7 +34,7 @@ Your `Secret Key` will be used for all calls to the Core API. Core API requires authentication using your Magic secret key for all requests: -Your Magic secret key for service authentication. Format: `sk_live_XXXXXXXX` +Your Magic secret key for service authentication. Format: `sk_v2_` followed by 64 hexadecimal characters. Keys created before this format start with `sk_live_` and keep working until you roll them. diff --git a/server-wallets/core-api/signing-operations.mdx b/server-wallets/core-api/signing-operations.mdx index fcb5786..2937973 100644 --- a/server-wallets/core-api/signing-operations.mdx +++ b/server-wallets/core-api/signing-operations.mdx @@ -20,7 +20,7 @@ Sign Ethereum and EVM-compatible chain transactions. ```bash cURL icon="square-terminal" curl -X POST 'https://tee.magiclabs.com/v2/api/wallet/sign_transaction' \ -H 'Content-Type: application/json' \ - -H 'x-magic-secret-key: sk_live_XXXXXXXX' \ + -H 'x-magic-secret-key: sk_v2_XXXXXXXX' \ -d '{ "op_jwt": "eyJhbGciOiJSUzI1NiIsImtpZCI6ImFiYzEyMyIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2F1dGgueW91cmFwcC5jb20iLCJzdWIiOiJ1c2VyXzEyMzQ1NiIsImF1ZCI6Imh0dHBzOi8vdGVlLm1hZ2ljbGFicy5jb20iLCJpYXQiOjE3NTE2NzIwMDAsImV4cCI6MTc1MTY3MjMwMH0.SIGNATURE", "wallet_id": "e982b4a3-14d3-4d66-a3ac-fadfc3xxxxxx", @@ -45,7 +45,7 @@ Sign Solana blockchain transactions. ```bash cURL icon="square-terminal" curl -X POST 'https://tee.magiclabs.com/v2/api/wallet/sign_transaction' \ -H 'Content-Type: application/json' \ - -H 'x-magic-secret-key: sk_live_XXXXXXXX' \ + -H 'x-magic-secret-key: sk_v2_XXXXXXXX' \ -d '{ "op_jwt": "eyJhbGciOiJSUzI1NiIsImtpZCI6ImFiYzEyMyIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2F1dGgueW91cmFwcC5jb20iLCJzdWIiOiJ1c2VyXzEyMzQ1NiIsImF1ZCI6Imh0dHBzOi8vdGVlLm1hZ2ljbGFicy5jb20iLCJpYXQiOjE3NTE2NzIwMDAsImV4cCI6MTc1MTY3MjMwMH0.SIGNATURE", "wallet_id": "e982b4a3-14d3-4d66-a3ac-fadfc3xxxxxx", @@ -61,7 +61,7 @@ Sign Bitcoin blockchain transactions. ```bash cURL icon="square-terminal" curl -X POST 'https://tee.magiclabs.com/v2/api/wallet/sign_transaction' \ -H 'Content-Type: application/json' \ - -H 'x-magic-secret-key: sk_live_XXXXXXXX' \ + -H 'x-magic-secret-key: sk_v2_XXXXXXXX' \ -d '{ "op_jwt": "eyJhbGciOiJSUzI1NiIsImtpZCI6ImFiYzEyMyIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2F1dGgueW91cmFwcC5jb20iLCJzdWIiOiJ1c2VyXzEyMzQ1NiIsImF1ZCI6Imh0dHBzOi8vdGVlLm1hZ2ljbGFicy5jb20iLCJpYXQiOjE3NTE2NzIwMDAsImV4cCI6MTc1MTY3MjMwMH0.SIGNATURE", "wallet_id": "e982b4a3-14d3-4d66-a3ac-fadfc3xxxxxx", @@ -136,7 +136,7 @@ Sign arbitrary data using keccak256 hash (EVM only). ```bash cURL icon="square-terminal" curl -X POST 'https://tee.magiclabs.com/v2/api/wallet/sign_data' \ -H 'Content-Type: application/json' \ - -H 'x-magic-secret-key: sk_live_XXXXXXXX' \ + -H 'x-magic-secret-key: sk_v2_XXXXXXXX' \ -d '{ "op_jwt": "eyJhbGciOiJSUzI1NiIsImtpZCI6ImFiYzEyMyIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2F1dGgueW91cmFwcC5jb20iLCJzdWIiOiJ1c2VyXzEyMzQ1NiIsImF1ZCI6Imh0dHBzOi8vdGVlLm1hZ2ljbGFicy5jb20iLCJpYXQiOjE3NTE2NzIwMDAsImV4cCI6MTc1MTY3MjMwMH0.SIGNATURE", "wallet_id": "e982b4a3-14d3-4d66-a3ac-fadfc3xxxxxx", @@ -206,7 +206,7 @@ Sign an arbitrary message using a Solana wallet. ```bash cURL icon="square-terminal" curl -X POST 'https://tee.magiclabs.com/v2/api/wallet/sign_message' \ -H 'Content-Type: application/json' \ - -H 'x-magic-secret-key: sk_live_XXXXXXXX' \ + -H 'x-magic-secret-key: sk_v2_XXXXXXXX' \ -d '{ "op_jwt": "eyJhbGciOiJSUzI1NiIsImtpZCI6ImFiYzEyMyIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2F1dGgueW91cmFwcC5jb20iLCJzdWIiOiJ1c2VyXzEyMzQ1NiIsImF1ZCI6Imh0dHBzOi8vdGVlLm1hZ2ljbGFicy5jb20iLCJpYXQiOjE3NTE2NzIwMDAsImV4cCI6MTc1MTY3MjMwMH0.SIGNATURE", "wallet_id": "e982b4a3-14d3-4d66-a3ac-fadfc3xxxxxx", diff --git a/server-wallets/core-api/v1-to-v2-migration.mdx b/server-wallets/core-api/v1-to-v2-migration.mdx index 5cccb88..9e93e5a 100644 --- a/server-wallets/core-api/v1-to-v2-migration.mdx +++ b/server-wallets/core-api/v1-to-v2-migration.mdx @@ -28,7 +28,7 @@ Replace `encryption_context` with `auth_jwt` — the user's JWT from your identi ```bash cURL icon="square-terminal" curl -X POST 'https://tee.magiclabs.com/v1/api/wallet' \ -H 'Content-Type: application/json' \ - -H 'x-magic-secret-key: sk_live_XXXXXXXX' \ + -H 'x-magic-secret-key: sk_v2_XXXXXXXX' \ -d '{ "encryption_context": "hashed_passcode", "network": "eth_mainnet", @@ -40,7 +40,7 @@ curl -X POST 'https://tee.magiclabs.com/v1/api/wallet' \ ```bash cURL icon="square-terminal" curl -X POST 'https://tee.magiclabs.com/v2/api/wallet' \ -H 'Content-Type: application/json' \ - -H 'x-magic-secret-key: sk_live_XXXXXXXX' \ + -H 'x-magic-secret-key: sk_v2_XXXXXXXX' \ -d '{ "auth_jwt": "eyJhbGciOiJSUzI1NiIsImtpZCI6ImFiYzEyMyIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2F1dGgueW91cmFwcC5jb20iLCJzdWIiOiJ1c2VyXzEyMzQ1NiIsImF1ZCI6Imh0dHBzOi8vdGVlLm1hZ2ljbGFicy5jb20iLCJpYXQiOjE3NTE2NzIwMDAsImV4cCI6MTc1MTY3MjMwMH0.SIGNATURE", "network": "eth_mainnet", @@ -60,7 +60,7 @@ Replace `encryption_context` with `op_jwt`. The `access_key` and `wallet_id` rem ```bash cURL icon="square-terminal" curl -X POST 'https://tee.magiclabs.com/v1/api/wallet/sign_data' \ -H 'Content-Type: application/json' \ - -H 'x-magic-secret-key: sk_live_XXXXXXXX' \ + -H 'x-magic-secret-key: sk_v2_XXXXXXXX' \ -d '{ "encryption_context": "hashed_passcode", "raw_data_hash": "0xabc...", @@ -73,7 +73,7 @@ curl -X POST 'https://tee.magiclabs.com/v1/api/wallet/sign_data' \ ```bash cURL icon="square-terminal" curl -X POST 'https://tee.magiclabs.com/v2/api/wallet/sign_data' \ -H 'Content-Type: application/json' \ - -H 'x-magic-secret-key: sk_live_XXXXXXXX' \ + -H 'x-magic-secret-key: sk_v2_XXXXXXXX' \ -d '{ "op_jwt": "eyJhbGciOiJSUzI1NiIsImtpZCI6ImFiYzEyMyIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2F1dGgueW91cmFwcC5jb20iLCJzdWIiOiJ1c2VyXzEyMzQ1NiIsImF1ZCI6Imh0dHBzOi8vdGVlLm1hZ2ljbGFicy5jb20iLCJpYXQiOjE3NTE2NzIwMDAsImV4cCI6MTc1MTY3MjMwMH0.SIGNATURE", "raw_data_hash": "0xabc...", diff --git a/server-wallets/core-api/wallet-operations.mdx b/server-wallets/core-api/wallet-operations.mdx index 7ea6b3e..432e4c5 100644 --- a/server-wallets/core-api/wallet-operations.mdx +++ b/server-wallets/core-api/wallet-operations.mdx @@ -18,7 +18,7 @@ Creates a new wallet group for organizing wallets. ```bash cURL icon="square-terminal" curl -X POST 'https://tee.magiclabs.com/v1/api/wallet_group' \ -H 'Content-Type: application/json' \ - -H 'x-magic-secret-key: sk_live_XXXXXXXX' \ + -H 'x-magic-secret-key: sk_v2_XXXXXXXX' \ -d '{ "metadata": { "resource_id": "customer-resource-id" @@ -67,7 +67,7 @@ Retrieve all wallet groups for your application. ```bash cURL icon="square-terminal" curl -X GET 'https://tee.magiclabs.com/v1/api/wallet_groups' \ - -H 'x-magic-secret-key: sk_live_XXXXXXXX' + -H 'x-magic-secret-key: sk_v2_XXXXXXXX' ``` **Response:** @@ -102,7 +102,7 @@ Create a new wallet for a user. In v2, the wallet is cryptographically bound to ```bash cURL icon="square-terminal" curl -X POST 'https://tee.magiclabs.com/v2/api/wallet' \ -H 'Content-Type: application/json' \ - -H 'x-magic-secret-key: sk_live_XXXXXXXX' \ + -H 'x-magic-secret-key: sk_v2_XXXXXXXX' \ -d '{ "auth_jwt": "eyJhbGciOiJSUzI1NiIsImtpZCI6ImFiYzEyMyIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2F1dGgueW91cmFwcC5jb20iLCJzdWIiOiJ1c2VyXzEyMzQ1NiIsImF1ZCI6Imh0dHBzOi8vdGVlLm1hZ2ljbGFicy5jb20iLCJpYXQiOjE3NTE2NzIwMDAsImV4cCI6MTc1MTY3MjMwMH0.SIGNATURE", "network": "mainnet", diff --git a/server-wallets/express-api/getting-started.mdx b/server-wallets/express-api/getting-started.mdx index 02a69c9..03d5eed 100644 --- a/server-wallets/express-api/getting-started.mdx +++ b/server-wallets/express-api/getting-started.mdx @@ -46,7 +46,7 @@ Your Magic API key for service authentication. -Alternative to API key - your Magic secret key for service authentication. +Alternative to API key - your Magic secret key for service authentication. Format: `sk_v2_` followed by 64 hexadecimal characters. Keys created before this format start with `sk_live_` and keep working until you roll them.