The portal is in development. Key management, analytics, and docs pages are placeholder UI for now.
How it works
- Your backend authenticates the user in your own system
- Your backend calls
POST /v2/portal.createSessionwith a root key - You redirect the user to the returned portal URL
- The portal exchanges the session ID for a 24-hour browser session
- The browser calls Unkey API directly with the session token
1. Configure a portal
Enable the Customer Portal for your workspace in the Unkey dashboard.Dashboard configuration UI is coming soon. During early access, reach out to the Unkey team to get your portal configured.
my-portal or billing-dashboard. Use this slug when creating sessions.
Slugs must be 3–64 characters, lowercase alphanumeric and hyphens only, and cannot start or end with a hyphen.
Optionally, you can customize branding with your logo and brand colors.
2. Create a session
When your user wants to access the portal, create a session from your backend:Required parameters
Optional parameters
3. Redirect your user
Send the user to the portal URL. The session ID is valid for 15 minutes and can only be used once.- Exchange the session ID for a 24-hour browser session
- Set an httpOnly cookie
- Redirect to the first visible tab based on permissions
Permissions and tabs
Permissions use the RBAC tuple format{resourceType}.{resourceId}.{action}. Use * as the resourceId to grant access to all resources of that type.
Tab visibility is derived from the action segment (third part) of each permission:
Examples:
api.*.read_key→ shows the Keys tabapi.api_123.create_key→ shows the Keys tab (specific resource)api.*.read_analytics→ shows the Analytics tab- Docs tab is visible whenever at least one permission is present
Session lifecycle
When the browser session expires:
- If
return_urlis set on the portal config → redirects to{return_url}?reason=session_expired - Otherwise → shows a “Session expired” error page
Branding
The portal supports basic white-labeling:
Logo URLs must be HTTPS.