The user ID.
In addition to supporting the UserHub user ID, you can also pass in the User Provider external identifier in the format <externalId>@<connectionId>
and if the user doesn't exist in UserHub they will automatically be imported.
POST
/admin/v1/users/{userId}:createPortalSessionCreate 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/admin/v1/users/auth0%7C123456789@conn_26yEiYymqy6ZmG:createPortalSession \
-H "Authorization: Bearer $USERHUB_ADMIN_KEY" \
-X POST
const res = await adminApi.users.createPortalSession(
"auth0|123456789@conn_26yEiYymqy6ZmG",
);
res, err := adminApi.Users().CreatePortalSession(
context.Background(),
"auth0|123456789@conn_26yEiYymqy6ZmG",
nil,
)
$res = $adminApi->users->createPortalSession(
userId: 'auth0|123456789@conn_26yEiYymqy6ZmG',
);
res = admin_api.users.create_portal_session(
user_id="auth0|123456789@conn_26yEiYymqy6ZmG",
)
{
"redirectUrl": "https://billing.example.com/signin?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}