Use the base URL for your API requests depending on your region:
https://api.rudderstack.com/v2
https://api.eu.rudderstack.com/v2
Manage tracking plans
This section covers the API endpoints for creating and managing your tracking plans.
Create tracking plan
POST
/catalog/tracking-plans
Request body
name
Required
String
Tracking plan name.
Note that:
The name must be between 3 and 65 characters and should start with a letter.
It must contain only letters, numbers, underscores, commas, spaces, dashes, and dots.
description
Optional
String
Tracking plan description.
Example request
POST/v2/catalog/tracking-plansHTTP/1.1Host:api.rudderstack.comContent-Type:application/jsonAuthorization:Bearer <SERVICE_ACCESS_TOKEN>Content-Length:83{"name":"Product Ordered Plan","description":"Tracking plan for users placing an order for the product."}
curl --location 'https://api.rudderstack.com/v2/catalog/tracking-plans'\
--header 'Content-Type: application/json'\
--header 'Authorization: Bearer <SERVICE_ACCESS_TOKEN>'\
--data '{
"name": "Product Ordered Plan",
"description": "Tracking plan for users placing an order for the product."
}'
Example response
{"id":"tp_5gopz6tfKxAjpS4TjuqVIeTdm7T","name":"Product Ordered Plan","description":"Tracking plan for users placing an order for the product.","version":1,"workspaceId":"1hitizAoFT91DD6rfFhBjiTex3e","creationType":"Data catalog API","createdAt":"2024-05-22T10:34:03.016Z","updatedAt":"2024-05-22T10:34:03.016Z"}
Response codes
Code
Description
200
Tracking plan is successfully created. RudderStack also returns an ID for the newly created tracking plan.
{"trackingPlans":[{"id":"tp_5gopz6tfKxAjpS4TjuqVIeTdm7T","name":"Product Ordered Plan","description":"Tracking plan for users placing an order for the product.","version":1,"createdAt":"2024-05-22T13:07:18.617Z","updatedAt":"2024-05-22T13:07:18.617Z","creationType":"Data catalog API","workspaceId":"1hitizAoFT91DD6rfFhBjiTex3e"},{"id":"tp_2rKxjFu6R1qot19aWhTW7W7Ojew","name":"Order Completed Plan","description":"Tracking plan for users completing an order for the product.","version":4,"createdAt":"2024-01-30T15:41:14.446Z","updatedAt":"2024-02-01T08:59:15.095Z","creationType":"Event Audit API","workspaceId":"1hitizAoFT91DD6rfFhBjiTex3e"}]}
Response codes
Code
Description
200
List of all tracking plans in the associated workspace.
Get tracking plan by ID
GET
/catalog/tracking-plans/{trackingPlanId}
Path parameters
trackingPlanId
Required
String
Tracking plan ID.
version
Optional
String
Tracking plan version. Note that it must be a number.
{"id":"tp_5gopz6tfKxAjpS4TjuqVIeTdm7T","name":"Product Ordered Plan","description":"Tracking plan for users placing an order for the product.","version":1,"workspaceId":"1hitizAoFT91DD6rfFhBjiTex3e","creationType":"Data catalog API","createdAt":"2024-05-22T13:07:18.617Z","updatedAt":"2024-05-22T13:07:18.617Z"}
Response codes
Code
Description
200
Tracking plan is updated successfully.
404
Tracking plan not found for the specified ID.
Update tracking plan
PUT
/catalog/tracking-plans/{trackingPlanId}
Path parameters
trackingPlanId
Required
String
Tracking plan ID.
Request body
To update the tracking plan, at least one of the following parameters is required:
name
String
Tracking plan name.
Note that:
The name must be between 3 and 65 characters and should start with a letter.
It must contain only letters, numbers, underscores, commas, spaces, dashes, and dots.
description
String
Tracking plan description.
Example request
PUT/v2/catalog/tracking-plans/tp_5gopz6tfKxAjpS4TjuqVIeTdm7THTTP/1.1Host:api.rudderstack.comContent-Length:87{
"name": "New Product Ordered Plan",
"description": "Updated tracking plan for users placing an order for the product."
}
curl --location --request PUT 'https://api.rudderstack.com/v2/catalog/tracking-plans/tp_5gopz6tfKxAjpS4TjuqVIeTdm7T'\
--data '{
"name": "New Product Ordered Plan",
"description": "Updated tracking plan for users placing an order for the product."
}'
Example response
{"id":"tp_5gopz6tfKxAjpS4TjuqVIeTdm7T","name":"New Product Ordered Plan","description":"Updated tracking plan for users placing an order for the product.","version":2,"workspaceId":"1hitizAoFT91DD6rfFhBjiTex3e","creationType":"Data catalog API","createdAt":"2024-05-22T10:34:03.016Z","updatedAt":"2024-05-22T10:36:49.252Z"}
Response codes
Code
Description
200
Tracking plan is updated successfully.
400
Bad or invalid request.
Delete tracking plan
Deleted tracking plans cannot be recovered or restored.
{"name":"New Product Ordered Plan","version":1,"description":"Updated tracking plan for users placing an order for the product.","creationType":"Data catalog API","workspaceId":"1hitizAoFT91DD6rfFhBjiTex3e","createdBy":"2KDKycoVHAOLttVvzBiqw12O3Hr","updatedBy":null,"createdAt":"2024-05-22T13:41:33.057Z","updatedAt":"2024-05-22T13:41:33.057Z","events":[]}
Response codes
Code
Description
200
Tracking plan is deleted successfully.
400
Bad or invalid request.
Manage tracking plan events
This section covers the API endpoints for upserting and managing events in your tracking plans.
The Data Catalog API creates the events and properties in the data catalog only if they do not exist already.
Upsert event to tracking plan
While upserting an event to a tracking plan, make sure the schema of the properties adheres to the advanced rules set for those properties in the data catalog. Otherwise, RudderStack will drop the schema and give the below error:
“Property with name [${prop.name}] and type [${prop.type}] already exists with different advanced keywords.”
If you get this error, you can update the existing catalog property by adding required advanced rules and try again.
Upsert event with rules
This endpoint will be deprecated soon.
PATCH
/catalog/tracking-plans/{trackingPlanId}/events
Path parameters
trackingPlanId
Required
String
Tracking plan ID.
Request body
name
Required
String
Name of the event to be upserted.
Note that:
The name must be between 3 and 65 characters and should start with a letter.
It must contain only letters, numbers, underscores, commas, spaces, dashes, and dots.
For non-track events, the name should be an empty string.
description
Optional
String
Event description.
eventType
Required
String
Type of event to be upserted.
Note that:
Once set, the event type cannot be updated later.
Allowed event types are track, identify, group, page, and screen.
categoryId
Optional
String
Category ID of the event. It should be a valid, non-empty string.
rules
Required
Object
JSON schema against which RudderStack validates the event. The event rules cannot be empty.
Note: The keywords defined for a property in the rules parameter are the same as the advanced rules defined for a property in the dashboard.
PATCH/v2/catalog/tracking-plans/tp_5gopz6tfKxAjpS4TjuqVIeTdm7T/eventsHTTP/1.1Host:api.rudderstack.comContent-Type:application/jsonAuthorization:••••••Content-Length:955{"name":"Product Viewed","eventType":"track","description":"User viewed a product.","categoryId":null,"rules":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"properties":{"type":"object","required":["amount"],"additionalProperties":false,"properties":{"amount":{"type":["number"]},}}}}}
The name must be of at least one character and should start with a letter.
It must contain only letters, numbers, underscores, and spaces.
description
Optional
String
Property description.
type
Required
String
Data type of the property.
Note that:
The data type must be either string, integer, number, object, array, boolean, null, or multi data type.
If not explicitly set, RudderStack allows all the above data types for the property, by default.
propConfig
Required
Object
Advanced rules for the property. See JSON Schema for the complete list of supported keywords.
required
Optional
Boolean
Determines whether the property must be present in the event.
additionalProperties
Optional
Boolean
This parameter is only applicable for arrays and objects if nested properties are present. It determines if additional properties (apart from the provided nested properties) should be allowed.
metadata
Optional
Object
Additional metadata for the property containing generic keywords.
properties
Required only for nested properties
Array
Details of the nested properties.
Example request
POST/v2/catalog/tracking-plans/tp_2u9kdo9I3y0ou8O722ZTc8SOgMk/eventsHTTP/1.1Host:api.rudderstack.comContent-Type:application/jsonAuthorization:••••••Content-Length:955{"description":"Triggered when user views a product.","eventType":"track","name":"Product Viewed","properties":[{"name":"product_details","description":"Product details","type":"object","propConfig":{},"required":false,"additionalProperties":true,"metadata":{},"properties":[{"name":"id","description":"Product ID","type":"string","propConfig":{"minLength":1},"required":true,"additionalProperties":true,"metadata":{}}]},{"name":"amount","description":"Product amount","type":"number, string","propConfig":{},"required":true,"additionalProperties":true,"metadata":{},"properties":[]}]}
{"id":"tp_2u9kdo9I3y0ou8O722ZTc8SOgMk","name":"Product Viewed Plan","version":3,"description":"User viewed a product.","creationType":"Data catalog API","workspaceId":"1hitizAoFT91DD6rfFhBjiTex3e","createdAt":"2024-05-22T10:34:03.016Z","updatedAt":"2024-05-22T11:01:24.706Z"}
Response codes
Code
Description
200
Event is upserted to the tracking plan successfully. The API gives the updated tracking plan information as a response.
400
Bad or invalid request.
Upsert event with identifiers
This endpoint has the same functionality as Upsert event with properties except that this request only requires the identifiers (tracking plan ID, event ID, and property IDs).
PUT
/catalog/tracking-plans/{trackingPlanId}/events
Path parameters
trackingPlanId
Required
String
Tracking plan ID.
Request body
id
Required
String
Event ID.
RudderStack automatically fetches the event name, description, type, and other event details from this ID.
properties
Required
Array
The event properties against which RudderStack validates the event. It cannot be empty.
See Properties structure section below for more information on this parameter.
Properties structure
id
Required
String
Property ID.
RudderStack automatically fetches the property name, description, type, and other details from this ID.
required
Optional
Boolean
Determines whether the property must be present in the event.
additionalProperties
Optional
Boolean
This parameter is only applicable for arrays and objects if nested properties are present. It determines if additional properties (apart from the provided nested properties) should be allowed.
metadata
Optional
Object
Additional metadata for the property containing generic keywords.
{"data":[{"id":"ev_2gotMKGuOtdDY4XbSdKjkwk4qc2","name":"Product Viewed","description":"User viewed a product.","eventType":"track","categoryId":null,"workspaceId":"1hitizAoFT91DD6rfFhBjiTex3e","createdBy":"2KDKycoVHAOLttVvzBiqw12O3Hr","updatedBy":null,"createdAt":"2024-05-22T11:01:24.706Z","updatedAt":"2024-05-22T11:01:24.706Z","identitySection":"properties","additionalProperties":true,}],"total":1,"currentPage":1,"pageSize":50}
Response codes
Code
Description
200
All the events in the tracking plan are fetched successfully.
The response when you add format=schema as the query parameter is shown:
{"id":"ev_2gotMKGuOtdDY4XbSdKjkwk4qc2","name":"Product Viewed","description":"User viewed a product.","eventType":"track","categoryId":null,"workspaceId":"1hitizAoFT91DD6rfFhBjiTex3e","createdBy":"2KDKycoVHAOLttVvzBiqw12O3Hr","updatedBy":null,"createdAt":"2024-05-22T11:01:24.706Z","updatedAt":"2024-05-22T11:01:24.706Z","identitySection":"properties","rules":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"properties":{"type":"object","required":["amount"],"additionalProperties":false,"properties":{"amount":{"type":["number"]},}}}}}
The response when you add format=properties as the query parameter is shown:
{"id":"ev_2gotMKGuOtdDY4XbSdKjkwk4qc2","name":"Product Viewed","description":"User viewed a product.","eventType":"track","categoryId":null,"workspaceId":"1zitShAoFT91DD6rfFhBjiTex3e","createdBy":"2KDKycoVHAOLttVvzBiqw12O3Hr","updatedBy":"2KDKycoVHAOLttVvzBiqw12O3Hr","createdAt":"2024-05-22T11:22:32.710Z","updatedAt":"2025-03-11T04:44:43.633Z","identitySection":"properties","additionalProperties":false,"properties":[{"id":"prop_2bc0rhFC4oOKa8VCfAhMCkN31rf","name":"amount","description":"Product amount","type":"number, string","propConfig":{},"required":true,"additionalProperties":false,"metadata":{},"properties":[]}]}
Response codes
Code
Description
200
Event specified by the ID is fetched successfully.
404
Tracking plan event not found for the specified ID.
The request body must not be empty. Otherwise, you will encounter an error.
config
Required
Object
Tracking plan configuration for the source. See Config object structure below for more information.
Config object structure
The config object provided in the request body contains the source-specific tracking plan settings for validating the individual events. A sample object is shown below:
{"config":{"page":{"unplannedProperties":"forward",// or "drop"
"anyOtherViolation":"forward",// or "drop"
"propagateValidationErrors":"true",// or "false"
},"group":{"unplannedProperties":"forward","anyOtherViolation":"forward","propagateValidationErrors":"true"},"track":{"allowUnplannedEvents":"true","unplannedProperties":"forward","anyOtherViolation":"forward","propagateValidationErrors":"true",// or "false"
},"global":{"allowUnplannedEvents":"true","unplannedProperties":"forward","anyOtherViolation":"forward","propagateValidationErrors":"true"},"screen":{"unplannedProperties":"forward","anyOtherViolation":"forward","propagateValidationErrors":"true"},"identify":{"unplannedProperties":"forward","anyOtherViolation":"forward","propagateValidationErrors":"true"}}}
The event-level settings that you can define within the config object are described below. See Source-specific tracking plan settings for more information:
Field
Description
allowUnplannedEvents
Applicable for track object only.
Boolean that determines if RudderStack should drop all events that do not match the predefined event names in the tracking plan.
unplannedProperties
Acceptable values are forward and drop.
Determines if RudderStack should forward or drop events that contain properties not matching the list of predefined properties for the specific event.
anyOtherViolation
Acceptable values are forward and drop.
Determines if RudderStack should forward or drop events with any other violations that include Type Mismatch, Required Fields Missing, and others outlined in the Violation types section.
propagateValidationErrors
Boolean that determines if RudderStack should capture the validation errors in the event’s context object and send them downstream (user transformations and destinations).
Note that:
You need not provide the tracking plan settings for all events. For example, you can include only the track and global objects within config. However, note that you must not provide a blank event object. If included, you must define at least one setting for that event.
RudderStack uses the default settings for the events that you do not specify explicitly and validates them accordingly.
The request body must not be empty. Otherwise, you will encounter an error.
config
Required
Object
Tracking plan configuration for the source. See Config object structure below for more information.
Config object structure
The config object provided in the request body contains the source-specific tracking plan settings for validating the individual events. A sample object is shown below:
The event-level settings that you can define within the config object are described below. See Source-specific tracking plan settings for more information:
Field
Description
allowUnplannedEvents
Applicable for track object only.
Boolean that determines if RudderStack should drop all events that do not match the predefined event names in the tracking plan.
unplannedProperties
Acceptable values are forward and drop.
Determines if RudderStack should forward or drop events that contain properties not matching the list of predefined properties for the specific event.
anyOtherViolation
Acceptable values are forward and drop.
Determines if RudderStack should forward or drop events with any other violations that include Type Mismatch, Required Fields Missing, and others outlined in the Violation types section.
propagateValidationErrors
Boolean that determines if RudderStack should capture the validation errors in the event’s context object and send them downstream (user transformations and destinations).
Note that:
You need not provide the tracking plan settings for all events. For example, you can include only the track and global objects within config. However, note that you must not provide a blank event object. If included, you must define at least one setting for that event.
RudderStack uses the default settings for the events that you do not specify explicitly and validates them accordingly.
This site uses cookies to improve your experience while you navigate through the website. Out of
these
cookies, the cookies that are categorized as necessary are stored on your browser as they are as
essential
for the working of basic functionalities of the website. We also use third-party cookies that
help
us
analyze and understand how you use this website. These cookies will be stored in your browser
only
with
your
consent. You also have the option to opt-out of these cookies. But opting out of some of these
cookies
may
have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This
category only includes cookies that ensures basic functionalities and security
features of the website. These cookies do not store any personal information.
This site uses cookies to improve your experience. If you want to
learn more about cookies and why we use them, visit our cookie
policy. We'll assume you're ok with this, but you can opt-out if you wish Cookie Settings.