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

# Create Webhook

> Initialise a single webhook



## OpenAPI

````yaml POST /core/webhooks
openapi: 3.0.1
info:
  title: rootfi
  version: v3
servers:
  - url: https://api.rootfi.dev/v3
    description: global
  - url: https://api.sa.rootfi.dev/v3
    description: saudi
security: []
paths:
  /core/webhooks:
    post:
      tags:
        - CoreWebhooks
      summary: Create Webhook
      description: Initialise a single webhook
      operationId: core_webhooks_create
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/coreCreateWebhookReqBody'
            examples:
              Example1:
                value:
                  webhook:
                    operations:
                      - CREATE
                    name: webhook 1
                    type: CONNECTION_CHANGED
                    data_models:
                      - ACCOUNTS
                    url: https://webhook.site/eec24873-a381-4694-b684-a1d77d9e0697
                    headers:
                      api_key: fhsjd
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/coreWebhookData'
              examples:
                Example1:
                  value:
                    id: THBROZzWGuL3b8qEEdBF
                    headers:
                      api_key: fhsjd
                    operations:
                      - CREATE
                    data_models:
                      - ACCOUNTS
                    name: webhook 1
                    created_at: '2024-04-15T04:52:25.309Z'
                    type: CONNECTION_CHANGED
                    url: https://webhook.site/eec24873-a381-4694-b684-a1d77d9e0697
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RootFiAPIResponseType'
        '403':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RootFiAPIResponseType'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RootFiAPIResponseType'
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RootFiAPIResponseType'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    coreCreateWebhookReqBody:
      title: coreCreateWebhookReqBody
      type: object
      description: The data of the webhooks endpoint
      properties:
        webhook:
          $ref: '#/components/schemas/coreCreateWebhookData'
          description: The data of the webhook
      required:
        - webhook
    coreWebhookData:
      title: coreWebhookData
      type: object
      description: The data of the invite link endpoint
      properties:
        id:
          type: string
          description: The ID of the webhook
          example: THBROZzWGuL3b8qEEdBF
        headers:
          type: object
          additionalProperties: true
          description: The headers of the webhook
        operations:
          type: array
          items:
            $ref: '#/components/schemas/coreWebhookOperation'
          description: The operations of the webhook
        data_models:
          type: array
          items:
            $ref: '#/components/schemas/DataModels'
          description: The data models of the webhook
        name:
          type: string
          description: The name of the webhook
          example: webhook 1
        created_at:
          type: string
          description: The date the webhook was created
          example: '2024-04-15T04:52:25.309Z'
        type:
          $ref: '#/components/schemas/coreWebhookType'
          description: The type of the webhook
        url:
          type: string
          description: The URL of the webhook
          example: https://webhook.site/eec24873-a381-4694-b684-a1d77d9e0697
      required:
        - id
        - headers
        - operations
        - data_models
        - name
        - created_at
        - type
        - url
    RootFiAPIResponseType:
      title: RootFiAPIResponseType
      type: object
      properties:
        error:
          $ref: '#/components/schemas/RootFiAPIResponseErrorType'
          description: The error message
      required:
        - error
    coreCreateWebhookData:
      title: coreCreateWebhookData
      type: object
      description: The data of the webhooks endpoint
      properties:
        operations:
          type: array
          items:
            $ref: '#/components/schemas/coreWebhookOperation'
          description: The operations of the webhook
        name:
          type: string
          description: The name of the webhook
          example: webhook 1
        type:
          $ref: '#/components/schemas/coreWebhookType'
          description: The type of the webhook
        data_models:
          type: array
          items:
            $ref: '#/components/schemas/DataModels'
          description: The data models of the webhook
        url:
          type: string
          description: The URL of the webhook
          example: https://webhook.site/eec24873-a381-4694-b684-a1d77d9e0697
        headers:
          type: object
          additionalProperties: true
          description: The headers of the webhook
      required:
        - operations
        - name
        - type
        - data_models
        - url
        - headers
    coreWebhookOperation:
      title: coreWebhookOperation
      type: string
      enum:
        - CREATE
        - UPDATE
        - DELETE
    DataModels:
      title: DataModels
      type: string
      enum:
        - ACCOUNTS
        - BANK_ACCOUNTS
        - BILLS
        - BILL_PAYMENTS
        - COMPANY_INFO
        - CONTACTS
        - BILL_CREDIT_NOTES
        - INVOICE_CREDIT_NOTES
        - DOCUMENTS
        - EXPENSES
        - INVOICES
        - INVOICE_PAYMENTS
        - ITEMS
        - LINE_ITEMS
        - TAX_RATES
        - JOURNAL_ENTRIES
        - BANK_TRANSACTIONS
        - JOURNAL_LINES
        - PURCHASE_ORDERS
        - SALES_ORDERS
        - PHONE_NUMBERS
        - ADDRESSES
        - EXTERNAL_LINKS
        - CONTACT_PERSONS
        - INCOME_STATEMENT
        - BALANCE_SHEET
        - TRACKING_CATEGORIES
        - CASH_FLOW_STATEMENT
        - CURRENCIES
        - PAYMENT_CUSTOMERS
        - PAYMENT_INVOICES
        - PAYMENT_LINE_ITEMS
        - PAYMENT_ITEMS
        - PAYMENT_ORDERS
        - PAYMENT_TAX_RATES
        - PAYMENT_DISPUTES
        - PAYMENT_PAYMENTS
        - PAYMENT_REFUNDS
        - PAYMENT_PAYMENT_LINKS
        - PAYMENT_PAYOUTS
        - PAYMENT_ADDRESSES
        - PAYMENT_PHONE_NUMBERS
        - PAYMENT_EXTERNAL_LINKS
        - PAYMENT_TRANSACTIONS
        - PAYMENT_BALANCES
        - ECOMMERCE_ORDERS
        - ECOMMERCE_CUSTOMERS
        - ECOMMERCE_PRODUCTS
        - ECOMMERCE_LINE_ITEMS
        - CRM_CONTACTS
        - CRM_COMPANIES
        - CRM_DEALS
        - CRM_LEADS
        - CRM_NOTES
        - CRM_PIPELINES
        - CRM_STAGES
        - CRM_ACTIVITIES
        - CRM_TASKS
        - CRM_USERS
        - CRM_EXTERNAL_LINKS
        - CRM_PHONE_NUMBERS
        - CRM_ADDRESSES
    coreWebhookType:
      title: coreWebhookType
      type: string
      enum:
        - DATA_MODEL_CHANGES
        - CONNECTION_CHANGED
        - SYNC_COMPLETED
    RootFiAPIResponseErrorType:
      title: RootFiAPIResponseErrorType
      type: object
      properties:
        message:
          type: string
          description: The error message
        code:
          type: string
          description: The error code
        field:
          type: string
          description: The status of the error
      required:
        - message
        - code
        - field
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: api_key

````