portal
Create portal session
Create a short-lived session token for an end user to access the Customer Portal.
The returned session ID is valid for 15 minutes and can be exchanged exactly once for a 24-hour browser session via portal.exchangeSession. Redirect the end user to the returned URL to start the portal experience.
Required Permissions
Your root key must be associated with a workspace that has an enabled portal configuration.
post/v2/portal.createSession
Request body
Example request
{
"slug": "my-portal",
"externalId": "user_123",
"permissions": [
"keys:read",
"keys:reroll",
"analytics:read"
]
}Response
Session token created successfully. Redirect the end user to the returned URL.
Example response
{
"meta": {
"requestId": "req_123"
},
"data": {
"sessionId": "pst_abc123def456",
"url": "https://portal.unkey.com/?session=pst_abc123def456"
}
}