Create a Portal session.
Create a Portal session
POST
/admin/v1/users/{userId}:createPortalSessionpath parameters
body 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}/cancel
- cancel current plan/{accountId}/members
- manage organization members/{accountId}/invite
- invite a user to an organization
Returns
curl 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",
)
Response bodyJSON
{
"redirectUrl": "https://billing.example.com/signin?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}