SuperTokens · Example Payload

Supertokens Create Session Example

Create a new SuperTokens session after user authentication

AuthenticationOpen-SourceSession ManagementSocial LoginPasswordlessIdentityAuthorizationMulti-TenancyNode.jsSelf-Hosted

Supertokens Create Session Example is an example object payload from SuperTokens, with 3 top-level fields. It illustrates the shape of data this provider's APIs accept or return.

Top-level fields

descriptionrequestresponse

Example Payload

Raw ↑
{
  "description": "Create a new SuperTokens session after user authentication",
  "request": {
    "method": "POST",
    "url": "http://localhost:3567/recipe/session",
    "headers": {
      "Content-Type": "application/json",
      "api-key": "your-supertokens-api-key",
      "cdi-version": "5.1"
    },
    "body": {
      "userId": "user-123",
      "userDataInJWT": {
        "role": "admin"
      },
      "userDataInDatabase": {
        "lastLogin": "2026-05-02T10:00:00Z"
      },
      "tenantId": "public"
    }
  },
  "response": {
    "status": 200,
    "body": {
      "status": "OK",
      "session": {
        "handle": "a8b2c3d4-e5f6-...",
        "userId": "user-123",
        "userDataInJWT": {
          "role": "admin"
        },
        "tenantId": "public",
        "recipeUserId": "user-123"
      },
      "accessToken": {
        "token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
        "expiry": 1746524400000,
        "createdTime": 1746520800000
      },
      "refreshToken": {
        "token": "7f3a9b1c2d4e5f6a...",
        "expiry": 1746607200000,
        "createdTime": 1746520800000
      },
      "antiCsrfToken": "csrf-abc123"
    }
  }
}

Work with this as data

Every example here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for examples

4 MCP tools reach this
  • find_examplesBrowse and filter every example in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This example
curl "https://apis.io/api/v1/examples/supertokens-create-session-example"
All examples
curl "https://apis.io/api/v1/examples?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.