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

# Send test event

## Overview

> [!TIP]
>
> **Note**: This endpoint is available only in Sandbox environment

Sends an example event of the chosen [event type](https://docs.partners.api.cobee.io/en/api-reference/webhooks/events) to the URL of an existing subscription, so you can check that your endpoint receives and processes webhooks correctly before real events arrive.

> **Important**: the `eventType` must be one of the event types the subscription was registered with. Otherwise the call fails with `422 event_type_not_in_subscription`.

> **Important**: the example is delivered and signed exactly like a real event, using the subscription's `signingSecret`. Use it to validate your [signature verification](https://docs.partners.api.cobee.io/en/api-reference/webhooks/security.md).

> **Important**: the delivery is asynchronous. A `202` response means the test event was queued, not that your endpoint has already received it. The payload contains example data, so do not act on it as if it were a real event.


## OpenAPI

````yaml POST /webhooks/subscriptions/{subscriptionId}/test
openapi: 3.0.1
info:
  title: Partners API
  description: >-
    Partners API definition where you can check the documentation for the
    different available operations to integrate with the platform.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://pre-partners-api.cobee.io/api/v3
  - url: https://partners-api.cobee.io/api/v3
security:
  - bearerAuth: []
paths:
  /webhooks/subscriptions/{subscriptionId}/test:
    post:
      summary: >-
        Send a test event to a webhook subscription. **Note:** This endpoint is
        **only available** in the **sandbox** environment.
      parameters:
        - name: subscriptionId
          in: path
          required: true
          description: >-
            The unique identifier of the webhook subscription, as returned when
            it was registered.
          schema:
            type: string
          example: ep_3LKAAVHUEM1x9jdh9kJ8aT9nOzm
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - eventType
              properties:
                eventType:
                  type: string
                  description: >-
                    The event type of the example payload to send. It must be
                    one of the event types the subscription is registered for.
                    See [Event Models](/en/api-reference/webhooks/events) for
                    what each one delivers.
                  enum:
                    - employee.committed-expense.created
                    - employee.committed-expense.finished
                    - employee.committed-expense.cancelled
                    - employee.committed-expense.payment.cancelled
                  example: employee.committed-expense.created
      responses:
        '202':
          description: >-
            The test event was accepted and queued for delivery to the
            subscription's URL.
          content:
            application/json:
              schema:
                type: object
                required:
                  - messageId
                properties:
                  messageId:
                    type: string
                    description: The unique identifier of the queued test message.
                    example: msg_2LKAAVHUEM1x9jdh9kJ8aT9nOzm
        '400':
          description: >-
            Bad Request - eventType is missing or malformed, or the request body
            is not valid JSON.
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - message
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                    enum:
                      - validation_error
                  message:
                    type: string
                    description: Human-readable error description.
              example:
                code: validation_error
                message: body must have required property 'eventType'
        '404':
          description: >-
            Not Found - the subscription does not exist or does not belong to
            you.
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - message
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                    enum:
                      - webhook_subscription_not_found
                  message:
                    type: string
                    description: Human-readable error description.
              example:
                code: webhook_subscription_not_found
                message: Webhook subscription not found
        '422':
          description: >-
            Unprocessable Entity - the event type is not supported, or the
            subscription is not registered for it.
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - message
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                    enum:
                      - unsupported_event_type
                      - event_type_not_in_subscription
                  message:
                    type: string
                    description: Human-readable error description.
              examples:
                unsupportedEventType:
                  summary: The event type is not supported
                  value:
                    code: unsupported_event_type
                    message: Webhook event type is not supported
                eventTypeNotInSubscription:
                  summary: The subscription is not registered for the event type
                  value:
                    code: event_type_not_in_subscription
                    message: Event type is not included in the subscription
        '500':
          description: >-
            Internal Server Error - the delivery engine is unavailable or
            something went wrong on our end.
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - message
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                    enum:
                      - webhook_internal_error
                  message:
                    type: string
                    description: Human-readable error description.
              example:
                code: webhook_internal_error
                message: Unable to send the test event
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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