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

# Create a webhook

> Creates a new webhook



## OpenAPI

````yaml /openapi/beyond-ai/webhooks-api.yaml post /webhooks/
openapi: 3.1.0
info:
  title: Webhooks API
  version: 1.0.0
  description: >-
    # Webhooks API


    ## Overview

    The Alpha Webhooks API allows you to register endpoints that will receive
    real-time notifications when Caliper events are processed by our system.
    This enables your application to react immediately to learning events
    without the need for polling or direct database access.



    # Authentication


    ## Guide


    Most endpoints require authentication using the `Authorization: Bearer
    <token>` header.


    The token can be obtained with:


    ```

    curl -X POST
    https://prod-beyond-timeback-api-2-idp.auth.us-east-1.amazoncognito.com/oauth2/token
    \

    -H "Content-Type: application/x-www-form-urlencoded" \

    -d
    "grant_type=client_credentials&client_id=<your-client-id>&client_secret=<your-client-secret>"

    ```


    Use the correct IDP server depending on the environment you're using.


    IDP Server for this environment:

    ```text
      https://prod-beyond-timeback-api-2-idp.auth.us-east-1.amazoncognito.com
    ```


    Reach out to the platform team to get a client/secret pair for your
    application.
servers:
  - url: https://caliper.alpha-1edtech.ai
    description: Webhooks API
security:
  - OAuth2: []
tags:
  - name: Webhook Filters
    description: >-
      These are the endpoints to use when creating, updating, and deleting
      webhook filters
  - name: Webhooks
    description: >-
      These are the endpoints to use when creating, updating, and deleting
      webhooks
paths:
  /webhooks/:
    post:
      tags:
        - Webhooks
      summary: Create a webhook
      description: Creates a new webhook
      requestBody:
        description: The webhook to create
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                sensor:
                  type:
                    - string
                    - 'null'
                  description: The sensor that the webhook is associated with
                  example: sensor123
                name:
                  type: string
                  description: The name of the webhook
                  example: My Webhook
                description:
                  type:
                    - string
                    - 'null'
                  description: The description of the webhook
                  example: This webhook is used to send data to the example.com/webhook
                targetUrl:
                  type: string
                  description: The URL that the webhook will send the data to
                  example: https://example.com/webhook
                secret:
                  type: string
                  description: >-
                    The secret that the webhook will use to authenticate the
                    data
                  example: secret123
                active:
                  type: boolean
                  description: Whether the webhook is active
                  example: true
              required:
                - name
                - description
                - targetUrl
                - secret
                - active
      responses:
        '201':
          description: Webhook created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  webhook:
                    type: object
                    properties:
                      id:
                        type: string
                        description: The unique identifier for the webhook
                        example: 123e4567-e89b-12d3-a456-426614174000
                      sensor:
                        type:
                          - string
                          - 'null'
                        description: The sensor that the webhook is associated with
                        example: sensor123
                      name:
                        type: string
                        description: The name of the webhook
                        example: My Webhook
                      description:
                        type:
                          - string
                          - 'null'
                        description: The description of the webhook
                        example: >-
                          This webhook is used to send data to the
                          example.com/webhook
                      targetUrl:
                        type: string
                        description: The URL that the webhook will send the data to
                        example: https://example.com/webhook
                      secret:
                        type: string
                        description: >-
                          The secret that the webhook will use to authenticate
                          the data
                        example: secret123
                      active:
                        type: boolean
                        description: Whether the webhook is active
                        example: true
                      createdAt:
                        type:
                          - string
                          - 'null'
                        description: The date and time the webhook was created
                        example: '2021-01-01T00:00:00.000Z'
                      updatedAt:
                        type: string
                        description: The date and time the webhook was last updated
                        example: '2021-01-01T00:00:00.000Z'
                      deletedAt:
                        type:
                          - string
                          - 'null'
                        description: The date and time the webhook was deleted
                        example: '2021-01-01T00:00:00.000Z'
                    required:
                      - id
                      - name
                      - description
                      - targetUrl
                      - secret
                      - active
                      - createdAt
                      - updatedAt
                      - deletedAt
                required:
                  - webhook
        '400':
          description: Invalid webhook data
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: The error message
                    example: An error occurred
                  details:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          description: The code of the error
                          example: invalid_type
                        expected:
                          type: string
                          description: The expected value
                          example: string
                        received:
                          type: string
                          description: The received value
                          example: undefined
                        path:
                          type: array
                          items:
                            type: string
                          description: The path of the error
                          example:
                            - sensor
                        message:
                          type: string
                          description: The message of the error
                          example: Required
                      required:
                        - code
                        - expected
                        - received
                        - path
                        - message
                required:
                  - error
                  - details
components:
  securitySchemes:
    OAuth2:
      type: oauth2
      flows:
        clientCredentials:
          scopes:
            https://purl.imsglobal.org/spec/caliper/v1p1/scope/admin: Admin scope (can call all endpoints)
            https://purl.imsglobal.org/spec/caliper/v1p1/scope/webhook.create: Webhook create scope (can create and update webhooks)
            https://purl.imsglobal.org/spec/caliper/v1p1/scope/webhook.readonly: Webhook readonly scope (can read webhooks)
            https://purl.imsglobal.org/spec/caliper/v1p1/scope/event.create: Event create scope (can create events)
          tokenUrl: >-
            https://prod-beyond-timeback-api-2-idp.auth.us-east-1.amazoncognito.com/oauth2/token

````