Imports
Undoing an import that created tasks in bulk.
Undo an import
POST /api/v2/imports/:id/undo · beta
Moves the tasks an import created to the trash.
The custom fields the import created are switched off when no task outside the trash still holds a value in them. A field that has since been made a field of every project stays, and so do statuses and tags. A task the import only updated is left alone. Trashing a task takes the tasks under it, so a task that is kept keeps every task above it.
An import with tasks that someone has worked on since (a history line other than its creation, a comment the import did not bring, or a subtask it did not make) is not undone unless keepEdited is true; those tasks are then left where they are.
| Auth | Session or API token with the write scope |
| Token limited to projects | Refused |
| Permission | The person who ran the import, an owner or an admin |
Path parameters
| Name | Type | Description |
|---|---|---|
id | id | The import, from GET /api/v2/imports. |
Body
| Field | Type | Required | Description |
|---|---|---|---|
keepEdited | boolean | true to undo the import and keep the tasks that have been worked on. Defaults to false. |
Request
POST /api/v2/imports/<id>/undo
Authorization: Bearer <token>
companyid: <company id>
Content-Type: application/json
{ "keepEdited": true }Response
{
"status": true,
"statusText": "38 imported task(s) moved to the trash.",
"data": {
"trashed": 38,
"kept": [{ "id": "<task id>", "name": "Plan the launch" }],
"keptCount": 1,
"fieldsRemoved": ["Story points"],
"fieldsKept": []
}
}| Field | Description |
|---|---|
trashed | How many tasks were moved to the trash. |
kept | The tasks left where they are, at most 50, each as { id, name }. |
keptCount | How many tasks were kept. |
fieldsRemoved | The titles of the custom fields that were switched off. |
fieldsKept | The titles of the custom fields the import created that are still in use. |
Errors
| Status | When |
|---|---|
| 401 | No token, a token that is invalid, expired or revoked, or no valid companyid header. |
| 403 | The token lacks the write scope, or its person is no longer a member of the workspace. A token limited to projects is refused here. |
| 404 | The import does not exist. |
| 409 | The import was already undone (code: "ALREADY_UNDONE"); nothing it created is left (NOTHING_TO_UNDO); or tasks were worked on since and keepEdited was not sent (EDITED, with data.edited, the first 50 of them as { id, name }, and data.editedCount). |
| 429 | Too many requests from this address. Wait retryAfter seconds and send it again. |
