# Method: settings.datasources.update

- [HTTP request](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/settings.datasources/update#body.HTTP_TEMPLATE)
- [Path parameters](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/settings.datasources/update#body.PATH_PARAMETERS)
- [Request body](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/settings.datasources/update#body.request_body)
  - [JSON representation](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/settings.datasources/update#body.request_body.SCHEMA_REPRESENTATION)
    - [JSON representation](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/settings.datasources/update#body.request_body.SCHEMA_REPRESENTATION.source.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/settings.datasources/update#body.response_body)
- [Authorization scopes](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/settings.datasources/update#body.aspect)
- [Try it!](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/settings.datasources/update#try-it)

Updates a datasource.

**Note:** This API requires an admin account to execute.

### HTTP request

`PUT https://cloudsearch.googleapis.com/v1/settings/{source.name=datasources/*}`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `source.name` | `string` The name of the datasource resource. Format: datasources/{sourceId}. The name is ignored when creating a datasource. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "source": { "name": string, "displayName": string, "shortName": string, "indexingServiceAccounts": [ string ], "disableServing": boolean, "disableModifications": boolean, "itemsVisibility": [ { "gsuiteUserEmail": string, "gsuiteGroupEmail": string, "gsuiteDomain": boolean } ], "returnThumbnailUrls": boolean, "operationIds": [ string ] }, "debugOptions": { object (`https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/DebugOptions`) }, "updateMask": string } ``` |

| Fields ||
|---|---|
| `source.displayName` | `string` Required. Display name of the datasource The maximum length is 300 characters. |
| `source.shortName` | `string` A short name or alias for the source. This value will be used to match the 'source' operator. For example, if the short name is *\<value\>* then queries like *source:\<value\>* will only return results for this source. The value must be unique across all datasources. The value must only contain alphanumeric characters (a-zA-Z0-9). The value cannot start with 'google' and cannot be one of the following: mail, gmail, docs, drive, groups, sites, calendar, hangouts, gplus, keep, people, teams. Its maximum length is 32 characters. |
| `source.indexingServiceAccounts[]` | `string` List of service accounts that have indexing access. |
| `source.disableServing` | `boolean` Disable serving any search or assist results. |
| `source.disableModifications` | `boolean` If true, sets the datasource to read-only mode. In read-only mode, the Indexing API rejects any requests to index or delete items in this source. Enabling read-only mode does not stop the processing of previously accepted data. |
| `source.itemsVisibility[]` | ``object (`https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/GSuitePrincipal`)`` This field restricts visibility to items at the datasource level. Items within the datasource are restricted to the union of users and groups included in this field. Note that, this does not ensure access to a specific item, as users need to have ACL permissions on the contained items. This ensures a high level access on the entire datasource, and that the individual items are not shared outside this visibility. |
| `source.returnThumbnailUrls` | `boolean` Can a user request to get thumbnail URI for Items indexed in this data source. |
| `source.operationIds[]` | `string` IDs of the Long Running Operations (LROs) currently running for this schema. |
| `debugOptions` | ``object (`https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/DebugOptions`)`` Common debug options. |
| `updateMask` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#field-mask` format)`` Only applies to [`settings.datasources.patch`](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/settings.datasources/patch). Update mask to control which fields to update. Example field paths: `name`, `displayName`. - If `updateMask` is non-empty, then only the fields specified in the `updateMask` are updated. - If you specify a field in the `updateMask`, but don't specify its value in the source, that field is cleared. - If the `updateMask` is not present or empty or has the value `*`, then all fields are updated. |

### Response body

If successful, the response body contains an instance of `https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/operations#Operation`.

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloud_search.settings.indexing`
- `https://www.googleapis.com/auth/cloud_search.settings`
- `https://www.googleapis.com/auth/cloud_search`

For more information, see the [Authorization guide](https://developers.google.com/workspace/guides/configure-oauth-consent).