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

# Test a monitor's webhook

> Send a signed test event to a monitor's configured webhook and inspect the delivery outcome.

This endpoint sends one `monitor.webhook.test` event to the current webhook URL, signed with the current secrets. It takes no request body and returns after the receiver responds or the 10-second attempt times out.

HTTP `200` means the test completed, not necessarily that delivery succeeded. Check `delivered`, `status_code` when available, and `error` for the outcome.

When delivery fails, `error` is a typed string such as `http_status`, `timeout`, `network_error`, or `tls_certificate`. An `http_status` error includes the receiver's `status_code`; redirects count as failures. Allow for new error values. A delivered test omits `error`.

The attempt is not retried and does not count toward the `webhook_failing` pause threshold. A monitor without a webhook returns HTTP `409` with `invalid_state`; [add a webhook](https://docs.perplexity.ai/api-reference/monitors-update-patch.md) before testing.

```bash cURL theme={null}
curl --request POST "https://api.perplexity.ai/v1/monitors/$MONITOR_ID/webhook/test" \
  --header "Authorization: Bearer $PERPLEXITY_API_KEY" | jq
```


## OpenAPI

````yaml post /v1/monitors/{monitor_id}/webhook/test
openapi: 3.1.0
info:
  title: Perplexity AI API
  description: Perplexity AI API
  version: 1.0.0
servers:
  - url: https://api.perplexity.ai
    description: Perplexity AI API
security: []
paths:
  /v1/monitors/{monitor_id}/webhook/test:
    post:
      tags:
        - Monitors
      summary: Test a monitor's webhook
      description: >-
        Sends one signed `monitor.webhook.test` event to the configured webhook
        URL. Takes no request body and returns the delivery outcome after a
        response or a 10-second timeout. The test is not retried and does not
        count toward the `webhook_failing` pause threshold. A monitor without a
        webhook returns HTTP `409` with `invalid_state`.
      operationId: testMonitorWebhook
      parameters:
        - $ref: '#/components/parameters/MonitorId'
      responses:
        '200':
          description: The outcome of the send, delivered or not
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonitorWebhookTest'
              examples:
                delivered:
                  value:
                    object: monitor.webhook_test
                    event_id: evt_0f9e8d7c6b5a49382716051f2e3d4c5b
                    delivered: true
                    status_code: 200
                    duration_ms: 184
                rejected:
                  value:
                    object: monitor.webhook_test
                    event_id: evt_0f9e8d7c6b5a49382716051f2e3d4c5b
                    delivered: false
                    status_code: 401
                    duration_ms: 95
                    error: http_status
                timeout:
                  value:
                    object: monitor.webhook_test
                    event_id: evt_0f9e8d7c6b5a49382716051f2e3d4c5b
                    delivered: false
                    duration_ms: 10000
                    error: timeout
        '401':
          $ref: '#/components/responses/MonitorUnauthorized'
        '403':
          $ref: '#/components/responses/MonitorForbidden'
        '404':
          $ref: '#/components/responses/MonitorNotFound'
        '409':
          $ref: '#/components/responses/MonitorInvalidState'
        '429':
          $ref: '#/components/responses/MonitorTooManyRequests'
        '502':
          $ref: '#/components/responses/MonitorBadGateway'
        '503':
          $ref: '#/components/responses/MonitorUnavailable'
        '504':
          $ref: '#/components/responses/MonitorGatewayTimeout'
      security:
        - HTTPBearer: []
      servers:
        - url: https://api.perplexity.ai
          description: Production API
components:
  parameters:
    MonitorId:
      name: monitor_id
      in: path
      required: true
      schema:
        type: string
      description: Monitor identifier (mon_...)
  schemas:
    MonitorWebhookTest:
      type: object
      description: The outcome of one test send
      required:
        - object
        - event_id
        - delivered
        - duration_ms
      properties:
        object:
          type: string
          enum:
            - monitor.webhook_test
        event_id:
          type: string
          description: The test event's `id` and `webhook-id` header
        delivered:
          type: boolean
          description: The receiver answered 2xx
        status_code:
          type: integer
          format: int32
          description: The receiver's HTTP status; omitted when it never answered
        duration_ms:
          type: integer
          format: int32
          minimum: 0
          description: Time from sending to the answer or the failure
        error:
          $ref: '#/components/schemas/MonitorWebhookTestError'
    MonitorWebhookTestError:
      type: string
      enum:
        - http_status
        - timeout
        - network_error
        - tls_certificate
        - blocked_address
        - invalid_url
        - send_failed
      description: |
        Why the send failed; omitted when delivered. `http_status`: the
        receiver answered `status_code` (a 3xx too, since redirects are not
        followed). New values may be added.
    MonitorApiError:
      type: object
      properties:
        error:
          type: object
          required:
            - message
            - type
            - code
          properties:
            message:
              description: Human-readable error message
              type: string
            type:
              $ref: '#/components/schemas/MonitorApiErrorType'
            code:
              type: integer
              description: HTTP status code
            param:
              type: string
              description: Parameter that caused the error
    MonitorApiErrorType:
      type: string
      enum:
        - invalid_request
        - invalid_api_key
        - token_expired
        - insufficient_quota
        - payment_required
        - forbidden
        - api_product_not_allowed
        - not_found
        - invalid_state
        - conflict
        - quota_exceeded
        - run_in_progress
        - request_rate_limit_exceeded
        - internal_error
        - bad_gateway
        - service_unavailable
        - gateway_timeout
      description: >
        Machine-readable error type. Monitors returns `invalid_request`

        (400), `invalid_api_key`, `token_expired` and

        `insufficient_quota` (401), `payment_required` (402),

        `forbidden` and `api_product_not_allowed` (403), `not_found`

        (404), `invalid_state` (409: the monitor's state does not allow

        the request; change it first), `conflict` (409: the monitor was

        modified concurrently; retry), `quota_exceeded` (409),

        `run_in_progress` (409), `request_rate_limit_exceeded` (429),

        `internal_error` (500), `bad_gateway` (502), `service_unavailable` (503)
        and

        `gateway_timeout` (504). New types may be added; act on `code`

        for an unknown one.
  responses:
    MonitorUnauthorized:
      description: Invalid API key, expired token, or no credits
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MonitorApiError'
    MonitorForbidden:
      description: Monitors are not available to this API Group
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MonitorApiError'
    MonitorNotFound:
      description: Monitor not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MonitorApiError'
    MonitorInvalidState:
      description: The monitor's state does not allow this request (`invalid_state`)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MonitorApiError'
    MonitorTooManyRequests:
      description: Rate limit exceeded
      headers:
        Retry-After:
          $ref: '#/components/headers/MonitorRetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MonitorApiError'
    MonitorBadGateway:
      description: The Monitor request failed; retry.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MonitorApiError'
    MonitorUnavailable:
      description: Monitor service unavailable; retry
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MonitorApiError'
    MonitorGatewayTimeout:
      description: The monitor service did not answer in time; retry
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MonitorApiError'
  headers:
    MonitorRetryAfter:
      schema:
        type: integer
        minimum: 1
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````