You're reading the reference for API revision 2026-01-15. The latest revision is 2026-10-15. See this page in the latest revision.
Custom Objects
What are custom objects?
Custom objects let you sync structured data into Klaviyo and link it to customer profiles — things like pet records, product subscriptions, reservations, or wishlist items. Once your data is in Klaviyo, you can use it to personalize emails, build segments, and trigger flows.
custom-objects:readcustom-objects:write
How it works
Key concepts
- Data source: Represents a collection of data from an external system where your data source records live (e.g., a table from your internal database or Shopify Subscriptions). You send JSON records as data source records to a data source in Klaviyo. A single data source can be used by multiple object types. We recommend using different data sources for different payloads, but schema is not required or enforced for any data source records.
- Object type: The kind of custom object you're creating (e.g., "Pet", "Reservation"). Creating one automatically generates a draft schema and an empty source mapping.
- Schema: Defines the structure of your object — its properties and relationships. Starts in
draftstatus. Must be set toactivebefore data is processed into object records. You can only modify a schema's properties and relationships while it's indraft. - Configuration (beta): Controls which properties are indexed for search and how records are displayed in Klaviyo. Unlike properties and relationships, you can update the configuration on an
activeschema. See Configure search and display. - Source mapping: The bridge between your data source records and your schema. Uses JSONPath expressions to extract fields from your data and map them to schema properties. Each property mapping references a data source by its
source_id, which is how the data source connects to the object type. - Profile relationship: Links each object record to a Klaviyo profile via an identifier like email, phone number, external ID, Klaviyo ID, or anonymous ID.
Private vs. shared schema
Custom objects support two schema visibility modes:
- Private (
visibility: "private"): The default. The schema is scoped to a single Klaviyo account. This is used when a Klaviyo customer creates their own custom objects. - Shared (
visibility: "shared"): The schema is tied to an application via thenamespacefield (format:applications/<app_id>) and is automatically linked to every account that installs the app. This is used by app partners building integration objects. An application can define up to 8 shared schema object types. See Application objects for app partners for the full workflow.
When a customer installs an app with a shared schema object, the object type is automatically linked to their account — they do not need to create or configure it themselves. When they uninstall the app, the object type is unlinked, but existing records persist.
Data flow
Data Source Records → Data Source → Source Mapping → Schema → Custom Object Records
↓ ↓
(extracts fields (linked to profiles
via JSONPath) via relationships)Data source records are stored when you ingest them. When you activate a schema, Klaviyo processes all existing data source records into custom object records and links them to profiles. After activation, new records are processed immediately.
Object properties
Every object can have up to 15 properties (or 30 depending on your billing plan). Each property must not exceed 2 KB in size.
Each property must be one of the following types:
string(calledTextin the UI): Max 2 KB. Source data must NOT be a boolean or array type.int(calledNumber (Integer)in the UI): Supports up to 2 KB large integers. May be coerced from string type. Source data must NOT have a non-zero fractional component.float(calledNumber (Decimal)in the UI): Supports up to 2 KB large floating point numbers. May be coerced from a string type.boolean: Represents true or false. Acceptable values arefalse,'f','n','no','off','false',true,'t','y','on','yes','true', case insensitive.timestamp: Must follow Klaviyo's acceptable timestamp formats. Converted to UTC if a timezone offset is provided. Assumed UTC if no timezone offset is provided. Defaults to midnight if no time is provided.
Property names must be valid identifiers: letters, numbers, and underscores only. They cannot start with an underscore, cannot be Python reserved keywords (e.g., class, return), and cannot start with the prefix kl_ (reserved for internal use). The name id is reserved for the built-in identifier at property ID 0. Note that property names are independent from field names in your data source records — the source mapping connects them via JSONPath, so your data can have keys with spaces or special characters (e.g., "Variant Name", "$value") even though property names cannot.
The built-in id property is created automatically and does not count against your total property limit. The built-in id is populated by the id_path field in your source mapping — it stores whatever value that JSONPath extracts from your data source records (e.g., a product ID, coupon code, or subscription ID). You do not need to define a separate property for your unique identifier; the built-in id handles it.
The value extracted by id_path must be globally unique within the object type. If two records produce the same id value, the second record will overwrite the first. For example, if you have line items from different subscriptions that both use id: "00001", they will collide. In this case, use a more specific identifier (e.g., subscription_line_id) or a composite value that ensures uniqueness across all records of that object type.
Profile identifiers
Custom object records can be linked to a profile via a profile relationship. When configuring the relationship mapping, you specify which field in your data identifies the profile and what type of identifier it is:
email— email addressphone— phone number: must be in ISO E.164 formatexternal-id— an ID from your external system (must already exist on the profile in Klaviyo)klaviyo-id— Klaviyo's internal profile ID
If you configure multiple profile identifiers (e.g., both email and phone) but only have one available, include the identifier you have and set the other to null. Setting a profile identifier to null in the payload will not overwrite or remove that identifier from the profile.
Each entry in related_id_paths is a different identifier type (email, phone, etc.) for the same profile — they are not separate profile links. To link a single object record to multiple profiles, use array wildcards in your source mapping and structure your data with an array of identifier tuples. See Many-to-many profile relationships for a worked example.
Updating object records
If you ingest a record with the same unique identifier as an existing record, the existing record is updated with the new values. You must provide the entire object record when updating — if you exclude any properties, those properties are set to null. If your source mapping extracts profile identifiers from the same record as object properties, you must include the profile identifiers as well. To update object properties and profile links independently, consider separating them in your record structure.
When multiple object types share a data source, each source mapping extracts independently. The "entire object record" requirement applies per object type, not per data source record. For example, if you re-send a subscription payload without the line_items array, the Subscription object updates normally, but the Line Item source mapping finds nothing to match and existing Line Item records are left untouched — missing array data does not null out or delete child records.
Relationships between object types
The Custom Objects API supports two types of relationships:
- Profile relationships link object records to Klaviyo profiles via identifiers (email, phone, external ID, or Klaviyo ID). See Step 3 in the quick start.
- Object-to-object relationships link object records to records of another object type. For example, linking a Pet record to a Subscription record. See Step 3b in the quick start.
Both relationship types require a corresponding relationship mapping in the source mapping before activation.
JSONPath reference
Source mappings use JSONPath expressions to extract data from your data source records. There is no limit on nesting depth — you can chain as many levels as your data requires. The bracket notation ($['field']) handles keys with spaces, special characters, and $ prefixes:
| Pattern | Description | Example |
|---|---|---|
$['field'] |
Top-level field | $['reservation_id'] |
$['parent']['child'] |
Nested field | $['owner']['email'] |
$['a']['b']['c'] |
Deeply nested field | $['properties']['event_properties']['ProductID'] |
$['array'][*]['field'] |
Field from each item in an array | $['pets'][*]['name'] |
$['special key'] |
Key with spaces or special characters | $['Variant Option: Size'], $['$value'] |
You don't need to flatten or preprocess your source data. The source mapping handles extraction from nested structures and arrays. Fields in your data source records that are not referenced by any source mapping are still persisted in the data source record, but will not appear on the resulting object record. If you later add a mapping for those fields, the data will be available on the object record.
Quick start
This walkthrough creates a "Pet" custom object from scratch using the programmatic API. By the end, you'll have pet records linked to customer profiles in Klaviyo.
Here's the data we'll be working with — three pet records, each with an email to link to a customer profile and a subscription_id to link to a Subscription object:
[
{"id": 1, "name": "Buddy", "type": "dog", "breed": "Golden Retriever", "age": 3, "birth_datetime": "2023-03-15T00:00:00Z", "email": "amy.smith@klaviyo.com", "subscription_id": "sub-001"},
{"id": 2, "name": "Whiskers", "type": "cat", "breed": "Siamese", "age": 2, "birth_datetime": "2024-06-01T00:00:00Z", "email": "amy.smith@klaviyo.com", "subscription_id": "sub-001"},
{"id": 3, "name": "Nibbles", "type": "rabbit", "breed": "Holland Lop", "age": 1, "birth_datetime": "2025-01-10T00:00:00Z", "email": "jon.jacobson@klaviyo.com", "subscription_id": "sub-002"}
]Step 1: Create a data source
A data source represents where your data comes from. Create one using the Create Data Source endpoint.
curl --request POST \
--url https://a.klaviyo.com/api/data-sources \
--header 'Authorization: Klaviyo-API-Key your-private-api-key' \
--header 'content-type: application/vnd.api+json' \
--header 'revision: 2026-07-15' \
--data '
{
"data": {
"type": "data-source",
"attributes": {
"visibility": "private",
"namespace": "custom-objects",
"title": "Pet Registry",
"description": "Source of truth for customer pets"
}
}
}
'Save the returned id — you'll need it in later steps.
Step 2: Create an object type and define its schema
Create an object type with its schema properties in a single call using the Create Object Type endpoint. This also automatically creates a source mapping.
Each property needs a unique numeric id (starting from 1) and a data type.
curl --request POST \
--url https://a.klaviyo.com/api/object-types \
--header 'Authorization: Klaviyo-API-Key your-private-api-key' \
--header 'content-type: application/vnd.api+json' \
--header 'revision: 2026-07-15' \
--data '
{
"data": {
"type": "object-type",
"attributes": {
"title": "Pet",
"description": "Customer pets",
"object-schema": {
"data": {
"type": "object-schema",
"attributes": {
"properties": [
{"id": 1, "name": "name", "type": "string"},
{"id": 2, "name": "type", "type": "string"},
{"id": 3, "name": "breed", "type": "string"},
{"id": 4, "name": "age", "type": "int"},
{"id": 5, "name": "birth_datetime", "type": "timestamp"}
]
}
}
}
}
}
}
'The response includes the IDs you'll need for the remaining steps. Save the draft-schema ID from relationships:
{
"data": {
"type": "object-type",
"id": "01KJ5HFANFPC2W4XG9D4GP24J1",
"relationships": {
"draft-schema": {
"data": {
"type": "object-schema",
"id": "01KJ5HFAKYX5N1W2A9TB1RDQ86"
}
}
}
}
}Step 3: Create a profile relationship
Every custom object must be linked to Klaviyo profiles. Create this relationship on your draft schema.
The meta object is required and must include a name for the relationship (same naming rules as properties: letters, numbers, and underscores only). The type must be "profile-object-schema". The id field in the request must always be the static string "profile". The response id will be "profile:::<name>" (e.g. "profile:::pet_owner") — this compound format ensures uniqueness when multiple relationships exist between the same schemas. The server-generated relationship_id returned in meta is what you'll use in the source mapping in Step 4.
curl --request POST \
--url https://a.klaviyo.com/api/object-schemas/<DRAFT_SCHEMA_ID>/relationships/profile-object-schemas \
--header 'Authorization: Klaviyo-API-Key your-private-api-key' \
--header 'content-type: application/vnd.api+json' \
--header 'revision: 2026-07-15' \
--data '
{
"data": [
{
"type": "profile-object-schema",
"id": "profile",
"meta": {
"name": "pet_owner",
"description": "The profile who owns this pet"
}
}
]
}
'The response includes the server-generated relationship_id in meta:
{
"data": [
{
"type": "profile-object-schema",
"id": "profile:::pet_owner",
"meta": {
"relationship_id": "01K5YKKQKM819VVGCPZZKGE6D4",
"name": "pet_owner",
"description": "The profile who owns this pet"
}
}
]
}Save the relationship_id from the response — you'll need it in the next step.
Step 3b: Create an object-to-object relationship (optional)
If your data model links objects to other object types (e.g., each Pet has a Subscription), you can create an object-to-object relationship on the draft schema. This step requires that the target object type already exists and has an active schema.
The request structure is similar to a profile relationship, but uses the object-schemas relationship endpoint and the target object's schema ID (not its object type ID) as the id.
curl --request POST \
--url https://a.klaviyo.com/api/object-schemas/<DRAFT_SCHEMA_ID>/relationships/object-schemas \
--header 'Authorization: Klaviyo-API-Key your-private-api-key' \
--header 'content-type: application/vnd.api+json' \
--header 'revision: 2026-07-15' \
--data '
{
"data": [
{
"type": "object-schema",
"id": "<TARGET_SCHEMA_ID>",
"meta": {
"name": "subscription",
"description": "The subscription this pet is enrolled in"
}
}
]
}
'The response includes the server-generated relationship_id in meta:
{
"data": [
{
"type": "object-schema",
"id": "<TARGET_SCHEMA_ID>:::subscription",
"meta": {
"relationship_id": "01K97SE7GH4TE57FVNQY310QAK",
"name": "subscription",
"description": "The subscription this pet is enrolled in"
}
}
]
}Save the relationship_id — you'll need it when configuring the source mapping. The source mapping relationship entry for an object-to-object relationship uses "type": "custom-object" and a related_id_path (instead of related_id_paths):
{
"relationship_id": "<RELATIONSHIP_ID_FROM_STEP_3B>",
"type": "simple",
"source": {
"source_id": "<DATA_SOURCE_ID>",
"id_path": "$['id']",
"type": "custom-object",
"related_id_path": "$['subscription_id']"
}
}Step 4: Configure the source mapping
The source mapping tells Klaviyo how to read your data source records. It connects each schema property to a field in your data using JSONPath expressions, and links records to profiles.
curl --request PATCH \
--url https://a.klaviyo.com/api/source-mappings/<DRAFT_SCHEMA_ID> \
--header 'Authorization: Klaviyo-API-Key your-private-api-key' \
--header 'content-type: application/vnd.api+json' \
--header 'revision: 2026-07-15' \
--data @- << 'EOF'
{
"data": {
"type": "source-mapping",
"id": "<DRAFT_SCHEMA_ID>",
"attributes": {
"property_mappings": [
{"id": 1, "type": "simple", "source": {"source_id": "<DATA_SOURCE_ID>", "id_path": "$['id']", "data_path": "$['name']"}},
{"id": 2, "type": "simple", "source": {"source_id": "<DATA_SOURCE_ID>", "id_path": "$['id']", "data_path": "$['type']"}},
{"id": 3, "type": "simple", "source": {"source_id": "<DATA_SOURCE_ID>", "id_path": "$['id']", "data_path": "$['breed']"}},
{"id": 4, "type": "simple", "source": {"source_id": "<DATA_SOURCE_ID>", "id_path": "$['id']", "data_path": "$['age']"}},
{"id": 5, "type": "simple", "source": {"source_id": "<DATA_SOURCE_ID>", "id_path": "$['id']", "data_path": "$['birth_datetime']"}}
],
"relationship_mappings": [
{
"relationship_id": "<RELATIONSHIP_ID_FROM_STEP_3>",
"type": "simple",
"source": {
"source_id": "<DATA_SOURCE_ID>",
"id_path": "$['id']",
"type": "profile",
"related_id_paths": [
{
"identifier_type": "email",
"path": "$['email']"
}
]
}
},
{
"relationship_id": "<RELATIONSHIP_ID_FROM_STEP_3B>",
"type": "simple",
"source": {
"source_id": "<DATA_SOURCE_ID>",
"id_path": "$['id']",
"type": "custom-object",
"related_id_path": "$['subscription_id']"
}
}
]
}
}
}
EOFStep 5: Ingest your data
Send your records using the Bulk Create Data Source Records endpoint. Each pet is a separate record:
curl --request POST \
--url https://a.klaviyo.com/api/data-source-record-bulk-create-jobs \
--header 'Authorization: Klaviyo-API-Key your-private-api-key' \
--header 'content-type: application/vnd.api+json' \
--header 'revision: 2026-07-15' \
--data '
{
"data": {
"type": "data-source-record-bulk-create-job",
"attributes": {
"data-source-records": {
"data": [
{
"type": "data-source-record",
"attributes": {
"record": {"id": 1, "name": "Buddy", "type": "dog", "breed": "Golden Retriever", "age": 3, "birth_datetime": "2023-03-15T00:00:00Z", "email": "amy.smith@klaviyo.com", "subscription_id": "sub-001"}
}
},
{
"type": "data-source-record",
"attributes": {
"record": {"id": 2, "name": "Whiskers", "type": "cat", "breed": "Siamese", "age": 2, "birth_datetime": "2024-06-01T00:00:00Z", "email": "amy.smith@klaviyo.com", "subscription_id": "sub-001"}
}
},
{
"type": "data-source-record",
"attributes": {
"record": {"id": 3, "name": "Nibbles", "type": "rabbit", "breed": "Holland Lop", "age": 1, "birth_datetime": "2025-01-10T00:00:00Z", "email": "jon.jacobson@klaviyo.com", "subscription_id": "sub-002"}
}
}
]
}
},
"relationships": {
"data-source": {
"data": {
"type": "data-source",
"id": "<DATA_SOURCE_ID>"
}
}
}
}
}
'Step 6: Activate the schema
Once everything is configured, activate the schema:
curl --request PATCH \
--url https://a.klaviyo.com/api/object-schemas/<DRAFT_SCHEMA_ID> \
--header 'Authorization: Klaviyo-API-Key your-private-api-key' \
--header 'content-type: application/vnd.api+json' \
--header 'revision: 2026-07-15' \
--data '
{
"data": {
"type": "object-schema",
"id": "<DRAFT_SCHEMA_ID>",
"attributes": {
"status": "active"
}
}
}
'The response will show status publishing while records are being processed — this typically transitions to active within a few minutes.
Activation validates your entire configuration. If validation fails, the schema remains in draft status so you can make corrections and try again. See Troubleshooting for common errors.
That's it. After activation, Buddy, Whiskers, and Nibbles will appear as separate custom object records linked to their owners' profiles and their subscriptions. You can now use this data in templates, flows, and segments.
Working with nested data
The quick start above uses flat records where each record maps directly to one object. But your source data doesn't need to be flat — source mappings support JSONPath expressions that can reach into nested objects and arrays.
For example, instead of sending three separate pet records, you could send a single record containing an owner and an array of pets:
{
"owner": {
"email": "amy.smith@klaviyo.com"
},
"pets": [
{"id": 1, "name": "Buddy", "type": "dog", "breed": "Golden Retriever", "age": 3, "birth_datetime": "2023-03-15T00:00:00Z"},
{"id": 2, "name": "Whiskers", "type": "cat", "breed": "Siamese", "age": 2, "birth_datetime": "2024-06-01T00:00:00Z"},
{"id": 3, "name": "Nibbles", "type": "rabbit", "breed": "Holland Lop", "age": 1, "birth_datetime": "2025-01-10T00:00:00Z"}
]
}The only difference is in the source mapping. Use array wildcards ([*]) to extract each item from the pets array, and nested paths to reach the owner's email:
{
"data": {
"type": "source-mapping",
"id": "<DRAFT_SCHEMA_ID>",
"attributes": {
"property_mappings": [
{"id": 1, "type": "simple", "source": {"source_id": "<DATA_SOURCE_ID>", "id_path": "$['pets'][*]['id']", "data_path": "$['pets'][*]['name']"}},
{"id": 2, "type": "simple", "source": {"source_id": "<DATA_SOURCE_ID>", "id_path": "$['pets'][*]['id']", "data_path": "$['pets'][*]['type']"}},
{"id": 3, "type": "simple", "source": {"source_id": "<DATA_SOURCE_ID>", "id_path": "$['pets'][*]['id']", "data_path": "$['pets'][*]['breed']"}},
{"id": 4, "type": "simple", "source": {"source_id": "<DATA_SOURCE_ID>", "id_path": "$['pets'][*]['id']", "data_path": "$['pets'][*]['age']"}},
{"id": 5, "type": "simple", "source": {"source_id": "<DATA_SOURCE_ID>", "id_path": "$['pets'][*]['id']", "data_path": "$['pets'][*]['birth_datetime']"}}
],
"relationship_mappings": [
{
"relationship_id": "<RELATIONSHIP_ID>",
"type": "simple",
"source": {
"source_id": "<DATA_SOURCE_ID>",
"id_path": "$['pets'][*]['id']",
"type": "profile",
"related_id_paths": [
{
"identifier_type": "email",
"path": "$['owner']['email']"
}
]
}
}
]
}
}
}You then pass the entire nested structure as a single data source record — no flattening or preprocessing needed. Klaviyo extracts three pet objects from the single record, each linked to the owner's profile.
Common patterns
Flat data — one object type
If your data is flat (one record per object, profile identifier at the top level), a single object type is all you need. This covers use cases like coupon codes, reservations, or product records where each record is self-contained. Follow the Quick start directly.
Parent-child data — two object types, shared data source
If your data has a parent entity with child items (e.g., a Subscription with Line Items, or an Order with Order Items), model these as two separate object types. You can use the same data source for both — each object type has its own source mapping that extracts different fields from the same data source records. When you ingest a single data source record, every object type whose source mapping references that data source will independently process the record.
Follow the Quick start once for the parent object type and once for the child, reusing the same data source from Step 1. Specifically: run Steps 2-4 for the parent, then Steps 2-4 for the child, then ingest your data in Step 5, then activate both schemas in Step 6. Activation order does not matter — you can activate the parent and child schemas in any order.
You can use object-to-object relationships to formally link the child to the parent (e.g., linking each Line Item to its Subscription). Alternatively, you can store the parent's ID as a string property on the child object type (e.g., a subscription_id property on each line item) for simpler cross-referencing.
Here is an example using a Subscription (parent) with Line Items (child). The source data looks like:
{
"subscription_id": "sub_123",
"status": "active",
"next_billing_date": "2026-03-01T00:00:00Z",
"email": "customer@example.com",
"line_items": [
{"id": "li_001", "product_id": "prod_001", "price": 29.99, "quantity": 2, "subscription_id": "sub_123"},
{"id": "li_002", "product_id": "prod_002", "price": 15.00, "quantity": 1, "subscription_id": "sub_123"}
]
}Parent source mapping (Subscription): Uses top-level JSONPaths. The id_path is $['subscription_id'].
"property_mappings": [
{"id": 1, "type": "simple", "source": {"source_id": "<DATA_SOURCE_ID>", "id_path": "$['subscription_id']", "data_path": "$['status']"}},
{"id": 2, "type": "simple", "source": {"source_id": "<DATA_SOURCE_ID>", "id_path": "$['subscription_id']", "data_path": "$['next_billing_date']"}}
]Child source mapping (Line Item): Uses array wildcards for id_path and data_path. Note that subscription_id (property id 3) uses a top-level data_path ($['subscription_id']) paired with an array-based id_path — the top-level value is applied to every record extracted from the array. This works in both property mappings and relationship mappings.
"property_mappings": [
{"id": 1, "type": "simple", "source": {"source_id": "<DATA_SOURCE_ID>", "id_path": "$['line_items'][*]['id']", "data_path": "$['line_items'][*]['product_id']"}},
{"id": 2, "type": "simple", "source": {"source_id": "<DATA_SOURCE_ID>", "id_path": "$['line_items'][*]['id']", "data_path": "$['line_items'][*]['price']"}},
{"id": 3, "type": "simple", "source": {"source_id": "<DATA_SOURCE_ID>", "id_path": "$['line_items'][*]['id']", "data_path": "$['subscription_id']"}},
{"id": 4, "type": "simple", "source": {"source_id": "<DATA_SOURCE_ID>", "id_path": "$['line_items'][*]['id']", "data_path": "$['line_items'][*]['quantity']"}}
],
"relationship_mappings": [
{
"relationship_id": "<RELATIONSHIP_ID>",
"type": "simple",
"source": {
"source_id": "<DATA_SOURCE_ID>",
"id_path": "$['line_items'][*]['id']",
"type": "profile",
"related_id_paths": [
{"identifier_type": "email", "path": "$['email']"}
]
}
}
]Both object types reference the same <DATA_SOURCE_ID>. You ingest the full nested payload as a single data source record, and Klaviyo extracts one Subscription record and two Line Item records from it.
Configure search and display (beta)
Every object schema has a configuration that controls which properties Klaviyo indexes for full-text search and how object records appear in Klaviyo (e.g., the record title, images, and the columns shown in the record explorer). Klaviyo creates a default configuration when you create an object type. You can read and update it on the object schema endpoints.
Configuration fields
The configuration attribute contains the following fields. Every field references a property by its numeric property id from the schema. Property ID 0 is the built-in id property.
searchable_property_ids: Up to 3 property IDs whose values are indexed for full-text search. Defaults to[0], so records are searchable by theiridvalue until you change it.title_property_id: The property whose value is used as the record's title in Klaviyo. Defaults to0.primary_image_url_property_id: Optional. Astringproperty whose value is an image URL, used as the primary image for the record. Set tonullif your object has no image.thumbnail_image_url_property_id: Optional. Astringproperty whose value is an image URL, used as the record thumbnail. Set tonullif your object has no image.record_explorer_display_property_ids: An ordered list of property IDs to display as columns in the record explorer.
Update the configuration
Update the configuration with the Update Object Schema endpoint. Unlike other object schema attributes, you can update configuration on an active schema without creating a new draft schema. The configuration attribute is replaced in full, so include every field in the request.
This example configures the Pet object from the Quick start so that records are searchable by name (property 1) and breed (property 3), titled by name, and displayed with four columns in the record explorer:
curl --request PATCH \
--url https://a.klaviyo.com/api/object-schemas/<SCHEMA_ID> \
--header 'Authorization: Klaviyo-API-Key your-private-api-key' \
--header 'content-type: application/vnd.api+json' \
--header 'revision: 2026-07-15.pre' \
--data '
{
"data": {
"type": "object-schema",
"id": "<SCHEMA_ID>",
"attributes": {
"configuration": {
"searchable_property_ids": [1, 3],
"title_property_id": 1,
"primary_image_url_property_id": null,
"thumbnail_image_url_property_id": null,
"record_explorer_display_property_ids": [1, 2, 3, 4]
}
}
}
}
'The response includes the updated configuration alongside the other schema attributes. Get Object Schema also returns configuration when you use the beta revision.
Search index status
When you change searchable_property_ids on an active schema, Klaviyo rebuilds the search index for the affected properties asynchronously. Existing records become searchable by a newly added property once the backfill completes. New records are indexed as they are ingested.
Track backfill progress with two fields on the object type, returned by Get Object Type in the beta revision:
search_indexed_property_ids: Property IDs that are fully indexed for all records.search_indexing_property_ids: Property IDs with a backfill in progress.
Together, these two lists always equal the schema's searchable_property_ids.
These fields track newly added properties. If you only remove a property from searchable_property_ids, search_indexing_property_ids stays empty even though Klaviyo is still rebuilding the index — records can continue to match on the removed property's values until that rebuild completes.
Search object records
Use the search query parameter on the Get Records for Object Type endpoint to find records by the values of their searchable properties:
curl --request GET \
--url 'https://a.klaviyo.com/api/object-types/<OBJECT_TYPE_ID>/object-records?search=golden%20retriever&page%5Bsize%5D=20' \
--header 'Authorization: Klaviyo-API-Key your-private-api-key' \
--header 'accept: application/vnd.api+json' \
--header 'revision: 2026-07-15.pre'Search is case insensitive and matches substrings. The query is split on whitespace, and every term must match somewhere in the record's searchable property values. For example, search=golden retriever matches a pet whose breed is Golden Retriever, and search=bud matches a pet named Buddy. Results are paginated in the same way as an unfiltered request.
UI-based setup
If you prefer using the UI instead of the API:
- Navigate to the Object Manager to create a new data source and object.
- Give your object a unique name and either select an existing data source or create a new one.
- Define the object's schema and relationships using the Object Manager. For more information, check out Getting started with custom objects.
- Use the provided sample payload to begin ingesting records with the Bulk Create Data Source Records endpoint.
API reference
Create Data Source Record
Use the Create Data Source Record endpoint to ingest records one at a time. Ideal for real-time or event-driven workloads such as processing webhooks. The request body uses the same record structure as the bulk endpoint — wrap your JSON payload inside a single data-source-record object with a data-source relationship.
Rate limits and throughput:
- Rate limit tier: LARGE (75 requests/second burst, 750 requests/minute steady)
- Throughput: Up to 75 records/second and 750 records/minute
Bulk Create Data Source Records
Use the Bulk Create Data Source Records endpoint for batch imports.
Rate limits and throughput:
- Rate limit: 3 requests/second burst, 15 requests/minute steady
- Throughput: Up to ~1,500 records/second in bursts and 7,500 records/minute steady (with 500 records per request)
- Records per request: Up to 500 records
Get Object Records
Use the Get Records for Object Type endpoint to retrieve paginated object records for a given object type. This is useful for verifying ingested data or syncing records to an external system.
curl --request GET \
--url 'https://a.klaviyo.com/api/object-types/<OBJECT_TYPE_ID>/object-records?page%5Bsize%5D=20' \
--header 'Authorization: Klaviyo-API-Key your-private-api-key' \
--header 'accept: application/vnd.api+json' \
--header 'revision: 2026-07-15'Key details:
- Scope:
custom-objects:read - Rate limit tier: SMALL (3 requests/second burst, 60 requests/minute steady)
- Pagination: Cursor-based. Use
page[cursor]with the cursor from the previous response to fetch the next page.page[size]controls records per page (default 20, max 100). - Search (beta): With the
revision: 2026-07-15.preheader, add thesearchquery parameter to filter records by the values of their searchable properties. See Search object records.
Bulk Delete Object Records
Use the Bulk Delete Object Records endpoint to delete up to 500 object records in a single request. This is useful for removing stale or incorrect records.
curl --request POST \
--url https://a.klaviyo.com/api/object-record-bulk-delete-jobs \
--header 'Authorization: Klaviyo-API-Key your-private-api-key' \
--header 'content-type: application/vnd.api+json' \
--header 'revision: 2026-07-15' \
--data '
{
"data": {
"type": "object-record-bulk-delete-job",
"relationships": {
"object-records": {
"data": [
{"type": "object-record", "id": "<OBJECT_TYPE_ID>:::<RECORD_ID_1>"},
{"type": "object-record", "id": "<OBJECT_TYPE_ID>:::<RECORD_ID_2>"}
]
}
}
}
}
'Key details:
- Scope:
custom-objects:write - Rate limit tier: SMALL (3 requests/second burst, 60 requests/minute steady)
- Records per request: Up to 500 object record IDs. All record IDs must belong to the same object type.
- Max payload size: 5 MB
- Response:
202 Accepted— deletion is processed asynchronously.
Separating object data from profile identifiers
For production workloads, we recommend separating object properties from relationship identifiers within each record. This structure makes it explicit which fields are object data and which are used for linking, and supports many-to-many profile relationships where a single object record is linked to multiple profiles.
Basic separation
At its simplest, move object properties under object_record and profile identifiers under relationships:
{
"type": "data-source-record",
"attributes": {
"record": {
"object_record": {
"id": 1,
"name": "Buddy",
"type": "dog",
"breed": "Golden Retriever",
"age": 3,
"birth_datetime": "2023-03-15T00:00:00Z"
},
"relationships": {
"email": "amy.smith@klaviyo.com"
}
}
}
}With this structure, your source mapping property paths would use $['object_record']['id'], $['object_record']['name'], etc., and the profile identifier path would use $['relationships']['email']. This makes it easier to update object record attributes independent of profile links.
Many-to-many profile relationships
If an object record can be linked to multiple profiles (e.g., a pet with two owners), use an array in the relationships section and wildcard expansion in the source mapping to create a link for each entry:
{
"type": "data-source-record",
"attributes": {
"record": {
"object_record": {
"id": 1,
"name": "Buddy",
"type": "dog",
"breed": "Golden Retriever",
"age": 3,
"birth_datetime": "2023-03-15T00:00:00Z",
"subscription_id": "sub-001"
},
"relationships": {
"owners": [
{"id": 1, "email": "amy.smith@klaviyo.com", "phone": "+15550001000"},
{"id": 1, "email": "pat.jones@klaviyo.com", "phone": "+15550001001"}
]
}
}
}
}Each entry in the owners array includes an id that matches the object record's identifier, plus one or more profile identifiers. The source mapping uses wildcards to expand each entry into a separate profile link:
"relationship_mappings": [
{
"relationship_id": "<RELATIONSHIP_ID>",
"type": "simple",
"source": {
"source_id": "<DATA_SOURCE_ID>",
"id_path": "$['relationships']['owners'][*]['id']",
"type": "profile",
"related_id_paths": [
{"identifier_type": "email", "path": "$['relationships']['owners'][*]['email']"},
{"identifier_type": "phone", "path": "$['relationships']['owners'][*]['phone']"}
]
}
}
]This creates two profile links for Buddy — one for Amy and one for Pat — each identified by both email and phone. The property mappings remain unchanged, referencing $['object_record']['id'] and $['object_record']['name'] as before.
Payload limits
Bulk Create Data Source Records:
- Max payload size — 4 MB
- Max records per request — 500 records
All custom object records:
- Max object record size — 8 KB
- Max object property size — 2 KB
Troubleshooting
Schema activation errors
When activating a schema, the API validates your entire configuration. If validation fails, the schema remains in draft status so you can fix the issue and retry.
| Error | Cause | Fix |
|---|---|---|
| Property IDs do not match | Schema properties don't have a 1:1 match with source mapping properties. | Ensure every schema property (except the built-in id at ID 0) has exactly one corresponding property mapping, and vice versa. |
| Relationship IDs do not match | Schema relationships don't match source mapping relationships. | Ensure the relationship_id in each relationship mapping matches a relationship on the schema. Retrieve relationship IDs from the schema's relationships endpoints (e.g., GET /api/object-schemas/{id}/relationships/profile-object-schemas) — each item in the response includes a meta object containing the relationship_id. |
| Schema not in draft | The schema is not in draft status. |
Only draft schemas can be activated. To modify an active schema's properties or relationships, create a new draft version first. The configuration can be updated on an active schema. |
| Data source not found | A source mapping references a data source ID that doesn't exist. | Create the data source first, or correct the source_id in your source mapping. |
Data ingestion errors
| Status code | Reasons |
|---|---|
| 400 | Number of records exceeded the limit (>500), or a data source identifier was not provided. |
| 413 | Request payload size is too large (>4 MB). |
| 429 | Rate limit exceeded. Learn more. |
Profile relationship errors
| Error | Cause | Fix |
|---|---|---|
| 400: Relationship must include meta | The meta field is required when creating a profile relationship. |
Include a meta object with at least a name field. |
| 400: Invalid type | Wrong type value. |
Use "profile-object-schema", not "object-schema". |
| 400: Invalid ULID | A relationship_id was provided in an invalid format. |
Relationship IDs must be ULIDs (26-character strings, e.g., 01K5YKKQKM819VVGCPZZKGE6D4). When creating a new relationship, omit relationship_id — it is server-generated. |
Additional resources
Endpoints
- GETGet Data Sources
/api/data-sources - GETGet Data Source
/api/data-sources/{id} - POSTCreate Data Source
/api/data-sources - DELETEDelete Data Source
/api/data-sources/{id} - POSTBulk Create Data Source Records
/api/data-source-record-bulk-create-jobs - POSTCreate Data Source Record
/api/data-source-record-create-jobs