Create a new Portal session.
Create a Portal session
POST
/user/v1/session:createPortalbody parameters
The Portal URL, this is the target URL on the portal site.
If not defined the root URL for the portal will be used.
This does not need to be the full URL, you have the option of passing in a path instead (e.g.
/
).You also have the option of including the
{accountId}
string in the path/URL which will be replaced with either the UserHub user ID (iforganizationId
is not specified) or the UserHub organization ID (if specified).Examples:
/{accountId}
- the billing dashboard/{accountId}/checkout
- start a checkout/{accountId}/checkout/<some-plan-id>
- start a checkout with a specified plan/{accountId}/cancel
- cancel current plan/{accountId}/members
- manage organization members/{accountId}/invite
- invite a user to an organization
Returns
curl https://api.userhub.com/user/v1/session:createPortal \
-H "UserHub-Api-Key: $USERHUB_USER_KEY" \
-H "Authorization: Bearer $USER_ACCESS_TOKEN" \
-X POST
const res = await userApi.session.createPortal();
res, err := userApi.Session().CreatePortal(
context.Background(),
nil,
)
$res = $userApi->session->createPortal();
res = user_api.session.create_portal()
Response bodyJSON
{
"redirectUrl": "https://example.userhub.app/signin?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}