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

# Send a test event to a webhook

> Sends a synthetic event payload for `eventType` to the webhook's URL using its configured method and headers, and returns what your endpoint answered.



## OpenAPI

````yaml POST /webhook/{webhookId}/test
openapi: 3.0.1
info:
  title: Tela API
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.tela.com
security: []
paths:
  /webhook/{webhookId}/test:
    post:
      tags:
        - Webhook
      summary: Send a test event to a webhook
      description: >
        Sends a synthetic [event
        payload](#/components/schemas/WebhookEventPayload) for `eventType` to
        the

        webhook's URL using its configured method and headers, and returns what
        your endpoint answered. The

        payload contains a sample task with a sample PDF input; `mockData` lets
        you override a few task fields.

        The test does not create a delivery record and always returns `200`,
        even when your endpoint fails —

        inspect `success` and `statusCode`.
      operationId: testWebhook
      parameters:
        - $ref: '#/components/parameters/WebhookIdPath'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookTestRequest'
      responses:
        '200':
          description: Result of the test request to your endpoint
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookTestResponse'
        '400':
          $ref: '#/components/responses/WebhookBadRequest'
        '401':
          $ref: '#/components/responses/WebhookUnauthorized'
        '403':
          $ref: '#/components/responses/WebhookForbidden'
        '404':
          $ref: '#/components/responses/WebhookNotFound'
        '422':
          $ref: '#/components/responses/WebhookValidationError'
      security:
        - bearerAuth: []
components:
  parameters:
    WebhookIdPath:
      name: webhookId
      in: path
      required: true
      description: Webhook subscription ID
      schema:
        type: string
        format: uuid
  schemas:
    WebhookTestRequest:
      type: object
      properties:
        eventType:
          $ref: '#/components/schemas/WebhookEventType'
        mockData:
          type: object
          description: Optional overrides applied to the sample payload.
          properties:
            task:
              type: object
              properties:
                name:
                  type: string
                  description: Defaults to `Test Task`.
                status:
                  type: string
                  description: >-
                    Defaults to `completed`, or `failed` / `validating` for the
                    failure and approval-revoke events.
                reference:
                  type: number
                  description: Defaults to `12345`.
            promptApplication:
              type: object
              properties:
                title:
                  type: string
            workspace:
              type: object
              properties:
                name:
                  type: string
      required:
        - eventType
      example:
        eventType: task.completed
        mockData:
          task:
            name: Contract 42 review
            reference: 42
    WebhookTestResponse:
      type: object
      properties:
        success:
          type: boolean
          description: >-
            `true` when the request reached your endpoint (regardless of the
            HTTP status it returned).
        statusCode:
          type: integer
          description: >-
            HTTP status returned by your endpoint; `0` when the request could
            not be completed.
        response:
          type: string
          description: Response body returned by your endpoint.
        responseTime:
          type: integer
          description: Round-trip time in milliseconds.
        error:
          type: string
          description: >-
            Error message when the request could not be completed (timeout, DNS
            failure, ...).
      required:
        - success
        - statusCode
        - response
        - responseTime
      example:
        success: true
        statusCode: 200
        response: '{"ok":true}'
        responseTime: 184
    WebhookEventType:
      type: string
      enum:
        - task.completed
        - task.approved
        - task.approval-revoke
        - task.failed
      description: >
        Events a webhook can subscribe to:

        - `task.completed` — a task run finished successfully and is ready for
        review.

        - `task.approved` — a task was reviewed and approved.

        - `task.approval-revoke` — an approved task was sent back to
        `validating`.

        - `task.failed` — a task run ended with a failure (`errorMessage` is set
        in the payload).
    Error: {}
  responses:
    WebhookBadRequest:
      description: Invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    WebhookUnauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    WebhookForbidden:
      description: The key does not have the required role
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    WebhookNotFound:
      description: Webhook not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    WebhookValidationError:
      description: Request body or query failed schema validation (`code` is `VALIDATION`)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT or UUID

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.