# Create or update multiple events.

Endpoint: PUT /events
Version: v3
Security: oauth2

## Request fields (application/json):

  - `id` (string)
    Gets the event id which acts as the primary key in the database.

  - `name` (null | string, required)
    Gets or sets the event name.

  - `description` (null | string)
    Gets or sets the event description.

  - `startTime` (string, required)
    Gets or sets the event start time.

  - `endTime` (null | string)
    Gets or sets the event end time.

  - `eventTypeId` (integer, required)
    Gets the event type id which is defined by Willow, e.g. CalendarEvent, WeatherForecast, UtilityBill, ….

  - `type` (integer)
    Gets the strongly-typed event type, or `null` when int Event.EventTypeId does not
correspond to a known EventType.

  - `subTypeId` (null | integer)
    Gets or sets the event sub type id, which further qualifies the int Event.EventTypeId.

  - `category` (null | integer)
    Gets or sets the event category — the id of a user-defined EventCategory. Independent of
the event type and sub type — any event may carry any category. Null or 0 means "no category". On update,
null preserves the existing category and 0 explicitly clears it, so clients that don't yet send the field
can't clear data they don't know about.

  - `eventSourceId` (null | string)
    Gets the name of the source system, which is for informational purposes.

  - `externalId` (null | string)
    Gets an Id linking it to the source system, facilitating updates and deletes.

  - `payload` (null | string, required)
    Gets or sets a JSON string containing type-specific values.

  - `payloadVersion` (null | string, required)
    Gets or sets a version for the payload to assist in the deserialization of the payload.

  - `scalarValue` (null | number)
    Gets or sets a double value that may be stored to complement the Payload value.

  - `twinId` (null | string, required)
    Gets the id of the twin that is a reference to to an existing space, or equipment twin.

  - `locations` (null | string)
    Gets or sets a JSON string with the expanded location ancestors for the twinId.

  - `createdDate` (string, required)
    Gets or sets the date the event was created in the system.

  - `lastModifiedDate` (string, required)
    Gets or sets the date the event was last modified in the system.

## Response 200 fields (text/plain):

  - `eventsCreatedCount` (integer)
    Gets or sets the number of created events.

  - `eventsUpdatedCount` (integer)
    Gets or sets the number of updated events.

