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

# Create event

> Creates a new event.



## OpenAPI

````yaml https://api.notifense.com/openapi/v1.json post /v1/accounts/{accountId}/assets/{assetId}/events
openapi: 3.1.1
info:
  title: Notifense
  version: v1
servers:
  - url: https://api.notifense.com
security:
  - oauth2: []
tags:
  - name: accounts
  - name: assets
  - name: alertRules
  - name: events
  - name: telemetry
  - name: geofences
  - name: auth
paths:
  /v1/accounts/{accountId}/assets/{assetId}/events:
    post:
      tags:
        - events
      summary: Create event
      description: Creates a new event.
      parameters:
        - name: accountId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: assetId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateEventRequest'
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IdResponse'
        '202':
          description: Accepted
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CreateEventRequest:
      required:
        - type
        - startedAt
      type: object
      properties:
        type:
          $ref: '#/components/schemas/EventType'
        startedAt:
          type: string
          format: date-time
        telemetry:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/Telemetry'
        location:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/Location'
        recipient:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/Recipient'
              description: The recipient to notify. Used to bypass the alert rule engine.
        channel:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/AlertRuleChannel'
              description: >-
                The channel to notify the recipient through. Used to bypass the
                alert rule engine.
    IdResponse:
      required:
        - id
      type: object
      properties:
        id:
          type: string
          format: uuid
    Error:
      required:
        - code
        - message
      type: object
      properties:
        code:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - integer
            - string
          format: int32
        message:
          type: string
    EventType:
      enum:
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
        - 7
        - 8
        - 9
        - 10
        - 11
        - 12
        - 13
        - 14
        - 15
        - 16
        - 17
        - 18
        - 19
        - 20
        - 21
        - 22
        - 23
        - 24
        - 25
        - 26
      type: integer
      x-enumDescriptions:
        - Any
        - InputPowerDisconnected
        - InputVoltageLow
        - BatteryLow
        - Jammed
        - MovementStarted
        - MovementStopped
        - IgnitionTurnedOn
        - IgnitionTurnedOff
        - GeofenceEntered
        - GeofenceExited
        - SpeedLimitExceeded
        - AssetLeftBehind
        - FuelLevelLow
        - AdBlueLevelLow
        - AlarmTriggered
        - LockdownViolated
        - Tampering
        - CountryBorderCrossed
        - TemperatureHigh
        - TemperatureLow
        - PressureHigh
        - PressureLow
        - HardCornering
        - EngineIdling
        - EngineSpeedLimitExceeded
    Telemetry:
      type: object
      properties:
        longitude:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - 'null'
            - number
            - string
          format: double
        latitude:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - 'null'
            - number
            - string
          format: double
        altitude:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          description: 'Unit: m'
          format: int32
        speed:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          description: 'Unit: km/h'
          format: uint32
        heading:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          description: 'Unit: degrees 0-360'
          format: uint32
        isIgnitionOn:
          type:
            - 'null'
            - boolean
        isMoving:
          type:
            - 'null'
            - boolean
        isLockdownEnabled:
          type:
            - 'null'
            - boolean
        isAlarmTriggered:
          type:
            - 'null'
            - boolean
        isDriverAuthenticated:
          type:
            - 'null'
            - boolean
        driverIds:
          type:
            - 'null'
            - array
          items:
            type: string
        inputVoltage:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - 'null'
            - number
            - string
          description: 'Unit: V'
          format: double
        batteryVoltage:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - 'null'
            - number
            - string
          description: 'Unit: V'
          format: double
        batteryLevel:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - 'null'
            - number
            - string
          description: 'Unit: percentage 0.0-1.0'
          format: double
        fuelLevel:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - 'null'
            - number
            - string
          description: 'Unit: percentage 0.0-1.0'
          format: double
        adBlueLevel:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - 'null'
            - number
            - string
          description: 'Unit: percentage 0.0-1.0'
          format: double
        temperature:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - 'null'
            - number
            - string
          description: 'Unit: °C'
          format: double
        pressure:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - 'null'
            - number
            - string
          description: 'Unit: kPa'
          format: double
        engineSpeed:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          description: 'Unit: rpm'
          format: uint32
    Location:
      type: object
      properties:
        address:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/Address'
        name:
          type:
            - 'null'
            - string
          description: >-
            The well-known name of the location, or the name of a geofence that
            was entered or exited.
    Recipient:
      required:
        - culture
        - timeZone
        - phoneNumber
      type: object
      properties:
        culture:
          $ref: '#/components/schemas/CultureInfo'
        timeZone:
          $ref: '#/components/schemas/TimeZoneInfo'
        phoneNumber:
          type: string
          description: >-
            The phone number of the recipient in E.164 format (e.g.
            +1234567890).
        description:
          type:
            - 'null'
            - string
    AlertRuleChannel:
      required:
        - type
      type: object
      properties:
        type:
          $ref: '#/components/schemas/ChannelType'
        call:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/CallChannelOptions'
        sms:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/SmsChannelOptions'
        telegram:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/TelegramChannelOptions'
        email:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/EmailChannelOptions'
    Address:
      required:
        - country
        - region
        - place
        - postalCode
        - subdivision
        - streetName
        - streetNumber
      type: object
      properties:
        country:
          type: string
        region:
          type:
            - 'null'
            - string
        place:
          type:
            - 'null'
            - string
        postalCode:
          type:
            - 'null'
            - string
        subdivision:
          type:
            - 'null'
            - string
        streetName:
          type:
            - 'null'
            - string
        streetNumber:
          type:
            - 'null'
            - string
    CultureInfo: {}
    TimeZoneInfo: {}
    ChannelType:
      enum:
        - 1
        - 2
        - 3
        - 4
      type: integer
      x-enumDescriptions:
        - Call
        - Sms
        - Telegram
        - Email
    CallChannelOptions:
      type: object
    SmsChannelOptions:
      type: object
      properties:
        isInteractive:
          type: boolean
          description: >-
            If true, allows the user to resolve the event using a link inside
            the SMS message.
    TelegramChannelOptions:
      required:
        - chatId
        - isInteractive
      type: object
      properties:
        chatId:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - integer
            - string
          description: >-
            The Telegram chat ID between the Notifense Telegram bot and the
            user.
          format: int64
        isInteractive:
          type: boolean
          description: >-
            If true, allows the user to resolve the event using buttons in the
            Telegram message.
    EmailChannelOptions:
      required:
        - emailAddress
      type: object
      properties:
        emailAddress:
          type: string
        isInteractive:
          type: boolean
          description: >-
            If true, allows the user to resolve the event using a link inside
            the email.
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://api.notifense.com/v1/auth/token
          scopes: {}

````