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

# Test

> Send a sample event to the webhook URL to verify that the endpoint is reachable and responding correctly.



## OpenAPI

````yaml https://spec.speakeasy.com/conductor-one/conductorone/my-source-with-code-samples post /api/v1/webhooks/{id}/test
openapi: 3.1.0
info:
  description: The C1 API is a HTTP API for managing C1 resources.
  title: C1 API
  version: 0.1.0-alpha
servers:
  - description: The C1 API server for the current tenant.
    url: https://{tenantDomain}.conductor.one
    variables:
      tenantDomain:
        default: example
        description: The domain of the tenant to use for this request.
security:
  - bearerAuth: []
    oauth: []
paths:
  /api/v1/webhooks/{id}/test:
    post:
      tags:
        - Webhook
      summary: Test
      description: >-
        Send a sample event to the webhook URL to verify that the endpoint is
        reachable and responding correctly.
      operationId: c1.api.webhooks.v1.WebhooksService.Test
      parameters:
        - in: path
          name: id
          required: true
          schema:
            description: The ID of the webhook to send a test event to.
            readOnly: false
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/c1.api.webhooks.v1.WebhooksServiceTestRequestInput
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/c1.api.webhooks.v1.WebhooksServiceTestResponse
          description: Successful response
      x-codeSamples:
        - lang: go
          label: Test
          source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/conductorone/conductorone-sdk-go/pkg/models/shared\"\n\tconductoronesdkgo \"github.com/conductorone/conductorone-sdk-go\"\n\t\"github.com/conductorone/conductorone-sdk-go/pkg/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := conductoronesdkgo.New(\n        conductoronesdkgo.WithSecurity(shared.Security{\n            BearerAuth: \"<YOUR_BEARER_TOKEN_HERE>\",\n            Oauth: \"<YOUR_OAUTH_HERE>\",\n        }),\n    )\n\n    res, err := s.Webhooks.Test(ctx, operations.C1APIWebhooksV1WebhooksServiceTestRequest{\n        ID: \"<id>\",\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.WebhooksServiceTestResponse != nil {\n        // handle response\n    }\n}"
        - lang: typescript
          label: Typescript (SDK)
          source: >-
            import { ConductoroneSDKTypescript } from
            "conductorone-sdk-typescript";


            const conductoroneSDKTypescript = new ConductoroneSDKTypescript({
              security: {
                bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
                oauth: "<YOUR_OAUTH_HERE>",
              },
            });


            async function run() {
              const result = await conductoroneSDKTypescript.webhooks.test({
                id: "<id>",
              });

              console.log(result);
            }


            run();
