User Authorization (Tenant Registration)
The purpose of user authorization set up in the backend is for Upsolve AI to provide appropriate data access based on your user permissioning set up. In your product’s authentication flow, you will need to call the /register-tenant endpoint to authorize users/register tenants. This endpoint allows you to tell Upsolve AI who the authorized user is and what data permission they have via a payload. The endpoint is a “refresh” endpoint that consumes the payload and issues an one-hour short-lived JWT. This endpoint should be hit every time you re-authorize the user in your app. This JWT is then used to provide your authorized users the appropriate access to the agent and underlying data. Please refer to the documentation for the /register-tenant endpoint. You will need to call this endpoint in your auth flow.To generate your API Key for the /register-tenant endpoint please go to the deploy page
Example: Calling the /register-tenant using Clerk middleware
Example: Calling the /register-tenant using Clerk middleware
Here is an example of doing this using Clerk middleware:
middleware.ts
Project User Token — New (Recommended)
When embedding an Application Space (via thehttps://ai-hub.upsolve.ai/share/application/:applicationId iFrame), you need a project user token rather than the standard tenant JWT. This token identifies a specific user within a project organisation and is used by the embed to load their personalised Space.
This is the preferred authentication method for new integrations.
Endpoint
Request
| Field | Type | Required | Description |
|---|---|---|---|
userId | string (UUID) | Yes | The project user’s ID (found in your project’s user list) |
organizationId | string (UUID) | Yes | The organisation ID the user belongs to |
apiKey | string | No | Your Upsolve embed API key (if not passed via Authorization header) |
expiration | number | No | Token lifetime in seconds (default: 3600) |
Response
Example
projectUserToken as the jwt query parameter in the Application iFrame src. See Frontend Setup for the full embed example.
The legacy
/register-tenant endpoint still works. For organizations that have been migrated to hub2.5, it automatically returns project user tokens. New integrations should use POST /v1/api/projects/user-token directly.Setup Inspection
You could inspect whether the user authorization is setup successfully. Navigate to the Deploy application using the side navigation bar.
