agentId to use in every subsequent step.
Prerequisites
- Crossmint API key — a client-side key from the Crossmint Console. In staging, all scopes are enabled by default.
- Authentication provider — any provider that issues JWTs your backend can verify (for example Stytch, Auth0, Dynamic, or Crossmint Auth). The virtual-cards-quickstart uses Stytch with Google OAuth.
Step 1: Authenticate the User
Before calling any Crossmint endpoint you need a valid session JWT for the user. How you obtain it depends on your auth provider. Below is the pattern used by the quickstart with Stytch:X-API-KEYheader with your Crossmint client API keyAuthorization: Bearer <jwt>header with the user’s session JWT
Step 2: Register an Agent
With the JWT in hand, send aPOST request to /api/unstable/agents to create an agent for this user.
agentId — you will pass it when saving cards, creating order intents, and fetching virtual card credentials. You typically create one agent per user.
For the full request and response schema, see the Create Agent API Reference.
Example Response
Example Response

