Authentication
Dacard.ai uses Clerk for authentication. Most API endpoints require a valid session, but some are publicly accessible.Authentication methods
Session cookie
__session cookie set automatically when a user signs in via the dashboard. Used by the web app and browser-based integrations.Bearer token
Authorization: Bearer <jwt> header for server-to-server and programmatic access. JWTs are issued by Clerk.Session cookie (browser)
When a user signs in at app.dacard.ai, Clerk sets a secure__session cookie. All subsequent requests from the browser include this cookie automatically.
No additional configuration is needed for browser-based access.
Bearer token (server-to-server)
For programmatic access, include a Clerk-issued JWT in theAuthorization header:
Public endpoints
The following endpoints do not require authentication:| Endpoint | Method | Description |
|---|---|---|
/api/score/{id} | GET | View any scoring result by ID |
/api/try-score | POST | Anonymous scoring (rate-limited) |
/api/og | GET | Open Graph image generation |
/api/stripe/webhook | POST | Stripe webhook receiver |
Public routes
These pages are accessible without sign-in:/r/{id}, Shared score result pages/try, Anonymous scoring page/pricing, Pricing page/demo/*, Demo pages/sign-in,/sign-up, Authentication pages
Error responses
When authentication fails, the API returns a401 Unauthorized response:
403 Forbidden response: