---
title: Import a tracking plan from CSV
description: "Sends a tracking-plan CSV as the request body and applies it to a new import branch. This endpoint always imports into a branch and never writes to main dire…"
product: general
lang: en
last_updated: 2026-11-18
token_estimate: 3455
---
# Import a tracking plan from CSV

## Import a tracking plan from CSV

**POST** `/v1/projects/{project_id}/tracking-plan/import`

Full URL: `https://developer-api.amplitude.com/v1/projects/{project_id}/tracking-plan/import`

> For AI agents: a documentation index is available at [/docs/llms.txt](/docs/llms.txt). Append `.md` to any page URL for markdown, or send `Accept: text/markdown`.

**Servers:**
- Production (US): `https://developer-api.amplitude.com/v1/projects/{project_id}/tracking-plan/import`
- Production (EU): `https://developer-api.eu.amplitude.com/v1/projects/{project_id}/tracking-plan/import`

Import a tracking plan from CSV

Sends a tracking-plan CSV as the request body and applies it to a new import branch.
This endpoint always imports into a branch and never writes to main directly.
Creating the branch publishes any pending changes on main's staging version
first, as creating a branch in the product does. When the import fails after
the branch was created (422 for invalid rows, 502 for a server failure), the
error payload includes `details.branch` so callers can inspect or delete the
branch. A duplicate `branch_name` returns 409 before anything is created.

## Authorizations

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| Authorization | string | Yes | — | http |

## Path parameters

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| project_id (path) | string | Yes | 12345 | Amplitude project identifier, backed by the canonical app ID. Constraints: pattern: ^[0-9]+$ |

## Query parameters

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| branch_name (query) | string | No | — | Optional name for the import branch, 1 to 256 characters. When omitted, the import uses `import`, or `import-N` if that name is taken. A name that already exists returns 409. Constraints: min length: 1, max length: 256 |

## Body (text/csv)

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| value | string | No | — | — |

## Response (application/json)

**201** — Import completed on an import branch.

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| data | object | Yes | — | — |
| data.object | string | Yes | — | Allowed values: tracking_plan_import |
| data.project_id | string | Yes | — | — |
| data.branch_id | string | Yes | — | — |
| data.branch_name | string | No | — | Constraints: nullable |
| data.current_version_id | string | No | — | Constraints: nullable |
| data.staging_version_id | string | No | — | Constraints: nullable |
| data.import_type | string | Yes | — | Public import target type. `events` includes event, template, event-property, and template-property rows; `user_properties` includes user-property rows. Allowed values: events, user_properties |
| data.event_count | integer | Yes | — | — |
| data.template_count | integer | Yes | — | — |
| data.user_property_count | integer | Yes | — | — |
| data.breakdown | object | No | — | Per-type import counters. Units: - templates/events/user_properties: definition rows changed. - template_properties/event_properties `created|updated`:   property definition rows changed. - template_properties/event_properties `unmapped`: properties   removed from templates/events; the property definition is kept. Constraints: nullable |
| data.breakdown.templates | object | No | — | — |
| data.breakdown.templates.created | integer | Yes | — | — |
| data.breakdown.templates.updated | integer | Yes | — | — |
| data.breakdown.templates.removed | integer | Yes | — | — |
| data.breakdown.template_properties | object | No | — | — |
| data.breakdown.template_properties.created | integer | Yes | — | — |
| data.breakdown.template_properties.updated | integer | Yes | — | — |
| data.breakdown.template_properties.unmapped | integer | Yes | — | — |
| data.breakdown.events | object | No | — | — |
| data.breakdown.events.created | integer | Yes | — | — |
| data.breakdown.events.updated | integer | Yes | — | — |
| data.breakdown.events.removed | integer | Yes | — | — |
| data.breakdown.event_properties | object | No | — | — |
| data.breakdown.event_properties.created | integer | Yes | — | — |
| data.breakdown.event_properties.updated | integer | Yes | — | — |
| data.breakdown.event_properties.unmapped | integer | Yes | — | — |
| data.breakdown.user_properties | object | No | — | — |
| data.breakdown.user_properties.created | integer | Yes | — | — |
| data.breakdown.user_properties.updated | integer | Yes | — | — |
| data.breakdown.user_properties.removed | integer | Yes | — | — |

