# Have Mida draft a skill

> POST /skills/draft

Source: https://mockflow.com/developers/reference/skills/draft-skill

**POST** `https://api.mockflow.com/v1/skills/draft`  
Scopes: `ai:generate`

**curl**

```bash
curl https://api.mockflow.com/v1/skills/draft \
  -X POST \
  -H "Authorization: Bearer $MOCKFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "description": "string",
  "outputType": "string"
}'
```

**JavaScript**

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

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

**Python**

```python
import os, requests

response = requests.post(
    "https://api.mockflow.com/v1/skills/draft",
    headers={"Authorization": f"Bearer {os.environ['MOCKFLOW_API_KEY']}"},
    json={
  "description": "string",
  "outputType": "string"
},
)

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

**200**

```json
{
  "name": "Q4 Launch Planning",
  "description": "string",
  "outputType": "string",
  "category": "general",
  "systemPrompt": "string",
  "placeholder": "string",
  "tags": [
    "string"
  ],
  "model": "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"
}
```

Returns a draft (name, description, system prompt, placeholder, tags) for a description and an output type. Nothing is saved; send it to POST /skills when you are happy with it. Charged in AI credits.

### Authorization

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

### Body

- `description` (string, required)
- `outputType` (string, required)

### Response

- `name` (string, required)
- `description` (string)
- `outputType` (string, required)
- `category` (enum<string>): One of `general`, `brainstorm`, `diagrams`, `planning` or `media`. Defaults to `general`.
- `systemPrompt` (string, required)
- `placeholder` (string)
- `tags` (string[])
- `model` (string)

### Errors

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