The identifier of the organization.
When specified the {accountId}
in the portalUrl
will be replaced with the organization ID, otherwise the user ID will be used.
POST
/user/v1/session:createPortalCreate Portal session.
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 (if organizationId
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 organizationcurl 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.createPortal()
{
"redirectUrl": "https://example.userhub.app/signin?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}