Ayush Synapse uses JWT (HS256) for authentication. In demo mode, any caller can obtain a token fromDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/sagar-grv/ayush-synapse/llms.txt
Use this file to discover all available pages before exploring further.
POST /auth/login — no credentials or prior registration is needed. The returned token must then be included in the Authorization header of all protected endpoint requests.
POST /auth/login
Generates a signed JWT token for the supplied user identity and role.| Property | Value |
|---|---|
| Method | POST |
| Path | /auth/login |
| Auth required | No |
| Content-Type | application/json |
Request Body
An identifier for the requesting user. Any non-empty string is accepted in demo mode. Echoed back in the response.
The role to embed in the token. Controls permission checks on protected endpoints.Accepted values:
clinician, adminResponse Fields
Always
"Authentication successful" on a valid request.The signed JWT string. Pass this value in the
Authorization: Bearer header of subsequent requests.The
user_id value echoed from the request body (or "demo_user" if omitted).The role embedded in the token (
"clinician" or "admin").A set of boolean flags describing what this token authorises.
true when the server is running with DEMO_MODE=True. Indicates that all features are accessible regardless of role.Example Request
Example Response
Using the Token
Include the token from the login response as aBearer credential in the Authorization header of every protected request.
Token Expiry
Tokens are valid for 24 hours from the time of issue (iat claim). After expiry, the API returns:
POST /auth/login again. There is no refresh-token flow; a new full login is required.
Error Responses
| HTTP Status | Condition | Response body |
|---|---|---|
401 | Authorization header is absent | {"error": "Authorization header is required"} |
401 | Header format is not Bearer <token> | {"error": "Invalid Authorization header format"} |
401 | Token signature is invalid or malformed | {"error": "Invalid token"} |
401 | Token has passed its 24-hour expiry | {"error": "Token has expired"} |
403 | Token is valid but role does not meet endpoint requirement | {"error": "Access denied. Required role: <role>"} |