Skip to main content
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"
}

Authorizations

X-Management-Id
string
header
required
X-Management-Token
string
header
required

Path Parameters

projectId
string
required

Provide the unique identifier of the project.

Example:

"proj_TrlkLiH4"

Body

application/json

Defines the custom event schema.

Request body schema for POST /management/v1/projects/{projectId}/custom-event-schema. 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).

Response

Returns the details about the custom event schema.

Response body schema for POST /management/v1/projects/{projectId}/custom-event-schema. Object containing the response to creating a custom event schema. Object representing a custom event schema.

id
string
required

Unique identifier of the custom event schema.

Example:

"ms_oA8CawM07Q8i05Cx62U6euTK"

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).

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.

Example:

"2024-03-27T08:00:09.472Z"

object
enum<string>
default:custom-event-schema
required

The type of the object represented by JSON.

Available options:
custom-event-schema
Example:

"custom-event-schema"

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.

Example:

"2024-03-27T08:00:09.472Z"

I