Upload a file to import
Step 1 of 3 (upload, preview, commit). Administrators only (`org.settings.manage`). multipart/form-data with the CSV in `file` (at most 10 MB and 5,000 rows) and the target `teamId`. The file is read at once, so one that cannot be used (empty, not a CSV, a stray quote, too many rows) is refused with 422 and nothing is stored. UTF-8, UTF-16 and Windows-1252 are recognised, and the separator is detected. Nothing is written to the team. The response carries the file's headers, a few sample rows, and `suggestedMapping`, a starting point guessed from the header names for the caller to review. `namespace` names where the file's row ids come from: rows already imported under the same namespace are recognised on a re-run and skipped. It defaults to one derived from the file name, or to `linear` or `jira` for an export of that tool, so overlapping exports share it. `detected` is set when the file is recognised as another tool's export. `previousImport` is set when this exact file was imported into the team before. Uploads that are never committed are closed after 24 hours and their file deleted. A team holds at most 10 unfinished imports (409).
View as MarkdownAuthorization
bearer In: header
Request Body
multipart/form-data
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/imports" \ -F file="string" \ -F teamId="a4ede8ba-7c0a-4485-8763-cbd9b282fbec"{ "import": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "teamId": "a4ede8ba-7c0a-4485-8763-cbd9b282fbec", "source": "csv", "namespace": "string", "status": "uploaded", "fileName": "string", "fileSize": 0, "totalRows": 0, "createdCount": 0, "skippedCount": 0, "failedCount": 0, "cancelRequested": true, "createdBy": "25a02396-1048-48f9-bf93-102d2fb7895e", "createdAt": "2019-08-24T14:15:22Z", "startedAt": "2019-08-24T14:15:22Z", "finishedAt": "2019-08-24T14:15:22Z", "retryAfter": "2019-08-24T14:15:22Z", "undoneAt": "2019-08-24T14:15:22Z", "batchId": "5579c111-9c50-47e2-af92-f16d52e63189", "origin": "file", "undoableUntil": "2019-08-24T14:15:22Z", "commentCount": 0, "mapping": { "v": 1, "columns": { "property1": "string", "property2": "string" }, "idColumn": "string", "idAlias": "string", "people": { "property1": "string", "property2": "string" }, "strict": true, "sprintDates": { "property1": { "start": "2019-08-24", "end": "2019-08-24" }, "property2": { "start": "2019-08-24", "end": "2019-08-24" } }, "linkColumns": [ "string" ], "markup": "none", "commentFormat": "plain", "completedFallback": "string", "dateFormat": "iso", "timezone": "Asia/Kolkata", "labelSeparator": "str", "status": { "property1": { "stateId": "871bb69c-5872-42b2-88b0-72e9da663aaa", "create": true, "type": "backlog" }, "property2": { "stateId": "871bb69c-5872-42b2-88b0-72e9da663aaa", "create": true, "type": "backlog" } }, "priority": { "property1": 0, "property2": 0 } }, "reconciliation": { "rows": 0, "created": 0, "alreadyImported": 0, "refused": 0, "notWritten": 0, "allAccountedFor": true, "byStatus": [ { "status": "string", "inFile": 0, "created": 0, "alreadyImported": 0, "refused": 0, "notWritten": 0 } ] } }, "file": { "headers": [ "string" ], "rowCount": 0, "sampleRows": [ [ "string" ] ], "delimiter": "string", "encoding": "utf-8", "warnings": [ "string" ] }, "suggestedMapping": { "v": 1, "columns": { "property1": "string", "property2": "string" }, "idColumn": "string", "idAlias": "string", "people": { "property1": "string", "property2": "string" }, "strict": true, "sprintDates": { "property1": { "start": "2019-08-24", "end": "2019-08-24" }, "property2": { "start": "2019-08-24", "end": "2019-08-24" } }, "linkColumns": [ "string" ], "markup": "none", "commentFormat": "plain", "completedFallback": "string", "dateFormat": "iso", "timezone": "Asia/Kolkata", "labelSeparator": "str", "status": { "property1": { "stateId": "871bb69c-5872-42b2-88b0-72e9da663aaa", "create": true, "type": "backlog" }, "property2": { "stateId": "871bb69c-5872-42b2-88b0-72e9da663aaa", "create": true, "type": "backlog" } }, "priority": { "property1": 0, "property2": 0 } }, "previousImport": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "finishedAt": "2019-08-24T14:15:22Z", "createdCount": 0, "namespace": "string" }, "detected": { "source": "linear", "namespace": "string", "notes": [ "string" ] }}List imports, newest first
Administrators only (`org.settings.manage`): a job carries the names and emails the uploaded file contained. Imports in another workspace are never listed. `team_id` narrows to one team (404 if the team is not one the caller can reach). `batch_id` narrows to the imports of one batch (400 if it is not an id). `limit` defaults to 20, maximum 50, which is also the most a batch can hold.
Say which teams a file names
Before an upload, for a file that holds several teams (a Linear export of a whole workspace). Administrators only (`org.settings.manage`). multipart/form-data with the CSV in `file` and, optionally, `column`, the header of the column that names the team. Without `column` it is the `Team` column, and `teamColumn` is null when the file has none (a Jira file has none, but its Project column can be named). Nothing is stored. Each name in the file comes back with how many rows it has and `match`, the team of the workspace it most likely means: by team name, then by team key, ignoring case and spacing. `match` is null when nothing fits or when two teams fit, because Accounts allows two teams to share a name and a guess would put issues in a team nobody chose. Only teams the caller can reach are matched. Rows with no team are counted in `noTeamRows`.