# Check a payload without drawing it

> POST /item-types/{type}:validate

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

**POST** `https://api.mockflow.com/v1/item-types/{type}:validate`

**curl**

```bash
curl https://api.mockflow.com/v1/item-types/artifact:validate \
  -X POST \
  -H "Authorization: Bearer $MOCKFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "data": {
    "files": {},
    "merge": false,
    "deletes": [
      "string"
    ],
    "order": [
      "string"
    ],
    "html": "string",
    "data": {}
  }
}'
```

**JavaScript**

```javascript
const response = await fetch("https://api.mockflow.com/v1/item-types/artifact:validate", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MOCKFLOW_API_KEY}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
  "data": {
    "files": {},
    "merge": false,
    "deletes": [
      "string"
    ],
    "order": [
      "string"
    ],
    "html": "string",
    "data": {}
  }
})
});

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

**Python**

```python
import os, requests

response = requests.post(
    "https://api.mockflow.com/v1/item-types/artifact:validate",
    headers={"Authorization": f"Bearer {os.environ['MOCKFLOW_API_KEY']}"},
    json={
  "data": {
    "files": {},
    "merge": False,
    "deletes": [
      "string"
    ],
    "order": [
      "string"
    ],
    "html": "string",
    "data": {}
  }
},
)

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

**200**

```json
{
  "valid": false,
  "type": "artifact"
}
```

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

Runs the same validation a create would, and answers 422 with the field that is wrong, or 200.

### Authorization

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

### Path parameters

- `type` (enum<string>, required)

### Body

- `data` (ItemData): Selected by the sibling `type`. One schema per item type, generated from the component registry.

### Response

- `valid` (boolean)
- `type` (enum<string>): 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.

### Errors

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