portal
List portal sessions
Changed onList the end users holding a revocable session on a portal, with each end user's sessions.
Unreleased and subject to change without notice.
A session is revocable until it expires or is revoked. That includes sessions whose portal URL was created but not opened yet. Pass an end user's externalId to portal.revokeSession to end their sessions.
Required Permissions
Your root key must have one of:
- portal.*.create_portal_session (for any portal in the workspace)
- portal.<portal_id>.create_portal_session (for a specific portal)
It also accepts unkey:v1:<workspace_id>:projects/<project_id>/portals/<portal_id>/sessions/* with #read or #write. Reading the portal itself is not enough.
Without the permission this returns 404, not 403.
post/v2/portal.listSessions
Request
- Base URLhttps://api.unkey.com
- URLhttps://api.unkey.com/v2/portal.listSessions
- AuthHTTP bearer
Request body
Example request
{
"portal": "proj_1234abcd",
"cursor": "user_123",
"search": "user_"
}Response
One page of end users with revocable sessions.
Example response
{
"meta": {
"requestId": "req_123"
},
"data": [
{
"externalId": "user_123",
"sessions": [
{
"id": "ps_1234abcd",
"status": "active",
"createdAt": 1704067200000,
"expiresAt": 1704153600000,
"scopes": [
"keys:read"
]
}
]
}
],
"pagination": {
"cursor": "eyJrZXkiOiJrZXlfMTIzNCIsInRzIjoxNjk5Mzc4ODAwfQ==",
"hasMore": true
}
}Changes
- info
endpoint added
- info