> For the complete documentation index, see [llms.txt](https://help.openloyalty.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.openloyalty.io/main-features/custom-events/custom-event-schemas.md).

# Custom Event Schemas

## Custom Event Schemas

Custom event schemas define events for [event-based campaigns](/main-features/campaigns/campaigns-and-referral-campaigns/creating-campaigns/trigger-types/custom-event.md). Each schema provides an event name and optional attributes for campaign conditions.

### Add a custom event schema

Follow these steps to create an event schema:

{% stepper %}
{% step %}
**Open Custom Event Schemas**

In the **Members** menu, select **Custom Events**. Then select **Custom Event Schemas**.
{% endstep %}

{% step %}
**Start a new schema**

Click **Add Event Schema**.

<figure><img src="/files/IxrmiTUKPZsTxn2L472A" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Complete the basic settings**

Enter an **Event system identifier** and an **Event name**.

Use the system identifier when sending the event. For example, for `bike_ride`, send `"type": "bike_ride"` in the request body.

The event name appears in the **Event name** list when creating an event-based campaign.
{% endstep %}

{% step %}
**Add attributes, if needed**

Attributes let you build campaign conditions and reward members. They are available in the campaign **Conditions type** list.

Select one of these attribute types:

* **Boolean** — `true` or `false`
* **Datetime** — for example, `2024-03-08T02:02:08+01:00`
* **Number** or **Text**

<figure><img src="/files/BacLlICUjfmuLkSjucWT" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Activate and create the schema**

Set the schema status to **Active**. Then click **Add Event Schema**.
{% endstep %}
{% endstepper %}

### Filter custom event schemas

Use **Add Filter** to narrow the schema list. You can filter by:

* **Active**
* **Create date**
* **Event name**
* **Event system identifier**

<img src="/files/fdRC8yONxgZ4UA67TqXn" alt="" width="375">

Choose a property, condition, and value. Then click **Add filter**. Only matching schemas appear.

Use the search field above the table to find a schema by name. Use the table control below the list to change rows per page.

<figure><img src="/files/xUtWxEluZ5MpTNIj4kVv" alt=""><figcaption></figcaption></figure>

### Edit a custom event schema

{% stepper %}
{% step %}
**Select the schema**

Find the event schema in the list.
{% endstep %}

{% step %}
**Open the editor**

Open the context menu and select **Edit**.
{% endstep %}

{% step %}
**Save your changes**

Make the required updates, then click **Save**.

<figure><img src="/files/ADCxgmLHa7WbbjyWuoBE" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.openloyalty.io/main-features/custom-events/custom-event-schemas.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
