Pivotal Tracker Python API Docs | dltHub
Build a Pivotal Tracker-to-database pipeline in Python using dlt with AI Workbench support for Claude Code, Cursor, and Codex.
Last updated:
Pivotal Tracker is a project management and agile tracking platform exposing a REST API to create, read, update, and delete projects, stories, epics, iterations, memberships, activity, labels and related resources. The REST API base URL is https://www.pivotaltracker.com/services/v5 and all requests require a user API token (X-TrackerToken header or token query param).
dlt is an open-source Python library that handles authentication, pagination, and schema evolution automatically. dlthub provides AI context files that enable code assistants to generate production-ready pipelines. Install with uv pip install "dlt[workspace]" and start loading Pivotal Tracker data in under 10 minutes.
What data can I load from Pivotal Tracker?
Here are some of the endpoints you can load from Pivotal Tracker:
| Resource | Endpoint | Method | Data selector | Description |
|---|---|---|---|---|
| projects | projects | GET | (top-level array) | List projects available to the authenticated user |
| project | projects/{project_id} | GET | (object) | Get a single project by id |
| stories | projects/{project_id}/stories | GET | (top-level array) | List stories in a project (supports filter, limit, offset) |
| story | projects/{project_id}/stories/{story_id} | GET | (object) | Get a single story |
| me | me | GET | (object) | Information about the authenticated user (includes token when Basic auth used) |
| accounts | accounts | GET | (top-level array) | List accounts for the user |
| labels | projects/{project_id}/labels | GET | (top-level array) | List labels for a project |
| iterations | projects/{project_id}/iterations | GET | (top-level array) | Get project iterations (supports scope, limit, offset) |
| memberships | projects/{project_id}/memberships | GET | (top-level array) | Project memberships |
| epics | projects/{project_id}/epics | GET | (top-level array) | List epics in a project |
| activity | projects/{project_id}/activity | GET | (top-level array) | Activity feed for a project |
| my_activity | my/activity | GET | (top-level array) | Activity across user scopes |
| story_tasks | projects/{project_id}/stories/{story_id}/tasks | GET | (top-level array) | Tasks on a story |
| notifications | notifications | GET | (top-level array) | User notifications |
How do I authenticate with the Pivotal Tracker API?
Authenticate by passing the user's API token in the HTTP header X-TrackerToken: (or as token= query parameter). You can also obtain the token by calling GET /me using HTTP Basic auth (username:password) which returns the token in the response.
1. Get your credentials
- Sign in to Pivotal Tracker (web UI).
- Open your Profile (usually via avatar → Profile or Account settings).
- Locate the API token value on your Profile page and copy it.
- Use this token in the X-TrackerToken header for API requests (or token query param).
2. Add them to .dlt/secrets.toml
[sources.pivotal_tracker_source] api_token = "your_pivotal_tracker_api_token"
dlt reads this automatically at runtime — never hardcode tokens in your pipeline script. For production environments, see setting up credentials with dlt for environment variable and vault-based options.
How do I set up and run the pipeline?
Set up a virtual environment and install dlt:
uv venv && source .venv/bin/activate uv pip install "dlt[workspace]"
1. Install the dlt AI Workbench:
dlt ai init --agent <your-agent> # <agent>: claude | cursor | codex
This installs project rules, a secrets management skill, appropriate ignore files, and configures the dlt MCP server for your agent. Learn more →
2. Install the rest-api-pipeline toolkit:
dlt ai toolkit rest-api-pipeline install
This loads the skills and context about dlt the agent uses to build the pipeline iteratively, efficiently, and safely. The agent uses MCP tools to inspect credentials — it never needs to read your secrets.toml directly. Learn more →
3. Start LLM-assisted coding:
Use /find-source to load data from the Pivotal Tracker API into DuckDB.
The rest-api-pipeline toolkit takes over from here — it reads relevant API documentation, presents you with options for which endpoints to load, and follows a structured workflow to scaffold, debug, and validate the pipeline step by step.
4. Run the pipeline:
python pivotal_tracker_pipeline.py
If everything is configured correctly, you'll see output like this:
Pipeline pivotal_tracker_pipeline load step completed in 0.26 seconds 1 load package(s) were loaded to destination duckdb and into dataset pivotal_tracker_data The duckdb destination used duckdb:/pivotal_tracker.duckdb location to store data Load package 1749667187.541553 is LOADED and contains no failed jobs
Inspect your pipeline and data:
dlt pipeline pivotal_tracker_pipeline show
This opens the Pipeline Dashboard where you can verify pipeline state, load metrics, schema (tables, columns, types), and query the loaded data directly.
Python pipeline example
This example loads projects and stories from the Pivotal Tracker API into DuckDB. It mirrors the endpoint and data selector configuration from the table above:
import dlt from dlt.sources.rest_api import RESTAPIConfig, rest_api_resources @dlt.source def pivotal_tracker_source(api_token=dlt.secrets.value): config: RESTAPIConfig = { "client": { "base_url": "https://www.pivotaltracker.com/services/v5", "auth": { "type": "api_key", "token": api_token, }, }, "resources": [ {"name": "projects", "endpoint": {"path": "projects"}}, {"name": "stories", "endpoint": {"path": "projects/{project_id}/stories"}} ], } yield from rest_api_resources(config) def get_data() -> None: pipeline = dlt.pipeline( pipeline_name="pivotal_tracker_pipeline", destination="duckdb", dataset_name="pivotal_tracker_data", ) load_info = pipeline.run(pivotal_tracker_source()) print(load_info)
To add more endpoints, append entries from the resource table to the "resources" list using the same name, path, and data_selector pattern.
How do I query the loaded data?
Once the pipeline runs, dlt creates one table per resource. You can query with Python or SQL.
Python (pandas DataFrame):
import dlt data = dlt.pipeline("pivotal_tracker_pipeline").dataset() sessions_df = data.stories.df() print(sessions_df.head())
SQL (DuckDB example):
SELECT * FROM pivotal_tracker_data.stories LIMIT 10;
In a marimo or Jupyter notebook:
import dlt data = dlt.pipeline("pivotal_tracker_pipeline").dataset() data.stories.df().head()
See how to explore your data in marimo Notebooks and how to query your data in Python with dataset.
What destinations can I load Pivotal Tracker data to?
dlt supports loading into any of these destinations — only the destination parameter changes:
| Destination | Example value |
|---|---|
| DuckDB (local, default) | "duckdb" |
| PostgreSQL | "postgres" |
| BigQuery | "bigquery" |
| Snowflake | "snowflake" |
| Redshift | "redshift" |
| Databricks | "databricks" |
| Filesystem (S3, GCS, Azure) | "filesystem" |
Change the destination in dlt.pipeline(destination="snowflake") and add credentials in .dlt/secrets.toml. See the full destinations list.
Troubleshooting
Authentication failures
If you see HTTP 401 (unauthenticated) the request lacked credentials. Ensure X-TrackerToken header is present and valid or include token query param. Calling GET /me with Basic auth can be used to exchange username/password for a token; invalid basic auth returns 403.
Authorization errors (403)
HTTP 403 with code unauthorized_operation indicates the token is valid but the user lacks permission for the requested resource (e.g., not a member of the project or project API access disabled). Check project membership and roles.
Not found (404)
A 404 returns code unfound_resource and means the referenced resource id does not exist or is not visible to the authenticated user.
Validation / bad request (400)
Bad inputs return 400 with code invalid_parameter and may include validation_errors array with per-field issues.
Pagination and envelope behavior
List endpoints return pagination via response headers: X-Tracker-Pagination-Limit, -Offset, -Total, -Returned. If you pass envelope=true the response body will include a top-level envelope with data (the actual records) and a pagination object. By default collection responses are top-level arrays (data selector is the top-level array).
Rate limiting and retries
The public docs do not document a strict rate‑limit header; implement exponential backoff on 429/5xx and respect 4xx errors. Monitor HTTP response headers for any provider‑specific guidance (project-version, downtime, deprecation warnings).
Ensure that the API key is valid to avoid 401 Unauthorized errors. Also, verify endpoint paths and parameters to avoid 404 Not Found errors.
Next steps
Continue your data engineering journey with the other toolkits of the dltHub AI Workbench:
data-exploration— Build custom notebooks, charts, and dashboards for deeper analysis with marimo notebooks.dlthub-runtime— Deploy, schedule, and monitor your pipeline in production.
dlt ai toolkit data-exploration install dlt ai toolkit dlthub-runtime install
Was this page helpful?
Community Hub
Need more dlt context for Pivotal Tracker?
Request dlt skills, commands, AGENT.md files, and AI-native context.