Skip to main content
This guide walks you through administering a standalone psychological test (a single record) using the Braintest API. You will list available records, authenticate a participant profile using either SMS verification or the instant path (depending on your organizer setting), fetch questions, submit answers, and retrieve the final result.
Prerequisites
  • A valid API key from the organizer panel, sent in the API-KEY header
  • At least one record with status: 2 (ready) available in your account
Do not call /record/{token}/auth/ for records that belong to a cognitive roadmap. Roadmap records must be authenticated through the roadmap endpoint instead. See the Cognitive Roadmap guide for details.

Two authentication paths

Every record payload includes an organizer-level flag named tests_auth_required that controls how authentication works: Read tests_auth_required from the record before choosing the next step. Your integration should handle both paths.
1

List your records

Fetch your available records. Filter for unfinished, ready records so you only see tests that can be started.
Look for a record with status: 2 (ready) and auth_required: true. The response includes the token you need for the next steps, plus tests_auth_required which tells you whether SMS verification is on.
2

Inspect the record

Retrieve the full record details before starting.
Key fields to review:
  • status: must be 2 (ready)
  • auth_required: must be true before you can authenticate
  • tests_auth_required: selects the auth path (see the decision matrix above)
  • test.questions_count: total number of questions
  • test.doing_time_minutes: recommended time limit
  • test.gender_permission: gender restrictions, if any
3

Start authentication

Post the participant profile to the auth endpoint. The body is the same regardless of tests_auth_required.
Profile fieldsThe response echoes tests_auth_required. Branch on it to decide the next step.SMS path (tests_auth_required: true)
An SMS code is sent to the participant’s mobile. Keep the draft_token for the verify step. It expires after 5 minutes.Instant path (tests_auth_required: false)
The profile is created and linked to the record immediately. Skip the next step and jump to fetching questions.
4

Verify the SMS code (SMS path only)

Ask the participant for the code they received, then send it with the draft_token to complete authentication.
Success response
Common errorsSkip this step entirely when tests_auth_required is false.
5

Fetch the questions

Retrieve the question set for the authenticated participant.
The API supports two response formats:
  • JSON (default): structured question objects with IDs, text, and options
  • HTML: pre-rendered question markup for direct embedding in a web view
Request HTML explicitly by adding ?format=html to the URL if your client renders a web interface.
6

Submit answers

Send the participant’s responses back. The record array maps each question to its selected answer.
  • record: array of objects, each with question_id and answer_id
  • doing_duration_in_minutes: integer, time the participant spent answering
After submission, the record status changes to 1 (finished) and results become available.
7

Retrieve the result

Once is_finished is true, fetch the test results in your preferred format.
The JSON response contains structured scores, interpretations, and metadata. The HTML response is a ready-to-render report page.

Flow summary

SMS enabled (tests_auth_required: true, default)
SMS disabled (tests_auth_required: false)

What to do next