# 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](https://help.openloyalty.io/technical-guide/getting-started-guide/authentication) and [storeCode](https://help.openloyalty.io/technical-guide/member-registartion-configuration#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="<https://content.gitbook.com/content/gIv2CyIIYf7vRfuhMKQ6/blobs/2xnMWXnOETp8Vxl2YZoi/openapi-5.61.0%20(1).json>" 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="<https://app.gitbook.com/s/cNVX03KZzmrGwJihLiEx/main-features/custom-events/custom-event-schemas>" %}
[Custom Event Schemas](https://app.gitbook.com/s/cNVX03KZzmrGwJihLiEx/main-features/custom-events/custom-event-schemas)
{% endcontent-ref %}
