Summary
PATCH /api/object-schemas/{id} with status: ACTIVE returns a 500 server error when activating a draft schema that was created via POST /api/object-schemas for an object type that already has an active schema. This blocks updating custom object schemas with new properties.
Steps to reproduce
All requests use revision: 2026-01-15.pre.
1. Create an object type with an initial schema (works)
curl -X POST https://a.klaviyo.com/api/object-types \
-H 'Authorization: Klaviyo-API-Key <KEY>' \
-H 'content-type: application/vnd.api+json' \
-H 'revision: 2026-01-15.pre' \
-d '{
"data": {
"type": "object-type",
"attributes": {
"title": "TestObject",
"description": "Test",
"object-schema": {
"data": {
"type": "object-schema",
"attributes": {
"properties": [
{"id": 1, "name": "field_a", "type": "STRING"}
]
}
}
}
}
}
}'
Note the draft-schema ID from the response relationships.
2. Set up profile relationship, source mapping, and activate (works)
# Create profile relationship
curl -X POST https://a.klaviyo.com/api/object-schemas/<DRAFT_SCHEMA_ID>/relationships/profile-object-schemas \
-H 'Authorization: Klaviyo-API-Key <KEY>' \
-H 'content-type: application/vnd.api+json' \
-H 'revision: 2026-01-15.pre' \
-d '{"data": [{"type": "profile-object-schema", "id": "profile", "meta": {"name": "test_owner"}}]}'
# Configure source mapping (with matching property + relationship mappings)
curl -X PATCH https://a.klaviyo.com/api/source-mappings/<DRAFT_SCHEMA_ID> \
-H 'Authorization: Klaviyo-API-Key <KEY>' \
-H 'content-type: application/vnd.api+json' \
-H 'revision: 2026-01-15.pre' \
-d '{ ... property_mappings + relationship_mappings ... }'
# Activate — this works for the initial schema
curl -X PATCH https://a.klaviyo.com/api/object-schemas/<DRAFT_SCHEMA_ID> \
-H 'Authorization: Klaviyo-API-Key <KEY>' \
-H 'content-type: application/vnd.api+json' \
-H 'revision: 2026-01-15.pre' \
-d '{"data": {"type": "object-schema", "id": "<DRAFT_SCHEMA_ID>", "attributes": {"status": "ACTIVE"}}}'
3. Create a new draft schema for the now-active object type (works)
curl -X POST https://a.klaviyo.com/api/object-schemas \
-H 'Authorization: Klaviyo-API-Key <KEY>' \
-H 'content-type: application/vnd.api+json' \
-H 'revision: 2026-01-15.pre' \
-d '{
"data": {
"type": "object-schema",
"attributes": {
"title": "TestObject",
"properties": [
{"id": 1, "name": "field_a", "type": "STRING"},
{"id": 2, "name": "field_b", "type": "STRING"}
]
},
"relationships": {
"object-type": {
"data": {"type": "object-type", "id": "<OBJECT_TYPE_ID>"}
}
}
}
}'
This returns 201 with a new draft schema ID.
4. Set up profile relationship, source mapping on the new draft (works)
Profile relationship is created, source mapping is configured with 1:1 property and relationship mappings. Verified via GET that everything matches.
5. Activate the new draft (FAILS with 500)
curl -X PATCH https://a.klaviyo.com/api/object-schemas/<NEW_DRAFT_SCHEMA_ID> \
-H 'Authorization: Klaviyo-API-Key <KEY>' \
-H 'content-type: application/vnd.api+json' \
-H 'revision: 2026-01-15.pre' \
-d '{"data": {"type": "object-schema", "id": "<NEW_DRAFT_SCHEMA_ID>", "attributes": {"status": "ACTIVE"}}}'
Response: 500
{
"errors": [{
"status": 500,
"code": "error",
"title": "A server error occurred.",
"detail": "A server error occurred.",
"source": {"pointer": "/data/"}
}]
}
Verified state before activation
Before the failing activation call, I verified via GET:
- Schema (
GET /api/object-schemas/<ID>): status DRAFT, all properties present, published_at: null
- Source mapping (
GET /api/source-mappings/<ID>): all property_mappings have matching IDs, relationship_mappings reference the correct relationship_id
- Profile relationship (
GET /api/object-schemas/<ID>?include=profile-object-schemas): included with correct relationship_id in meta
Everything is correctly configured per the docs. The 500 is consistently reproducible across multiple attempts.
Expected behavior
The draft schema should transition to PUBLISHING then ACTIVE, replacing the previous active schema version — the same way it works for the initial activation in step 2.
Environment
- API revision:
2026-01-15.pre
- Node SDK:
klaviyo-api npm package
- Response time on 500: ~1300ms (suggests server-side processing before failure)
Summary
PATCH /api/object-schemas/{id}withstatus: ACTIVEreturns a 500 server error when activating a draft schema that was created viaPOST /api/object-schemasfor an object type that already has an active schema. This blocks updating custom object schemas with new properties.Steps to reproduce
All requests use
revision: 2026-01-15.pre.1. Create an object type with an initial schema (works)
Note the
draft-schemaID from the response relationships.2. Set up profile relationship, source mapping, and activate (works)
3. Create a new draft schema for the now-active object type (works)
This returns 201 with a new draft schema ID.
4. Set up profile relationship, source mapping on the new draft (works)
Profile relationship is created, source mapping is configured with 1:1 property and relationship mappings. Verified via GET that everything matches.
5. Activate the new draft (FAILS with 500)
Response: 500
{ "errors": [{ "status": 500, "code": "error", "title": "A server error occurred.", "detail": "A server error occurred.", "source": {"pointer": "/data/"} }] }Verified state before activation
Before the failing activation call, I verified via GET:
GET /api/object-schemas/<ID>): statusDRAFT, all properties present,published_at: nullGET /api/source-mappings/<ID>): allproperty_mappingshave matching IDs,relationship_mappingsreference the correctrelationship_idGET /api/object-schemas/<ID>?include=profile-object-schemas): included with correctrelationship_idin metaEverything is correctly configured per the docs. The 500 is consistently reproducible across multiple attempts.
Expected behavior
The draft schema should transition to
PUBLISHINGthenACTIVE, replacing the previous active schema version — the same way it works for the initial activation in step 2.Environment
2026-01-15.preklaviyo-apinpm package