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

# Create a new webhook

> Create a new webhook in the workspace



## OpenAPI

````yaml https://api.onset.io/v1/openapi.yml post /webhooks
openapi: 3.1.0
info:
  title: Onset API
  description: >-
    RESTful API for managing milestones, releases, subscribers, and webhooks in
    Onset workspace.
  version: 1.0.0
  contact:
    name: Onset Support
    url: https://www.onset.io
    email: support@onset.io
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://api.onset.io/v1
    description: API V1
security:
  - bearerAuth: []
  - basicAuth: []
tags:
  - name: Workspace
    description: Workspace management operations
  - name: Milestones
    description: Milestone management operations
  - name: Releases
    description: Release management operations
  - name: Subscribers
    description: Subscriber management operations
  - name: Webhooks
    description: Webhook management operations
  - name: Incoming Webhooks
    description: Incoming webhook management operations
paths:
  /webhooks:
    post:
      tags:
        - Webhooks
      summary: Create a new webhook
      description: Create a new webhook in the workspace
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhookRequest'
      responses:
        '201':
          description: Webhook created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    CreateWebhookRequest:
      type: object
      properties:
        name:
          type: string
          minLength: 3
          maxLength: 50
          description: Webhook name
          example: Production Deployment Hook
        url:
          type: string
          format: uri
          description: Webhook URL endpoint
          example: https://api.example.com/webhooks/onset
        events:
          type: object
          additionalProperties:
            type: boolean
          description: Webhook event subscriptions
          example:
            release.created: true
            release.updated: true
            release.deleted: false
            release.published: true
            release.scheduled: false
            release.reverted: false
            release.reacted: true
            release.unreacted: false
            milestone.created: true
            milestone.updated: true
            milestone.deleted: false
            milestone.upvoted: true
            milestone.downvoted: false
            milestone.archived: false
            milestone.unarchived: false
            subscriber.created: true
            subscriber.updated: false
            subscriber.deleted: false
            subscriber.unsubscribed: false
      required:
        - name
        - url
        - events
    Webhook:
      type: object
      properties:
        id:
          type: string
          description: Unique webhook identifier
        name:
          type: string
          description: Webhook name
        url:
          type: string
          format: uri
          description: Webhook URL endpoint
        events:
          type: object
          additionalProperties:
            type: boolean
          description: Webhook event subscriptions
          example:
            release.created: true
            release.updated: true
            release.deleted: false
            release.published: true
            release.scheduled: false
            release.reverted: false
            release.reacted: false
            release.unreacted: false
            milestone.created: true
            milestone.updated: true
            milestone.deleted: false
            milestone.upvoted: false
            milestone.downvoted: false
            milestone.archived: false
            milestone.unarchived: false
            subscriber.created: false
            subscriber.updated: false
            subscriber.deleted: false
            subscriber.unsubscribed: false
        last_triggered_at:
          type: string
          format: date-time
          nullable: true
          description: When the webhook was last triggered
        created_at:
          type: string
          format: date-time
          description: When the webhook was created
        updated_at:
          type: string
          format: date-time
          description: When the webhook was last updated
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message
        details:
          type: object
          description: Additional error details
      required:
        - error
  responses:
    BadRequest:
      description: Bad request - Invalid input parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Unauthorized - Invalid or missing authentication
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````