Create Custom Event Schema
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.
POST
/
management
/
v1
/
projects
/
{projectId}
/
custom-event-schemas
Create Custom Event Schema
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
Body
application/json
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.