components:
  schemas:
    c1.api.webhooks.v1.WebhooksServiceTestRequestInput:
      description: The WebhooksServiceTestRequest message.
      title: Webhooks Service Test Request
      type: object
      x-speakeasy-name-override: WebhooksServiceTestRequest
    c1.api.webhooks.v1.WebhooksServiceTestResponse:
      description: The WebhooksServiceTestResponse message.
      properties:
        webhook:
          $ref: '#/components/schemas/c1.api.webhooks.v1.WebhookInstance'
      title: Webhooks Service Test Response
      type: object
      x-speakeasy-name-override: WebhooksServiceTestResponse
    c1.api.webhooks.v1.WebhookInstance:
      description: The WebhookInstance message.
      properties:
        attempts:
          description: The attempts field.
          format: int32
          readOnly: false
          type: integer
        completedAt:
          format: date-time
          readOnly: true
          type: string
        createdAt:
          format: date-time
          readOnly: true
          type: string
        expiresAt:
          format: date-time
          readOnly: true
          type: string
        id:
          description: The id field.
          readOnly: false
          type: string
        lastAttemptedAt:
          format: date-time
          readOnly: true
          type: string
        source:
          $ref: '#/components/schemas/c1.api.webhooks.v1.WebhookSource'
        spec:
          $ref: '#/components/schemas/c1.api.webhooks.v1.WebhookSpec'
        state:
          description: The state field.
          enum:
            - WEBHOOK_STATE_UNSPECIFIED
            - WEBHOOK_STATE_PENDING
            - WEBHOOK_STATE_RUNNING
            - WEBHOOK_STATE_ERROR
            - WEBHOOK_STATE_WAITING_CALLBACK
            - WEBHOOK_STATE_PROCESS_RESPONSE
            - WEBHOOK_STATE_SUCCESS
            - WEBHOOK_STATE_FATAL_ERROR
          readOnly: false
          type: string
          x-speakeasy-unknown-values: allow
        updatedAt:
          format: date-time
          readOnly: true
          type: string
        webhookId:
          description: The webhookId field.
          readOnly: false
          type: string
      title: Webhook Instance
      type: object
      x-speakeasy-name-override: WebhookInstance
    c1.api.webhooks.v1.WebhookSource:
      description: >
        The WebhookSource message.


        This message contains a oneof named source. Only a single field of the
        following list may be set at a time:
          - test
          - policyPostAction
          - approvalStep
          - provisionStep
          - workflowStep
      properties:
        approvalStep:
          $ref: >-
            #/components/schemas/c1.api.webhooks.v1.WebhookSource.WebhookSourceApprovalStep
        policyPostAction:
          $ref: >-
            #/components/schemas/c1.api.webhooks.v1.WebhookSource.WebhookSourcePolicyPostAction
        provisionStep:
          $ref: >-
            #/components/schemas/c1.api.webhooks.v1.WebhookSource.WebhookSourceProvisionStep
        test:
          $ref: >-
            #/components/schemas/c1.api.webhooks.v1.WebhookSource.WebhookSourceTest
        workflowStep:
          $ref: >-
            #/components/schemas/c1.api.webhooks.v1.WebhookSource.WebhookSourceWorkflowStep
      title: Webhook Source
      type: object
      x-speakeasy-name-override: WebhookSource
    c1.api.webhooks.v1.WebhookSpec:
      description: The WebhookSpec message.
      properties:
        destination:
          description: The destination field.
          readOnly: false
          type: string
      title: Webhook Spec
      type: object
      x-speakeasy-name-override: WebhookSpec
    c1.api.webhooks.v1.WebhookSource.WebhookSourceApprovalStep:
      description: The WebhookSourceApprovalStep message.
      nullable: true
      properties:
        ticketId:
          description: The ticketId field.
          readOnly: false
          type: string
      title: Webhook Source Approval Step
      type: object
      x-speakeasy-name-override: WebhookSourceApprovalStep
    c1.api.webhooks.v1.WebhookSource.WebhookSourcePolicyPostAction:
      description: The WebhookSourcePolicyPostAction message.
      nullable: true
      properties:
        ticketId:
          description: The ticketId field.
          readOnly: false
          type: string
      title: Webhook Source Policy Post Action
      type: object
      x-speakeasy-name-override: WebhookSourcePolicyPostAction
    c1.api.webhooks.v1.WebhookSource.WebhookSourceProvisionStep:
      description: The WebhookSourceProvisionStep message.
      nullable: true
      properties:
        ticketId:
          description: The ticketId field.
          readOnly: false
          type: string
      title: Webhook Source Provision Step
      type: object
      x-speakeasy-name-override: WebhookSourceProvisionStep
    c1.api.webhooks.v1.WebhookSource.WebhookSourceTest:
      description: The WebhookSourceTest message.
      nullable: true
      title: Webhook Source Test
      type: object
      x-speakeasy-name-override: WebhookSourceTest
    c1.api.webhooks.v1.WebhookSource.WebhookSourceWorkflowStep:
      description: The WebhookSourceWorkflowStep message.
      nullable: true
      properties:
        workflowExecutionId:
          description: The workflowExecutionId field.
          format: int64
          readOnly: false
          type: string
        workflowStepId:
          description: The workflowStepId field.
          readOnly: false
          type: string
      title: Webhook Source Workflow Step
      type: object
      x-speakeasy-name-override: WebhookSourceWorkflowStep
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http
    oauth:
      description: >-
        This API uses OAuth2 with the Client Credential flow.

        Client Credentials must be sent in the BODY, not the headers.

        For an example of how to implement this, refer to the
        [c1TokenSource.Token()](https://github.com/ConductorOne/conductorone-sdk-go/blob/3375fe7c0126d17e7ec4e711693dee7b791023aa/token_source.go#L101-L187)
        function.
      flows:
        clientCredentials:
          scopes: {}
          tokenUrl: /auth/v1/token
      type: oauth2

````