Documentation
Import data
Move existing data into a project, prove it all arrived, and recover if something goes wrong. Keep the original source until the checks pass.
Choose where data goes
Put structured rows you need to filter in a collection. Put original exports and media in assets, which keep exact versions. Save decisions and results as records. Keep large raw event streams in their source.
An archived file is not searchable row by row. Report archived files, imported rows and files that still live elsewhere as separate counts.
Use the Projects and Tasks template
Open Data in a project and choose Projects and Tasks. A project member can install both tables and their starting views. A linked task row shows the native status and opens the task to make changes.
Agents with project write access can call pm_template_propose with a reason and a stable request key. Include optional fields or saved views. A view specifies its table, columns, and exact-match filters. A project member reviews the proposal in Data before changes go live. Ask for a fresh proposal if another review updated the template.
Define the collection
Call collection_list first and reuse a suitable collection. Otherwise call collection_define with a project and a JSON Schema. Later calls accept the collection name or the returned ID.
{
"name": "inspections",
"project": "my-project",
"schema": {
"type": "object",
"properties": {
"item": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"pending",
"passed",
"failed"
]
},
"notes": {
"type": "string"
}
},
"required": [
"item",
"status"
],
"additionalProperties": false
}
}Collections do not enforce links between rows. Store the related row's key as a field and filter on it with where. Store unknown values as null, not zero.
Start an import job
Open a project, then choose Imports under Data. Select a collection and upload or choose a JSON or JSON Lines file. Review the planned changes before starting. You can close the page once the job is queued and return to its progress from the same link.
Through MCP or the API, upload and register a project file, then call import_job_create with the project, collection, asset ID, exact version, and a stable requestKey. Retry a lost response with the same request key. Use import_job_start to confirm the plan, and import_job_get with the returned job ID to check progress. The same start call resumes a paused job.
Township checks the reviewed destination before writing. Each saved batch and its progress commit together. If a later batch is blocked, the job shows where it stopped and which rows were already processed. Review a fresh file or destination state before creating a new job.
When the job is verified, download the receipt from its page or read it with import_job_get. It includes the source file hash, saved change counts, and a digest checked against persisted rows. The receipt covers the exact file, collection, and verification time.
Import Notion tasks
Export one project’s Tasks from Notion. Keep its original page IDs and URLs. Map each named owner to a Township member ID or agent handle. Leave the owner null only when the source task is unassigned. Add a blocker reason for Waiting and recorded evidence for Done.
Choose Notion tasks in Imports, or pass destination: "notion_tasks" to import_job_create and omit collection. Use the Notion page UUID as key, and omit expectedRevision. Give each row the selected Township project slug and the same original Notion project UUID. Due dates use YYYY-MM-DD.
{
"key": "5bf4ad6f-d522-4851-ae44-4933d8755fa6",
"data": {
"project": "protos",
"sourceProjectId": "dfa3fcd9-e22c-4efb-bcc4-f61f328da00e",
"url": "https://www.notion.so/5bf4ad6fd5224851ae444933d8755fa6",
"title": "Review the gameplay clips",
"status": "Waiting",
"owner": {
"kind": "agent",
"handle": "chief"
},
"priority": "P1",
"dueOn": "2026-12-08",
"notes": "Use the clips from the reviewed build.",
"blockReason": "Awaiting the capture"
}
}To do becomes open or assigned. Doing and In progress become in progress. Waiting becomes blocked, Done becomes done, and Dropped becomes canceled. An identical import leaves existing tasks as they are. The review flags duplicate IDs, missing evidence and changed mappings for reconciliation.
Control file batches directly
Use this for a prepared file or more than a few hundred rows. The agent uploads the file, and Township reads the rows from it, so they do not pass through the conversation. It works with the agent's existing sign-in.
- Write one row per line as JSON Lines. Each row has a
keyanddata. A JSON array, or an object with arowsarray, also works. Convert CSV first. - Upload it with
asset_upload_urland register it withasset_register. - Call
collection_importwithdryRunto check every row without writing. It returns what would change, plus invalid rows and conflicts. - Call it again without
dryRun. Each call saves up to 500 rows. Passprojectandtagsin the call, not the file. PassnextRowasfromRowuntildoneis true.
{"key":"crm:customer:42","data":{"name":"Ana"}}
{"key":"crm:customer:43","data":{"name":"Rio"}}{
"collection": "inspections",
"assetId": "22222222-2222-4222-8222-222222222222",
"version": 1,
"dryRun": true,
"source": "CRM export 2026-12-01"
}A JSON Lines file holds up to 16 MiB and 50,000 rows, with up to 1 MB per row. A JSON array or rows object holds up to 4 MiB. If any row is invalid, nothing is written and the first 50 problems are listed by row. To fix one, register a corrected version with the same assetId and import that version. Repeating a call is safe. One import runs per workspace at a time, so retry after a few seconds if you get import_busy.
Import in batches
For a few rows, send them in the call. Give each source item one stable key, such as crm:customer:42. Include the source system so IDs from two systems cannot collide. Keys hold up to 200 characters and are unique within the collection.
{
"collection": "inspections",
"source": "Inspection register",
"rows": [
{
"key": "inspection-42",
"data": {
"item": "Unit 42",
"status": "pending"
},
"expectedRevision": 0
}
]
}A batch holds up to 500 rows and a request up to 4 MB. Each batch commits together or writes nothing. Check the returned inserted, updated, restored and unchanged counts.
Resume or repeat an import
If a call is interrupted, send the same batch again. Rows with the same key, data and source are left unchanged. The source text is part of each row, so keep it identical across retries.
To change a row, send its current revision as expectedRevision with the complete replacement data.
Resolve conflicts
A conflict writes nothing and lists every conflicting key. Read the saved row with externalKey before choosing which version to keep.
| Reason | What happened | Next step |
|---|---|---|
changed | The saved data differs. | Compare both versions. Send the listed revision to replace it. |
source_changed | Only the source text differs. | Restore the original source, or send the listed revision to accept the new one. |
removed | The row was undone. | Find out why. Send the listed revision only if you want it back. |
missing | No row has this key. | Check the key. Use revision 0 to create it. |
Check that everything arrived
Pause imports, then call collection_query. Pages hold 100 rows by default and at most 1,000. Pass nextCursor as cursor until hasMore is false, keeping the same filters and order.
{
"collection": "inspections",
"order": "oldest",
"limit": 200
}The first page includes total. Compare it with the distinct rows you read, then compare saved keys and data with your source. since filters by creation time, so it does not find later edits. Use smaller pages if your client truncates long responses.
Undo and export
Use change_revert to undo a row change. Undo works one row at a time, newest change first. There is no batch undo. Activity shows an import as one entry. Call activity_list with a row's entityId to find the auditId to undo, or with grouped: false to list each change. An undone row keeps its key reserved until someone restores it.
Agents can read the collections they have access to page by page. An owner or admin can export the whole workspace as one JSON file from the People page or GET /v1/export. The org_export tool returns a shorter copy: up to 5,000 rows and about 1 MB per section, with shortened sections named in truncatedSections.