# Undo a board import

Roll one import batch back: delete exactly the rows that run CREATED and nothing else — never a row it merely updated, and never a row somebody typed. Answers `{run, removed, kept}`. Refused with 409 `import_running` when the run never settled and 409 `already_undone` when the batch has been rolled back before, because "they were gone before you asked" and "I removed them" are different answers. Get the runId from GET /v1/boards/:id/imports.

Access class: `board:write`.

## Endpoint

`POST /v1/boards/{id}/imports/{runId}/undo`

## Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| id | path | string | Yes |
| runId | path | string | Yes |

## Request body

Content type: `application/json`.

```json
{
  "body": {},
  "params": {
    ":id": "string",
    ":runId": ""
  },
  "query": {}
}
```

## Responses

### 201

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "kept": [
      "string"
    ],
    "removed": 1.5,
    "run": {
      "actorUserId": 1.5,
      "createdAt": "string",
      "failed": 1.5,
      "fileName": "string",
      "finishedAt": "string",
      "id": "",
      "imported": 1.5,
      "keptCount": 1.5,
      "results": [
        "string"
      ],
      "standing": 1.5,
      "status": "string",
      "total": 1.5,
      "undoneAt": "string",
      "undoneBy": 1.5,
      "undoneCount": 1.5
    }
  }
}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
