# Method: indexing.datasources.items.push

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

Pushes an item onto a queue for later polling and updating.

This API requires an admin or service account to execute. The service account used is the one whitelisted in the corresponding data source.

### HTTP request

`POST https://cloudsearch.googleapis.com/v1/indexing/{item.name=datasources/*/items/*}:push`

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

### Path parameters

| Parameters ||
|---|---|
| `item.name` | `string` The name of the `https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items#Item` to push into the indexing queue. Format: datasources/{sourceId}/items/{id} This is a required field. The maximum length is 1536 characters. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "item": { "name": string, "type": enum (`https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items/push#PushItem.Type`), "metadataHash": string, "structuredDataHash": string, "contentHash": string, "payload": string, "queue": string, "repositoryError": { "type": enum (`https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items#RepositoryError.Type`), "httpStatusCode": integer, "errorMessage": string } }, "connectorName": string, "debugOptions": { object (`https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/DebugOptions`) } } ``` |

| Fields ||
|---|---|
| `item.type` | ``enum (`https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items/push#PushItem.Type`)`` The type of the push operation that defines the push behavior. |
| `item.metadataHash` | `string` The metadata hash of the item according to the repository. If specified, this is used to determine how to modify this item's status. Setting this field and the `https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items/push#PushItem.FIELDS.type` field results in argument error. The maximum length is 2048 characters. |
| `item.structuredDataHash` | `string` Structured data hash of the item according to the repository. If specified, this is used to determine how to modify this item's status. Setting this field and the `https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items/push#PushItem.FIELDS.type` field results in argument error. The maximum length is 2048 characters. |
| `item.contentHash` | `string` Content hash of the item according to the repository. If specified, this is used to determine how to modify this item's status. Setting this field and the `https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items/push#PushItem.FIELDS.type` field results in argument error. The maximum length is 2048 characters. |
| `item.payload` | `string (https://developers.google.com/discovery/v1/type-format format)` Provides additional document state information for the connector, such as an alternate repository id and other metadata. The maximum length is 8192 bytes. A base64-encoded string. |
| `item.queue` | `string` Queue to which this item belongs. The `default` queue is chosen if this field is not specified. The maximum length is 512 characters. |
| `item.repositoryError` | ``object (`https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items#RepositoryError`)`` Populate this field to store Connector or repository error details. This information is displayed in the Admin Console. This field may only be populated when the `https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items/push#PushItem.Type` is `https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items/push#PushItem.Type.ENUM_VALUES.REPOSITORY_ERROR`. |
| `connectorName` | `string` The name of connector making this call. Format: datasources/{sourceId}/connectors/{id} |
| `debugOptions` | ``object (`https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/DebugOptions`)`` Common debug options. |

### Response body

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

### Authorization scopes

Requires one of the following OAuth scopes:

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

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

## PushItem

Represents an item to be pushed to the indexing queue.

| JSON representation |
|---|
| ``` { "name": string, "type": enum (`https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items/push#PushItem.Type`), "metadataHash": string, "structuredDataHash": string, "contentHash": string, "payload": string, "queue": string, "repositoryError": { object (`https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items#RepositoryError`) } } ``` |

| Fields ||
|---|---|
| `name` | `string` The name of the `https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items#Item` to push into the indexing queue. Format: datasources/{sourceId}/items/{id} This is a required field. The maximum length is 1536 characters. |
| `type` | ``enum (`https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items/push#PushItem.Type`)`` The type of the push operation that defines the push behavior. |
| `metadataHash` | `string` The metadata hash of the item according to the repository. If specified, this is used to determine how to modify this item's status. Setting this field and the `https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items/push#PushItem.FIELDS.type` field results in argument error. The maximum length is 2048 characters. |
| `structuredDataHash` | `string` Structured data hash of the item according to the repository. If specified, this is used to determine how to modify this item's status. Setting this field and the `https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items/push#PushItem.FIELDS.type` field results in argument error. The maximum length is 2048 characters. |
| `contentHash` | `string` Content hash of the item according to the repository. If specified, this is used to determine how to modify this item's status. Setting this field and the `https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items/push#PushItem.FIELDS.type` field results in argument error. The maximum length is 2048 characters. |
| `payload` | `string (https://developers.google.com/discovery/v1/type-format format)` Provides additional document state information for the connector, such as an alternate repository id and other metadata. The maximum length is 8192 bytes. A base64-encoded string. |
| `queue` | `string` Queue to which this item belongs. The `default` queue is chosen if this field is not specified. The maximum length is 512 characters. |
| `repositoryError` | ``object (`https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items#RepositoryError`)`` Populate this field to store Connector or repository error details. This information is displayed in the Admin Console. This field may only be populated when the `https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items/push#PushItem.Type` is `https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items/push#PushItem.Type.ENUM_VALUES.REPOSITORY_ERROR`. |

## PushItem.Type

The type of the push operation that defines the push behavior.

| Enums ||
|---|---|
| `UNSPECIFIED` | Default UNSPECIFIED. Specifies that the push operation should not modify `https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items#ItemStatus` |
| `MODIFIED` | Indicates that the repository document has been modified or updated since the previous `https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items/index_#google.apps.search.v1.ItemsService.IndexItem` call. This changes status to `https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/ItemStatus.Code#ENUM_VALUES.MODIFIED` state for an existing item. If this is called on a non existing item, the status is changed to `https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/ItemStatus.Code#ENUM_VALUES.NEW_ITEM`. |
| `NOT_MODIFIED` | Item in the repository has not been modified since the last update call. This push operation will set status to `https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/ItemStatus.Code#ENUM_VALUES.ACCEPTED` state. |
| `REPOSITORY_ERROR` | Connector is facing a repository error regarding this item. Change status to `https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/ItemStatus.Code#ENUM_VALUES.ERROR` state. Item is unreserved and rescheduled at a future time determined by exponential backoff. |
| `REQUEUE` | Call push with REQUEUE only for items that have been reserved. This action unreserves the item and resets its available time to the wall clock time. |