> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# BulkReportEvent

# Package: triggers

# Namespace: EsbConfigResolver

# Method link: https://dev.wix.com/docs/api-reference/business-management/automations/triggers/triggered-events/bulk-report-event.md

## Permission Scopes:
Set Up Automations: SCOPE.CRM.SETUP-AUTOMATIONS

## Introduction

Reports multiple events at once, activating site automations configured with the specified trigger key.


Each event in `eventsInfo` is processed independently and asynchronously, so some events can succeed while others fail. Check `bulkActionMetadata` for the success and failure totals.

To report a single event, call [Report Event](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/triggered-events/report-event.md).

---

## REST API

### Schema

```
 Method: bulkReportEvent
 Description: Reports multiple events at once, activating site automations configured with the specified trigger key.   Each event in `eventsInfo` is processed independently and asynchronously, so some events can succeed while others fail. Check `bulkActionMetadata` for the success and failure totals.  To report a single event, call [Report Event](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/triggered-events/report-event.md).
 URL: https://www.wixapis.com/automations/v1/events/bulk-report
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  triggerKey, eventsInfo
 Method parameters: 
   param name: eventsInfo | type: array<eventsInfo> | description: Repeated list of event details for bulk reporting. | required: true | validation: minItems 1, maxItems 100
              - name: payload | type: object | description: Event payload, formatted as key:value pairs. Must comply with the payload schema if you provided one when configuring your trigger.  
              - name: externalEntityId | type: string | description: GUID of the related resource in GUGUID format.  | validation: format GUID
              - name: idempotency | type: Idempotency | description: Idempotency information for the event.  
                 - name: key | type: string | description: A unique identifier for the event. If you send the same idempotency key in multiple report event requests, for the same trigger key and app id, consecutive requests will be ignored after the first one. Note that the idempotency key is kept for a week before it expires.  | validation: minLength 1, maxLength 80
                 - name: ttlInMilliseconds | type: string | description: Optional. The time to live (TTL) in milliseconds before the key will expire. Default is a week.  | validation: minimum 1, format int64
   param name: triggerKey | type: triggerKey | description: Trigger key as defined in your app's trigger configuration in the app dashboard. For example, `form_submitted` or `invoice_due`. | required: true | validation: minLength 1, maxLength 100
 Return type: BulkReportEventResponse
  - name: triggerKey | type: string | description: Trigger key associated with the event.  | validation: minLength 1, maxLength 100
  - name: results | type: array<BulkReportEventResult> | description: List of results for each item in the bulk report event request.  
     - name: itemMetadata | type: ItemMetadata | description: Metadata for the individual item in the request.  
        - name: id | type: string | description: Item GUID. Should always be available, unless it's impossible (for example, when failing to create an item).  
        - name: originalIndex | type: integer | description: Index of the item within the request array. Allows for correlation between request and response items.  
        - name: success | type: boolean | description: Whether the requested action was successful for this item. When `false`, the `error` field is populated.  
        - name: error | type: ApplicationError | description: Details about the error in case of failure.  
           - name: code | type: string | description: Error code.  
           - name: description | type: string | description: Description of the error.  
           - name: data | type: object | description: Data related to the error.  
     - name: eventInfo | type: EventInfo | description: Event details for the item in the request.  
        - name: payload | type: object | description: Event payload, formatted as key:value pairs. Must comply with the payload schema if you provided one when configuring your trigger.  
        - name: externalEntityId | type: string | description: GUID of the related resource in GUGUID format.  | validation: format GUID
        - name: idempotency | type: Idempotency | description: Idempotency information for the event.  
           - name: key | type: string | description: A unique identifier for the event. If you send the same idempotency key in multiple report event requests, for the same trigger key and app id, consecutive requests will be ignored after the first one. Note that the idempotency key is kept for a week before it expires.  | validation: minLength 1, maxLength 80
           - name: ttlInMilliseconds | type: string | description: Optional. The time to live (TTL) in milliseconds before the key will expire. Default is a week.  | validation: minimum 1, format int64
  - name: bulkActionMetadata | type: BulkActionMetadata | description: Metadata for the overall bulk action, including success and failure counts.  
     - name: totalSuccesses | type: integer | description: Number of items that were successfully processed.  
     - name: totalFailures | type: integer | description: Number of items that couldn't be processed.  
     - name: undetailedFailures | type: integer | description: Number of failures without details because detailed failure threshold was exceeded.  


```

### Examples

