# Convert an item to another type

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

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

**POST** `https://api.mockflow.com/v1/boards/{boardId}/items/{itemId}/convert`  
Scopes: `ai:generate`, `boards:write`

**curl**

```bash
curl https://api.mockflow.com/v1/boards/brd_3f9e2a/items/itm_k9/convert \
  -X POST \
  -H "Authorization: Bearer $MOCKFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "to": "artifact",
  "keepSource": false
}'
```

**JavaScript**

```javascript
const response = await fetch("https://api.mockflow.com/v1/boards/brd_3f9e2a/items/itm_k9/convert", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MOCKFLOW_API_KEY}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
  "to": "artifact",
  "keepSource": false
})
});

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

**Python**

```python
import os, requests

response = requests.post(
    "https://api.mockflow.com/v1/boards/brd_3f9e2a/items/itm_k9/convert",
    headers={"Authorization": f"Bearer {os.environ['MOCKFLOW_API_KEY']}"},
    json={
  "to": "artifact",
  "keepSource": False
},
)

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

**402**

```json
{
  "error": {
    "code": "plan_limit",
    "message": "AI credits exhausted. 0 of 2000 remaining this month.",
    "upgradeUrl": "https://mockflow.com/pricing"
  },
  "requestId": "req_01ja"
}
```

**429**

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

Mida rebuilds the item's content as the target type and, once the new item has landed, deletes the source unless `keepSource` is true. See `convertibleTo` on GET /item-types/{type} for sensible targets.

### Authorization

- `Authorization` (string, required): `Bearer <key>`. The key needs `ai:generate` and `boards:write` scopes. 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)
- `itemId` (string, required)

### Body

- `to` (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.
- `keepSource` (boolean): Defaults to `false`.

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

- 402 `plan_limit`: The workspace plan does not allow this, or AI credits are exhausted.
- 429 `rate_limited`: Too many requests.
