{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","description":"Create an object schema.<br><br>*Rate limits*:<br>Burst: `3/s`<br>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_schema.json)","properties":{"query":{"type":"object","properties":{"fields[object-schema]":{"type":"array","items":{"type":"string","enum":["description","id","properties","published_at","required","status","title","visibility"]},"description":"For more information please visit https://developers.klaviyo.com/en/v2026-10-15/reference/api-overview#sparse-fieldsets"}},"required":[],"additionalProperties":false},"headers":{"type":"object","properties":{"revision":{"type":"string","default":"2026-10-15","enum":["2026-10-15"],"description":"API endpoint revision (format: YYYY-MM-DD[.suffix])"}},"required":["revision"],"additionalProperties":false},"body":{"$ref":"#/definitions/ObjectSchemaCreateQuery"}},"required":["headers","body"],"additionalProperties":false,"definitions":{"ObjectSchemaCreateQuery":{"type":"object","properties":{"data":{"$ref":"#/definitions/ObjectSchemaCreateQueryResourceObject"}},"required":["data"]},"ObjectSchemaCreateQueryResourceObject":{"type":"object","properties":{"type":{"$ref":"#/definitions/ObjectSchemaEnum"},"attributes":{"type":"object","properties":{"title":{"description":"The title for this object schema","type":"string","examples":["Pet Care Subscription"]},"properties":{"description":"Properties of the object schema","type":"array","items":{"$ref":"#/definitions/APISchemaProperty"}},"description":{"description":"The description of this object schema","type":["string","null"]},"status":{"description":"The status to create this object schema in. Defaults to `draft`. Setting `active` activates the schema immediately; while activation is in progress, reads may report a `publishing` status.","type":["string","null"],"default":"draft","enum":["active","draft"],"examples":["draft"]},"required":{"description":"Properties that are required on the object schema","type":["array","null"],"items":{"type":"string"}},"source-mapping":{"description":"The source mapping to create with this object schema","type":["object","null"],"properties":{"data":{"$ref":"#/definitions/SourceMappingCreateQueryResourceObject"}},"required":["data"]}},"required":["title","properties"]},"relationships":{"type":"object","properties":{"object-type":{"type":"object","properties":{"data":{"type":"object","properties":{"type":{"$ref":"#/definitions/ObjectTypeEnum"},"id":{"description":"The object type to which the object schema belongs","type":"string","examples":["01K61DKJ7EKJ0ES9VE456XF5JG"]}},"required":["type","id"]}}}}}},"required":["type","attributes"]},"ObjectSchemaEnum":{"type":"string","enum":["object-schema"]},"APISchemaProperty":{"type":"object","properties":{"id":{"description":"The ID of the schema property. Must be a postive integer.","type":"integer","examples":[1]},"name":{"description":"The name of the schema property","type":"string","examples":["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","null"],"default":""}},"required":["id","name","type"]},"SourceMappingCreateQueryResourceObject":{"type":"object","properties":{"type":{"$ref":"#/definitions/SourceMappingEnum"},"attributes":{"type":"object","properties":{"property_mappings":{"description":"A mapping of source property IDs to source mappings","type":["array","null"],"items":{"oneOf":[{"$ref":"#/definitions/ConstantPropertyMapping"},{"$ref":"#/definitions/SimplePropertyMapping"}]}},"relationship_mappings":{"description":"A mapping of source relationship IDs to source mappings","type":["array","null"],"items":{"$ref":"#/definitions/SimpleRelationshipMapping"}}}}},"required":["type","attributes"]},"ObjectTypeEnum":{"type":"string","enum":["object-type"]},"SourceMappingEnum":{"type":"string","enum":["source-mapping"]},"ConstantPropertyMapping":{"type":"object","properties":{"id":{"description":"Property ID. Must be a positive integer.","type":"integer","examples":[1]},"type":{"description":"String literal for serialization","type":"string","enum":["constant"]},"value":{"description":"Constant value assigned to every record","oneOf":[{"type":"integer"},{"type":"number"},{"type":"string"},{"type":"boolean"}],"examples":["active"]}},"required":["id","type","value"]},"SimplePropertyMapping":{"type":"object","properties":{"id":{"description":"Property ID","type":"integer","examples":[1]},"type":{"description":"String literal for serialization","type":"string","enum":["simple"]},"source":{"$ref":"#/definitions/PropertySource"}},"required":["id","type","source"]},"SimpleRelationshipMapping":{"type":"object","properties":{"relationship_id":{"description":"Object schema relationship ULID ID","type":"string","examples":["01K97SE7GH4TE57FVNQY310QAK"]},"type":{"description":"String literal for serialization","type":"string","enum":["simple"],"examples":["simple"]},"source":{"description":"Data source mapping","oneOf":[{"$ref":"#/definitions/CustomObjectRelationshipSource"},{"$ref":"#/definitions/ProfileRelationshipSource"}]}},"required":["relationship_id","type","source"]},"PropertySource":{"type":"object","properties":{"source_id":{"description":"Data source ULID ID","type":"string","examples":["01JXKX2HM7NV4QPTR5WE8BF6GY"]},"id_path":{"description":"JSONPath ID selector","type":"string","examples":["$['object_record']['subscription_id']"]},"data_path":{"description":"JSONPath data selector","type":"string","examples":["$['object_record']['service_plan']"]}},"required":["source_id","id_path","data_path"]},"CustomObjectRelationshipSource":{"type":"object","properties":{"source_id":{"description":"Data source ULID ID","type":"string","examples":["01JXKX2HM7NV4QPTR5WE8BF6GY"]},"type":{"description":"String literal for serialization","type":"string","enum":["custom-object"]},"id_path":{"description":"JSONPath data selector to owning ID","type":"string","examples":["$['object_record']['subscription_id']"]},"related_id_path":{"description":"JSONPath data selector to related ID","type":"string","examples":["$['object_record']['pet_id']"]},"update_strategy":{"description":"Strategy for updating relationships with each new RawDataRecord ingestion","type":["string","null"],"default":"replace_from_origin","enum":["additive","replace_from_origin"],"examples":["replace_from_origin"]}},"required":["source_id","type","id_path","related_id_path"]},"ProfileRelationshipSource":{"type":"object","properties":{"source_id":{"description":"Data source ULID ID","type":"string","examples":["01JXKX2HM7NV4QPTR5WE8BF6GY"]},"type":{"description":"String literal for serialization","type":"string","enum":["profile"]},"id_path":{"description":"JSONPath data selector to owning ID","type":"string","examples":["$['relationships']['owners'][*]['id']"]},"related_id_paths":{"description":"List of profile identifier mappings to JSONPath data selectors","type":"array","items":{"$ref":"#/definitions/RelatedIdPath"},"examples":[[{"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","null"],"default":"replace_from_origin","enum":["additive","replace_from_origin"],"examples":["replace_from_origin"]}},"required":["source_id","type","id_path","related_id_paths"]},"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","examples":["$['relationships']['owners'][*]['email']"]}},"required":["identifier_type","path"]}}},"name":"Create Object Schema","id":"klaviyo.create_object_schema","example":{"headers":{"revision":"2026-10-15"},"body":{"data":{"type":"object-schema","attributes":{"title":"Pet Care Subscription","properties":[]}}}},"maxRequests":1,"summary":false}}