---
title: "Create a batch of events used to record user actions"
method: POST
path: "/events/batch"
tags: ["Events"]
---

# Create a batch of events used to record user actions

`POST /events/batch`

## Request

- Base URL: `https://partners.disconetwork.com`
- URL: `https://partners.disconetwork.com/events/batch`
- Auth: none declared. Required headers: `version`
- TypeScript: <https://skmtc.dev/disconetwork/apis/external-api-for-disco-integration-partners/docs/events/batch/post.ts> (a function with typed inputs; its response is checked against the schema)

Submit between 1 and 20 events in a single request. Each event is processed independently and the response reports the per-event result so the caller can retry only the events that failed.

The `event_name` values, what triggers each one and how often to send it are listed on [Create an event used to record user actions](/developers/api-reference/platform-api/create-an-event-used-to-record-user-actions).

## Headers

- `version` string, required

## Request body

- BatchEventRequest: Request body for hitting the /events/batch endpoint
  - `events` EventRequest[], required: The events to record. At least 1 and at most 20 events may be submitted in a single request.
    - union: Request body for hitting the /event endpoint
      - WidgetEventRequest: The properties shared on all events
        - `event_name` 'WIDGET_LOAD' | 'WIDGET_DISPLAY' | 'WIDGET_VIEW' | 'BRAND_DISPLAY' | 'BRAND_VIEW' | 'BRAND_CLICK' | 'PRODUCT_DISPLAY' | 'PRODUCT_VIEW' | 'PRODUCT_CLICK' | 'ELEMENT_CLICK', required: The name of the event you are sending to Disco. Casing must be all caps
        - `event_datetime` string, date-time, required: The [RFC-3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) datetime at which the event occurred on the shopper's device
        - `session_id` string, uuid, required: An identifier provided on the response of the recommendations endpoint to identify the session associated with the event
      - ElementClickRequest: The properties shared on all events
        - `event_name` 'WIDGET_LOAD' | 'WIDGET_DISPLAY' | 'WIDGET_VIEW' | 'BRAND_DISPLAY' | 'BRAND_VIEW' | 'BRAND_CLICK' | 'PRODUCT_DISPLAY' | 'PRODUCT_VIEW' | 'PRODUCT_CLICK' | 'ELEMENT_CLICK', required: The name of the event you are sending to Disco. Casing must be all caps
        - `event_datetime` string, date-time, required: The [RFC-3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) datetime at which the event occurred on the shopper's device
        - `session_id` string, uuid, required: An identifier provided on the response of the recommendations endpoint to identify the session associated with the event
        - `initiating_target` 'INLINE_NAV_FORWARD' | 'INLINE_NAV_BACKWARD' | 'INLINE_FOOTER_DISCO' | 'INLINE_FOOTER_PRIVACY', required: Indicates the UI element that triggered this event
        - `brand_properties` BrandEventProperties
          - `offer_id` string, uuid, required: Unique identifier of the offer this event is being sent for
          - `advertiser_id` string, uuid, required: Unique identifier of the advertiser this event is being sent for
          - `insertion_id` string, required: Unique identifier associated with this advertiser provided from the recommendations endpoint
      - BrandDisplayRequest: The properties shared on all events
        - `event_name` 'WIDGET_LOAD' | 'WIDGET_DISPLAY' | 'WIDGET_VIEW' | 'BRAND_DISPLAY' | 'BRAND_VIEW' | 'BRAND_CLICK' | 'PRODUCT_DISPLAY' | 'PRODUCT_VIEW' | 'PRODUCT_CLICK' | 'ELEMENT_CLICK', required: The name of the event you are sending to Disco. Casing must be all caps
        - `event_datetime` string, date-time, required: The [RFC-3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) datetime at which the event occurred on the shopper's device
        - `session_id` string, uuid, required: An identifier provided on the response of the recommendations endpoint to identify the session associated with the event
        - `initiating_target` 'INLINE_SLOT', required: Indicates the UI element that triggered this event
        - `brand_properties` BrandEventProperties, required
          - `offer_id` string, uuid, required: Unique identifier of the offer this event is being sent for
          - `advertiser_id` string, uuid, required: Unique identifier of the advertiser this event is being sent for
          - `insertion_id` string, required: Unique identifier associated with this advertiser provided from the recommendations endpoint
      - BrandClickRequest: The properties shared on all events
        - `event_name` 'WIDGET_LOAD' | 'WIDGET_DISPLAY' | 'WIDGET_VIEW' | 'BRAND_DISPLAY' | 'BRAND_VIEW' | 'BRAND_CLICK' | 'PRODUCT_DISPLAY' | 'PRODUCT_VIEW' | 'PRODUCT_CLICK' | 'ELEMENT_CLICK', required: The name of the event you are sending to Disco. Casing must be all caps
        - `event_datetime` string, date-time, required: The [RFC-3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) datetime at which the event occurred on the shopper's device
        - `session_id` string, uuid, required: An identifier provided on the response of the recommendations endpoint to identify the session associated with the event
        - `initiating_target` 'INLINE_ACTION_BUTTON' | 'INLINE_ASSET_TILE', required: Indicates the UI element that triggered this event
        - `asset_id` string: The id of the asset clicked, if an asset click triggered this event
        - `brand_properties` BrandEventProperties, required
          - `offer_id` string, uuid, required: Unique identifier of the offer this event is being sent for
          - `advertiser_id` string, uuid, required: Unique identifier of the advertiser this event is being sent for
          - `insertion_id` string, required: Unique identifier associated with this advertiser provided from the recommendations endpoint

## Response `202`

Every event in the batch was accepted for processing.

- BatchEventResponse: The result of processing a batch of events
  - `results` BatchEventResult[], required: The per-event results, ordered to match the submitted `events` array
    - `index` integer, required: The position of the event in the submitted `events` array
    - `success` boolean, required: Whether the event at this index was accepted for processing
  - `accepted` integer, required: The number of events that were accepted for processing
  - `failed` integer, required: The number of events that failed to be accepted for processing

## Other responses

- `207`: Some events were accepted and others failed. Inspect `results` to determine which events to retry.
- `400`: The server could not understand the request due to invalid syntax. The client should modify the request and try again.
- `401`: Authentication is required to access the requested resource. The client must include the appropriate credentials.
- `403`: The server understood the request, but refuses to authorize it. Ensure the client has appropriate permissions.
- `500`: The server encountered an unexpected condition that prevented it from fulfilling the request. Report the issue to the support team if it persists.
- `502`: Every event in the batch failed to be accepted for processing. The caller should retry the whole batch.

---

[API](https://skmtc.dev/disconetwork/apis/external-api-for-disco-integration-partners.md) - [All operations](https://skmtc.dev/disconetwork/apis/external-api-for-disco-integration-partners/llms.txt) - [OpenAPI document](https://skmtc.dev/disconetwork/apis/external-api-for-disco-integration-partners/revisions/6daa87b07a73?raw)
