# Create an item

> POST /boards/{boardId}/items

Source: https://mockflow.com/developers/reference/items/create-item

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

**curl**

```bash
curl https://api.mockflow.com/v1/boards/brd_3f9e2a/items \
  -X POST \
  -H "Authorization: Bearer $MOCKFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "sticky_note",
  "position": {
    "x": 120,
    "y": 80
  },
  "data": {
    "text": "Interview 5 users",
    "color": "yellow"
  }
}'
```

**JavaScript**

```javascript
const response = await fetch("https://api.mockflow.com/v1/boards/brd_3f9e2a/items", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MOCKFLOW_API_KEY}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
  "type": "sticky_note",
  "position": {
    "x": 120,
    "y": 80
  },
  "data": {
    "text": "Interview 5 users",
    "color": "yellow"
  }
})
});

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

**Python**

```python
import os, requests

response = requests.post(
    "https://api.mockflow.com/v1/boards/brd_3f9e2a/items",
    headers={"Authorization": f"Bearer {os.environ['MOCKFLOW_API_KEY']}"},
    json={
  "type": "sticky_note",
  "position": {
    "x": 120,
    "y": 80
  },
  "data": {
    "text": "Interview 5 users",
    "color": "yellow"
  }
},
)

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

**201**

```json
{
  "id": "itm_k9",
  "type": "string",
  "componentType": "string",
  "boardId": "brd_3f9e2a",
  "sectionId": "string",
  "groupId": "string"
}
```

**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"
}
```

Any creatable type. `type` selects the schema for `data`: a frame's schema is the MCP render tool's own, a primitive's is below. Omit `position` and the item goes below everything on the board. A connector needs no position; its `data` names the two items it joins.

The item is drawn by a browser, which mints its id. When the draw has landed within a few seconds the answer is 201 with the item; otherwise 202 with a Job whose `result.itemIds` carries the id once it appears. A board open in the editor draws it live either way.

### 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

- `type` (enum<string>, required): Item types, generated from the MockFlow component registry. Primitive types are drawn by the editor; frame types are rich components whose `data` schema is the same one the MCP `render_*` tool accepts.
- `position` (Point): - `x` (number, required)
  - `y` (number, required)
- `size` (Size): - `width` (number)
  - `height` (number)
- `data` (ItemData, required): Selected by the sibling `type`. One schema per item type, generated from the component registry.

### Response

- `id` (string)
- `type` (string): An ItemType, or `other` for an editor widget the API has no type for.
- `componentType` (string): The editor's own class name, exact where `type` is a family.
- `boardId` (string)
- `sectionId` (string | null): The section the item sits inside, by position.
- `groupId` (string | null)
- `position` (Point): - `x` (number, required)
  - `y` (number, required)
- `size` (Size): - `width` (number)
  - `height` (number)
- `rotation` (number)
- `zIndex` (integer)
- `locked` (boolean)
- `text` (string): Plain text extracted from the item, for search and the outline.
- `readback` (enum<string>): One of `exact`, `unwrapped`, `text`, `pointer`, `parts` or `none`.
- `data` (ItemData): Selected by the sibling `type`. One schema per item type, generated from the component registry.
- `from` (string | null): Connectors only: the item or `group:` the line starts at.
- `to` (string | null): Connectors only.
- `directed` (boolean): Connectors only.
- `label` (string): Connectors only.
- `url` (string): Opens the board focused on this item.

### Errors

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