sv# Import Tracking Plan
Import tracking plan using Avo API
The Import API allows you to import a tracking plan from a CSV file into a specific branch in your Avo workspace.
Endpoint
https://api.avo.app/workspaces/:workspaceId/branches/:branchId/import/v1
:workspaceId
is the ID of your workspace. You’ll find it in the URL of your avo tab after /schemas/
. :branchId
is the ID of the branch you want to import into. If you open a branch in Avo you can find it in the URL after /branches/
. For the main branch simply use main
. Note that the branch id is not the same as the branch name.
Important Restrictions:
- You cannot import directly to the main branch if the “Protected main branch” setting is enabled in your workspace
- You cannot import to a branch that is closed or merged
Authentication
This endpoint requires an authorization header containing a Base64 encoded service account name and secret.
Rate Limit
We currently soft-enforce 1/req/s rate limit per service account for this endpoint. Please reach out to us if you have a use case in mind that requires a higher rate limit.
Parameters
- workspaceId
Locate your workspaceId in the URL
avo.app/schemas/:workspaceId
- branchId
Locate your branchId by switching onto the branch and checking the URL
avo.app/schemas/:workspaceId/branches/:branchId
- For the main branch, use
main
as the ID (if “Protected main branch” is disabled)
- Base64 encoding secret header
The base64 encoded token expects name:secret
See more on authorization
Request Body
The request body should be the CSV content as a string. The request must include a Content-Type: text/csv
header.
Your CSV content following the format described in the [importing documentation](/publishing/import/importing)
Response
On success, the API returns a JSON object with the import results:
{
"message": "Import completed",
"result": {
"newEvents": 5,
"updatedEvents": 2,
"newProperties": 10,
"updatedProperties": 3,
"newSources": 1,
"newStakeholderDomains": 2
}
}
Response Fields
message
: A success message indicating the import completedresult
: An object containing statistics about the import:newEvents
: Number of new events createdupdatedEvents
: Number of existing events that were updatednewProperties
: Number of new properties createdupdatedProperties
: Number of existing properties that were updatednewSources
: Number of new sources creatednewStakeholderDomains
: Number of new stakeholder domains created
Example Usage
Request
$ curl -H "Authorization: Basic <Base64 encoded token>" \
-H "Content-Type: text/csv" \
-X POST https://api.avo.app/workspaces/:workspaceId/branches/main/import/v1 \
-d 'KPI,Event Category,Event Name,Event Description,Event Property Name,Property Description,Property Value Type,Is Property Required?,Is Property Array?,Property Enumeration Options,Platforms,Status,Code Snippet\n,,Imported Event I,Event sent when a user clicks the import button. ,,,,,,,\"iOS, Android, Web\",,'
Response
{
"message": "Import completed",
"result": {
"newEvents": 1,
"updatedEvents": 0,
"newProperties": 0,
"updatedProperties": 0,
"newSources": 0,
"newStakeholderDomains": 0
}
}