curl --request POST \
--url https://{cluster}.voucherify.io/management/v1/projects/{projectId}/custom-event-schemas \
--header 'Content-Type: application/json' \
--header 'X-Management-Id: <api-key>' \
--header 'X-Management-Token: <api-key>' \
--data '
{
"name": "<string>",
"schema": {
"properties": {}
}
}
'{
"id": "ms_GgjUlnCmbNV5z1pajU11NtnT",
"name": "review",
"schema": {
"properties": {
"published": {
"type": "boolean",
"optional": true
}
}
},
"created_at": "2024-04-29T11:25:44.458Z",
"object": "custom-event-schema"
}{
"statusCode": 400,
"error": "Bad Request",
"message": "Invalid request payload JSON format"
}{
"code": 401,
"message": "Unauthorized",
"key": "unauthorized"
}{
"code": 402,
"message": "Payment required",
"details": "Your current plan does not include a feature required to perform this operation.",
"key": "missing_required_feature"
}{
"code": 404,
"message": "Resource not found",
"details": "Cannot find project with id proj_5itvmU7"
}{
"code": 409,
"key": "duplicate_found",
"message": "Duplicated resource found",
"details": "Duplicated custom_event_schema exists with name sign-up",
"request_id": "v-0ead453c10ec031067",
"resource_id": "sign-up",
"resource_type": "custom_event_schema"
}Create Custom Event Schema
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 article to learn how custom events work in Voucherify.
Read also the details about the Track Custom Event endpoint and the Custom Event Object.
curl --request POST \
--url https://{cluster}.voucherify.io/management/v1/projects/{projectId}/custom-event-schemas \
--header 'Content-Type: application/json' \
--header 'X-Management-Id: <api-key>' \
--header 'X-Management-Token: <api-key>' \
--data '
{
"name": "<string>",
"schema": {
"properties": {}
}
}
'{
"id": "ms_GgjUlnCmbNV5z1pajU11NtnT",
"name": "review",
"schema": {
"properties": {
"published": {
"type": "boolean",
"optional": true
}
}
},
"created_at": "2024-04-29T11:25:44.458Z",
"object": "custom-event-schema"
}{
"statusCode": 400,
"error": "Bad Request",
"message": "Invalid request payload JSON format"
}{
"code": 401,
"message": "Unauthorized",
"key": "unauthorized"
}{
"code": 402,
"message": "Payment required",
"details": "Your current plan does not include a feature required to perform this operation.",
"key": "missing_required_feature"
}{
"code": 404,
"message": "Resource not found",
"details": "Cannot find project with id proj_5itvmU7"
}{
"code": 409,
"key": "duplicate_found",
"message": "Duplicated resource found",
"details": "Duplicated custom_event_schema exists with name sign-up",
"request_id": "v-0ead453c10ec031067",
"resource_id": "sign-up",
"resource_type": "custom_event_schema"
}Path Parameters
Provide the unique identifier of the project.
"proj_TrlkLiH4"
Body
Defines the custom event schema.
Request body schema for POST /management/v1/projects/{projectId}/custom-event-schema.
Response
Returns the details about the custom event schema.
Response body schema for POST /management/v1/projects/{projectId}/custom-event-schema.
Unique identifier of the custom event schema.
"ms_oA8CawM07Q8i05Cx62U6euTK"
User-defined name of the custom event. This is also shown in Project Settings > Event Schema in the Voucherify Dashboard.
Object containing custom event schema and its custom attributes (metadata).
Show child attributes
Show child attributes
Timestamp representing the date and time when the custom event schema was created. The value is shown in the ISO 8601 format.
"2024-03-27T08:00:09.472Z"
The type of the object represented by JSON.
custom-event-schema "custom-event-schema"
Timestamp representing the date and time when the custom event schema was updated. The value is shown in the ISO 8601 format.
"2024-03-27T08:00:09.472Z"
Was this page helpful?

