# 创建背调自定义字段

创建用户在发起背调时展示的表单自定义字段。自定义字段支持多种类型如单行文本、单选等，可以设置为必填或非必填。

**注意事项**：* 创建操作不影响已发起的背调。
* 此接口为全量更新，多次调用时，将生效最后一次调用传入的自定义字段。

## 请求

基本 | &nbsp;
---|---
HTTP URL | https://open.feishu.cn/open-apis/hire/v1/eco_background_check_custom_fields
HTTP Method | POST
接口频率限制 | [1000 次/分钟、50 次/秒](https://open.feishu.cn/document/ukTMukTMukTM/uUzN04SN3QjL1cDN)
支持的应用类型 | Custom App、Store App
权限要求<br>**调用该 API 所需的权限。开启其中任意一项权限即可调用** | 更新招聘背调信息(hire:background_check_order)

### 请求头

名称 | 类型 | 必填 | 描述
---|---|---|---
Authorization | string | 是 | `tenant_access_token`<br>**值格式**："Bearer `access_token`"<br>**示例值**："Bearer t-7f1bcd13fc57d46bac21793a18e560"<br>[了解更多：如何选择与获取 access token](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-choose-which-type-of-token-to-use)
Content-Type | string | 是 | **固定值**："application/json; charset=utf-8"

### 请求体

名称 | 类型 | 必填 | 描述
---|---|---|---
account_id | string | 是 | 背调账号 ID，可在[账号绑定](https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_account/events/created)事件中获取<br>**示例值**："6995842370159937061"
custom_field_list | eco_background_check_custom_field_data\[\] | 是 | 自定义字段列表
type | string | 是 | 自定义字段类型<br>**示例值**："select"<br>**可选值有**：<br>- text：单行文本，最多100个汉字<br>- textarea：多行文本，最多200个汉字<br>- number：数字<br>- boolean：布尔<br>- select：单选<br>- multiselect：多选<br>- date：日期<br>- file：附件<br>- resume：候选人简历
key | string | 是 | 自定义字段的标识，在同一账号内唯一<br>**示例值**："candidate_degree"
name | i18n | 是 | 自定义字段的名称，用户在安排背调表单看到的控件标题
zh_cn | string | 否 | 中文名称<br>**示例值**："候选人学历"
en_us | string | 否 | 英文名称<br>**示例值**："Candidate degree"
is_required | boolean | 是 | 是否必填<br>**示例值**：true
description | i18n | 否 | 自定义字段的描述。如果是输入控件（type=text 或 type=textarea），为用户在安排背调表单看到的 placeholder 或 提示文字
zh_cn | string | 否 | 中文描述<br>**示例值**："候选人的真实学历"
en_us | string | 否 | 英文描述<br>**示例值**："The candidate's real degree"
options | eco_background_check_custom_field_data_option\[\] | 否 | type 为`select`或`multiselect`时必填，单选或多选的选项
key | string | 是 | 选项的唯一标识<br>**示例值**："bachelor"
name | i18n | 是 | 选项的名称
zh_cn | string | 否 | 中文名称<br>**示例值**："本科"
en_us | string | 否 | 英文名称<br>**示例值**："Bachelor"

### 请求体示例
```json
{
    "account_id": "6995842370159937061",
    "custom_field_list": [
        {
            "type": "select",
            "key": "candidate_degree",
            "name": {
                "zh_cn": "候选人学历",
                "en_us": "Candidate degree"
            },
            "is_required": true,
            "description": {
                "zh_cn": "候选人的真实学历",
                "en_us": "The candidate's real degree"
            },
            "options": [
                {
                    "key": "bachelor",
                    "name": {
                        "zh_cn": "本科",
                        "en_us": "Bachelor"
                    }
                }
            ]
        }
    ]
}
```

## 响应

### 响应体

名称 | 类型 | 描述
---|---|---
code | int | 错误码，非 0 表示失败
msg | string | 错误描述
data | \- | \-

### 响应体示例
```json
{
    "code": 0,
    "msg": "success",
    "data": {}
}
```

### 错误码

HTTP状态码 | 错误码 | 描述 | 排查建议
---|---|---|---
400 | 1002855 | 参数错误或系统异常 | 请根据实际报错信息定位问题或联系[技术支持](https://applink.feishu.cn/TLJpeNdW)
500 | 1002001 | 系统错误 | 请根据实际报错信息定位问题或联系[技术支持](https://applink.feishu.cn/TLJpeNdW)