### BulkReportEvent
```curl
~~~cURL
curl -X POST https://www.wixapis.com/automations/v1/events/bulk-report  \
  -H 'Content-Type: application/json;charset=UTF-8' \
  -H 'Authorization: <AUTH>' \
  -d '{
    "triggerKey": "appointment_scheduled",
    "eventsInfo": [
      {
        "payload": {
          "customerName": "John Doe"
        },
        "externalEntityId": "16ef8c9c-413e-4d5f-b77d-8c67c3c8ae0c"
      },
      {
        "payload": {
          "customerName": "Jane Smith"
        },
        "externalEntityId": "2c0a8f4b-9d6e-4a1f-bc23-7e5d1a2b3c4d"
      }
    ]
  }'
~~~
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.automations.activations.bulkReportEvent(triggerKey, eventsInfo)
 Description: Reports multiple events at once, activating site automations configured with the specified trigger key.   Each event in `eventsInfo` is processed independently and asynchronously, so some events can succeed while others fail. Check `bulkActionMetadata` for the success and failure totals.  To report a single event, call [Report Event](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/triggered-events/report-event.md).
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  triggerKey, eventsInfo
 Method parameters: 
   param name: triggerKey | type: string | description: Trigger key as defined in your app's trigger configuration in the app dashboard. For example, `form_submitted` or `invoice_due`. | required: true | validation: minLength 1, maxLength 100
   param name: eventsInfo | type: array<EventInfo> | description: Repeated list of event details for bulk reporting. | required: true | validation: minItems 1, maxItems 100
              - name: payload | type: object | description: Event payload, formatted as key:value pairs. Must comply with the payload schema if you provided one when configuring your trigger.  
              - name: externalEntityId | type: string | description: GUID of the related resource in GUGUID format.  | validation: format GUID
              - name: idempotency | type: Idempotency | description: Idempotency information for the event.  
                 - name: key | type: string | description: A unique identifier for the event. If you send the same idempotency key in multiple report event requests, for the same trigger key and app id, consecutive requests will be ignored after the first one. Note that the idempotency key is kept for a week before it expires.  | validation: minLength 1, maxLength 80
                 - name: ttlInMilliseconds | type: string | description: Optional. The time to live (TTL) in milliseconds before the key will expire. Default is a week.  | validation: minimum 1, format int64
 Return type: PROMISE<BulkReportEventResponse>
  - name: triggerKey | type: string | description: Trigger key associated with the event.  | validation: minLength 1, maxLength 100
  - name: results | type: array<BulkReportEventResult> | description: List of results for each item in the bulk report event request.  
     - name: itemMetadata | type: ItemMetadata | description: Metadata for the individual item in the request.  
        - name: _id | type: string | description: Item GUID. Should always be available, unless it's impossible (for example, when failing to create an item).  
        - name: originalIndex | type: integer | description: Index of the item within the request array. Allows for correlation between request and response items.  
        - name: success | type: boolean | description: Whether the requested action was successful for this item. When `false`, the `error` field is populated.  
        - name: error | type: ApplicationError | description: Details about the error in case of failure.  
           - name: code | type: string | description: Error code.  
           - name: description | type: string | description: Description of the error.  
           - name: data | type: object | description: Data related to the error.  
     - name: eventInfo | type: EventInfo | description: Event details for the item in the request.  
        - name: payload | type: object | description: Event payload, formatted as key:value pairs. Must comply with the payload schema if you provided one when configuring your trigger.  
        - name: externalEntityId | type: string | description: GUID of the related resource in GUGUID format.  | validation: format GUID
        - name: idempotency | type: Idempotency | description: Idempotency information for the event.  
           - name: key | type: string | description: A unique identifier for the event. If you send the same idempotency key in multiple report event requests, for the same trigger key and app id, consecutive requests will be ignored after the first one. Note that the idempotency key is kept for a week before it expires.  | validation: minLength 1, maxLength 80
           - name: ttlInMilliseconds | type: string | description: Optional. The time to live (TTL) in milliseconds before the key will expire. Default is a week.  | validation: minimum 1, format int64
  - name: bulkActionMetadata | type: BulkActionMetadata | description: Metadata for the overall bulk action, including success and failure counts.  
     - name: totalSuccesses | type: integer | description: Number of items that were successfully processed.  
     - name: totalFailures | type: integer | description: Number of items that couldn't be processed.  
     - name: undetailedFailures | type: integer | description: Number of failures without details because detailed failure threshold was exceeded.  


```

### Examples

### bulkReportEvent
```javascript
import { activations } from '@wix/automations';

async function bulkReportEvent(triggerKey,eventsInfo) {
  const response = await activations.bulkReportEvent(triggerKey,eventsInfo);
};
```

### bulkReportEvent (with elevated permissions)
```javascript
import { activations } from '@wix/automations';
import { auth } from '@wix/essentials';

async function myBulkReportEventMethod(triggerKey,eventsInfo) {
  const elevatedBulkReportEvent = auth.elevate(activations.bulkReportEvent);
  const response = await elevatedBulkReportEvent(triggerKey,eventsInfo);
}
```

### bulkReportEvent (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { activations } from '@wix/automations';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { activations },
  // Include the auth strategy and host as relevant
});


async function bulkReportEvent(triggerKey,eventsInfo) {
  const response = await myWixClient.activations.bulkReportEvent(triggerKey,eventsInfo);
};
```

---