{ "openapi": "3.0.2", "info": { "title": "Klaviyo API", "version": "2026-07-15", "description": "The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details.", "contact": { "name": "Klaviyo Developer Experience Team", "email": "developers@klaviyo.com", "url": "https://developers.klaviyo.com" }, "termsOfService": "https://www.klaviyo.com/legal/api-terms", "license": { "name": "License", "url": "https://www.klaviyo.com/legal" } }, "servers": [ { "url": "https://a.klaviyo.com", "description": "Production" } ], "security": [ { "Klaviyo-API-Key": [] } ], "paths": { "/api/object-types": { "post": { "operationId": "create_object_type", "summary": "Create Object Type", "description": "Create an object type.

*Rate limits*:
Burst: `3/s`
Steady: `60/m`\n\n**Scopes:**\n`custom-objects:write`\n\n[OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/create_object_type.json)", "parameters": [ { "name": "fields[object-type]", "in": "query", "description": "For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets", "required": false, "schema": { "type": "array", "items": { "type": "string", "enum": [ "created_at", "description", "id", "namespace", "status", "title", "updated_at" ] } }, "explode": false }, { "name": "revision", "in": "header", "description": "API endpoint revision (format: YYYY-MM-DD[.suffix])", "required": true, "schema": { "type": "string", "default": "2026-07-15" } } ], "requestBody": { "description": "Create an object type", "required": true, "content": { "application/vnd.api+json": { "schema": { "$ref": "#/components/schemas/ObjectTypeCreateQuery" } } } }, "responses": { "201": { "description": "Success", "content": { "application/vnd.api+json": { "schema": { "$ref": "#/components/schemas/PostObjectTypeResponse" } } } }, "4XX": { "$ref": "#/components/responses/ClientError" }, "5XX": { "$ref": "#/components/responses/ServerError" } }, "tags": [ "Custom Objects" ], "x-klaviyo-pre-release": "None", "x-klaviyo-ratelimit": { "burst": "3/s", "steady": "60/m" }, "x-klaviyo-scopes": [ "custom-objects:write" ], "x-klaviyo-subtag": "Object Types" } } }, "components": { "responses": { "ClientError": { "description": "Client Error", "content": { "application/vnd.api+json": { "schema": { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "id", "code", "title", "detail" ], "properties": { "id": { "type": "string" }, "code": { "type": "string" }, "title": { "type": "string" }, "detail": { "type": "string" }, "source": { "type": "object", "properties": { "pointer": { "type": "string" }, "parameter": { "type": "string" } } } } } } }, "required": [ "errors" ] } } } }, "ServerError": { "description": "Server Error", "content": { "application/vnd.api+json": { "schema": { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "id", "code", "title", "detail" ], "properties": { "id": { "type": "string" }, "code": { "type": "string" }, "title": { "type": "string" }, "detail": { "type": "string" }, "source": { "type": "object", "properties": { "pointer": { "type": "string" }, "parameter": { "type": "string" } } } } } } }, "required": [ "errors" ] } } } } }, "schemas": { "APISchemaProperty": { "type": "object", "properties": { "id": { "description": "The ID of the schema property. Must be a postive integer.", "type": "integer", "example": 1 }, "name": { "description": "The name of the schema property", "type": "string", "example": "service_plan" }, "type": { "description": "The type of the schema property", "type": "string", "enum": [ "boolean", "float", "int", "list_str", "string", "timestamp" ] }, "description": { "description": "The description of the schema property", "type": "string", "default": "", "nullable": true } }, "required": [ "id", "name", "type" ] }, "AgentHints": { "description": "Optional hints emitted by the API for agent callers", "type": "object", "properties": { "next_steps": { "description": "Suggested follow-up actions for agents to take after this response", "type": "array", "items": { "type": "string" } } } }, "ConstantPropertyMapping": { "type": "object", "properties": { "id": { "description": "Property ID. Must be a positive integer.", "type": "integer", "example": 1 }, "type": { "description": "String literal for serialization", "type": "string", "enum": [ "constant" ] }, "value": { "description": "Constant value assigned to every record", "example": "active", "oneOf": [ { "type": "integer" }, { "type": "number" }, { "type": "string" }, { "type": "boolean" } ] } }, "required": [ "id", "type", "value" ] }, "CustomObjectRelationshipSource": { "type": "object", "properties": { "source_id": { "description": "Data source ULID ID", "type": "string", "example": "01JXKX2HM7NV4QPTR5WE8BF6GY" }, "type": { "description": "String literal for serialization", "type": "string", "enum": [ "custom-object" ] }, "id_path": { "description": "JSONPath data selector to owning ID", "type": "string", "example": "$['object_record']['subscription_id']" }, "related_id_path": { "description": "JSONPath data selector to related ID", "type": "string", "example": "$['object_record']['pet_id']" }, "update_strategy": { "description": "Strategy for updating relationships with each new RawDataRecord ingestion", "type": "string", "example": "replace_from_origin", "default": "replace_from_origin", "enum": [ "additive", "replace_from_origin" ], "nullable": true } }, "required": [ "source_id", "type", "id_path", "related_id_path" ] }, "EmbeddedObjectSchemaResourceObject": { "type": "object", "properties": { "type": { "$ref": "#/components/schemas/ObjectSchemaEnum" }, "attributes": { "type": "object", "properties": { "properties": { "description": "Properties of the object schema", "type": "array", "items": { "$ref": "#/components/schemas/APISchemaProperty" }, "nullable": true }, "status": { "description": "The status of this object schema", "type": "string", "example": "draft", "default": "draft", "enum": [ "active", "draft" ], "nullable": true }, "required": { "description": "Properties that are required on the object schema", "type": "array", "items": { "type": "string" }, "nullable": true }, "source-mapping": { "description": "The source mapping to create with this object schema", "type": "object", "nullable": true, "properties": { "data": { "$ref": "#/components/schemas/SourceMappingCreateQueryResourceObject" } }, "required": [ "data" ] } } } }, "required": [ "type", "attributes" ] }, "ObjectLinks": { "type": "object", "properties": { "self": { "type": "string", "format": "uri" } }, "required": [ "self" ] }, "ObjectSchemaEnum": { "type": "string", "enum": [ "object-schema" ] }, "ObjectTypeCreateQuery": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/ObjectTypeCreateQueryResourceObject" } }, "required": [ "data" ] }, "ObjectTypeCreateQueryResourceObject": { "type": "object", "properties": { "type": { "$ref": "#/components/schemas/ObjectTypeEnum" }, "attributes": { "type": "object", "properties": { "title": { "description": "The title for this object type. Note that this title moves in lockstep with the associated object-schema title.", "type": "string", "example": "Pet Care Subscription" }, "description": { "description": "The description of this object type. Note that this description moves in lockstep with the associated object-schema description.", "type": "string", "default": "", "nullable": true }, "visibility": { "description": "The visibility of this object type", "type": "string", "example": "private", "default": "private", "enum": [ "private", "shared" ], "nullable": true }, "namespace": { "description": "The namespace of this object type. Either `custom-objects` or `applications/`, where `` is the ULID of the OAuth application that owns the object type. Defaults to `custom-objects`.", "type": "string", "example": "custom-objects", "default": "custom-objects", "nullable": true }, "object-schema": { "description": "The object schema to create with this object type", "type": "object", "nullable": true, "properties": { "data": { "$ref": "#/components/schemas/EmbeddedObjectSchemaResourceObject" } }, "required": [ "data" ] } }, "required": [ "title" ] } }, "required": [ "type", "attributes" ] }, "ObjectTypeEnum": { "type": "string", "enum": [ "object-type" ] }, "PostObjectTypeResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "$ref": "#/components/schemas/ObjectTypeEnum" }, "id": { "description": "The ULID ID of the object type", "type": "string", "example": "01JXKYCN9A5M3QPVR8T2WE4BLD" }, "attributes": { "type": "object", "properties": { "title": { "description": "The title for this object type", "type": "string", "example": "Pet Care Subscription" }, "description": { "description": "The description of this object type", "type": "string" }, "status": { "description": "The status of the schema associated with this object type", "type": "string", "enum": [ "active", "draft", "publishing", "undefined" ] }, "namespace": { "description": "The namespace of this object type. Either `custom-objects` or `applications/`, where `` is the ULID of the OAuth application that owns the object type.", "type": "string" }, "created_at": { "description": "The date and time when this object type was created", "type": "string", "format": "date-time", "example": "2022-11-08T00:00:00+00:00" }, "updated_at": { "description": "The date and time when this object type was last updated", "type": "string", "format": "date-time", "example": "2022-11-08T00:00:00+00:00" } }, "required": [ "title", "description", "status", "namespace", "created_at", "updated_at" ] }, "relationships": { "type": "object", "properties": { "current-schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "$ref": "#/components/schemas/ObjectSchemaEnum" }, "id": { "description": "The current active schema for this object type", "type": "string" } }, "required": [ "type", "id" ] }, "links": { "$ref": "#/components/schemas/RelationshipLinks" } } }, "draft-schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "$ref": "#/components/schemas/ObjectSchemaEnum" }, "id": { "description": "The draft schema for this object type, if one exists", "type": "string" } }, "required": [ "type", "id" ] }, "links": { "$ref": "#/components/schemas/RelationshipLinks" } } }, "schema-versions": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "$ref": "#/components/schemas/ObjectSchemaEnum" }, "id": { "description": "All schema versions for this object type", "type": "string" } } } }, "links": { "$ref": "#/components/schemas/RelationshipLinks" } } }, "object-types": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "$ref": "#/components/schemas/ObjectTypeEnum" }, "id": { "description": "The object type relationships for this object type", "type": "string" } } } }, "links": { "$ref": "#/components/schemas/RelationshipLinks" } } }, "profile-object-types": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "$ref": "#/components/schemas/ProfileObjectTypeEnum" }, "id": { "description": "The profile object type relationships for this object type", "type": "string" } } } }, "links": { "$ref": "#/components/schemas/RelationshipLinks" } } } } }, "links": { "$ref": "#/components/schemas/ObjectLinks" } }, "required": [ "type", "id", "attributes", "links" ] }, "links": { "$ref": "#/components/schemas/ObjectLinks" }, "meta": { "$ref": "#/components/schemas/ResponseMeta" } }, "required": [ "data" ] }, "ProfileObjectTypeEnum": { "type": "string", "enum": [ "profile-object-type" ] }, "ProfileRelationshipSource": { "type": "object", "properties": { "source_id": { "description": "Data source ULID ID", "type": "string", "example": "01JXKX2HM7NV4QPTR5WE8BF6GY" }, "type": { "description": "String literal for serialization", "type": "string", "enum": [ "profile" ] }, "id_path": { "description": "JSONPath data selector to owning ID", "type": "string", "example": "$['relationships']['owners'][*]['id']" }, "related_id_paths": { "description": "List of profile identifier mappings to JSONPath data selectors", "type": "array", "items": { "$ref": "#/components/schemas/RelatedIdPath" }, "example": [ { "identifier_type": "email", "path": "$['relationships']['owners'][*]['email']" }, { "identifier_type": "phone", "path": "$['relationships']['owners'][*]['phone']" } ] }, "update_strategy": { "description": "Strategy for updating relationships with each new RawDataRecord ingestion", "type": "string", "example": "replace_from_origin", "default": "replace_from_origin", "enum": [ "additive", "replace_from_origin" ], "nullable": true } }, "required": [ "source_id", "type", "id_path", "related_id_paths" ] }, "PropertySource": { "type": "object", "properties": { "source_id": { "description": "Data source ULID ID", "type": "string", "example": "01JXKX2HM7NV4QPTR5WE8BF6GY" }, "id_path": { "description": "JSONPath ID selector", "type": "string", "example": "$['object_record']['subscription_id']" }, "data_path": { "description": "JSONPath data selector", "type": "string", "example": "$['object_record']['service_plan']" } }, "required": [ "source_id", "id_path", "data_path" ] }, "RelatedIdPath": { "type": "object", "properties": { "identifier_type": { "description": "Profile identifier type", "type": "string", "enum": [ "anonymous", "email", "external-id", "klaviyo-id", "phone" ] }, "path": { "description": "JSONPath data selector to related ID", "type": "string", "example": "$['relationships']['owners'][*]['email']" } }, "required": [ "identifier_type", "path" ] }, "RelationshipLinks": { "type": "object", "properties": { "self": { "type": "string", "format": "uri" }, "related": { "type": "string", "format": "uri" } }, "required": [ "self", "related" ] }, "ResponseMeta": { "description": "Response-level metadata", "type": "object", "properties": { "agent_hints": { "$ref": "#/components/schemas/AgentHints" } } }, "SimplePropertyMapping": { "type": "object", "properties": { "id": { "description": "Property ID", "type": "integer", "example": 1 }, "type": { "description": "String literal for serialization", "type": "string", "enum": [ "simple" ] }, "source": { "description": "Data source mapping", "example": { "source_id": "01JXKX2HM7NV4QPTR5WE8BF6GY", "id_path": "$['object_record']['subscription_id']", "data_path": "$['object_record']['service_plan']" }, "$ref": "#/components/schemas/PropertySource" } }, "required": [ "id", "type", "source" ] }, "SimpleRelationshipMapping": { "type": "object", "properties": { "relationship_id": { "description": "Object schema relationship ULID ID", "type": "string", "example": "01K97SE7GH4TE57FVNQY310QAK" }, "type": { "description": "String literal for serialization", "type": "string", "example": "simple", "enum": [ "simple" ] }, "source": { "description": "Data source mapping", "oneOf": [ { "$ref": "#/components/schemas/CustomObjectRelationshipSource" }, { "$ref": "#/components/schemas/ProfileRelationshipSource" } ] } }, "required": [ "relationship_id", "type", "source" ] }, "SourceMappingCreateQueryResourceObject": { "type": "object", "properties": { "type": { "$ref": "#/components/schemas/SourceMappingEnum" }, "attributes": { "type": "object", "properties": { "property_mappings": { "description": "A mapping of source property IDs to source mappings", "type": "array", "items": { "oneOf": [ { "$ref": "#/components/schemas/ConstantPropertyMapping" }, { "$ref": "#/components/schemas/SimplePropertyMapping" } ] }, "nullable": true }, "relationship_mappings": { "description": "A mapping of source relationship IDs to source mappings", "type": "array", "items": { "$ref": "#/components/schemas/SimpleRelationshipMapping" }, "nullable": true } } } }, "required": [ "type", "attributes" ] }, "SourceMappingEnum": { "type": "string", "enum": [ "source-mapping" ] } }, "securitySchemes": { "Klaviyo-API-Key": { "type": "apiKey", "in": "header", "name": "Authorization", "description": "Private key authentication for /api/ endpoints is performed by setting the `Authorization` header to `Klaviyo-API-Key your-private-api-key`
For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#authentication", "x-default": "Klaviyo-API-Key your-private-api-key" } } }, "tags": [ { "name": "Custom Objects", "description": "custom objects" } ] }