---
title: "Create Custom Event Schema"
method: POST
path: "/management/v1/projects/{projectId}/custom-event-schemas"
tags: ["Management"]
---

# Create Custom Event Schema

`POST /management/v1/projects/{projectId}/custom-event-schemas`

## Request

- Base URL: `https://api.voucherify.io`
- URL: `https://api.voucherify.io/management/v1/projects/{projectId}/custom-event-schemas`
- Auth: API key in header `X-Management-Id` and API key in header `X-Management-Token`

Creates a custom event schema.

The `"properties"` object is required, but it can be empty, however. This object is for optional custom properties (metadata).

> 📘 Custom Event Documentation
>
> Read [Custom Events](/prepare/custom-events) article to learn how custom events work in Voucherify.
>
>Read also the details about the [Track Custom Event](/api-reference/events/track-custom-event) endpoint and the [Custom Event Object](/api-reference/events/event-object).

## Request body

- ManagementProjectsCustomEventSchemasCreateRequestBody: Object representing a custom event schema.
  - `name` string, required: User-defined name of the custom event. This is also shown in **Project Settings** > **Event Schema** in the Voucherify Dashboard.
  - `schema` object, required: Object containing custom event schema and its custom attributes (metadata).
    - `properties` object, required: Defines custom event custom attributes (metadata).

## Response `200`

Returns the details about the custom event schema.

- ManagementProjectsCustomEventSchemasCreateResponseBody: Object representing a custom event schema.
  - `id` string, required: Unique identifier of the custom event schema.
  - `name` string, required: User-defined name of the custom event. This is also shown in **Project Settings** > **Event Schema** in the Voucherify Dashboard.
  - `schema` object, required: Object containing custom event schema and its custom attributes (metadata).
    - `properties` object, required: Defines custom event custom attributes (metadata).
  - `created_at` string, date-time, required: Timestamp representing the date and time when the custom event schema was created. The value is shown in the ISO 8601 format.
  - `updated_at` string, date-time: Timestamp representing the date and time when the custom event schema was updated. The value is shown in the ISO 8601 format.
  - `object` 'custom-event-schema', required: The type of the object represented by JSON.

## Other responses

- `400`: Returns an error if the payload has incorrect values.
- `401`: Returns an error if an invalid token was provided.
- `402`: Returns an error if the current plan does not include the Management API feature.
- `404`: Returns an error when a resource could not be found.
- `409`: Returns an error if the resource has a duplicate.

---

[API](https://skmtc.dev/voucherifyio/apis/voucherify-api-async-actions.md) - [All operations](https://skmtc.dev/voucherifyio/apis/voucherify-api-async-actions/llms.txt) - [OpenAPI document](https://skmtc.dev/voucherifyio/apis/voucherify-api-async-actions/revisions/4982266e0494?raw)
