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

# Create a webhook

> Register a destination and subscribe it to one or more events. Use the exact names returned by List webhook event names. Save the returned `WebhookID` to manage the subscription.



## OpenAPI

````yaml /openapi/openapi.json post /Webhooks/NewWebhook
openapi: 3.1.0
info:
  title: Aiyoti Integration API
  description: Create, retrieve, update, and manage the tracking lifecycle of assets.
  version: 0.0.1
servers:
  - url: '{BaseURL}'
    variables:
      BaseURL:
        default: '{{BaseURL}}'
        description: >-
          Base URL provided when you create API credentials in the Aiyoti
          platform.
security: []
tags:
  - name: Assets / Shipments
    description: Create, list, retrieve, edit, annotate, and delete assets.
  - name: Locations
    description: Manage saved areas and find assets within them.
  - name: Carriers
    description: Look up the carriers available to an account.
  - name: Labels
    description: Look up the labels available for new assets.
  - name: Accounts
    description: Find and manage account records.
  - name: Users
    description: Look up user records.
  - name: Events
    description: Look up event types and query event history.
  - name: Webhooks
    description: Configure subscriptions to Aiyoti events.
  - name: Inventory
    description: Check label stock and look up label SKUs.
paths:
  /Webhooks/NewWebhook:
    post:
      tags:
        - Webhooks
      summary: Create a webhook
      description: >-
        Register a destination and subscribe it to one or more events. Use the
        exact names returned by List webhook event names. Save the returned
        `WebhookID` to manage the subscription.
      operationId: new_webhook_Webhooks_NewWebhook_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewWebhook'
            examples:
              example:
                summary: Subscribe to an event
                value:
                  WebhookName: Example webhook
                  URL: https://example.com/webhook
                  Events:
                    - User comment
      responses:
        '200':
          description: Webhook created.
          content:
            application/json:
              schema:
                type: object
                properties:
                  Code:
                    type: integer
                    description: >-
                      Application code in the response body. Separate from the
                      HTTP status.
                  Message:
                    type: string
                    description: Result message.
                  WebhookID:
                    type: string
                    description: New webhook ID.
              example:
                Code: 200
                Message: Success
                WebhookID: '00000000000000000000000000000005'
        '400':
          description: >-
            Request rejected. Check your credentials, account access, and
            request parameters.
        '422':
          description: Request validation failed. Check required fields and value types.
      security:
        - clientId: []
          apiKey: []
components:
  schemas:
    NewWebhook:
      properties:
        WebhookName:
          type: string
          description: Name of the webhook. Use a name that is unique within the account.
        URL:
          type: string
          description: Destination URL for the webhook.
        Events:
          items:
            type: string
          type: array
          description: Event names from List webhook event names.
        AccountID:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Account for the webhook. Defaults to the account associated with
            your credentials.
        Headers:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          description: Optional header names and values to send to the destination.
      type: object
      required:
        - WebhookName
        - URL
        - Events
  securitySchemes:
    clientId:
      type: apiKey
      in: header
      name: ClientID
    apiKey:
      type: apiKey
      in: header
      name: ApiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.