# REST Resource: projects.locations.corpora

- [Resource: Corpus](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora#Corpus)
  - [JSON representation](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora#Corpus.SCHEMA_REPRESENTATION)
- [Type](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora#Type)
- [SearchCapabilitySetting](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora#SearchCapabilitySetting)
  - [JSON representation](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora#SearchCapabilitySetting.SCHEMA_REPRESENTATION)
- [SearchCapability](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora#SearchCapability)
  - [JSON representation](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora#SearchCapability.SCHEMA_REPRESENTATION)
- [Type](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora#Type_1)
- [Methods](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora#METHODS_SUMMARY)

## Resource: Corpus

Corpus is a set of media contents for management. Within a corpus, media shares the same data schema. Search is also restricted within a single corpus.

| JSON representation |
|---|
| ``` { "name": string, "displayName": string, "description": string, "defaultTtl": string, "type": enum (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora#Type`), "searchCapabilitySetting": { object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora#SearchCapabilitySetting`) } } ``` |

| Fields ||
|---|---|
| `name` | `string` Resource name of the corpus. Form: `projects/{project_number}/locations/{locationId}/corpora/{corpus_id}` |
| `displayName` | `string` Required. The corpus name to shown in the UI. The name can be up to 32 characters long. |
| `description` | `string` Optional. Description of the corpus. Can be up to 25000 characters long. |
| `defaultTtl` | ``string (`https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Duration` format)`` Optional. The default TTL value for all assets under the corpus without a asset level user-defined TTL. For STREAM_VIDEO type corpora, this is required and the maximum allowed defaultTtl is 10 years. A duration in seconds with up to nine fractional digits, ending with '`s`'. Example: `"3.5s"`. |
| `type` | ``enum (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora#Type`)`` Optional. Type of the asset inside corpus. |
| `searchCapabilitySetting` | ``object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora#SearchCapabilitySetting`)`` Default search capability setting on corpus level. |

## Type

Type of the asset inside the corpus.

| Enums ||
|---|---|
| `TYPE_UNSPECIFIED` | The default type, not supposed to be used. If this default type is used, the corpus will be created as STREAM_VIDEO corpus. |
| `STREAM_VIDEO` | Asset is a live streaming video asset. |
| `IMAGE` | Asset is an image. |
| `VIDEO_ON_DEMAND` | Asset is a video asset. |

## SearchCapabilitySetting

Setting for search capability to enable.

| JSON representation |
|---|
| ``` { "searchCapabilities": [ { object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora#SearchCapability`) } ] } ``` |

| Fields ||
|---|---|
| `searchCapabilities[]` | ``object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora#SearchCapability`)`` The metadata of search capability to enable. |

## SearchCapability

The capability and metadata of search capability.

| JSON representation |
|---|
| ``` { "type": enum (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora#Type_1`) } ``` |

| Fields ||
|---|---|
| `type` | ``enum (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora#Type_1`)`` The search capability to enable. |

## Type

Capability to perform different search on assets.

| Enums ||
|---|---|
| `TYPE_UNSPECIFIED` | Unspecified search capability, should never be used. |
| `EMBEDDING_SEARCH` | Embedding search. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora/analyze` | Analyzes a corpus. |
| ### `https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora/create` | Creates a corpus inside a project. |
| ### `https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora/delete` | Deletes a corpus only if its empty. |
| ### `https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora/get` | Gets corpus details inside a project. |
| ### `https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora/list` | Lists all corpora in a project. |
| ### `https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora/patch` | Updates a corpus in a project. |
| ### `https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1/projects.locations.corpora/searchAssets` | Search media asset. |