# Import personal vocabulary

Import up to 500 personal vocabulary entries from JSON or CSV. Imported entries start with fresh learning progress and keep an import source record.

- Capability ID: `vocabulary.personal.import`
- Operation: `ielts_vocabulary_personal_import`
- Category: 词汇
- Endpoint: `POST /api/v1/agent/capabilities/ielts_vocabulary_personal_import`
- Authentication: Bearer Token（通过 /api/v1/agent-bindings 绑定账号）
- Required scopes: vocabulary:write
- Side effect: write
- Human documentation: https://ieltsbuddy.igopx.cn/developers/api/ielts_vocabulary_personal_import

## Request parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `content` | string | 是 | UTF-8 JSON or CSV text. Import carries vocabulary content only, never review progress. |
| `format` | string | 是 | Format of content. |
| `sourceId` | string | 否 | Stable import id when available; otherwise the service derives one from the content. |
| `sourceTitle` | string | 否 | Human-readable filename or import title. |

## Request example

```bash
curl -X POST \
  'https://work.ieltsbuddy.igopx.cn/api/v1/agent/capabilities/ielts_vocabulary_personal_import' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer $IELTS_BUDDY_TOKEN' \
  --data '{"content":"<content>","format":"csv","sourceId":"","sourceTitle":""}'
```

## Request schema

```json
{
  "type": "object",
  "properties": {
    "content": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2000000,
      "description": "UTF-8 JSON or CSV text. Import carries vocabulary content only, never review progress."
    },
    "format": {
      "type": "string",
      "enum": [
        "csv",
        "json"
      ],
      "description": "Format of content."
    },
    "sourceId": {
      "default": "",
      "description": "Stable import id when available; otherwise the service derives one from the content.",
      "type": "string"
    },
    "sourceTitle": {
      "default": "",
      "description": "Human-readable filename or import title.",
      "type": "string"
    }
  },
  "required": [
    "content",
    "format",
    "sourceId",
    "sourceTitle"
  ],
  "additionalProperties": false
}
```

## Response envelope

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

## Errors

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