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:

  1. Create a wallet -- a smart contract wallet on the Polygon network
  2. 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.

bash
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"
  }'
javascript
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);
FieldTypeRequiredDescription
qxstringYesP-256 public key X coordinate (hex, up to 64 hex chars, optional 0x prefix)
qystringYesP-256 public key Y coordinate (hex, up to 64 hex chars, optional 0x prefix)
rpIdHashstringYesSHA-256 hash of the RP ID, 0x-prefixed (66 chars total). Must match a registered domain.
labelstringNoA friendly name for this wallet (max 50 chars)
backupAddressstringNoOptional backup Ethereum address for recovery
withFeebooleanNoWhether to pay creation fee (default: false)
externalUserIdstringNoYour internal user ID (max 255 chars)
externalUserLabelstringNoYour internal user display name (max 255 chars)

Expected response (200 OK):

json
{
  "statusCode": 200,
  "content": {
    "address": "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18",
    "label": "My First Wallet",
    "transactionHash": "0xabc123def456789..."
  }
}

Step 2: List Your Wallets

Endpoint: GET /baas/wallets

Required scope: wallet:read

bash
curl https://gateway.dev.passkallet.com/sepolia/api/v1/passkallet/baas/wallets \
  -H "x-api-key: pk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4"

Expected response (200 OK):

json
{
  "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-key header 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.