# Ask Mida about the board

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

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

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

**curl**

```bash
curl https://api.mockflow.com/v1/boards/brd_3f9e2a/ai/ask \
  -X POST \
  -H "Authorization: Bearer $MOCKFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "question": "string"
}'
```

**JavaScript**

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

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

**Python**

```python
import os, requests

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

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

**200**

```json
{
  "answer": "string",
  "sources": [
    {
      "itemId": "itm_k9",
      "title": "Q4 Launch Planning"
    }
  ],
  "creditsUsed": 0
}
```

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

Answers from the board's own content, the same text the outline shows, and cites the items it used. Charged in AI credits.

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

- `question` (string, required)

### Response

- `answer` (string): Markdown.
- `sources` (object[]): - `itemId` (string)
  - `title` (string)
- `creditsUsed` (integer)

### Errors

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