> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dropcv.work/llms.txt
> Use this file to discover all available pages before exploring further.

# save_candidate

> 把一段简历文本和附件文件入库到人才池。

`save_candidate` 把简历入库。**必须先通过 [/files/upload](/integration/skills/file-upload) 上传附件**拿到 file\_id，再调本 skill。

## 参数

| 字段                       | 类型                  | 必填 | 说明                                |
| ------------------------ | ------------------- | -- | --------------------------------- |
| `candidate_profile_text` | string (1-20000 字符) | 是  | 简历结构化文本（姓名 / 职位 / 经历 / 技能 等，换行分隔） |
| `attachment_file_id`     | string              | 是  | 来自 `/files/upload` 的 file\_id     |
| `source_url`             | string \| null      | 否  | 简历来源页面 URL（可选）                    |

## 返回

```json theme={null}
{
  "candidate_id": "uuid",
  "profile_status": "..."
}
```

## 示例

```bash theme={null}
# 步骤 1：上传附件
FILE_ID=$(curl -s -X POST https://api.dropcv.work/api/external/v1/files/upload \
  -H "Authorization: Bearer $DROPCV_API_KEY" \
  -F "file=@resume.pdf" -F "mime_type=application/pdf" | jq -r .file_id)

# 步骤 2：入库
curl -X POST https://api.dropcv.work/api/external/v1/skills/save_candidate/invoke \
  -H "Authorization: Bearer $DROPCV_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"params\": {
      \"candidate_profile_text\": \"姓名：张三\\n职位：高级后端\\n公司：字节跳动\\n经验：5 年\\n技能：Python, Go\",
      \"attachment_file_id\": \"$FILE_ID\"
    }
  }"
```

## 权限

需要 **write** 权限。

## 错误

* `FILE_NOT_FOUND (404)` — file\_id 不存在 / 已过期 / 不是这个 user 上传的
* `INSUFFICIENT_PERMISSION (403)` — key 没开 write 权限

## 审计

入库后的候选人在 DropCV 后台会标记 `source = external_api`，未来可在 dashboard 筛选 "AI 入库的候选人"。