```json
{
  "data": {
    "object": "tracking_plan_import",
    "project_id": "string",
    "branch_id": "string",
    "branch_name": "string",
    "current_version_id": "string",
    "staging_version_id": "string",
    "import_type": "events",
    "event_count": 0,
    "template_count": 0,
    "user_property_count": 0,
    "breakdown": {
      "templates": {
        "created": 0,
        "updated": 0,
        "removed": 0
      },
      "template_properties": {
        "created": 0,
        "updated": 0,
        "unmapped": 0
      },
      "events": {
        "created": 0,
        "updated": 0,
        "removed": 0
      },
      "event_properties": {
        "created": 0,
        "updated": 0,
        "unmapped": 0
      },
      "user_properties": {
        "created": 0,
        "updated": 0,
        "removed": 0
      }
    }
  }
}
```

**400**

**401**

**403**

**404**

**409** — The requested `branch_name` already exists. Nothing was created; choose
another name.


| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| type | string | Yes | — | Constraints: format: uri |
| title | string | Yes | — | — |
| status | integer | Yes | — | Constraints: min: 400, max: 599 |
| detail | string | No | — | Constraints: nullable |
| details | object | No | — | Constraints: nullable |
| instance | string | No | — | Constraints: format: uri, nullable |
| error_code | string | Yes | — | — |
| retryable | boolean | Yes | — | — |
| retry_after_seconds | integer | No | — | Constraints: nullable, min: 0 |
| validation_errors | object[] | No | — | Constraints: nullable |

```json
{
  "type": "https://example.com",
  "title": "The requested `branch_name` already exists. Nothing was created; choose\nanother name.\n",
  "status": 409,
  "detail": "string",
  "details": {},
  "instance": "https://example.com",
  "error_code": "string",
  "retryable": true,
  "retry_after_seconds": 0,
  "validation_errors": [
    {
      "field": "string",
      "message": "string",
      "code": "string"
    }
  ]
}
```

**413**

**415**

**422** — The CSV is not valid tracking-plan data. `details.branch` is present when
the error was found after the import branch was created.


| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| type | string | Yes | — | Constraints: format: uri |
| title | string | Yes | — | — |
| status | integer | Yes | — | Constraints: min: 400, max: 599 |
| detail | string | No | — | Constraints: nullable |
| details | object | No | — | Constraints: nullable |
| details.branch | object | No | — | — |
| details.branch.id | string | Yes | — | — |
| details.branch.name | string | Yes | — | — |
| instance | string | No | — | Constraints: format: uri, nullable |
| error_code | string | Yes | — | — |
| retryable | boolean | Yes | — | — |
| retry_after_seconds | integer | No | — | Constraints: nullable, min: 0 |
| validation_errors | object[] | No | — | Constraints: nullable |

```json
{
  "type": "https://example.com",
  "title": "The CSV is not valid tracking-plan data. `details.branch` is present when\nthe error was found after the import branch was created.\n",
  "status": 422,
  "detail": "string",
  "details": {
    "branch": {
      "id": "string",
      "name": "string"
    }
  },
  "instance": "https://example.com",
  "error_code": "string",
  "retryable": true,
  "retry_after_seconds": 0,
  "validation_errors": [
    {
      "field": "string",
      "message": "string",
      "code": "string"
    }
  ]
}
```

**429**

**500**

**502** — The import did not finish. Not retryable when `details.branch` is present
(the branch was created) or when the connection was lost mid-import (the
import may have started): a retry could create a second branch. List the
project's branches to find the result. A 502 without `details.branch`
that is marked retryable means the import was never started.


| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| type | string | Yes | — | Constraints: format: uri |
| title | string | Yes | — | — |
| status | integer | Yes | — | Constraints: min: 400, max: 599 |
| detail | string | No | — | Constraints: nullable |
| details | object | No | — | Constraints: nullable |
| details.branch | object | No | — | — |
| details.branch.id | string | Yes | — | — |
| details.branch.name | string | Yes | — | — |
| instance | string | No | — | Constraints: format: uri, nullable |
| error_code | string | Yes | — | — |
| retryable | boolean | Yes | — | — |
| retry_after_seconds | integer | No | — | Constraints: nullable, min: 0 |
| validation_errors | object[] | No | — | Constraints: nullable |

```json
{
  "type": "https://example.com",
  "title": "The import did not finish. Not retryable when `details.branch` is present\n(the branch was created) or when the connection was lost mid-import (the\nimport may have started): a retry could create a second branch. List the\nproject's branches to find the result. A 502 without `details.branch`\nthat is marked retryable means the import was never started.\n",
  "status": 502,
  "detail": "string",
  "details": {
    "branch": {
      "id": "string",
      "name": "string"
    }
  },
  "instance": "https://example.com",
  "error_code": "string",
  "retryable": true,
  "retry_after_seconds": 0,
  "validation_errors": [
    {
      "field": "string",
      "message": "string",
      "code": "string"
    }
  ]
}
```

**504** — The import did not respond in time and may still complete. Not
retryable: a retry may create a second branch. List the project's
branches to find the result.


| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| type | string | Yes | — | Constraints: format: uri |
| title | string | Yes | — | — |
| status | integer | Yes | — | Constraints: min: 400, max: 599 |
| detail | string | No | — | Constraints: nullable |
| details | object | No | — | Constraints: nullable |
| instance | string | No | — | Constraints: format: uri, nullable |
| error_code | string | Yes | — | — |
| retryable | boolean | Yes | — | — |
| retry_after_seconds | integer | No | — | Constraints: nullable, min: 0 |
| validation_errors | object[] | No | — | Constraints: nullable |

```json
{
  "type": "https://example.com",
  "title": "The import did not respond in time and may still complete. Not\nretryable: a retry may create a second branch. List the project's\nbranches to find the result.\n",
  "status": 504,
  "detail": "string",
  "details": {},
  "instance": "https://example.com",
  "error_code": "string",
  "retryable": true,
  "retry_after_seconds": 0,
  "validation_errors": [
    {
      "field": "string",
      "message": "string",
      "code": "string"
    }
  ]
}
```

## Code samples

### cURL

```bash
curl -X POST "https://developer-api.amplitude.com/v1/projects/12345/tracking-plan/import" \
  -H "Content-Type: application/json" \
  -H "Authorization: YOUR_API_KEY"
```

### Python

```python
import requests

response = requests.post(
    "https://developer-api.amplitude.com/v1/projects/12345/tracking-plan/import",
    headers={
        "Content-Type": "application/json",
        "Authorization": "YOUR_API_KEY"
    }
)
data = response.json()
```

### JavaScript

```javascript
const response = await fetch("https://developer-api.amplitude.com/v1/projects/12345/tracking-plan/import", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "YOUR_API_KEY"
  }
});
const data = await response.json();
```

### PHP

```php
<?php
$ch = curl_init("https://developer-api.amplitude.com/v1/projects/12345/tracking-plan/import");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Content-Type: application/json",
    "Authorization: YOUR_API_KEY"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
```

### Go

```go
package main

import (
  "bytes"
  "net/http"
)

func main() {
req, _ := http.NewRequest("POST", "https://developer-api.amplitude.com/v1/projects/12345/tracking-plan/import", nil)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "YOUR_API_KEY")
  client := &http.Client{}
  resp, _ := client.Do(req)
  defer resp.Body.Close()
}
```

### Java

```java
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create("https://developer-api.amplitude.com/v1/projects/12345/tracking-plan/import"))
      .method("POST", HttpRequest.BodyPublishers.noBody())
.header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_KEY")
      .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
```

### Ruby

```ruby
require "net/http"
require "json"

uri = URI("https://developer-api.amplitude.com/v1/projects/12345/tracking-plan/import")
request = Net::HTTP::Post.new(uri)
request["Content-Type"] = "application/json"
request["Authorization"] = "YOUR_API_KEY"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end
```

