Skip to content

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.

AuthSession or API token with the write scope
Token limited to projectsRefused
PermissionThe person who ran the import, an owner or an admin

Path parameters

NameTypeDescription
ididThe import, from GET /api/v2/imports.

Body

FieldTypeRequiredDescription
keepEditedbooleantrue to undo the import and keep the tasks that have been worked on. Defaults to false.

Request

http
POST /api/v2/imports/<id>/undo
Authorization: Bearer <token>
companyid: <company id>
Content-Type: application/json

{ "keepEdited": true }

Response

json
{
  "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": []
  }
}
FieldDescription
trashedHow many tasks were moved to the trash.
keptThe tasks left where they are, at most 50, each as { id, name }.
keptCountHow many tasks were kept.
fieldsRemovedThe titles of the custom fields that were switched off.
fieldsKeptThe titles of the custom fields the import created that are still in use.

Errors

StatusWhen
401No token, a token that is invalid, expired or revoked, or no valid companyid header.
403The token lacks the write scope, or its person is no longer a member of the workspace. A token limited to projects is refused here.
404The import does not exist.
409The 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).
429Too many requests from this address. Wait retryAfter seconds and send it again.

Released under the AGPL-3.0 licence.