Routes

Definition for all the routes

GET /user/@self/profile

scope: profile

Retrievies basic user profile. Includes email if email scope is set.

DELETE /user/@self/login

internal

Logs out current user

PATCH /user/@self/profile

tfa scope: profile_update

Edits the user profile.

GET /users/list

internal

Jem supports multiple accounts at once. This endpoint is used by internal apps to allow changing the currently ‘active’ user.

GET /user/@self/accounts

Retrievies a list of connected accounts. Requires the accounts scope. Includes email if email scope is set.

GET /user/@self/token

internal

Returns access token without refresh token (use this endpoint again). Request cannot be scoped.

GET /account/:platform/:id

scope: accounts

Returns the single acount. Requires accounts scope on account owner. Returns not found when user doesn’t have access to account.

GET /account/:platform/:id

scope: accounts internal

Disconnects the account from current user, removing it from Jem.

GET /user/@self/applications/connections

scope: applications

Returns a list of connected (authorized) applications.

DELETE /user/@self/applications/connections/:id

tfa scope: applications internal

Removes the connection and the application authorization.

GET /user/@self/applications

scope: applications internal

Returns a list of applications owned by user.

GET /user/@self/application/:id

scope: applications internal

Returns single application

DELETE /user/@self/applications/:id

tfa scope: applications internal

Deletes owned application

POST /user/@self/applications

permission: CREATE_APPS internal scope: applications

Creates a new application. Other fields can be updated using PATCH method.

PATCH /user/@self/applications

internal scope: applications

Updates application. All fields are optional, those that are set will overwrite old values.

GET /platforms

Returns list of platforms.

GET /oauth/:platform/login

internal

Redirects user to login using specified platform. After the user logs in, redirects to redirect_uri

Scopes parameter is ignored, includes all scopes by default. If user has 2FA, user will be first asked to fill 2FA on Jem before being redirected back.

When user logins for the first time, will get redirected to Jem to fill their account and finish registration before going back.

GET /oauth/:platform/callback

internal

Used as callback to given platform’s OAuth2 callback. Not to be used by any clients. Requires state cookie. Redirects to redirect_uri. Not callable directly.

GET /oauth/state

internal

Gets state data (simple info about the account user is trying to connect).

DELETE /oauth/state

internal

Deletes current state info, effectively cancelling account connection

POST /oauth/:platform/confirm

internal

Used after user confirms their choice to connect account, create a new account or similar.

If you want to set other fields, PATCH /user/@self/profile or PATCH INTERNAL after account creation.

POST /oauth/authorize/:client

Authorizes the application (:client is application ID).

GET /user/@self/firebase/token

internal returns: - `token` - JWT signed token that can be used with firebase. Custom Id is User ID. No custom claims.

Returns the signed firebase token

GET /user/@self/supabase/token

returns: - `token` - JWT signed token that can be used with supabase.

Returns signed supabase token.

User ID won’t exist in the users table, but RLS will still be usable.

Expiration time is set to 2 hours.