Skip to main content
The Customer Portal is a white-labeled web app you can offer to your end users. They get key management, usage analytics, and API documentation — without you building any UI. Authentication uses a Stripe-style session flow: your backend creates a session, redirects the user, and the portal handles the rest.
The portal is in development. Key management, analytics, and docs pages are placeholder UI for now.

How it works

  1. Your backend authenticates the user in your own system
  2. Your backend calls POST /v2/portal.createSession with a root key
  3. You redirect the user to the returned portal URL
  4. The portal exchanges the session ID for a 24-hour browser session
  5. 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.
When configuring your portal, you’ll choose a slug — a short, human-readable identifier like 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:
The response:

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.
The portal will:
  1. Exchange the session ID for a 24-hour browser session
  2. Set an httpOnly cookie
  3. 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 tab
  • api.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
The API requires at least one permission. An empty permissions array is rejected with HTTP 400.

Session lifecycle

When the browser session expires:
  • If return_url is 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.

Error responses

Last modified on May 20, 2026