# What Mida would build, without building it

> POST /boards/{boardId}/ai/plan

Source: https://mockflow.com/developers/reference/ai/ai-plan

**POST** `https://api.mockflow.com/v1/boards/{boardId}/ai/plan`  
Scopes: `ai:generate`, `boards:read`

**curl**

```bash
curl https://api.mockflow.com/v1/boards/brd_3f9e2a/ai/plan \
  -X POST \
  -H "Authorization: Bearer $MOCKFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "string",
  "outputTypes": [
    "artifact"
  ]
}'
```

**JavaScript**

```javascript
const response = await fetch("https://api.mockflow.com/v1/boards/brd_3f9e2a/ai/plan", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MOCKFLOW_API_KEY}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
  "prompt": "string",
  "outputTypes": [
    "artifact"
  ]
})
});

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

**Python**

```python
import os, requests

response = requests.post(
    "https://api.mockflow.com/v1/boards/brd_3f9e2a/ai/plan",
    headers={"Authorization": f"Bearer {os.environ['MOCKFLOW_API_KEY']}"},
    json={
  "prompt": "string",
  "outputTypes": [
    "artifact"
  ]
},
)

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

**200**

```json
{
  "multi": false,
  "boardTitle": "Q4 Launch Planning",
  "items": [
    {
      "id": "string",
      "name": "Q4 Launch Planning",
      "description": "string",
      "type": "string",
      "sizeHint": "string",
      "group": "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"
}
```

The planner's proposal for a prompt, the same one the editor shows for approval before it generates. Nothing is drawn and no generation credits are spent.

### Authorization

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

### Body

- `prompt` (string, required)
- `outputTypes` (enum<string>[])

### Response

- `multi` (boolean)
- `boardTitle` (string)
- `items` (object[]): - `id` (string)
  - `name` (string)
  - `description` (string)
  - `type` (string)
  - `sizeHint` (string | null)
  - `group` (string | null)

### Errors

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