Skip to main content
POST
/
auth
/
session-token
TypeScript
import { DiscovrClient } from "discovr";
import type { MintSessionTokenPayload, SessionTokenResponse } from "discovr";

// Requires a stored refresh token (after sign-in), same bearer as SDK identity tier.
const discovr = new DiscovrClient("your-client-id", {
  basePath: "https://api.discovr.media",
});

const payload: MintSessionTokenPayload = { profileId: "PROFILE_ID" };
const minted: SessionTokenResponse = await discovr.identityApi().mintSessionToken(payload);
{
  "sessionToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "sessionId": "feedfacefeedfacefeedfacefeedface",
  "expiresAt": 1733091000
}

Documentation Index

Fetch the complete documentation index at: https://docs.discovr.media/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer token authentication.

  • Identity-tier endpoints (/profiles, /auth/session-token, /auth/session) accept a long-lived refresh token (rt_<hex>).
  • Session-tier endpoints (/pages/*, /profile/*) accept a short-lived session JWT.

SDK clients use two typed API accessors (identityApi() with the refresh token vs sessionApi() with the session JWT) — see the SDK DiscovrAuth helper.

Format: Authorization: Bearer {token}

Body

application/json

The profile to scope the session to.

profileId
string
required

The ID of the profile to activate. Must belong to the signed-in user.

Example:

"profile_abc123"

Response

A new session token.

The session token scoped to the selected profile. Valid for 30 minutes.

sessionToken
string
required

Your session credential, valid for 30 minutes. Send it as the bearer in the Authorization header for all session-tier endpoints (/pages/*, /profile/*).

Example:

"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

sessionId
string
required

A unique identifier for this browsing session. Each new session token carries a fresh session ID.

Example:

"feedfacefeedfacefeedfacefeedface"

expiresAt
integer<int64>
required

When the session token expires, as a Unix timestamp (seconds).

Example:

1733091000