> ## Documentation Index
> Fetch the complete documentation index at: https://docs.schoolmaker.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a Webhook

> Create a webhook for events: `element_completed`, `member_joining_offer`, `new_payment`, `member_inactivity`, `gamification_level_passed` 

Webhooks will allow you to detect when a specified event occurs. Supported event types include:

* `element_completed` → When a step is completed
* `element_pending` → When a member submits an answer that needs to be corrected.
* `member_joining_offer` →  When a member is added to an offer
  * **extra\_parameters**:
    * `offerFilter` → An offer ID or multiple offer IDs separated by commas. This event will only trigger if the member is added to an offer that matches the filter
* `new_payment` → When a member initiates a new payment (whether it is on a one-time offer price, a multiple installment price, or a subscription)
* `member_inactivity` → Will trigger at the same time as the member inactivity notification from SchoolMaker
* `gamification_level_passed`  → Which will trigger when a level is passed in the community gamification feature
  * **extra\_parameters**:
    * `activeLevels` → A comma-separated list of level numbers. This event will only trigger if the member has passed a level that is in the list

To see the payload for each event, please refer to the [Webhooks Payload](/api-reference/endpoints/webhooks/payload) page.


## OpenAPI

````yaml post /webhooks
openapi: 3.0.1
info:
  title: SchoolMaker API V1
  description: API for managing your SchoolMaker school
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://schoolmaker.co/api/v1
    description: Production API
security:
  - bearerAuth: []
paths:
  /webhooks:
    post:
      summary: Create a Webhook
      description: >-
        Create a webhook for events: `element_completed`,
        `member_joining_offer`, `new_payment`, `member_inactivity`,
        `gamification_level_passed` 
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                webhook_url:
                  format: uri
                  type: string
                  description: >-
                    The URL where webhook payloads will be sent via POST
                    requests. This should be a publicly accessible HTTPS
                    endpoint that can receive and process the webhook events.
                event_type:
                  type: string
                  enum:
                    - element_completed
                    - element_pending
                    - member_joining_offer
                    - new_payment
                    - member_inactivity
                    - gamification_level_passed
                provider:
                  type: string
                extra_parameters:
                  type: object
                  properties:
                    offerFilter:
                      type: array
                      description: >-
                        List of offer IDs to filter `member_joining_offer`
                        events
                      items:
                        type: string
                    activeLevels:
                      type: array
                      description: >-
                        List of level numbers to filter
                        `gamification_level_passed` events
                      items:
                        type: integer
              required:
                - webhook_url
                - event_type
      responses:
        '201':
          description: Webhook created
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  webhook_url:
                    type: string
                  event_type:
                    type: string
                  provider:
                    type: string
                  extra_parameters:
                    type: object
                  created_at:
                    type: string
                    format: date-time
                  updated_at:
                    type: string
                    format: date-time
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````