> 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

## Resource: Introduction

## Article: Introduction

## Article Link: https://dev.wix.com/docs/api-reference/business-management/automations/triggers/triggered-events/introduction.md

## Article Content:

# About the Triggered Events API

> **Note:** You must have an app in the [Custom Apps Page](https://manage.wix.com/studio/custom-apps) to use this API. If you're using [Wix Headless](https://dev.wix.com/docs/go-headless/get-started/about-wix-headless.md) or developing a site, this API isn't applicable.

The Triggered Events API allows you to turn events in your service into [triggers](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/automations/triggers/about-triggers.md). Using this API, you can report events to Wix. A reported event becomes a trigger that site owners can use when they create their site [automations](https://dev.wix.com/docs/rest/business-management/automations/introduction.md).

With the Triggered Events API, you can:

- [Report events](https://dev.wix.com/docs/rest/business-management/automations/triggers/triggered-events/report-event.md) to trigger site automations.
- [Bulk report](https://dev.wix.com/docs/rest/business-management/automations/triggers/triggered-events/bulk-report-event.md) multiple events simultaneously to activate corresponding automations.
- [Cancel](https://dev.wix.com/docs/rest/business-management/automations/triggers/triggered-events/cancel-event.md) and [bulk cancel](https://dev.wix.com/docs/rest/business-management/automations/triggers/triggered-events/bulk-cancel-event.md) events to stop any remaining actions associated with a trigger and external entities.
- [Run an automation](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/triggered-events/run-automation.md) directly, without reporting an event.
- [Test an automation](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/triggered-events/test-automation.md), including an unpublished draft, before publishing it.
- [Rerun a previous activation](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/triggered-events/rerun-activation.md) to retry one that failed.

When you report an event, Wix accepts it and processes it asynchronously. A successful response means the event was accepted for processing, not that the automations have finished running.

## Run automations directly

In addition to reporting events, you can run automations directly:

- [**Run an automation**](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/triggered-events/run-automation.md): Activate an automation manually when no triggering event occurs in your system. For example, run an automation that sends a booking confirmation when a customer books by phone instead of online. Identify the automation by its ID, which you can retrieve from the [Automations API](https://dev.wix.com/docs/rest/business-management/automations/introduction.md), or, for a preinstalled automation, by its app ID and component ID.
- [**Test an automation**](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/triggered-events/test-automation.md): Run an automation in test mode to verify its behavior before publishing. Test mode runs the automation and its actions for real, can run an unpublished draft automation, and skips any configured delays so you see the results immediately.
- [**Rerun an activation**](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/triggered-events/rerun-activation.md): Retry a previous activation, reusing its original payload, after you've resolved whatever caused it to fail. A rerun creates a new activation.

## Before you begin

It's important to note the following points before starting to code:

- You must [add a trigger](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/automations/triggers/add-an-automations-trigger-extension.md) to your app and define its payload schema in the app dashboard before you report an event.
- Only the app that the trigger belongs to can report the event.
- Make sure you know your trigger key. You can find this by selecting your trigger in the [app dashboard](https://dev.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fautomations-dev-center).

## Use cases

- [Report an event and cancel it when it's no longer relevant](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/triggered-events/sample-flows.md#report-an-event-and-cancel-it-when-its-no-longer-relevant)
- [Bulk report events and later bulk cancel them](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/triggered-events/sample-flows.md#bulk-report-events-and-later-bulk-cancel-them)
- [Run an automation when no triggering event occurs](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/triggered-events/sample-flows.md#run-an-automation-when-no-triggering-event-occurs)
- [Retry a failed activation](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/triggered-events/sample-flows.md#retry-a-failed-activation)

## Terminology

- **Trigger Key**: A unique string that identifies the trigger.
- **External Entity ID**: A GUID that identifies the related resource for an event, such as a contact or session ID. This allows you to identify the specific case for which the event was reported. See [Reporting and Canceling Events](https://dev.wix.com/docs/rest/business-management/automations/triggers/triggered-events/reporting-and-canceling-events.md) for more information.
- **Idempotency**: A mechanism to ensure that multiple identical requests don't cause unnecessary automation activation. You pass in a unique idempotency key for the event when you report it. If an event with the same idempotency key is reported multiple times, Wix ignores it for the duration of time that you define.


