Create a hosted Cognitive Assessment session and retrieve its formal result.
The Cognitive Assessment API lets your backend create a hosted HK-MoCA 5-minute assessment for an external user. GOFA hosts the audio flow and returns only the formal scores, total, percentile interpretation, and confirmed demographics.
launchUrl in a top-level browser or camera-capable WebView.The launch URL is a hosted boundary; inline iframe embedding is not supported.
Keep the API key on your server. Do not put it in browser code, mobile apps,
URLs, or the hosted page. Activate Cognitive Assessment in API → API
Services and add the exact HTTPS return origin in the shared Allowed return
origins setting before sending returnUrl.
POST /api/v1/cognitive-assessment/sessionsThe request body is strict:
| Field | Required | Description |
|---|---|---|
userId | Yes | Your opaque external user identifier. It is returned as supplied and may contain ASCII letters, numbers, ., _, :, @, +, or -. |
returnUrl | No | An approved HTTPS URL. GOFA returns to this URL with only the session ID and status query parameters. |
locale | No | en, zh, zh-Hant, zh-Hans, or zh-TW. |
age | No | Optional prefill from 0 to 130. The participant can correct it in the hosted flow. |
educationYears | No | Optional prefill from -1 to 100. -1 means unknown; the participant can correct it. |
curl --request POST 'https://www.gofa.app/api/v1/cognitive-assessment/sessions' \
--header 'Authorization: Bearer <GOFA_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"userId": "customer-member-123",
"locale": "en",
"age": 72,
"educationYears": 6,
"returnUrl": "https://your-app.example/cognitive/complete"
}'The response is 201 Created:
{
"data": {
"cognitiveAssessmentSessionId": "<generated-session-id>",
"userId": "customer-member-123",
"status": "in_progress",
"createdAt": "2026-09-20T09:00:00.000Z",
"updatedAt": "2026-09-20T09:00:00.000Z",
"completedAt": null,
"expiresAt": "2026-09-20T11:00:00.000Z",
"resultExpiresAt": "2026-10-20T09:00:00.000Z",
"returnUrl": "https://your-app.example/cognitive/complete",
"locale": "en",
"demographics": { "age": 72, "educationYears": 6 },
"result": null,
"launchUrl": "https://www.gofa.app/cognitive-assessment-audio/runs/<id>#sessionToken=<temporary-token>"
}
}Every successful POST creates a new session and consumes one point. There is no customer-supplied idempotency key. A temporary launch credential is scoped to the client and session, expires with the two-hour unfinished session window, and must never be logged or forwarded to another user.
GET /api/v1/cognitive-assessment/sessions/{cognitiveAssessmentSessionId}GET is free, still requires the bearer API key, and is limited to one poll every
five seconds per session. Wait for Retry-After after a 429. A completed
session remains readable through the separate resultExpiresAt retention window
even after its launch URL expires.
The completed result contains the formal per-domain scores, raw and adjusted
total, education bonus, percentile label/risk interpretation, and the confirmed
age and education values. It does not contain recordings, audio URLs, model
costs, raw diagnostics, or technical capture data.
After completion or an early exit, GOFA navigates to the approved return origin
with only cognitive_assessment_session_id and status query parameters. Do
not treat these values as the result; fetch the session from your server.
DELETE /api/v1/cognitive-assessment/sessions/{cognitiveAssessmentSessionId}DELETE is free and returns 204 No Content for a session owned by the key. It
soft-deletes the session and never refunds the point used at creation. It can be
used after launch expiry while retention permits cleanup.