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

# Create new webhook subscription

> Creates a new webhook subscription with the specified subscription details.



## OpenAPI

````yaml /openapi.json post /webhooks
openapi: 3.0.1
info:
  title: API
  version: '1.0'
servers:
  - url: https://api.smokeball.com
  - url: https://api.smokeball.com.au
  - url: https://api.smokeball.co.uk
  - url: https://stagingapi.smokeball.com
  - url: https://stagingapi.smokeball.com.au
  - url: https://stagingapi.smokeball.co.uk
security:
  - api-key: []
    token: []
paths:
  /webhooks:
    post:
      tags:
        - Webhooks
      summary: Create new webhook subscription
      description: >-
        Creates a new webhook subscription with the specified subscription
        details.
      operationId: CreateSubscription
      requestBody:
        content:
          application/json-patch+json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookSubscriptionDto'
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookSubscriptionDto'
          application/*+json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookSubscriptionDto'
      responses:
        '200':
          description: When request is successful. Returns the new webhook subscriptions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookSubscription'
        '400':
          description: When an unsupported request is made.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
components:
  schemas:
    WebhookSubscriptionDto:
      type: object
      properties:
        key:
          type: string
          description: >-
            Unique key used for creating signature header in webhook
            notification requests.
          nullable: true
          example: da4e7fd1-5394-4ca9-b1c6-e18c4e2bf262
        name:
          type: string
          description: Name or description of the webhook subscription.
          nullable: true
          example: Listen to matter and contact changes
        eventTypes:
          type: array
          items:
            type: string
          description: >-
            The event types that the webhook subscription should be subscribed
            to.
          nullable: true
          example:
            - matter.updated
            - contact.created
        eventNotificationUrl:
          type: string
          description: The uri to notify when an event has occurred.
          nullable: true
          example: http://yourdomain.com/notify
      additionalProperties: false
    WebhookSubscription:
      type: object
      properties:
        id:
          type: string
          nullable: true
        href:
          type: string
          nullable: true
        relation:
          type: string
          nullable: true
        method:
          type: string
          default: GET
          nullable: true
        self:
          allOf:
            - $ref: '#/components/schemas/Link'
          nullable: true
        accountId:
          type: string
          description: Unique identifier of the associated account.
          nullable: true
          example: da4e7fd1-5394-4ca9-b1c6-e18c4e2bf262
        name:
          type: string
          description: Name or description of the subscription.
          nullable: true
          example: Listen to matter and contact changes
        eventTypes:
          type: array
          items:
            type: string
          description: The event types that the webhook subscription is subscribed to.
          nullable: true
          example:
            - matter.updated
            - contact.created
        eventNotificationUrl:
          type: string
          description: The uri to notify when an event has occurred.
          nullable: true
          example: http://yourdomain.com/notify
        createdDateUtc:
          type: string
          description: The webhook subscription creation date.
          format: date-time
          example: '2022-04-23T14:00:00Z'
        updatedDateUtc:
          type: string
          description: The webhook subscription last updated date.
          format: date-time
          example: '2022-04-23T14:00:00Z'
        lastUpdated:
          type: integer
          description: Last updated timestamp
          format: int64
          example: 637847425252027400
      additionalProperties: false
    ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: {}
    Link:
      type: object
      properties:
        id:
          type: string
          nullable: true
        href:
          type: string
          nullable: true
        relation:
          type: string
          nullable: true
        method:
          type: string
          default: GET
          nullable: true
      additionalProperties: false
  securitySchemes:
    api-key:
      type: apiKey
      name: x-api-key
      in: header
    token:
      type: apiKey
      name: Authorization
      in: header
      x-amazon-apigateway-authtype: cognito_user_pools

````