Exam record. Served by RenewalController::submitExam().answers must be a question of that pool, and no more keys than the course's exam_questions may be sent, otherwise 403. A question counts as correct when its selected answer is one of its correct answers. total is the course's exam_questions, so an unanswered question counts as wrong, and the exam passes when correct reaches the course's exam_minimum. A passed exam on a course that needs skills builds the renewal's skill logs (SkillLog::buildSkillsTrace()). There is no lock and no mail.App\Http\Controllers\Api\V1\Professional\RenewalController::submitExam()api.v1.professional.renewals.exam.submitAuthorization: Bearer {token}role:professional. A user without the professional role receives 403.POST/api/v1/professional/renewals/{log_code}/examapplication/json| Parameter | Type | Description |
|---|---|---|
{log_code} | string(32) | Renewal course log code, as returned by GET /api/v1/professional/renewals. Not a primary key. |
{
"answers": { "7301": 29100, "7302": 29104 },
"start": "2026-09-30 10:00:00",
"end": "2026-09-30 10:30:00"
}App\Http\Requests\Api\V1\Professional\SubmitRenewalAttemptRequest.| Field | Type | Required | Validation | Description |
|---|---|---|---|---|
answers | object | Yes | required|array | {question id: answer id} map. The keys are the answered questions, checked against the pool by the controller (403) |
answers.* | integer | Yes | required|integer|exists:answers,id | An id that exists in answers |
start | datetime | Yes | required|date | Attempt start. With the renewal it identifies the attempt (409 when sent twice) |
end | datetime | Yes | required|date|after:start | Attempt end, after start |
201 Createdexam_questions 2 and exam_minimum 1.{
"success": true,
"status": "success",
"message": "Exam submitted successfully",
"data": {
"id": 243101,
"log_code": "7c1e5d9a3b2f4a68901d2c3b4a5f6e70",
"total": 2,
"correct": 1,
"wrong": 1,
"score": 50,
"passed": true,
"date": "2026-09-30",
"start": "2026-09-30 10:00:00",
"end": "2026-09-30 10:30:00",
"questions": [
{
"id": 7301,
"text": "Why do you need to analyze your gas before diving?",
"missing": false,
"answers": [
{ "id": 29099, "text": "To ensure you have your correct mix", "is_correct": false, "selected": false },
{ "id": 29100, "text": "Both A and B are correct", "is_correct": true, "selected": true }
]
},
{
"id": 7302,
"text": "What is the maximum operating depth of a gas mix?",
"missing": false,
"answers": [
{ "id": 29103, "text": "The depth where its oxygen partial pressure reaches the limit", "is_correct": true, "selected": false },
{ "id": 29104, "text": "The depth of the dive site", "is_correct": false, "selected": true }
]
}
]
}
}ExamResultResource shape as GET_exam_results.md - see _resources.md. passed is correct >= course.exam_minimum, not a percentage threshold.401 Unauthorized{
"success": false,
"status": "error",
"message": "Unauthenticated"
}message is Token expired or Invalid token when a bearer token was sent but is expired or unknown.403 Forbiddenprofessional role (role:professional middleware, body not captured), when no renewal with that log_code belongs to the caller or the log_code does not exist, or when a key of answers is not a question of the course's exam pool at its current version or more keys than the course's exam_questions are sent. Nothing is written. The last three cases use the standard envelope:{
"success": false,
"status": "error",
"message": "Forbidden"
}409 Conflict - attempt already submittedstart was already submitted for this renewal: the same attempt sent twice, for example a retry. Nothing is written. Another attempt, with a different start, is always accepted: there is no limit on the number of attempts.{
"success": false,
"status": "error",
"message": "Attempt already submitted."
}422 Unprocessable Entity - validationApiFormRequest::failedValidation(), before the controller runs. Not captured on this route; the shape is the one the base class emits.{
"success": false,
"status": "error",
"message": "Validation failed",
"errors": {
"answers": ["The answers field is required."]
}
}429 Too Many Requestsx-ratelimit-limit: 120. The body is the standard envelope with message: "Too many requests" and a Retry-After header.Exam row. If passed and the course needs skills, builds the renewal's skill logs. No lock is set and no mail is sent.questions, the caller's IP in ip_address and the server time in date; start and end are stored as given.RenewalController carries a @deprecated docblock; it concerns the renewal payment endpoints only (checkout() and confirmPayment() answer 501), not this endpoint.docs/api/professional/renewals/POST_exam_submit.mdcurl --location 'https://test.diveraid.com/api/v1/professional/renewals//exam' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"answers": {
"property1": 0,
"property2": 0
},
"start": "2019-08-24T14:15:22.123Z",
"end": "2019-08-24T14:15:22.123Z"
}'{
"status": "success",
"message": "string",
"data": {
"id": 0,
"log_code": "string",
"total": 0,
"correct": 0,
"wrong": 0,
"score": 0,
"passed": true,
"date": "2019-08-24",
"start": "2019-08-24T14:15:22.123Z",
"end": "2019-08-24T14:15:22.123Z",
"questions": [
{
"id": 0,
"text": "string",
"missing": true,
"answers": [
{
"id": 0,
"text": "string",
"is_correct": true,
"selected": true
}
]
}
]
}
}