---
title: "Create an event definition"
method: POST
path: "/event/definitions"
tags: ["Custom Events"]
---

# Create an event definition

`POST /event/definitions`

Creates a custom event definition.

## Request body

- CustomEventDefinitionCreateRequest — Contains the properties of the custom event definition to be created.
  - `name` string, required — The unique name of the custom event.
  - `label` string, required — The label of the custom event.
  - `description` string — The description of the event.
  - `objectType` 'CONTACT', required — Type of the object that the event will be associated with. - `CONTACT`: Indicates that the object is a `contact`.
  - `properties` CustomEventDefinitionPropertyCreateRequest[] — A list of property definitions for the event.
    - `name` string, required — The unique name of the custom property.
    - `label` string, required — The label of the property.
    - `description` string — The description of the property.
    - `type` 'STRING' | 'NUMBER' | 'TIMESTAMP' | 'URL', required — Type of the property. - `STRING`: Indicates a property that receives plain text strings. - `NUMBER`: Indicates a property that receives numeric values with up to one decimal. - `TIMESTAMP`: Indicates a property that receives epoch millisecond. - `URL`: Indicates a property that receives URLs, formatted as strings starting with `http://` or `https://`.

## Response `200`

Successfully created an event definition.

- CustomEventDefinition — Represents a custom event definition.
  - `name` string — The name of the custom event definition.
  - `label` string — The label of the event definition, used for display purposes.
  - `description` string — The description of the event definition.
  - `objectType` 'CONTACT' — Type of the object that the event will be associated with. - `CONTACT`: Indicates that the object is a `contact`.
  - `createTime` string, date-time — The time at which this object is created, formatted in [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339). e.g., `2022-06-01T12:00:00.000Z`.
  - `properties` CustomEventDefinitionProperty[] — The list of property definitions for the event definition.
    - `name` string — The name of the custom property.
    - `label` string — The label of the property, used for display purposes.
    - `description` string — The description of the property.
    - `createTime` string, date-time — The time at which this object is created, formatted in [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339). e.g., `2022-06-01T12:00:00.000Z`.
    - `type` 'STRING' | 'NUMBER' | 'TIMESTAMP' | 'URL' — The data type of the property. - `STRING`: Indicates a property that receives plain text strings. - `NUMBER`: Indicates a property that receives numeric values with up to one decimal. - `TIMESTAMP`: Indicates a property that receives epoch millisecond. - `URL`: Indicates a property that receives URLs, formatted as strings starting with `http://` or `https://`.

---

[API](https://skmtc.dev/ycloud/apis/ycloud-api.md) · [All operations](https://skmtc.dev/ycloud/apis/ycloud-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ycloud/ycloud-api/revisions/4e13d3ca9df8/schema)
