Create Tracking Plan

POST {{host}}/v1beta/{{workspace_name}}/tracking-plans/

Request Body

{"tracking_plan"=>{"display_name"=>"Kicks App", "rules"=>{"global"=>{"$schema"=>"http://json-schema.org/draft-04/schema#", "type"=>"object", "properties"=>{"context"=>{"type"=>"object", "properties"=>{"librarry"=>{"type"=>["object"]}}, "required"=>["library"]}}}, "events"=>[{"name"=>"Order Completed", "description"=>"Who bought what", "rules"=>{"$schema"=>"http://json-schema.org/draft-04/schema#", "type"=>"object", "properties"=>{"properties"=>{"type"=>"object", "properties"=>{"product"=>{"type"=>["string"]}, "price"=>{"type"=>["number"]}, "amount"=>{"type"=>["number"]}}, "required"=>["product", "price", "amount"]}}}}], "identify"=>{"$schema"=>"http://json-schema.org/draft-04/schema#", "type"=>"object", "properties"=>{"traits"=>{"type"=>"object", "properties"=>{"name"=>{"type"=>["string"]}, "age"=>{"type"=>["number"]}, "occupation"=>{"type"=>["string"]}}, "required"=>["name"]}}}, "group"=>{"$schema"=>"http://json-schema.org/draft-04/schema#", "type"=>"object", "properties"=>{"traits"=>{"type"=>"object", "properties"=>{"company"=>{"type"=>["object"]}}, "required"=>["company"]}}}}}}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring

RESPONSES

status: OK

{"tracking_plan":{"display_name":"Kicks App","rules":{"global":{"$schema":"http://json-schema.org/draft-04/schema#","type":"object","properties":{"context":{"type":"object","properties":{"librarry":{"type":["object"]}},"required":["library"]},"properties":{},"traits":{}}},"events":[{"name":"Order Completed","version":1,"description":"Who bought what","rules":{"$schema":"http://json-schema.org/draft-04/schema#","type":"object","properties":{"context":{},"properties":{"type":"object","properties":{"product":{"type":["string"]},"price":{"type":["number"]},"amount":{"type":["number"]}},"required":["product","price","amount"]},"traits":{}}}}],"identify":{"$schema":"http://json-schema.org/draft-04/schema#","type":"object","properties":{"context":{},"properties":{},"traits":{"type":"object","properties":{"name":{"type":["string"]},"age":{"type":["number"]},"occupation":{"type":["string"]}},"required":["name"]}}},"group":{"$schema":"http://json-schema.org/draft-04/schema#","type":"object","properties":{"context":{},"properties":{},"traits":{"type":"object","properties":{"company":{"type":["object"]}},"required":["company"]}}}}}}