Make your first API call to Passkallet BaaS. Create a wallet, then list it.
First Request
Your First API Call
You have an organization and an API key. Let us use them.
We will do two things:
- Create a wallet -- a smart contract wallet on the Polygon network
- List your wallets -- confirm it was created
Step 1: Create a Wallet
Endpoint: POST /baas/wallets
Required scope: wallet:create
Every wallet is secured by a P-256 passkey. You must provide the public key coordinates (qx, qy) and the rpIdHash of the domain where the passkey was created.
curl -X POST https://gateway.dev.passkallet.com/sepolia/api/v1/passkallet/baas/wallets \
-H "x-api-key: pk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4" \
-H "Content-Type: application/json" \
-d '{
"qx": "0x1f2e3d4c5b6a79889786766554433221100ffeeddccbbaa99887766554433221",
"qy": "0xa0b1c2d3e4f50617283940516273849506172839405162738495061728394050",
"rpIdHash": "0x8fc154601bf086c9415d3c6cfbba676749925045017427c57e37cdbb94d84454",
"label": "My First Wallet",
"externalUserId": "user_12345",
"externalUserLabel": "John Doe"
}'const API_KEY = "pk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4";
const BASE_URL = "https://gateway.dev.passkallet.com/sepolia/api/v1/passkallet/baas";
const response = await fetch(`${BASE_URL}/wallets`, {
method: "POST",
headers: {
"x-api-key": API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
qx: "0x1f2e3d4c5b6a79889786766554433221100ffeeddccbbaa99887766554433221",
qy: "0xa0b1c2d3e4f50617283940516273849506172839405162738495061728394050",
rpIdHash: "0x8fc154601bf086c9415d3c6cfbba676749925045017427c57e37cdbb94d84454",
label: "My First Wallet",
externalUserId: "user_12345",
externalUserLabel: "John Doe",
}),
});
const data = await response.json();
console.log(data);| Field | Type | Required | Description |
|---|---|---|---|
qx | string | Yes | P-256 public key X coordinate (hex, up to 64 hex chars, optional 0x prefix) |
qy | string | Yes | P-256 public key Y coordinate (hex, up to 64 hex chars, optional 0x prefix) |
rpIdHash | string | Yes | SHA-256 hash of the RP ID, 0x-prefixed (66 chars total). Must match a registered domain. |
label | string | No | A friendly name for this wallet (max 50 chars) |
backupAddress | string | No | Optional backup Ethereum address for recovery |
withFee | boolean | No | Whether to pay creation fee (default: false) |
externalUserId | string | No | Your internal user ID (max 255 chars) |
externalUserLabel | string | No | Your internal user display name (max 255 chars) |
Expected response (200 OK):
{
"statusCode": 200,
"content": {
"address": "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18",
"label": "My First Wallet",
"transactionHash": "0xabc123def456789..."
}
}Step 2: List Your Wallets
Endpoint: GET /baas/wallets
Required scope: wallet:read
curl https://gateway.dev.passkallet.com/sepolia/api/v1/passkallet/baas/wallets \
-H "x-api-key: pk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4"Expected response (200 OK):
{
"statusCode": 200,
"content": [
{
"id": "clxyz123-abc456-def789",
"address": "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18",
"label": "My First Wallet",
"externalUserId": "user_12345",
"externalUserLabel": "John Doe",
"createdAtDatetime": "2026-05-31T12:00:00.000Z"
}
]
}You should see an array with the wallet you just created. If you see it, congratulations -- you are integrated with Passkallet.
Troubleshooting
I get a 401 Unauthorized
Your API key is wrong or missing. Double-check:
- The
x-api-keyheader is spelled correctly - The key value is correct (starts with
pk_live_) - The key has not been revoked or expired
I get a 403 Forbidden
Your API key does not have the right scopes. To create wallets, you need the wallet:create scope. The error message will tell you which scope is required.
I get a 400 Bad Request
Check the error message. Common causes: invalid hex format for qx/qy, wrong rpIdHash length, or the rpIdHash does not match a registered domain for your organization.