Update Tracking Plan
PUT {{host}}/v1beta/{{tracking_plan_name}}
To update a tracking plan field, include it in update_mask.paths
. For example, if tracking_plan.rules
is included in the paths array, existing rules will be replaced by rules specified in the request body. If a field is listed in the paths array, but is not included in the request body, it will be overwritten with an empty object.
It is expected that including a null
enum value as a property field will return a tracking plan that denotes that value as a string (null
). See documented example call.
Depending on the size of the tracking plan, the returned payload might not include the updated events. Use the GET endpoint or the UI instead.
Emojis are not currently supported in tracking plan JSON schemas.
Request Body
{"update_mask"=>{"paths"=>["tracking_plan.display_name", "tracking_plan.rules"]}, "tracking_plan"=>{"display_name"=>"Kicks App - Updated", "rules"=>{"global"=>{"$schema"=>"http://json-schema.org/draft-04/schema#", "type"=>"object", "properties"=>{"context"=>{"type"=>"object", "required"=>["userAgent"]}}, "required"=>["context"]}, "events"=>[{"name"=>"Product Viewed", "description"=>"Who checked out what", "rules"=>{"$schema"=>"http://json-schema.org/draft-04/schema#", "type"=>"object", "properties"=>{"properties"=>{"type"=>"object", "properties"=>{"product"=>{"type"=>["string"]}}, "required"=>["product"]}}, "required"=>["properties"]}}]}}}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string |
RESPONSES
status: OK
{"name":"{{tracking_plan_name}}","display_name":"Kicks App - Updated","rules":{"identify_traits":[],"group_traits":[],"events":[{"name":"Product Viewed","version":1,"description":"Who checked out what","rules":{"$schema":"http://json-schema.org/draft-04/schema#","type":"object","properties":{"traits":{},"properties":{"type":"object","properties":{"product":{"type":["string"]}},"required":["product"]},"context":{}},"required":["properties"]}}],"global":{"required":["context"],"$schema":"http://json-schema.org/draft-04/schema#","type":"object","properties":{"context":{"type":"object","properties":{"userAgent":{}},"required":["userAgent"]},"traits":{},"properties":{}}}},"create_time":"2019-02-05T00:28:31Z","update_time":"2019-02-05T00:32:15Z"}