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

# Create a new Lead Event

> Create a new Lead Event

<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](/developers/sdk).</span>
  </Note>

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

  const sdk = new SDK(...)

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


## OpenAPI

````yaml openapi post /leadEvents
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:
  /leadEvents:
    post:
      tags:
        - leadEvents
      summary: Create a new Lead Event
      description: Create a new Lead Event
      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/leadEventsRequest'
      responses:
        '200':
          $ref: '#/components/responses/leadEventsUpsertConfirmationResponse'
      security:
        - apiKeyAuth: []
components:
  requestBodies:
    leadEventsRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/leadEvents'
  responses:
    leadEventsUpsertConfirmationResponse:
      description: ok
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/leadEventsUpsertConfirmation'
  schemas:
    leadEvents:
      additionalProperties: false
      title: LeadEvent
      type: object
      properties:
        lead:
          oneOf:
            - type: number
              nullable: true
            - additionalProperties: false
              title: Lead
              type: object
              properties:
                processStatuses:
                  enum:
                    - Qualified Lead
                    - Actively Communicating
                    - First Communication Attempt (phone and text)
                    - Second Communication Attempt
                    - On Hold
                    - Lost
                  type: string
                  nullable: true
                reason:
                  enum:
                    - Do Not Contact
                    - Duplicate
                    - Looking For Business Financing
                    - Looking For Listings
                    - Looking For Personal Financing
                    - Not Responding
                    - Test
                    - Bad Credit
                  type: string
                  nullable: true
                latestEvent:
                  type: number
                  nullable: true
                notes:
                  type: string
                  nullable: true
                statusTracker:
                  type: string
                  nullable: true
                searches:
                  items:
                    type: number
                  type: array
                  nullable: true
                attachments:
                  type: string
                  nullable: true
                firstName:
                  type: string
                  nullable: true
                lastName:
                  type: string
                  nullable: true
                phone:
                  type: string
                  nullable: true
                call:
                  type: string
                  nullable: true
                zipcode:
                  type: string
                  nullable: true
                email:
                  type: string
                  nullable: true
                loginEmail:
                  type: string
                  nullable: true
                purchaseOption:
                  type: string
                  nullable: true
                timeToPurchase:
                  items:
                    enum:
                      - ASAP
                      - This week
                      - Within 1-2 weeks
                      - Within 2-4 weeks
                      - Asap
                      - This Week
                      - Within 1-2 Weeks
                      - Within 2-4 Weeks
                      - within 1-2 weeks
                      - within 2-4 weeks
                      - within 1-2 months
                      - other
                      - this week
                      - asap
                      - 2+ months
                      - just browsing
                      - 1-2 months
                      - 1-2 weeks
                      - 2-4 weeks
                    type: string
                  type: array
                  nullable: true
                monthlyPayment:
                  type: number
                  nullable: true
                budgetLower:
                  type: string
                  nullable: true
                budgetUpper:
                  type: string
                  nullable: true
                mileageLower:
                  type: number
                  nullable: true
                mileageUpper:
                  type: number
                  nullable: true
                cashDown:
                  type: number
                  nullable: true
                newOrUsed:
                  type: string
                  nullable: true
                bodyStyle:
                  items:
                    enum:
                      - truck
                      - car
                      - van
                      - suv
                      - wagon
                    type: string
                  type: array
                  nullable: true
                carStyle:
                  items:
                    enum:
                      - sedan
                      - coupe
                      - convertible
                      - hatchback
                    type: string
                  type: array
                  nullable: true
                truckStyle:
                  items:
                    enum:
                      - crew
                      - reg
                      - extended
                    type: string
                  type: array
                  nullable: true
                suvStyle:
                  items:
                    enum:
                      - small/compact
                      - mid-size
                      - large/full-size
                    type: string
                  type: array
                  nullable: true
                vanStyle:
                  items:
                    enum:
                      - cargo
                      - passenger
                      - conversion
                    type: string
                  type: array
                  nullable: true
                yearLower:
                  type: number
                  nullable: true
                yearUpper:
                  type: number
                  nullable: true
                year:
                  type: number
                  nullable: true
                make:
                  type: string
                  nullable: true
                model:
                  type: string
                  nullable: true
                exterior:
                  items:
                    enum:
                      - Silver
                      - White
                      - Black
                      - Brown
                      - Blue
                      - Orange
                      - Red
                      - Green
                      - Any color
                      - Beige
                      - Gold
                      - Gray
                      - Light Blue
                    type: string
                  type: array
                  nullable: true
                interior:
                  items:
                    enum:
                      - Black
                      - Gray
                      - Tan
                      - Beige
                      - Blue
                      - Brown
                      - Red
                      - White
                      - Any color
                      - Ivory
                      - Cream
                    type: string
                  type: array
                  nullable: true
                fuelType:
                  items:
                    enum:
                      - Gasoline
                      - Electric
                      - Hybrid
                      - gasoline
                      - flex fuel
                      - diesel
                      - other
                      - hybrid
                      - electric
                    type: string
                  type: array
                  nullable: true
                drivetrain:
                  items:
                    enum:
                      - Four Wheel Drive
                      - Rear Wheel Drive
                      - Front Wheel Drive
                      - all wheel drive
                      - front wheel drive
                      - rear wheel drive
                    type: string
                  type: array
                  nullable: true
                transmission:
                  items:
                    enum:
                      - Automatic
                      - Manual
                      - automatic
                      - cvt
                      - manual
                    type: string
                  type: array
                  nullable: true
                comfort:
                  items:
                    enum:
                      - Leather/premium Seats
                      - Heated Steering Wheel
                      - leather/premium seats
                      - heated steering wheel
                      - ventilated or cooled seats
                      - heated seats
                      - dual-zone/climate control
                      - power-adjustable seats
                      - noise-cancelling technology
                      - massage seats
                    type: string
                  type: array
                  nullable: true
                safety:
                  items:
                    enum:
                      - Adaptive Cruise Control
                      - Blind Spot Monitor
                      - lane departure warning
                      - back up camera
                      - 360 camera
                      - park assist
                      - heads-up display
                      - adaptive cruise control
                      - blind spot monitor
                    type: string
                  type: array
                  nullable: true
                entertainment:
                  items:
                    enum:
                      - Premium Audio System
                      - Entertainment Package/dvd
                      - premium audio system
                      - apple carplay/android auto
                      - bluetooth
                      - auxiliary input
                      - usb ports
                      - wireless device charging
                      - wi-fi hotspot
                      - navigation system
                      - entertainment package/dvd
                      - satellite radio
                    type: string
                  type: array
                  nullable: true
                utility:
                  items:
                    enum:
                      - Towing Package
                      - Sunroof/moonroof/panoramic Roof
                      - towing package
                      - sunroof/moonroof/panoramic roof
                      - adaptive suspension
                      - 4 wheel drive
                      - 3rd row seats
                      - handicap accessible
                    type: string
                  type: array
                  nullable: true
                subscribe:
                  type: boolean
                  nullable: true
                agree:
                  type: boolean
                  nullable: true
                customer:
                  type: string
                  nullable: true
                messageNotifications:
                  type: boolean
                  nullable: true
                emailNotifications:
                  type: boolean
                  nullable: true
                emailAlerts:
                  type: boolean
                  nullable: true
                emailOffers:
                  type: boolean
                  nullable: true
                leadEvents:
                  items:
                    type: number
                  type: array
                  nullable: true
                cfZipcode:
                  type: string
                  nullable: true
                cfState:
                  type: string
                  nullable: true
                cfCity:
                  type: string
                  nullable: true
                completedDate:
                  type: string
                  nullable: true
                localTime:
                  type: string
                  nullable: true
                trade:
                  items:
                    type: number
                  type: array
                  nullable: true
                messages:
                  items:
                    type: number
                  type: array
                  nullable: true
                creditScore:
                  type: string
                  nullable: true
                contactScore:
                  type: string
                  nullable: true
                contactBelongsTo:
                  type: string
                  nullable: true
                contactType:
                  type: string
                  nullable: true
                contactValid:
                  type: boolean
                  nullable: true
                testingCustomer:
                  type: boolean
                  nullable: true
                estimatedAgeRange:
                  type: string
                  nullable: true
                estimatedAddress:
                  type: string
                  nullable: true
                estimatedZipcode:
                  type: string
                  nullable: true
                meetings:
                  items:
                    type: number
                  type: array
                  nullable: true
                makeAndModel:
                  type: string
                  nullable: true
                conversation:
                  type: string
                  nullable: true
                city:
                  type: string
                  nullable: true
                state:
                  type: string
                  nullable: true
                preApprovalId:
                  type: string
                  nullable: true
                vdpEmails:
                  items:
                    type: number
                  type: array
                  nullable: true
                favorites:
                  items:
                    type: number
                  type: array
                  nullable: true
                calls:
                  items:
                    type: number
                  type: array
                  nullable: true
                salesRep:
                  type: number
                  nullable: true
                preApprovals:
                  items:
                    type: number
                  type: array
                  nullable: true
                anonymousId:
                  type: string
                  nullable: true
                manual:
                  type: boolean
                  nullable: true
                trim:
                  type: string
                  nullable: true
                oneOwner:
                  type: boolean
                  nullable: true
                customers:
                  type: number
                  nullable: true
                updatedAt:
                  type: string
                createdAt:
                  type: string
              required:
                - id
                - updatedAt
                - createdAt
        type:
          enum:
            - Cancel
            - Customer Answered
            - Customer Call
            - Customer DNC Request
            - Customer Email
            - Customer Needs More Options
            - Customer Search Provided
            - Customer Selects Vehicle
            - Customer Text
            - Lead Created
            - Loan Service Redirect
            - Outbound Email
            - Outbound Phone Call
            - Outbound Phone Call Answered
            - Outbound Phone Call Not Answered
            - Outbound Text
            - Outbound Voicemail Left
            - Scheduled Call
            - Search Results Found
            - Status Check
            - Time Passed
          type: string
          nullable: true
        status:
          enum:
            - Provide Customer With Three Options
            - Customer Provided Options
            - Answer Text Message
            - Had Conversation
            - Intake Form Submitted
            - Send Text Message
            - Send Text Template 1
            - Waiting For Meeting
            - Call Customer
            - First Communication Attempt
            - First Communication Attempt (phone and text)
            - Searching
            - Second Communication Attempt
            - Send Text Nudge 1
            - Waiting For Email Response
            - Looking For Financing
            - Customer Not Interested
            - No Contact
            - Customer Not Responding
            - Customer Interested
          type: string
          nullable: true
        nextSteps:
          type: string
          nullable: true
        createdBy:
          type: number
        currentStatusFor:
          oneOf:
            - type: number
              nullable: true
            - additionalProperties: false
              title: Lead
              type: object
              properties:
                processStatuses:
                  enum:
                    - Qualified Lead
                    - Actively Communicating
                    - First Communication Attempt (phone and text)
                    - Second Communication Attempt
                    - On Hold
                    - Lost
                  type: string
                  nullable: true
                reason:
                  enum:
                    - Do Not Contact
                    - Duplicate
                    - Looking For Business Financing
                    - Looking For Listings
                    - Looking For Personal Financing
                    - Not Responding
                    - Test
                    - Bad Credit
                  type: string
                  nullable: true
                latestEvent:
                  type: number
                  nullable: true
                notes:
                  type: string
                  nullable: true
                statusTracker:
                  type: string
                  nullable: true
                searches:
                  items:
                    type: number
                  type: array
                  nullable: true
                attachments:
                  type: string
                  nullable: true
                firstName:
                  type: string
                  nullable: true
                lastName:
                  type: string
                  nullable: true
                phone:
                  type: string
                  nullable: true
                call:
                  type: string
                  nullable: true
                zipcode:
                  type: string
                  nullable: true
                email:
                  type: string
                  nullable: true
                loginEmail:
                  type: string
                  nullable: true
                purchaseOption:
                  type: string
                  nullable: true
                timeToPurchase:
                  items:
                    enum:
                      - ASAP
                      - This week
                      - Within 1-2 weeks
                      - Within 2-4 weeks
                      - Asap
                      - This Week
                      - Within 1-2 Weeks
                      - Within 2-4 Weeks
                      - within 1-2 weeks
                      - within 2-4 weeks
                      - within 1-2 months
                      - other
                      - this week
                      - asap
                      - 2+ months
                      - just browsing
                      - 1-2 months
                      - 1-2 weeks
                      - 2-4 weeks
                    type: string
                  type: array
                  nullable: true
                monthlyPayment:
                  type: number
                  nullable: true
                budgetLower:
                  type: string
                  nullable: true
                budgetUpper:
                  type: string
                  nullable: true
                mileageLower:
                  type: number
                  nullable: true
                mileageUpper:
                  type: number
                  nullable: true
                cashDown:
                  type: number
                  nullable: true
                newOrUsed:
                  type: string
                  nullable: true
                bodyStyle:
                  items:
                    enum:
                      - truck
                      - car
                      - van
                      - suv
                      - wagon
                    type: string
                  type: array
                  nullable: true
                carStyle:
                  items:
                    enum:
                      - sedan
                      - coupe
                      - convertible
                      - hatchback
                    type: string
                  type: array
                  nullable: true
                truckStyle:
                  items:
                    enum:
                      - crew
                      - reg
                      - extended
                    type: string
                  type: array
                  nullable: true
                suvStyle:
                  items:
                    enum:
                      - small/compact
                      - mid-size
                      - large/full-size
                    type: string
                  type: array
                  nullable: true
                vanStyle:
                  items:
                    enum:
                      - cargo
                      - passenger
                      - conversion
                    type: string
                  type: array
                  nullable: true
                yearLower:
                  type: number
                  nullable: true
                yearUpper:
                  type: number
                  nullable: true
                year:
                  type: number
                  nullable: true
                make:
                  type: string
                  nullable: true
                model:
                  type: string
                  nullable: true
                exterior:
                  items:
                    enum:
                      - Silver
                      - White
                      - Black
                      - Brown
                      - Blue
                      - Orange
                      - Red
                      - Green
                      - Any color
                      - Beige
                      - Gold
                      - Gray
                      - Light Blue
                    type: string
                  type: array
                  nullable: true
                interior:
                  items:
                    enum:
                      - Black
                      - Gray
                      - Tan
                      - Beige
                      - Blue
                      - Brown
                      - Red
                      - White
                      - Any color
                      - Ivory
                      - Cream
                    type: string
                  type: array
                  nullable: true
                fuelType:
                  items:
                    enum:
                      - Gasoline
                      - Electric
                      - Hybrid
                      - gasoline
                      - flex fuel
                      - diesel
                      - other
                      - hybrid
                      - electric
                    type: string
                  type: array
                  nullable: true
                drivetrain:
                  items:
                    enum:
                      - Four Wheel Drive
                      - Rear Wheel Drive
                      - Front Wheel Drive
                      - all wheel drive
                      - front wheel drive
                      - rear wheel drive
                    type: string
                  type: array
                  nullable: true
                transmission:
                  items:
                    enum:
                      - Automatic
                      - Manual
                      - automatic
                      - cvt
                      - manual
                    type: string
                  type: array
                  nullable: true
                comfort:
                  items:
                    enum:
                      - Leather/premium Seats
                      - Heated Steering Wheel
                      - leather/premium seats
                      - heated steering wheel
                      - ventilated or cooled seats
                      - heated seats
                      - dual-zone/climate control
                      - power-adjustable seats
                      - noise-cancelling technology
                      - massage seats
                    type: string
                  type: array
                  nullable: true
                safety:
                  items:
                    enum:
                      - Adaptive Cruise Control
                      - Blind Spot Monitor
                      - lane departure warning
                      - back up camera
                      - 360 camera
                      - park assist
                      - heads-up display
                      - adaptive cruise control
                      - blind spot monitor
                    type: string
                  type: array
                  nullable: true
                entertainment:
                  items:
                    enum:
                      - Premium Audio System
                      - Entertainment Package/dvd
                      - premium audio system
                      - apple carplay/android auto
                      - bluetooth
                      - auxiliary input
                      - usb ports
                      - wireless device charging
                      - wi-fi hotspot
                      - navigation system
                      - entertainment package/dvd
                      - satellite radio
                    type: string
                  type: array
                  nullable: true
                utility:
                  items:
                    enum:
                      - Towing Package
                      - Sunroof/moonroof/panoramic Roof
                      - towing package
                      - sunroof/moonroof/panoramic roof
                      - adaptive suspension
                      - 4 wheel drive
                      - 3rd row seats
                      - handicap accessible
                    type: string
                  type: array
                  nullable: true
                subscribe:
                  type: boolean
                  nullable: true
                agree:
                  type: boolean
                  nullable: true
                customer:
                  type: string
                  nullable: true
                messageNotifications:
                  type: boolean
                  nullable: true
                emailNotifications:
                  type: boolean
                  nullable: true
                emailAlerts:
                  type: boolean
                  nullable: true
                emailOffers:
                  type: boolean
                  nullable: true
                leadEvents:
                  items:
                    type: number
                  type: array
                  nullable: true
                cfZipcode:
                  type: string
                  nullable: true
                cfState:
                  type: string
                  nullable: true
                cfCity:
                  type: string
                  nullable: true
                completedDate:
                  type: string
                  nullable: true
                localTime:
                  type: string
                  nullable: true
                trade:
                  items:
                    type: number
                  type: array
                  nullable: true
                messages:
                  items:
                    type: number
                  type: array
                  nullable: true
                creditScore:
                  type: string
                  nullable: true
                contactScore:
                  type: string
                  nullable: true
                contactBelongsTo:
                  type: string
                  nullable: true
                contactType:
                  type: string
                  nullable: true
                contactValid:
                  type: boolean
                  nullable: true
                testingCustomer:
                  type: boolean
                  nullable: true
                estimatedAgeRange:
                  type: string
                  nullable: true
                estimatedAddress:
                  type: string
                  nullable: true
                estimatedZipcode:
                  type: string
                  nullable: true
                meetings:
                  items:
                    type: number
                  type: array
                  nullable: true
                makeAndModel:
                  type: string
                  nullable: true
                conversation:
                  type: string
                  nullable: true
                city:
                  type: string
                  nullable: true
                state:
                  type: string
                  nullable: true
                preApprovalId:
                  type: string
                  nullable: true
                vdpEmails:
                  items:
                    type: number
                  type: array
                  nullable: true
                favorites:
                  items:
                    type: number
                  type: array
                  nullable: true
                calls:
                  items:
                    type: number
                  type: array
                  nullable: true
                salesRep:
                  type: number
                  nullable: true
                preApprovals:
                  items:
                    type: number
                  type: array
                  nullable: true
                anonymousId:
                  type: string
                  nullable: true
                manual:
                  type: boolean
                  nullable: true
                trim:
                  type: string
                  nullable: true
                oneOwner:
                  type: boolean
                  nullable: true
                customers:
                  type: number
                  nullable: true
                updatedAt:
                  type: string
                createdAt:
                  type: string
              required:
                - id
                - updatedAt
                - createdAt
        updatedAt:
          type: string
        createdAt:
          type: string
      required:
        - id
        - updatedAt
        - createdAt
    leadEventsUpsertConfirmation:
      type: object
      title: Lead Event upsert confirmation
      properties:
        doc:
          additionalProperties: false
          title: LeadEvent
          type: object
          properties:
            lead:
              type: number
              nullable: true
            type:
              enum:
                - Cancel
                - Customer Answered
                - Customer Call
                - Customer DNC Request
                - Customer Email
                - Customer Needs More Options
                - Customer Search Provided
                - Customer Selects Vehicle
                - Customer Text
                - Lead Created
                - Loan Service Redirect
                - Outbound Email
                - Outbound Phone Call
                - Outbound Phone Call Answered
                - Outbound Phone Call Not Answered
                - Outbound Text
                - Outbound Voicemail Left
                - Scheduled Call
                - Search Results Found
                - Status Check
                - Time Passed
              type: string
              nullable: true
            status:
              enum:
                - Provide Customer With Three Options
                - Customer Provided Options
                - Answer Text Message
                - Had Conversation
                - Intake Form Submitted
                - Send Text Message
                - Send Text Template 1
                - Waiting For Meeting
                - Call Customer
                - First Communication Attempt
                - First Communication Attempt (phone and text)
                - Searching
                - Second Communication Attempt
                - Send Text Nudge 1
                - Waiting For Email Response
                - Looking For Financing
                - Customer Not Interested
                - No Contact
                - Customer Not Responding
                - Customer Interested
              type: string
              nullable: true
            nextSteps:
              type: string
              nullable: true
            createdBy:
              type: number
              nullable: true
            currentStatusFor:
              type: number
              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

````