Skip to content
  • SDKs and APIs
  • Account API

Use Kinde Account API to access user data from your app

Kinde’s Account API uses a user’s access token to retrieve data like roles, permissions, profile, billing entitlements, and more. You can call these endpoints from a browser because each request is scoped to the user the token represents.

Use the Kinde Account API

Link to this section

Kinde uses the logged-in user’s access token to access the Account API.

  1. Get the access token using the relevant SDK or manually if you are using Kinde without an SDK.

    Next.js example
    import { getKindeServerSession } from "@kinde-oss/kinde-auth-nextjs/server";
    const { getAccessTokenRaw } = getKindeServerSession();
    const accessToken = await getAccessTokenRaw();
    console.log(accessToken); // use your access token
  2. Call the relevant Account API endpoint:

    JavaScript example
    fetch('<YOUR_DOMAIN>/account_api/v1/entitlements', {
    headers: {
    Authorization: `Bearer ${accessToken}`
    }
    })
    .then(response => {
    if (!response.ok) {
    throw new Error(`HTTP error! status: ${response.status}`);
    }
    return response.json();
    })
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
  • Access user billing entitlements - to gate product features based on the user’s billing entitlements.
  • Access user properties, feature flags, roles, and permissions - If your access token includes too many claims, offload some of them and access them via the Account API when needed.
  • Get the self-serve portal link - to redirect the user to the self-serve portal so they can manage their account. See Self-serve portal for users.
  • Access and revoke user sessions - You can obtain the latest user profile using the user_profile endpoint. You can also introspect the token or revoke it.

See the Account API library for the full list of endpoints and their usage. If you want an endpoint to be added, contact us at support@kinde.com.