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

# Create a new Webhook

> Create a new Webhook

<Accordion title="Usage with the Drivly SDK" icon="code-simple">
  <Note>
    <span class="font-medium">Make sure you install our SDK first. You can find out how, and more [here](/commerce/sdk).</span>
  </Note>

  ```typescript theme={null}
  import { SDK } from '@drivly/commerce'
  import type { webhooks } from '@drivly/commerce'

  const sdk = new SDK(...)

  const webhooks = await sdk.webhooks.create(data: webhooks): Promise<webhooks>
  ```
</Accordion>


## OpenAPI

````yaml post /webhooks
openapi: 3.0.3
info:
  title: Drivly Commerce API
  version: 1.0.0
  description: API for the Driv.ly experience
  contact:
    name: Drivly
    url: https://driv.ly
    email: support@driv.ly
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://commerce.driv.ly/api
security: []
paths:
  /webhooks:
    post:
      tags:
        - webhooks
      summary: Create a new Webhook
      description: Create a new Webhook
      parameters:
        - name: depth
          in: query
          description: number of levels to automatically populate relationships and uploads
          schema:
            type: number
        - name: locale
          in: query
          description: retrieves document(s) in a specific locale
          schema:
            type: string
        - name: fallback-locale
          in: query
          description: specifies a fallback locale if no locale value exists
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/webhooksRequest'
      responses:
        '200':
          $ref: '#/components/responses/webhooksUpsertConfirmationResponse'
      security:
        - apiKeyAuth: []
components:
  requestBodies:
    webhooksRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/webhooks'
  responses:
    webhooksUpsertConfirmationResponse:
      description: ok
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/webhooksUpsertConfirmation'
  schemas:
    webhooks:
      additionalProperties: false
      title: Webhook
      type: object
      properties:
        url:
          type: string
          nullable: true
        tenants:
          items:
            oneOf:
              - type: number
              - additionalProperties: false
                title: Tenant
                type: object
                properties:
                  name:
                    type: string
                    nullable: true
                  customer:
                    items:
                      type: number
                    type: array
                    nullable: true
                  defaultDealer:
                    items:
                      type: number
                    type: array
                    nullable: true
                  defaultFacilitator:
                    type: number
                    nullable: true
                  email:
                    type: string
                    nullable: true
                  apiKey:
                    type: string
                    nullable: true
                  environment:
                    type: string
                    nullable: true
                  creditApplicationLabel:
                    type: string
                    nullable: true
                  deals:
                    items:
                      type: number
                    type: array
                    nullable: true
                  locations:
                    items:
                      type: number
                    type: array
                    nullable: true
                  insuranceQuotes:
                    items:
                      type: number
                    type: array
                    nullable: true
                  serviceQuotes:
                    items:
                      type: number
                    type: array
                    nullable: true
                  serviceOrders:
                    type: string
                    nullable: true
                  insurancePolicies:
                    items:
                      type: number
                    type: array
                    nullable: true
                  addresses:
                    items:
                      type: number
                    type: array
                    nullable: true
                  listings:
                    items:
                      type: number
                    type: array
                    nullable: true
                  vehicles:
                    items:
                      type: number
                    type: array
                    nullable: true
                  webhooks:
                    items:
                      type: number
                    type: array
                    nullable: true
                  taxesAndFees:
                    items:
                      type: number
                    type: array
                    nullable: true
                  dmvFees:
                    items:
                      type: number
                    type: array
                    nullable: true
                  transportServiceOrders:
                    items:
                      type: number
                    type: array
                    nullable: true
                  updatedAt:
                    type: string
                  createdAt:
                    type: string
                required:
                  - id
                  - updatedAt
                  - createdAt
          type: array
          nullable: true
        method:
          type: string
          nullable: true
        updatedAt:
          type: string
        createdAt:
          type: string
      required:
        - id
        - updatedAt
        - createdAt
    webhooksUpsertConfirmation:
      type: object
      title: Webhook upsert confirmation
      properties:
        doc:
          additionalProperties: false
          title: Webhook
          type: object
          properties:
            url:
              type: string
              nullable: true
            tenants:
              items:
                type: number
              type: array
              nullable: true
            method:
              type: string
              nullable: true
            updatedAt:
              type: string
            createdAt:
              type: string
          required:
            - id
            - updatedAt
            - createdAt
        message:
          type: string
      required:
        - doc
        - message
  securitySchemes:
    apiKeyAuth:
      in: header
      type: apiKey
      name: Authorization

````