Skip to main content
POST
/
v1
/
principal-sessions
Create a principal session
curl --request POST \
  --url https://grantex-auth-dd4mtrt2gq-uc.a.run.app/v1/principal-sessions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "principalId": "user_abc123",
  "expiresIn": "2h"
}
'
{
  "sessionToken": "<string>",
  "dashboardUrl": "<string>",
  "expiresAt": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Developer API key

Body

application/json
principalId
string
required

The end-user's principal ID

Example:

"user_abc123"

expiresIn
string

Session duration (e.g. "1h", "30m", "24h"). Defaults to "1h", capped at "24h".

Example:

"2h"

Response

Session created

sessionToken
string

Signed JWT session token

dashboardUrl
string

Full URL the user can open to manage permissions

expiresAt
string<date-time>

When the session token expires