The Tracking Plan API lets you build applications or scripts on top of RudderStack's Tracking Plan capabilities. You can use the Tracking Plan API to:

  • Create/update/fetch tracking plans
  • Define the tracking plan rules
  • Connect a source to a tracking plan

This guide covers the details related to the usage of Tracking Plan API.

Prerequisites

The following prerequisites must be met to use the Tracking Plan API successfully:

  • Set up a source-destination connection in RudderStack. For more details, refer to Quickstart guide.

  • Generate a Personal Access Token in the RudderStack dashboard to authenticate the API successfully.

API Authorization

RudderStack uses Basic Authentication for authenticating all the API requests.

All the popular HTTP clients \(e.g. CURL, Postman, HTTPie\) have default support for Basic Authentication.

The Basic Authentication for this API requires a username and password, where:

  • The username is the email address you used to sign up for RudderStack.
  • The password is the personal access token generated previously.

For example, if the email address is name@surname.com and the personal access token is 1zl4GJkLu0HsBdrDK88NgYZzY2E, your request must have the following HTTP header:

Authorization: Basic bmFtZUBzdXJuYW1lLmNvbToxemw0R0prTHUwSHNCZHJESzg4TmdZWnpZMkU=
In case of the Invalid Authorization Header error, verify if the email address and the personal access token are valid.
You can use this Basic Authentication Header Generator to generate the HTTP header.

Tracking Plan API usage

The Tracking Plan API is divided into the following sections depending on its usage:

Tracking Plan APIDescription
Tracking PlansThis section demonstrates all the requests related to tracking plans, such as, creating, updating, upserting or fetching the tracking plans.
Tracking Plan RulesThis section demonstrates all the requests related to events, such as, creating, updating, linking/unlinking or fetching events.
Source Tracking Plan ConnectionsThis section demonstrates all the requests related to tracking plan configurations for a given source, such as, creating/updating, fetching, connecting, listing or deleting/removing source-tracking plan connections.

Refer to the Tracking Plan API documentation in Postman for detailed information on the API methods.


Contact us

For more information on the topics covered on this page, email us or start a conversation in our Slack community.

On this page