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

# Register a webhook endpoint

> Register an HTTPS endpoint to receive Partner API webhook events. Provide a secret `apiKey`; TruEnroll returns it as the `x-api-key` header on every delivery so you can verify each request is genuine. On the Partner API, `audience` defaults to `partner`, so the endpoint receives case events.

Each active endpoint URL can be registered once per organization. Registering a URL that is already active returns `409`.



## OpenAPI

````yaml /partner-api/openapi.json post /webhook-config
openapi: 3.0.3
info:
  title: TruEnroll Partner API
  version: 1.0.0
  description: >-
    Submit academic documents and retrieve structured extraction, forensics, and
    translation results.
servers:
  - url: https://eval-api.trential.dev/partner/v1
    description: Sandbox
  - url: https://api.truenroll.com/partner/v1
    description: Production
security:
  - apiKey: []
tags:
  - name: Cases
    description: Create and manage processing cases.
  - name: Results
    description: Fetch extraction, forensics, and translation results.
  - name: Webhooks
    description: Register endpoints that receive case events.
paths:
  /webhook-config:
    post:
      tags:
        - Webhooks
      summary: Register a webhook endpoint
      description: >-
        Register an HTTPS endpoint to receive Partner API webhook events.
        Provide a secret `apiKey`; TruEnroll returns it as the `x-api-key`
        header on every delivery so you can verify each request is genuine. On
        the Partner API, `audience` defaults to `partner`, so the endpoint
        receives case events.


        Each active endpoint URL can be registered once per organization.
        Registering a URL that is already active returns `409`.
      operationId: createWebhookConfig
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhookConfigRequest'
            example:
              endpoint: https://example.com/truenroll/webhook
              apiKey: whsec_a1b2c3d4e5f6g7h8i9j0
              description: Production case events
      responses:
        '200':
          description: Webhook endpoint registered.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/WebhookConfigCreated'
              example:
                success: true
                message: webhook config created successfully
                meta: {}
                data:
                  id: 6850abc123def456ghi789
        '400':
          description: >-
            Invalid request body, e.g. `endpoint` is not a valid URL or `apiKey`
            is shorter than 20 characters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Key is not a partner key, or the key is inactive.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: An active webhook config already exists for this endpoint URL.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    CreateWebhookConfigRequest:
      type: object
      required:
        - endpoint
        - apiKey
      properties:
        endpoint:
          type: string
          format: uri
          description: HTTPS URL TruEnroll will POST events to.
        apiKey:
          type: string
          minLength: 20
          description: >-
            A secret you choose (at least 20 characters). TruEnroll sends it
            back as the `x-api-key` header on every delivery, so you can verify
            each request is genuine.
        audience:
          type: string
          enum:
            - partner
            - internal
          description: >-
            Audience for the endpoint. On the Partner API this defaults to
            `partner`, so the endpoint receives Partner API case events. You
            normally don't need to set it.
        description:
          type: string
          description: Optional human-readable label for the endpoint.
    SuccessResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        message:
          type: string
        meta:
          type: object
          description: >-
            Optional metadata (e.g. pagination). Empty object when not
            applicable.
        data: {}
      required:
        - success
        - message
        - meta
        - data
    WebhookConfigCreated:
      type: object
      properties:
        id:
          type: string
          description: Unique ID of the registered webhook configuration.
      required:
        - id
    ErrorResponse:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
      required:
        - statusCode
        - message
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: 'Partner API key. Also accepted as `Authorization: Bearer <key>`.'

````