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

# Subscribe new webhook

> Create and subscribe a new webhook



## OpenAPI

````yaml post /v1/integrations/webhooks/subscribe
openapi: 3.0.0
info:
  title: Hystruct API
  version: 1.0.0
servers:
  - url: https://api.hystruct.com
security:
  - apiKey: []
externalDocs:
  url: https://docs.hystruct.com
  description: Documentation
paths:
  /v1/integrations/webhooks/subscribe:
    post:
      summary: Subscribe new webhook
      description: Create and subscribe a new webhook
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - workflowId
                - webhookUrl
                - events
              properties:
                workflowId:
                  type: string
                  description: workflow ID
                webhookUrl:
                  type: string
                  description: Webhook URL
                events:
                  type: array
                  description: The events to subscribe to
        required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                description: Successful response
                type: object
                properties:
                  message:
                    type: string
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                description: Bad request
                type: object
                properties:
                  error:
                    type: string
        '404':
          description: No workflow found
          content:
            application/json:
              schema:
                description: No workflow found
                type: object
                properties:
                  error:
                    type: string
components:
  securitySchemes:
    apiKey:
      type: apiKey
      name: x-api-key
      in: header

````