# Create, move, resize or delete many items in one draw

> POST /boards/{boardId}/items:batch

Source: https://mockflow.com/developers/reference/items/batch-items

**POST** `https://api.mockflow.com/v1/boards/{boardId}/items:batch`  
Scopes: `boards:write`

**curl**

```bash
curl https://api.mockflow.com/v1/boards/brd_3f9e2a/items:batch \
  -X POST \
  -H "Authorization: Bearer $MOCKFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "operations": [
    {
      "op": "string",
      "item": {
        "type": "artifact",
        "position": {
          "x": 0,
          "y": 0
        },
        "size": {
          "width": 0,
          "height": 0
        },
        "data": {
          "files": null,
          "merge": null,
          "deletes": null,
          "order": null,
          "html": null,
          "data": null
        }
      }
    }
  ]
}'
```

**JavaScript**

```javascript
const response = await fetch("https://api.mockflow.com/v1/boards/brd_3f9e2a/items:batch", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MOCKFLOW_API_KEY}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
  "operations": [
    {
      "op": "string",
      "item": {
        "type": "artifact",
        "position": {
          "x": 0,
          "y": 0
        },
        "size": {
          "width": 0,
          "height": 0
        },
        "data": {
          "files": null,
          "merge": null,
          "deletes": null,
          "order": null,
          "html": null,
          "data": null
        }
      }
    }
  ]
})
});

const data = await response.json();
```

**Python**

```python
import os, requests

response = requests.post(
    "https://api.mockflow.com/v1/boards/brd_3f9e2a/items:batch",
    headers={"Authorization": f"Bearer {os.environ['MOCKFLOW_API_KEY']}"},
    json={
  "operations": [
    {
      "op": "string",
      "item": {
        "type": "artifact",
        "position": {
          "x": 0,
          "y": 0
        },
        "size": {
          "width": 0,
          "height": 0
        },
        "data": {
          "files": None,
          "merge": None,
          "deletes": None,
          "order": None,
          "html": None,
          "data": None
        }
      }
    }
  ]
},
)

response.raise_for_status()
data = response.json()
```

**202**

```json
{
  "id": "job_7hd2",
  "kind": "item.create",
  "status": "queued",
  "progress": 0,
  "message": "Interview 5 users",
  "result": {
    "itemIds": [
      "string"
    ],
    "updated": [
      "string"
    ],
    "deleted": [
      "string"
    ],
    "creditsUsed": 0,
    "boardTitle": "Q4 Launch Planning",
    "skill": "string"
  }
}
```

**422**

```json
{
  "error": {
    "code": "validation_failed",
    "message": "data.columns[0].cards[0].priority must be one of low, medium, high",
    "details": [
      {
        "path": "data.columns[0].cards[0].priority",
        "expected": [
          "low",
          "medium",
          "high"
        ]
      }
    ]
  },
  "requestId": "req_01j9"
}
```

**429**

```json
{
  "error": {
    "code": "rate_limited",
    "message": "Too many requests.",
    "docsUrl": "https://mockflow.com/developers/concepts/errors#rate_limited"
  },
  "requestId": "req_45d49816999bac40"
}
```

Up to 100 operations, validated together before anything is drawn, then drawn as one action. Updates in a batch change position and size; replacing an item's data is PATCH /items/{itemId}. The Job's `result.itemIds` lists the created items, `updated` and `deleted` the others.

### Authorization

- `Authorization` (string, required): `Bearer <key>`. The key needs `boards:write` scope. Create and manage keys in the [developer console](/developers/console/); what each scope unlocks is on the [scopes page](/developers/concepts/scopes).

### Path parameters

- `boardId` (string, required)

### Headers

- `Idempotency-Key` (string): A unique key per logical request. Replays within 24 hours return the original response.

### Body

- `operations` (object | object | object[], required)

### Response

- `id` (string)
- `kind` (enum<string>): One of `item.create`, `item.update`, `item.delete`, `item.batch`, `ai.generate`, `ai.modify` or `skill.apply`.
- `status` (enum<string>): One of `queued`, `running`, `succeeded` or `failed`.
- `progress` (integer)
- `message` (string): Human readable progress, for example "Placing kanban".
- `result` (object | null): - `itemIds` (string[])
  - `updated` (string[])
  - `deleted` (string[])
  - `creditsUsed` (integer)
  - `boardTitle` (string | null)
  - `skill` (string | null)
  - `convertedFrom` (string)
  - `sourceDeleted` (boolean)
- `error` (error): - `code` (enum<string>, required): One of `unauthorized`, `forbidden`, `not_found`, `validation_failed`, `conflict`, `plan_limit`, `rate_limited` or `internal`.
  - `message` (string, required)
  - `details` (object[])
  - `docsUrl` (string)
  - `upgradeUrl` (string)
- `createdAt` (string)
- `finishedAt` (string | null)

### Errors

- 422 `validation_failed`: The body did not match the schema for this item type.
- 429 `rate_limited`: Too many requests.
