Overview
The/config endpoint returns the absolute path to the SuperTokens Core configuration file (config.yaml). This endpoint is restricted to requests from the same process and must be called from the base connection URI domain with the public app and tenant.
Key Features:
- Returns configuration file path
- Process ID verification for security
- Must be called from base tenant only
- No API key required
- Useful for debugging and configuration management
Endpoint
http://localhost:3567
Request
Headers
No authentication required.Query Parameters
The process ID of the SuperTokens Core process. Must match the current process ID for the request to succeed.
Request Body
None.Response
Success Response
Status Code:200 OK
Content-Type: application/json
Body:
Response status -
"OK" on successAbsolute path to the configuration file
Not Allowed Response
Status Code:200 OK
Body:
Response status -
"NOT_ALLOWED" when PID doesn’t matchError Response
Status Code:500 Internal Server Error
Returned when:
- The request is not from the base tenant (BadPermissionException)
- The tenant or app is not found (TenantOrAppNotFoundException)
- Required query parameter is missing
Examples
cURL
Wrong Process ID
JavaScript (Node.js)
Python
Implementation Details
Process ID Verification
The endpoint verifies that the providedpid parameter matches the current SuperTokens Core process ID using ProcessHandle.current().pid().
Source: View source
Configuration Path Resolution
The path is determined by:- Command-line argument (
--config-fileor-c) - Installation path +
config.yaml(default)
Tenant Restriction
The endpoint enforces that it can only be called from the base tenant (public app and tenant). Requests from specific tenants or apps will fail with BadPermissionException. Source: View sourceSecurity Considerations
Why PID Verification?- Prevents external applications from discovering configuration paths
- Ensures only the SuperTokens process can query its own configuration
- Protects sensitive file system information
- Configuration is global, not tenant-specific
- Prevents tenant isolation issues
- Ensures consistent behavior across multitenancy setups
Use Cases
Configuration Management Tools
Debugging and Diagnostics
Error Handling
Missing PID Parameter
Non-Base Tenant Request
Invalid App ID
Notes
- The endpoint does not require an API key
- API version header is not required
- The PID check ensures this is primarily for internal/debugging use
- The returned path is always absolute, regardless of how SuperTokens was started
- This endpoint is useful for automated configuration management in containerized environments
Related Endpoints
Health Check
Check if SuperTokens is running
API Overview
Learn about API authentication and structure