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

# api.triggerEvent()

> Public low-code contract, signatures and examples for api.triggerEvent.

## `api.triggerEvent()`

Schedules a custom event.
Matches active definitions by `custom: true` and the uppercase event type.
No implicit CUSTOM\_ prefix is added. Native events can only be replayed from history.
The message can use up to 10 MiB of serialized UTF-8 JSON.
For data over 1 MiB, prefer a finalized file in a restricted Explorer folder.
Pass its `storageEntryId` and filter fields in `message`. Give the Job execution
account read access and retain the file through the scheduled run and retries.
Returns an event ID after the event and its delivery intent are committed.
Queue delivery and target execution continue asynchronously.

Notes:

* Use the options object's `scheduleFor`; legacy delay properties are ignored.
* New code should use `scheduleFor` with a Date, ISO 8601 date-time, or Unix timestamp in milliseconds.
* The absolute time cannot be in the past or more than 30 days ahead.
* Unavailable with `readOnly: true` (throws an error).

### Signature

```ts theme={null}
static triggerEvent(
      name: string,
      message: any,
      options?: TriggerEventOptions,
    ): Promise<string>;
```

### Example

```ts theme={null}
const eventId = await api.triggerEvent(
  'customer_sync',
  { customerId: 'c-1' },
  {
    scheduleFor: new Date(Date.now() + 5 * 60 * 1000).toISOString(),
    metadata: { correlationId: 'sync-123' },
  },
);
```

See [all api methods](https://docs.revoengine.com/low-code/reference/api.md) or [runtime basics](https://docs.revoengine.com/low-code/overview.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.