# Modify data source

Modify an existing data source.

## Request

Facts | &nbsp;
---|---
HTTP URL | https://open.feishu.cn/open-apis/search/v2/data_sources/:data_source_id
HTTP Method | PATCH
Supported app types | Custom App、Store App
Required scopes<br>**To use this API, you must have at least 1 of the listed scopes.** | Search, create, modify, and delete custom search data source, schema or data item(search:data_source)

### Request header

Parameter | Type | Required | Description
---|---|---|---
Authorization | string | Yes | `tenant_access_token`<br>**Value format**: "Bearer `access_token`"<br>**Example value**: "Bearer t-7f1bcd13fc57d46bac21793a18e560"<br>[How to choose and get access token](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-choose-which-type-of-token-to-use)
Content-Type | string | Yes | **Fixed value**: "application/json; charset=utf-8"

### Path parameters

Parameter | Type | Description
---|---|---
data_source_id | string | Unique identification of the data source<br>**Example value**: "6953903108179099667"

### Request body

Parameter | Type | Required | Description
---|---|---|---
name | string | No | The display name of the data source<br>**Example value**: "Customer service ticket"
state | int | No | Data source status, 0-online, 1-offline<br>**Example value**: Number 0<br>**Optional values are**:<br>- 0：online<br>- 1：offline
description | string | No | Description of the data source<br>**Example value**: "Search for customer service tickets"
icon_url | string | No | The path of the display icon of the data source on the search tab<br>**Example value**: "https://www.xxx.com/open.jpg"
i18n_name | i18n_meta | No | Data source name Multilingual configuration, json format, key is language locale, value is corresponding copy, for example {"zh_cn": "Test Data Source", "en_us": "Test DataSource"}
zh_cn | string | No | Internationalization field: Chinese<br>**Example value**: "任务"
en_us | string | No | Internationalization field: English<br>**Example value**: "TODO"
ja_jp | string | No | Internationalization field: Japanese<br>**Example value**: "タスク"
i18n_description | i18n_meta | No | Data source description Multilingual configuration, json format, key is language locale, value is corresponding copy, for example {"zh_cn": "Search test data source related data", "en_us": "Search data from Test DataSource"}
zh_cn | string | No | Internationalization field: Chinese<br>**Example value**: "任务"
en_us | string | No | Internationalization field: English<br>**Example value**: "TODO"
ja_jp | string | No | Internationalization field: Japanese<br>**Example value**: "タスク"

### Request body example
```json
{
    "name": "Customer service",
    "state": 0,
    "description": "Search Customer service",
    "icon_url": "https://www.xxx.com/open.jpg"
}
```

## Response

### Response body

Parameter | Type | Description
---|---|---
code | int | Error codes, fail if not zero
msg | string | Error descriptions
data | \- | \-
data_source | data_source | Data source
id | string | Unique identification of the data source
name | string | name of data source
state | int | Data source status, 0-online, 1-offline. If not filled, the default is offline status.<br>**Optional values are**:<br>- 0：online<br>- 1：offline
description | string | Description of the data source
create_time | string | Creation time, using Unix timestamp, in "seconds"
update_time | string | Update time, using Unix timestamp, in "seconds"
is_exceed_quota | boolean | Whether the limit is exceeded
icon_url | string | The path of the display icon of the data source on the search tab, jpeg/png are recommeded, other formats may not display properly
template | string | The name of the display template used by the data source
searchable_fields | string\[\] | (Deprecated, please use the "Data Schema" API if you need to customize) Describe which fields can be searched
i18n_name | i18n_meta | The international presentation name of the data source
zh_cn | string | Internationalization field: Chinese
en_us | string | Internationalization field: English
ja_jp | string | Internationalization field: Japanese
i18n_description | i18n_meta | Internationalized description of data sources
zh_cn | string | Internationalization field: Chinese
en_us | string | Internationalization field: English
ja_jp | string | Internationalization field: Japanese
schema_id | string | The schema id associated with the data source

### Response body example
```json
{ 
 "Code": 0, 
 "Msg": "success" 
 }
```

### Error code

HTTP status code | Error code | Description | Troubleshooting suggestions
---|---|---|---
500 | 1270001 | Internal system error | Contact system developer to assist with positioning
400 | 1270002 | Parameter error | Troubleshoot illegal parameters based on error messages and documentation
500 | 1270003 | Call failed | If it still fails after retrying, please contact the system developer
400 | 1270004 | Data source does not exist | Verify that the data source ID is correct
400 | 1270005 | Only supported to Feishu Enterprise | Please contact sales to upgrade your plan
400 | 1271003 | nothing patches | No changes, please check whether the parameters are legal
401 | 1272001 | No permission to manipulate data source | Verify that the data source ID is valid
500 | 1272002 | Operation authentication failed | If it still fails after retrying, please contact the system developer for assistance in locating

