---
title: "Create a scheduled event"
method: POST
path: "/events/scheduled-events"
tags: ["Custom Scheduled Events"]
---

# Create a scheduled event

`POST /events/scheduled-events`

To create a custom scheduled event, you must specify the base object, the base field and the scheduled time.

## Headers

- `Idempotency-Key` string
- `Accept-Encoding` string
- `Content-Encoding` string
- `Zuora-Entity-Ids` string
- `Zuora-Org-Ids` string
- `Zuora-Track-Id` string

## Request body

- PostScheduledEventRequest — namespace.name pair should be unique universally
  - `active` boolean — Indicate whether the scheduled event is active or inactive.
  - `apiField` string, required — The base field of the base object in the `apiObject` field, should be in date or timestamp format. The scheduled event notifications are triggered based on this date and the event parameters (before or after a specified number of days) from notification definitions. Should be specified in the pattern: ^[A-Z][\\w\\-]*$ See [Custom Scheduled Events](https://docs.zuora.com?resourceId=platform-custom-scheduled-event-overview) for all available base fields.
  - `apiObject` string, required — The base object that the scheduled event is defined upon. The base object should contain a date or timestamp format field. Should be specified in the pattern: ^[A-Z][\\w\\-]*$ See [Custom Scheduled Events](https://docs.zuora.com?resourceId=platform-custom-scheduled-event-overview) for all available base objects.
  - `condition` string — The filter rule conditions, written in [JEXL](http://commons.apache.org/proper/commons-jexl/). The scheduled event is triggered only if the condition is evaluated as true. The rule might contain event context merge fields and data source merge fields. Data source merge fields must be from [the base object of the event or from the joined objects of the base object](https://docs.zuora.com?resourceId=platform-data-source-reference). Scheduled events with invalid merge fields will fail to evaluate, thus will not be triggered. For example, to trigger an invoice due date scheduled event to only invoices with an amount over 1000, you would define the following condition: ```Invoice.Amount > 1000.0``` `Invoice.Amount` refers to the `Amount` field of the Zuora object `Invoice`.
  - `description` string — The description of the scheduled event.
  - `displayName` string, required — The display name of the scheduled event.
  - `hours` integer, required — The scheduled time (hour) that the scheduled event notifications are sent. This time is based on the localized timezone of your tenant.
  - `minutes` integer, required — The scheduled time (minute) that the scheduled event notifications are sent. This time is based on the localized timezone of your tenant.
  - `name` string, required — The name of the scheduled event. Should be unique, contain no space, and be in the pattern: ^[A-Za-z]{1,}[\\w\\-]*$
  - `parameters` object — The parameter definitions of the filter rule. The names of the parameters must match with the filter rule and can't be duplicated. You should specify all the parameters when creating scheduled event notifications.

## Response `200`

OK

- GetScheduledEventResponse
  - `active` boolean — Indicate whether the scheduled event is active or inactive
  - `apiField` string — The base field of the base object in the `apiObject` field, should be in date or timestamp format. The scheduled event notifications are triggered based on this date and the event parameters (before or after a specified number of days) from notification definitions. Should be specified in the pattern: ^[A-Z][\\w\\-]*$
  - `apiObject` string — The base object that the scheduled event is defined upon. The base object should contain a date or timestamp format field. Should be specified in the pattern: ^[A-Z][\\w\\-]*$
  - `condition` string — The filter rule conditions, written in [JEXL](http://commons.apache.org/proper/commons-jexl/). The scheduled event is triggered only if the condition is evaluated as true. The rule might contain event context merge fields and data source merge fields. Data source merge fields must be from [the base object of the event or from the joined objects of the base object](https://docs.zuora.com?resourceId=platform-data-source-reference). Scheduled events with invalid merge fields will fail to evaluate, thus will not be triggered. For example, to trigger an invoice due date scheduled event to only invoices with an amount over 1000, you would define the following condition: ```Invoice.Amount > 1000.0``` `Invoice.Amount` refers to the `Amount` field of the Zuora object `Invoice`.
  - `cronExpression` string — The cron expression defines the time when scheduled event notifications will be sent.
  - `description` string — The description of the scheduled event.
  - `displayName` string — The display name of the scheduled event.
  - `id` string, uuid — Scheduled event ID.
  - `name` string — The name of the scheduled event.
  - `namespace` string — The namespace of the scheduled event name in the `name` field.
  - `parameters` object — The parameter definitions of the filter rule. The names of the parameters must match with the filter rule and can't be duplicated. You should specify all the parameters when creating scheduled event notifications.

## Other responses

- `400` — Bad Request
- `500` — Server Error

---

[API](https://skmtc.dev/zuora/apis/api-reference.md) · [All operations](https://skmtc.dev/zuora/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/zuora/api-reference/revisions/d11e237f3e54/schema)
