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

# Send test webhook



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml post /fleets/{fleetId}/webhooks/{webhookId}/test
openapi: 3.1.0
info:
  description: API-key accessible routes for Cerca agents.
  title: Cerca API
  version: 0.0.0
servers:
  - url: https://api.cerca.dev
security:
  - bearerAuth: []
paths:
  /fleets/{fleetId}/webhooks/{webhookId}/test:
    post:
      tags:
        - Webhooks
      summary: Send test webhook
      parameters:
        - schema:
            type: string
            minLength: 1
            example: fleet_abc123
          required: true
          in: path
          name: fleetId
        - schema:
            type: string
            minLength: 1
            example: webhook_abc123
          required: true
          in: path
          name: webhookId
      responses:
        '200':
          description: Structured result for a synthetic webhook.test delivery.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestWebhookResponse'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Not authorized for this fleet.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Fleet or webhook subscription not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Webhook subscription conflict.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '415':
          description: Content-Type must be application/json.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        default:
          description: Error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Cerca from '@cerca-dev/sdk';


            const client = new Cerca({
              apiKey: process.env['CERCA_API_KEY'], // This is the default and can be omitted
            });


            const response = await client.webhooks.test('fleet_abc123',
            'webhook_abc123');


            console.log(response.error);
        - lang: Python
          source: |-
            import os
            from cerca import Cerca

            client = Cerca(
                api_key=os.environ.get("CERCA_API_KEY"),  # This is the default and can be omitted
            )
            response = client.webhooks.test(
                fleet_id="fleet_abc123",
                webhook_id="webhook_abc123",
            )
            print(response.error)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/matrices/cerca-go\"\n\t\"github.com/matrices/cerca-go/option\"\n)\n\nfunc main() {\n\tclient := cercago.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Webhooks.Test(\n\t\tcontext.TODO(),\n\t\t\"fleet_abc123\",\n\t\t\"webhook_abc123\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Error)\n}\n"
        - lang: Ruby
          source: |-
            require "cerca"

            cerca = Cerca::Client.new(api_key: "My API Key")

            response = cerca.webhooks.test_("fleet_abc123", "webhook_abc123")

            puts(response)
        - lang: CLI
          source: |-
            cerca webhooks test \
              --api-key 'My API Key' \
              --fleet-id fleet_abc123 \
              --webhook-id webhook_abc123
components:
  schemas:
    TestWebhookResponse:
      type: object
      properties:
        error:
          type:
            - string
            - 'null'
        statusCode:
          type:
            - integer
            - 'null'
        success:
          type: boolean
      required:
        - error
        - statusCode
        - success
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
          description: Stable machine-readable error code when the API can provide one.
          example: MONTHLY_TOKEN_BUDGET_EXCEEDED
      required:
        - error
  securitySchemes:
    bearerAuth:
      bearerFormat: Cerca API key
      scheme: bearer
      type: http

````