# Webhooks v2 reference

The bodies Cademí sends to a webhook set to payload version 2, the default.

Every event is a `POST` with a JSON body: `version`, `event` (the event name), `event_id` and the data in `payload`. The Diamond funnel events are the exception: they carry the data in `data`.

## Students

| Event | Name | When |
|---|---|---|
| [Student created](https://cademi.dev/webhooks/v2/reference/user-created.md) | `user.created` | Sent every time a student is created by a sale, by an import, by the dashboard or by the API. Google sign-in does not fire it. |
| [Student created by free access](https://cademi.dev/webhooks/v2/reference/user-created-free.md) | `user.created.free` | Sent every time a student is created through a free access flow (free sign-up form or redirect). |
| [Access granted](https://cademi.dev/webhooks/v2/reference/user-access-created.md) | `user.access.created` | Sent every time a delivery is added to a student by hand, from the dashboard or the API. A delivery granted by a sale fires only `delivery.add`. |
| [Terms accepted](https://cademi.dev/webhooks/v2/reference/user-term-signed.md) | `user.term.signed` | Sent every time a student accepts the platform terms or a product terms. |

## Learning progress

| Event | Name | When |
|---|---|---|
| [Lesson completed](https://cademi.dev/webhooks/v2/reference/class-concluded.md) | `class.concluded` | Sent every time a student completes a lesson. |
| [Product started](https://cademi.dev/webhooks/v2/reference/course-initiated.md) | `course.initiated` | Sent every time a student starts a product. |
| [Product at 50%](https://cademi.dev/webhooks/v2/reference/course-progress-50-percent.md) | `course.progress.50` | Sent every time a student crosses 50% progress in a product. |
| [Product at 75%](https://cademi.dev/webhooks/v2/reference/course-progress-75-percent.md) | `course.progress.75` | Sent every time a student crosses 75% progress in a product. |
| [Product at 90%](https://cademi.dev/webhooks/v2/reference/course-progress-90-percent.md) | `course.progress.90` | Sent every time a student crosses 90% progress in a product. |
| [Product milestone](https://cademi.dev/webhooks/v2/reference/course-progress.md) | `course.progress` | Sent every time a student crosses the 50%, 75% or 90% mark in a product. It is the generic version of the three milestone events. |
| [Product completed](https://cademi.dev/webhooks/v2/reference/course-concluded.md) | `course.concluded` | Sent every time a student completes every lesson of a product. |
| [Progress reached](https://cademi.dev/webhooks/v2/reference/user-progress.md) | `user.progress` | Sent every time the student progress in a product reaches the percentage set in the webhook. Carries `progress_percentage`. |

## Exams

| Event | Name | When |
|---|---|---|
| [Exam passed](https://cademi.dev/webhooks/v2/reference/exam-approved.md) | `exam.approved` | Sent every time a student passes an exam. |
| [Exam failed](https://cademi.dev/webhooks/v2/reference/exam-reproved.md) | `exam.reproved` | Sent every time a student fails an exam. |

## Certificates

| Event | Name | When |
|---|---|---|
| [Certificate issued](https://cademi.dev/webhooks/v2/reference/certificate-created.md) | `certificate.created` | Sent every time a certificate is issued to a student, reissues included. |

## Deliveries

| Event | Name | When |
|---|---|---|
| [Delivery added](https://cademi.dev/webhooks/v2/reference/delivery-add.md) | `delivery.add` | Sent every time a delivery is added to a student, by hand or by a sale. |

## Diamond funnel

| Event | Name | When |
|---|---|---|
| [Diamond: Checkout abandoned](https://cademi.dev/webhooks/v2/reference/diamond-checkout-abandoned.md) | `spyhub.diamond.checkout_abandoned` | The student opened the checkout and did not buy. |
| [Diamond: Checkout started](https://cademi.dev/webhooks/v2/reference/diamond-checkout-initiated.md) | `spyhub.diamond.checkout_initiated` | The student opened the checkout. |
| [Diamond: Checkout not started](https://cademi.dev/webhooks/v2/reference/diamond-checkout-not-initiated.md) | `spyhub.diamond.checkout_not_initiated` | The student has not opened the checkout in the expected time. |
| [Diamond: Class 1 completed](https://cademi.dev/webhooks/v2/reference/diamond-class-1-concluded.md) | `spyhub.diamond.class_1_concluded` | The student completed class 1. |
| [Diamond: Class 1 not started](https://cademi.dev/webhooks/v2/reference/diamond-class-1-not-initiated.md) | `spyhub.diamond.class_1_not_initiated` | The student has not started class 1 in the expected time. |
| [Diamond: Class 2 completed](https://cademi.dev/webhooks/v2/reference/diamond-class-2-concluded.md) | `spyhub.diamond.class_2_concluded` | The student completed class 2. |
| [Diamond: Class 2 not started](https://cademi.dev/webhooks/v2/reference/diamond-class-2-not-initiated.md) | `spyhub.diamond.class_2_not_initiated` | The student has not started class 2 in the expected time. |
| [Diamond: Class 3 completed](https://cademi.dev/webhooks/v2/reference/diamond-class-3-concluded.md) | `spyhub.diamond.class_3_concluded` | The student completed class 3. |
| [Diamond: Class 3 not started](https://cademi.dev/webhooks/v2/reference/diamond-class-3-not-initiated.md) | `spyhub.diamond.class_3_not_initiated` | The student has not started class 3 in the expected time. |
| [Diamond: Lead](https://cademi.dev/webhooks/v2/reference/diamond-lead.md) | `spyhub.diamond.lead` | The student entered the funnel. |
| [Diamond: Won](https://cademi.dev/webhooks/v2/reference/diamond-won.md) | `spyhub.diamond.won` | The student bought the product. |
