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

# Register Webhook

> The `secret` is returned only once. Store it securely for
verifying `X-Edpire-Signature` headers on incoming deliveries.




## OpenAPI

````yaml POST /webhooks
openapi: 3.1.0
info:
  title: Edpire API
  description: >
    Edpire is a headless assessment engine. This API lets you manage
    assessments,

    submit answers for grading, retrieve results, manage collections, and
    configure

    webhooks for real-time notifications.


    All responses use a consistent envelope: `{ data, error, meta }`.
  version: 1.0.0
  contact:
    name: Edpire Support
    url: https://edpire.com
  license:
    name: Proprietary
servers:
  - url: https://edpire.com/api/v1
    description: Production
security:
  - BearerAuth: []
tags:
  - name: Assessments
    description: Create, list, update, publish, and grade assessments
  - name: Submissions
    description: Retrieve submission details
  - name: Learners
    description: Query learner results
  - name: Collections
    description: Manage ordered groups of assessments
  - name: Webhooks
    description: Register and manage webhook endpoints
  - name: Embed
    description: Mint tokens and load assessments for browser-side rendering
  - name: OpenAPI
    description: API specification
paths:
  /webhooks:
    post:
      tags:
        - Webhooks
      summary: Register a webhook endpoint
      description: |
        The `secret` is returned only once. Store it securely for
        verifying `X-Edpire-Signature` headers on incoming deliveries.
      operationId: registerWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhookRequest'
      responses:
        '201':
          description: Webhook registered (secret included)
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Envelope'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/WebhookWithSecret'
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - BearerAuth:
            - write:assessments
components:
  schemas:
    CreateWebhookRequest:
      type: object
      required:
        - url
        - events
      properties:
        url:
          type: string
          format: uri
          description: HTTPS URL (http://localhost allowed for dev)
        events:
          type: array
          minItems: 1
          items:
            type: string
            enum:
              - submission.graded
              - assessment.published
              - assessment.archived
              - assessment.updated
              - collection.created
              - collection.updated
              - collection.deleted
              - collection.item_added
              - collection.item_removed
              - collection.reordered
    Envelope:
      type: object
      properties:
        data: {}
        error:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/ErrorObject'
        meta:
          oneOf:
            - type: 'null'
            - type: object
    WebhookWithSecret:
      type: object
      properties:
        id:
          type: string
          format: uuid
        url:
          type: string
          format: uri
        events:
          type: array
          items:
            type: string
        secret:
          type: string
          description: Shown only once — store securely
    ErrorObject:
      type: object
      required:
        - message
      properties:
        message:
          type: string
    ErrorResponse:
      type: object
      properties:
        data:
          type: 'null'
        error:
          $ref: '#/components/schemas/ErrorObject'
        meta:
          type: 'null'
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >
        API key starting with `edp_live_`. Pass via `Authorization: Bearer
        edp_live_xxx`.


        Scopes: `read:assessments`, `write:assessments`, `read:results`,
        `write:submissions`.

````