POST/user/v1/session:createPortal

Create Portal session

Create Portal session.

body parameters

  • organizationId

    string

    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.

  • portalUrl

    string

    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 organization
  • returnUrl

    string

    The URL the user should be sent to when they want to return to the app (e.g. cancel checkout).

    If not defined the app URL will be used.

  • successUrl

    string

    The URL the user should be sent after they successfully complete an action (e.g. checkout).

    If not defined the return URL will be used.

Returns

  • redirectUrl

    string

    The URL you should redirect the user to after calling create portal session.

curl https://api.userhub.com/user/v1/session:createPortal \
  -H "UserHub-Api-Key: $USERHUB_USER_KEY" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN" \
  -X POST
Response bodyJSON
{
  "redirectUrl": "https://example.userhub.app/signin?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
PreviousAuthenticate using ID token
NextWebhooks

Turn users intorevenue
$

Subscribe to monthly product updates

© 2025 UserHub

Integrations

    UserHub & Auth0UserHub & Stripe BillingUserHub & Google CloudUserHub & FirebaseUserHub & custom auth