Onboarding Sessions
Create Onboarding Session
Start a hosted flow that lets your end user create an AgentCard account connected to your organization
POST
Creates a hosted onboarding session. Redirect your user to the returned
You’ll also receive a
url; they confirm their email with a one-click link, consent on an AgentCard-hosted page, and a cardholder is created (or claimed) in your organization linked to their AgentCard account. We then send them back to your return_url with the session id.
Before your first session, register your return URLs once: PUT /orgs/:orgId/onboarding-return-urls (organization owner, dashboard credentials) with { "returnUrls": ["https://yoursite.com/agentcard/return"] }.
Request body
Where we send the user after consent. Must exactly match (origin + path) one of your registered onboarding return URLs.
https required; http://localhost is allowed with test keys.Prefill for the email form. Required in practice for test keys — test-mode sessions will only send the confirmation email to this exact address.
Your own identifier for this user. Echoed back on the session object and the completion webhook so you can correlate.
An existing, unlinked cardholder in your organization to claim instead of creating a new one. The user must verify the email on that cardholder’s record.
404 if unknown, 409 if already linked.Opaque value (max 512 chars) echoed back on the final redirect — use it to bind the redirect to your user’s browser session (CSRF).
Response
Session id (
cos_…). The final redirect carries it as ?session_id=.The hosted onboarding URL to redirect your user to. Expires in 60 minutes.
pending → verified → completed (or expired).After the redirect
The user lands onreturn_url?session_id=cos_…&state=…. Never trust the query params alone — fetch the session server-side with your API key and read status and cardholder_id:
cardholder_onboarding_session.completed webhook (plus cardholder.created when a new cardholder was created rather than claimed). From there, use the regular cardholder endpoints — payment-method setup, card creation — with the returned cardholder_id.