> 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/technical-guide/getting-started-guide/add-custom-event-schema.md).

# Add Custom Event Schema

## How this example works

In this example, we will set up a sample custom event schema to trigger the achievement created in the next step.

***

## Try yourself <a href="#to-try-it-yourself" id="to-try-it-yourself"></a>

* Input the previous saved [token](/technical-guide/getting-started-guide/authentication.md) and [storeCode](/technical-guide/getting-started-guide/member-registartion-configuration.md#to-try-it-yourself) in the request header
* Add a custom event schema\
  Endpoint: `POST /api/{storeCode}/customEvent/schema`

  ```postman_json
  {
      "customEventSchema": {
          "eventType": "app_login",
          "schema": {},
          "name": "User Logged In",
          "active": {
              "isActive": true
          }
      }
  }
  ```
* `204 No Content` status indicates the custom event schema was successfully created.

{% hint style="info" %}
Although it is not included in this scenario, the custom event schema enables you to specify more detailed attributes that can be tracked by the achievements and campaigns.
{% endhint %}

***

## Endpoints used

{% openapi src="/files/jvocRY6tlAWocBwKFsNL" path="/api/{storeCode}/customEvent/schema" method="post" %}
[openapi-5.61.0 (1).json](https://content.gitbook.com/content/gIv2CyIIYf7vRfuhMKQ6/blobs/2xnMWXnOETp8Vxl2YZoi/openapi-5.61.0%20\(1\).json)
{% endopenapi %}

***

## More resources

For a detailed overview and description of the creation and management of the custom event schemas, please refer to these series of articles:

{% content-ref url="/spaces/cNVX03KZzmrGwJihLiEx/pages/kLAEcvOMad1u0l6UBdci" %}
[Custom Event Schemas](/main-features/custom-events/custom-event-schemas.md)
{% endcontent-ref %}


---

# 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/technical-guide/getting-started-guide/add-custom-event-schema.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.
