# Add a record to an item

> POST /boards/{boardId}/items/{itemId}/records

Source: https://mockflow.com/developers/reference/items/add-record

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

**curl**

```bash
curl https://api.mockflow.com/v1/boards/brd_3f9e2a/items/itm_k9/records \
  -X POST \
  -H "Authorization: Bearer $MOCKFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "record": {
    "title": "Export fails on boards over 200 items",
    "column": "To Do",
    "priority": "high",
    "key": "MF-1482"
  }
}'
```

**JavaScript**

```javascript
const response = await fetch("https://api.mockflow.com/v1/boards/brd_3f9e2a/items/itm_k9/records", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MOCKFLOW_API_KEY}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
  "record": {
    "title": "Export fails on boards over 200 items",
    "column": "To Do",
    "priority": "high",
    "key": "MF-1482"
  }
})
});

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

**Python**

```python
import os, requests

response = requests.post(
    "https://api.mockflow.com/v1/boards/brd_3f9e2a/items/itm_k9/records",
    headers={"Authorization": f"Bearer {os.environ['MOCKFLOW_API_KEY']}"},
    json={
  "record": {
    "title": "Export fails on boards over 200 items",
    "column": "To Do",
    "priority": "high",
    "key": "MF-1482"
  }
},
)

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

**200**

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

**409**

```json
{
  "error": {
    "code": "conflict",
    "message": "The item's type takes no records, the board is locked, or what the item holds could not be read back as it is.",
    "docsUrl": "https://mockflow.com/developers/concepts/errors#conflict"
  },
  "requestId": "req_45d49816999bac40"
}
```

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

Adds one thing to an item that holds many: a card to a kanban (in the column it names), a task to a gantt, an event to a timeline or calendar, an item to a checklist, a line to a document, a value to a chart, a row to a spreadsheet. Send the same `key` again and that record is updated and moved instead of added twice; without a key, a record identical to one already there changes nothing. Everything else in the item stays as it is. What a type takes is `record` on GET /item-types/{type}; types without it answer 409.

### Authorization

- `Authorization` (string, required): `Bearer <key>`. The key needs `boards:write` scope. Create and manage keys in the [developer console](/developers/console/), or use an [OAuth app](/developers/concepts/oauth-apps) to act for other people; what each scope unlocks is on the [scopes page](/developers/concepts/scopes).

### Path parameters

- `boardId` (string, required)
- `itemId` (string, required)

### Body

- `callbackUrl` (string): Optional. When the job this request starts finishes or fails, a short body is POSTed here once: `{ eventId, status, boardId, boardUrl, imageUrl }`, where status is `succeeded` or `failed` and imageUrl is a picture of what the job drew, or null. Signed with the workspace's callback secret (GET /webhooks/callback-secret). https to a public host. The full job is on GET /jobs/{jobId}.
- `record` (ItemRecord, required): Selected by the type of the item it is added to. One schema per type that takes records.

### 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.
- `changed` (boolean)

### Errors

- 409 `conflict`: The item's type takes no records, the board is locked, or what the item holds could not be read back as it is.
- 422 `validation_failed`: The body did not match the schema for this item type.
- 429 `rate_limited`: Too many requests.
