UseDocumentation Index
Fetch the complete documentation index at: https://docs.firmhouse.com/llms.txt
Use this file to discover all available pages before exploring further.
createSelfServiceCenterLoginTokenV2 when you want to send a customer directly into the Firmhouse Self Service Center from your own app, email, or support tool without asking them to request a login email first.
The mutation looks up a completed subscription in your project by email address, creates a short-lived Self Service Center login token, and returns a URL that includes the token. Redirect the customer to that URL for immediate login.
Requirements
- A Firmhouse API access token with write access. Create one in Settings > Integrations > Access Tokens in your Firmhouse project.
- The customer’s email address must match a completed subscription in the same Firmhouse project.
- The mutation should be called from your backend. Do not expose a write API access token in browser code.
Create the token
Send a GraphQL request to the Firmhouse API and pass the customer’s email address tocreateSelfServiceCenterLoginTokenV2.
Redirect the customer
UsereturnUrlWithToken from the response as the destination URL:
returnUrlWithToken. Firmhouse validates the token, starts the customer’s Self Service Center session, and shows the Self Service Center for the matched subscription.
If you only need the raw token, you can build the login URL yourself by adding it as the token query parameter to your project’s Self Service Center token login URL:
returnUrlWithToken is safer because Firmhouse returns the correct project host, locale, project path, and token parameter for the matched subscription.
Handle errors and expiry
Check both top-level GraphQL errors and the mutation payload’serrors field.
When the API returns a mutation payload but cannot create a login token, selfServiceCenterLoginToken is null and the payload’s errors field contains the validation details.
When the email address does not match a completed subscription in the project, the API can return a top-level GraphQL error before returning the mutation payload. Handle that response as a failed token creation and ask the customer to use the email address connected to their subscription.
Self Service Center login tokens expire after 4 hours. Generate the token shortly before redirecting the customer.