# Create speaking material

Create one speaking material. Exact question links are optional and are only written when explicitly provided; omitted links remain empty.

- Capability ID: `speaking_materials.create`
- Operation: `ielts_speaking_materials_create`
- Category: 口语素材
- Endpoint: `POST /api/v1/agent/capabilities/ielts_speaking_materials_create`
- Authentication: Bearer Token（通过 /api/v1/agent-bindings 绑定账号）
- Required scopes: speaking:write
- Side effect: write
- Human documentation: https://ieltsbuddy.igopx.cn/developers/api/ielts_speaking_materials_create

## Request parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `coreStory` | string | 是 | coreStory |
| `questionLinks` | record[] | 否 | questionLinks |
| `questionLinks.answerAngle` | string | 否 | answerAngle |
| `questionLinks.outline` | unknown[] | 否 | outline |
| `questionLinks.questionSlotId` | number | 是 | questionSlotId |
| `questionLinks.requiredAdaptation` | string | 否 | requiredAdaptation |
| `title` | string | 是 | title |

## Request example

```bash
curl -X POST \
  'https://work.ieltsbuddy.igopx.cn/api/v1/agent/capabilities/ielts_speaking_materials_create' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer $IELTS_BUDDY_TOKEN' \
  --data '{"coreStory":"<coreStory>","title":"Example"}'
```

## Request schema

```json
{
  "type": "object",
  "properties": {
    "coreStory": {
      "type": "string",
      "minLength": 1,
      "maxLength": 4000
    },
    "questionLinks": {
      "maxItems": 30,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "answerAngle": {
            "default": "",
            "type": "string",
            "maxLength": 500
          },
          "outline": {
            "default": [],
            "maxItems": 8,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 300
            }
          },
          "questionSlotId": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "requiredAdaptation": {
            "default": "",
            "type": "string",
            "maxLength": 500
          }
        },
        "required": [
          "answerAngle",
          "outline",
          "questionSlotId",
          "requiredAdaptation"
        ],
        "additionalProperties": false
      }
    },
    "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    }
  },
  "required": [
    "coreStory",
    "title"
  ],
  "additionalProperties": false
}
```

## Response envelope

```json
{
  "code": 0,
  "data": {},
  "message": "ok"
}
```

## Errors

| HTTP | Code | Meaning |
| --- | --- | --- |
| 400 | `40001` | 请求参数不符合接口契约 |
| 401 | `40101` | 缺少或使用了无效的访问令牌 |
| 403 | `40301` | 访问令牌不包含接口所需权限 |
| 404 | `40401` | 接口或目标资源不存在 |
