# Method: projects.locations.corpora.collections.addCollectionItem

- [HTTP request](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora.collections/addCollectionItem#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora.collections/addCollectionItem#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora.collections/addCollectionItem#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora.collections/addCollectionItem#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora.collections/addCollectionItem#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora.collections/addCollectionItem#body.AddCollectionItemResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora.collections/addCollectionItem#body.aspect)

Adds an item into a Collection.

### HTTP request

`POST https://visionai.googleapis.com/v1/{item.collection=projects/*/locations/*/corpora/*/collections/*}:addCollectionItem`

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

### Path parameters

| Parameters ||
|---|---|
| `item.collection` | `string` Required. The collection name that this item belongs to. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}` |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "item": { "collection": string, "type": enum (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/CollectionItem#Type`), "itemResource": string } } ``` |

| Fields ||
|---|---|
| `item.type` | ``enum (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/CollectionItem#Type`)`` Required. The type of item. |
| `item.itemResource` | `string` Required. The name of the CollectionItem. Its format depends on the `type` above. For ASSET: `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}` |

### Response body

Response message for collections.addCollectionItem.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "item": { object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/CollectionItem`) } } ``` |

| Fields ||
|---|---|
| `item` | ``object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/CollectionItem`)`` The item that has already been added. |

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://cloud.google.com/docs/authentication/).