> For the complete documentation index, see [llms.txt](https://academy.synap.ac/doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://academy.synap.ac/doc/integrations/webhooks/exam-completed-webhook.md).

# Exam Completed Webhook

This event is triggered when a user's Exam attempt has been Completed, e.g. once it has been submitted and marked.

* For exams which are automatically marked (e.g. pure MCQ exams), this will be sent at the same time as the Exam Submitted webhook.&#x20;
* For exams which are manually marked, this will be sent after the Exam Submitted webhook
* This webhook will only be sent for an Exam attempt. To respond to any attempt on the platform, regardless of whether it is part of an Exam or not, you should use the Attempt Completed and/or Attempt Submitted webhooks

To subscribe to this webhook, please set up a URL endpoint capable of receiving POST requests.

### Request Details

The request will POST a JSON payload that conforms to the following Typescript interface:

```typescript
interface ExamCompletedWebhookBody {
  user: {
    id: string;
    name: string;
    email: string;
    customAttributes: Record<string, unknown>;
  };
  portal: { id: string };
  meta: { timestamp: string };
  attempt: {
    score: number;
    scoreFrac: number;
    totalAnsweredCorrectly: number;
    grade?: {
      label: string;
      minScore: number;
      isPass: boolean;
    };
    gradeCriteria?: {
      grades: {
        label: string;
        minScore: number;
        isPass: boolean;
      }[];
    };
    id: string;
    isExam: true;
    state: {
      responseQuestionMap: string[][];
      isRevoked: boolean;
      isStarted: boolean;
      sections?: {
        items: [
          {
            sectionId: string;
            responseIds: string[];
            isOpen: boolean;
            isUnlocked: boolean;
            isCompleted: boolean;
            totalQuestionsCompleted: number;
            totalQuestionsSkipped: number;
            marks: {
              points?: number;
              maxPoints?: number;
              credits?: number;
              penalties?: number;
            };
            timeStarted: string;
            timeCompleted: string;
            timeSpentInMs: number;
            score: number;
            scoreFrac: number;
            totalCorrect: number;
          }
        ];
      };
      timeStarted: string;
      timeCompleted: string;
      timeSpentInMs: number;
      results: { markingStatus: string; pendingMarks: number; status: string };
      deferred?: {
        locked: boolean;
      };
    };
    marks: {
      points?: number;
      maxPoints?: number;
      credits?: number;
      penalties?: number;
    };
    totalQuestions: number;
    tags?: {
      nonFacetTags: string[];
      skill: string[];
      difficulty: string[];
      subtopic: string[];
      topic: string[];
      subject: string[];
      module: string[];
      exam: string[];
    };
    totalAnswered: number;
    timeStarted: string;
    timeCompleted: string;
    timeSpentInMs: number;
  };
  test: { id: string; title: string };
  exam: {
    id: string;
    name: string;
    resitCount: number;
    sourceTests: string[];
    sectionGrades?: {
      id: string;
      marks: {
        points?: number;
        maxPoints?: number;
        credits?: number;
        penalties?: number;
      };
    }[];
  };
  id: string;
  timeStarted: string;
  timeCompleted: string;
  timeSpentInMs: number;
  certificate?: {
    url: string;
    certificatePdfPath: string;
  };
  userGroup: {
    id?: string;
    name?: string;
  }
}
```

This should contain all of the information you need for most common use cases, such as emailing a confirmation to the user, or adding the attempt information to another system. You can also use this in conjunction with our APIs to fetch more data if needed.&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://academy.synap.ac/doc/integrations/webhooks/exam-completed-webhook.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
