Introduction
The SuperTokens Core API provides HTTP endpoints for managing authentication, users, and configuration. These are low-level APIs that power the SuperTokens authentication system.Base URL
The default base URL for SuperTokens Core is:config.yaml file:
API Versioning
The Core API uses CDI (Core Driver Interface) versioning via thecdi-version header. The API supports multiple versions for backward compatibility.
Supported CDI Versions:
- v5.4 (latest)
- v5.3, v5.2, v5.1, v5.0
- v4.0
- v3.1, v3.0
- v2.x series (v2.7 through v2.21)
/hello and /.well-known/jwks.json do not require version headers.
Authentication
Most Core API endpoints require authentication using an API key. Configure API keys in yourconfig.yaml:
/hello, /) and public endpoints (/.well-known/jwks.json) do not require authentication.
Multitenancy
SuperTokens Core supports multitenancy with app-specific and tenant-specific endpoints. You can route requests to specific tenants using URL patterns:- Public tenant:
http://localhost:3567/users - Specific tenant:
http://localhost:3567/{tenantId}/users - Specific app:
http://localhost:3567/appid-{appId}/users - App and tenant:
http://localhost:3567/appid-{appId}/{tenantId}/users
Error Handling
The Core API returns standard HTTP status codes and JSON error responses.HTTP Status Codes
- 200 OK - Request successful
- 400 Bad Request - Invalid parameters or malformed request
- 401 Unauthorized - Missing or invalid API key
- 404 Not Found - Endpoint or resource not found
- 500 Internal Server Error - Server error or storage exception
Error Response Format
Error responses include astatus field indicating the error type:
BAD_REQUEST_ERROR- Invalid request parametersUNKNOWN_USER_ID_ERROR- User not foundNOT_ALLOWED- Operation not permittedGENERAL_ERROR- Generic error (check logs)
ServletException Errors
Internal errors (StorageQueryException, TenantOrAppNotFoundException, BadPermissionException) are thrown as ServletException with 500 status code.Rate Limiting
Some endpoints implement rate limiting to prevent abuse. The/hello endpoint uses a rate limiter with a default limit of 200 requests.
When rate limited, the endpoint will still return 200 OK but may return a different response in testing mode.
Request/Response Format
All API endpoints use JSON for request and response bodies (except text-only endpoints like/hello).
Request Headers:
Pagination
Endpoints that return lists of users support pagination using tokens: Query Parameters:paginationToken- Base64 encoded token for the next pagelimit- Maximum number of items per page (default: 100, max: 1000)timeJoinedOrder- Sort order:ASCorDESC(default:ASC)
Next Steps
Health Check
Test server connectivity with the
/hello endpointUser Management
List, search, and manage users
Configuration
Retrieve server configuration
JWKS
Get public keys for JWT verification