Skip to main content
PUT
/
management
/
v1
/
projects
/
{projectId}
/
custom-event-schemas
/
{customEventSchemaId}
Update Custom Event Schema
curl --request PUT \
  --url https://{cluster}.voucherify.io/management/v1/projects/{projectId}/custom-event-schemas/{customEventSchemaId} \
  --header 'Content-Type: application/json' \
  --header 'X-Management-Id: <api-key>' \
  --header 'X-Management-Token: <api-key>' \
  --data '{
  "schema": {
    "properties": {}
  }
}'
{
  "id": "ms_u3bIQLbdU0fi3rhqpTLiF26T",
  "related_object": "reward",
  "properties": {
    "region": {
      "type": "string",
      "array": true,
      "optional": false,
      "object_type": null,
      "eq": [
        "EMEA",
        "APAC",
        "LATAM",
        "NA",
        "EU"
      ]
    }
  },
  "allow_defined_only": false,
  "created_at": "2024-04-29T12:03:55.991Z",
  "updated_at": "2024-04-29T12:06:20.866Z",
  "object": "metadata_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"

customEventSchemaId
string
required

Provide the unique identifier of the custom event schema.

Example:

"ms_f1r5Tcu5T0m3v3nT5ch3ma"

Body

application/json

Defines the custom event schema to be updated.

Request body schema for POST /management/v1/projects/{projectId}/custom-event-schema/{customEventSchemaId}. Object representing a custom event schema.

schema
object

Object containing custom event schema and its custom attributes (metadata).

Response

Returns the details about the updated custom event schema.

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