# Custom Event Schemas

## Custom Event Schemas

In this section, you can build your customized Event schemas which can be used later to set [Event-based Campaigns](https://help.openloyalty.io/main-features/custom-events/broken-reference) - the one which you will pick during creation, in the 'Event name' one of the created custom Event schema, and which are triggered by custom Events - based on custom Event schemas.

To access **Custom Event schemas** go to the **Custom Events** under the **Members** panel. Here you will see all the events presented in the table.&#x20;

***

## Adding custom event schema

{% hint style="success" %}
**To add Event Schema:**

1. Go to **Members** > **Custom Events** > **CUSTOM EVENT SCHEMAS**
2. Click **ADD EVENT SCHEMA**
3. Fill in **Basic settings** and **Attributes (optional)**
4. Set status to **Active**
5. Click **ADD EVENT SCHEMA**
   {% endhint %}

{% hint style="info" %}
*Added custom Event schema will be present during creating **Event based Campaign**, on the 'Event name' list, also added attributes will be present on the 'Conditions type' list.*
{% endhint %}

<figure><img src="https://2658975168-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcNVX03KZzmrGwJihLiEx%2Fuploads%2FngCaL49YEtkY8P7DTeDy%2Fschemas%201.png?alt=media&#x26;token=17f87256-72d8-4ca7-a817-a89d9cd76a96" alt=""><figcaption></figcaption></figure>

#### Fields available when creating Custom Event Schema:

* **Event system identifier** - during creating the custom Event you will need to pass the Event system identifier: e.g. if you call your Event system identifier as "bike\_ride" then in the request body you will pass: "type": "bike\_ride"&#x20;
* **Event name** - during creating an Event-based Campaign in the 'Event name'  dropdown list custom Event schemas names will be present.
* **Attribute (optional)** - You can use attributes to create a Campaign with conditions based on those attributes and Reward Members.

The attribute can be used when creating an Event-Based campaign that determines the receipt of Units.

<figure><img src="https://2658975168-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcNVX03KZzmrGwJihLiEx%2Fuploads%2FhsO2dxQiZl1RyrMlOjXS%2Fschemas%202.png?alt=media&#x26;token=85b67077-80b5-4a51-9a53-e2f7f4b1a877" alt=""><figcaption></figcaption></figure>

Available attribute types:&#x20;

* **Boolean** - true/false
* **Datetime** - e.g. "2024-03-08T02:02:08+01:00"
* **Number**&#x20;
* **Text** - 'string'

#### Filtering Custom event schemas

When there are a lot of records, you can change the number of rows displayed per page by clicking on the arrow icon below the table and picking a handy number from the list. You can also filter the results by clicking on the **ADD FILTER** button and picking a suitable option from the list:

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

![](https://2658975168-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcNVX03KZzmrGwJihLiEx%2Fuploads%2Fbu3v2ZX8ZUNXtavvJx7S%2Fschemas%203.png?alt=media\&token=28556152-7614-462f-a4a4-90236354c285)

the In Filter pop-up screen you will choose the *Property* mentioned above along with condition and value, after filling it up click on the 'Add filter', and only records fulfilling such criteria will be displayed.

Besides searching via filters you can use a Search Table available in the upper right corner under the 'Add Event Schema' button. The search field allows you to find the event schema via the name:

<figure><img src="https://2658975168-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcNVX03KZzmrGwJihLiEx%2Fuploads%2F8FCsVjWtBlfUww8AaPLz%2Fschemas%204.png?alt=media&#x26;token=6a7034b1-7246-45df-9e09-99cee8135e77" alt=""><figcaption></figcaption></figure>

***

## Editing Custom Event Schema

{% hint style="success" %}
**To edit Custom Event Schema:**

1. Select **Event Schema** from the list
2. Click the context menu
3. Click **Edit**
4. Make changes
5. Click **SAVE**
   {% endhint %}

<figure><img src="https://2658975168-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcNVX03KZzmrGwJihLiEx%2Fuploads%2FAO7bdgWbRFcrFYAzTK24%2Fschemas%205.png?alt=media&#x26;token=45c879c1-2c04-437f-b8c0-d521d5c61cde" alt=""><figcaption></figcaption></figure>
