Fall Risk API
Endpoints
POST /api/fall-risk— Create a new fall risk result for a user/client.
POST /api/fall-risk
Create a new empty fall risk result for a user/client. Returns URLs for subsequent quiz and test steps.
Headers:
Authorization: Bearer <JWT>Content-Type: application/json
Request Body:
{
"userId": "string (optional)",
"email": "string (optional)",
"photoURL": "string (optional)"
}
userId: User ID to associate with the result (optional; if provided, must exist for the client)email: Email address (optional; if provided, must be valid)photoURL: Photo URL (optional; if provided, must be a valid URL)
Response:
-
200 OK:{
"fallRiskResultId": "string",
"quizUrl": "string",
"sitToStandTestUrl": "string",
"tandemStanceTestUrl": "string",
"singleLegStanceTestUrl": "string",
"tandemWalkTestUrl": "string",
"createdAt": "string (ISO date)"
} -
400 Bad Request:{ error: "Invalid email" | "Invalid photoURL" | "User does not exist" } -
401 Unauthorized:{ error: string } -
500 Internal Server Error:{ error: "Client ID not found" | string }
Notes:
- All returned URLs are relative paths for the next steps in the fall risk assessment process.
- CORS headers are set to allow cross-origin requests.
- For the full schema of a fall risk result, see Fall Risk Results API.