Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/chamals3n4/OpenATS/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Assessment Execution endpoints handle the candidate experience of taking tests, including starting assessments, submitting answers, and automatic grading. These endpoints use token-based authentication for public access.

Invite Candidate to Assessment

curl -X POST http://localhost:8080/api/assessment-execution/invite \
  -H "Content-Type: application/json" \
  -d '{
    "candidateId": 15,
    "assessmentId": 3,
    "expiryDays": 7
  }'
Manually invite a candidate to take an assessment. Generates a unique token and expiry date.

Body Parameters

candidateId
integer
required
The unique identifier of the candidate
assessmentId
integer
required
The unique identifier of the assessment to send
expiryDays
integer
default:"7"
Number of days until the assessment link expires

Response

{
  "data": {
    "id": 42,
    "candidateId": 15,
    "assessmentId": 3,
    "token": "a3f9b2c8-4d1e-4f6a-9c8b-1e2d3f4a5b6c",
    "status": "pending",
    "expiresAt": "2024-01-27T10:00:00Z",
    "startedAt": null,
    "completedAt": null,
    "scorePercentage": null,
    "passed": null
  }
}

Get Candidate Assessment Attempts

curl -X GET http://localhost:8080/api/assessment-execution/candidate/15
Retrieve all assessment attempts for a specific candidate.

Path Parameters

candidateId
integer
required
The unique identifier of the candidate

Response

{
  "data": [
    {
      "id": 42,
      "candidateId": 15,
      "assessmentId": 3,
      "token": "a3f9b2c8-4d1e-4f6a-9c8b-1e2d3f4a5b6c",
      "status": "completed",
      "expiresAt": "2024-01-27T10:00:00Z",
      "startedAt": "2024-01-20T14:30:00Z",
      "completedAt": "2024-01-20T15:15:00Z",
      "scorePercentage": 85,
      "passed": true,
      "assessment": {
        "id": 3,
        "title": "Backend Node.js Assessment",
        "timeLimit": 60,
        "passScore": 70
      }
    }
  ]
}

Get Assessment for Candidate (Public)

curl -X GET http://localhost:8080/api/assessment-execution/public/a3f9b2c8-4d1e-4f6a-9c8b-1e2d3f4a5b6c
Public endpoint for candidates to fetch assessment details using their unique token from the email invite.

Path Parameters

token
string
required
The unique token from the assessment invitation email

Response

{
  "data": {
    "id": 42,
    "status": "pending",
    "expiresAt": "2024-01-27T10:00:00Z",
    "assessment": {
      "id": 3,
      "title": "Backend Node.js Assessment",
      "description": "Technical screening for backend developers",
      "timeLimit": 60,
      "passScore": 70,
      "questions": [
        {
          "id": 1,
          "title": "Which of the following are Node.js core modules?",
          "description": null,
          "questionType": "multiple_choice",
          "points": 1,
          "position": 1,
          "options": [
            {"id": 1, "label": "fs", "position": 1},
            {"id": 2, "label": "express", "position": 2}
          ]
        }
      ]
    }
  }
}

Error Responses

410 Gone
Assessment link has expired
404 Not Found
Invalid token or assessment attempt not found

Start Assessment (Public)

curl -X POST http://localhost:8080/api/assessment-execution/public/a3f9b2c8-4d1e-4f6a-9c8b-1e2d3f4a5b6c/start
Mark the assessment as started and begin the timer. Can only be called when status is pending.

Path Parameters

token
string
required
The unique token from the assessment invitation

Response

{
  "data": {
    "id": 42,
    "status": "started",
    "startedAt": "2024-01-20T14:30:00Z",
    "expiresAt": "2024-01-27T10:00:00Z"
  }
}

Error Responses

400 Bad Request
Cannot start an assessment that is already started or completed

Submit Answer (Public)

curl -X POST http://localhost:8080/api/assessment-execution/public/a3f9b2c8-4d1e-4f6a-9c8b-1e2d3f4a5b6c/answer \
  -H "Content-Type: application/json" \
  -d '{
    "questionId": 1,
    "optionIds": [1, 3]
  }'
Save or update a candidate’s answer for a specific question. Can be called multiple times for the same question to update the answer.

Path Parameters

token
string
required
The unique token from the assessment invitation

Body Parameters

questionId
integer
required
The unique identifier of the question being answered
answerText
string
Text answer for short_answer questions
optionIds
array
Array of selected option IDs for multiple_choice questions

Response

{
  "data": {
    "id": 101,
    "attemptId": 42,
    "questionId": 1,
    "answerText": null,
    "optionIds": [1, 3],
    "isCorrect": true,
    "pointsAwarded": 1
  }
}

Error Responses

403 Forbidden
Assessment must be in ‘started’ state to submit answers

Complete Assessment (Public)

curl -X POST http://localhost:8080/api/assessment-execution/public/a3f9b2c8-4d1e-4f6a-9c8b-1e2d3f4a5b6c/complete
Finalize the assessment, stop the timer, and calculate the final score. Automatically grades all answers.

Path Parameters

token
string
required
The unique token from the assessment invitation

Response

{
  "message": "Assessment completed successfully",
  "data": {
    "passed": true,
    "scorePercentage": 85
  }
}

Error Responses

400 Bad Request
Only started assessments can be completed

Assessment Status Flow

Assessments follow a specific status lifecycle:
  1. pending - Invitation sent, assessment not yet started
  2. started - Candidate has begun the assessment (timer running)
  3. completed - Assessment submitted and graded
Transitions:
  • pendingstarted via /start endpoint
  • startedcompleted via /complete endpoint
Answers can only be submitted when the assessment is in started status. Once an assessment is completed, no further changes can be made.

Build docs developers (and LLMs) love