Every CogNerd API request that accesses your data requires a valid session token. You obtain a token by logging in with your email and password. Once you have a token, you pass it in theDocumentation Index
Fetch the complete documentation index at: https://docs.cognerd.in/llms.txt
Use this file to discover all available pages before exploring further.
Authorization header on every subsequent request. This page walks through registration, login, and authenticated calls — with working copy-paste examples in both curl and JavaScript.
Register an account
Send aPOST request to /api/auth/register with your name, email, and password. Registration creates your account and logs you in automatically — the response includes your session token so you can start making authenticated requests immediately.
Request parameters
Your full name. Stored on your profile and visible in the dashboard.
The email address you want to use as your login credential. Must be unique.
Your chosen password. Must be at least 8 characters. CogNerd never stores plaintext passwords.
Response
Your session token. Use this in the
Authorization: Bearer header for all authenticated requests.Your unique user ID.
The email address associated with your account.
Log in
If you already have an account, send aPOST request to /api/auth/login. A successful login returns a fresh session token.
Request parameters
The email address you registered with.
Your account password.
Response
Your session token. Store this securely — you will send it with every authenticated request.
Your unique user ID.
The email address associated with your account.
Authenticate requests
Pass your token in theAuthorization header as a Bearer token on every protected request.
Example — fetch your user profile
Response
Your numeric user ID.
Your display name.
Your registered email address.
Your active subscription plan (e.g.,
"monitor", "optimize", "enterprise").Token expiry and refresh
Session tokens are valid for 7 days. The expiry is automatically extended by 1 day on each successful authenticated request, so an active session stays alive without any action from you. If your token has expired, re-authenticate usingPOST /api/auth/login to get a fresh one.
There is no separate refresh token endpoint. Simply log in again when your session expires.
Authentication errors
When a request is missing a token or the token is invalid/expired, the API responds with a401 status code.
Always
"UNAUTHORIZED" for authentication failures.A human-readable description of why the request was rejected.
Keeping your token secure
A few recommendations for API integrations:- Store tokens in environment variables, a secrets manager, or an encrypted credential store — never hard-code them in source files.
- Rotate tokens by logging out (
POST /api/auth/logout) and logging in again if you suspect a token has been compromised. - Use HTTPS at all times. The production endpoint (
https://api.cognerd.in) enforces TLS automatically.