---
title: "POST /v1/{+parent}/ragCorpora"
method: POST
path: "/v1/{+parent}/ragCorpora"
tags: ["projects"]
---

# POST /v1/{+parent}/ragCorpora

`POST /v1/{+parent}/ragCorpora`

Creates a RagCorpus.

## Path parameters

- `parent` string, required

## Request body

- GoogleCloudAiplatformV1RagCorpus — A RagCorpus is a RagFile container and a project can have multiple RagCorpora.
  - `vertexAiSearchConfig` GoogleCloudAiplatformV1VertexAiSearchConfig — Config for the Vertex AI Search.
    - `servingConfig` string — Vertex AI Search Serving Config resource full name. For example, `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config}` or `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}`.
  - `corpusStatus` GoogleCloudAiplatformV1CorpusStatus — RagCorpus status.
    - `state` 'UNKNOWN' | 'INITIALIZED' | 'ACTIVE' | 'ERROR' — Output only. RagCorpus life state.
    - `errorStatus` string — Output only. Only when the `state` field is ERROR.
  - `name` string — Output only. The resource name of the RagCorpus.
  - `description` string — Optional. The description of the RagCorpus.
  - `displayName` string — Required. The display name of the RagCorpus. The name can be up to 128 characters long and can consist of any UTF-8 characters.
  - `satisfiesPzi` boolean — Output only. Reserved for future use.
  - `createTime` string, google-datetime — Output only. Timestamp when this RagCorpus was created.
  - `satisfiesPzs` boolean — Output only. Reserved for future use.
  - `vectorDbConfig` GoogleCloudAiplatformV1RagVectorDbConfig — Config for the Vector DB to use for RAG.
    - `apiAuth` GoogleCloudAiplatformV1ApiAuth — The generic reusable api auth config. Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto) instead.
      - `apiKeyConfig` GoogleCloudAiplatformV1ApiAuthApiKeyConfig — The API secret.
        - `apiKeyString` string — The API key string. Either this or `api_key_secret_version` must be set.
        - `apiKeySecretVersion` string — Required. The SecretManager secret version resource name storing API key. e.g. projects/{project}/secrets/{secret}/versions/{version}
    - `pinecone` GoogleCloudAiplatformV1RagVectorDbConfigPinecone — The config for the Pinecone.
      - `indexName` string — Pinecone index name. This value cannot be changed after it's set.
    - `ragManagedDb` GoogleCloudAiplatformV1RagVectorDbConfigRagManagedDb — The config for the default RAG-managed Vector DB.
      - `knn` GoogleCloudAiplatformV1RagVectorDbConfigRagManagedDbKNN — Config for KNN search.
      - `ann` GoogleCloudAiplatformV1RagVectorDbConfigRagManagedDbANN — Config for ANN search. RagManagedDb uses a tree-based structure to partition data and facilitate faster searches. As a tradeoff, it requires longer indexing time and manual triggering of index rebuild via the ImportRagFiles and UpdateRagCorpus API.
        - `treeDepth` integer — The depth of the tree-based structure. Only depth values of 2 and 3 are supported. Recommended value is 2 if you have if you have O(10K) files in the RagCorpus and set this to 3 if more than that. Default value is 2.
        - `leafCount` integer — Number of leaf nodes in the tree-based structure. Each leaf node contains groups of closely related vectors along with their corresponding centroid. Recommended value is 10 * sqrt(num of RagFiles in your RagCorpus). Default value is 500.
    - `vertexVectorSearch` GoogleCloudAiplatformV1RagVectorDbConfigVertexVectorSearch — The config for the Vertex Vector Search.
      - `indexEndpoint` string — The resource name of the Index Endpoint. Format: `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}`
      - `index` string — The resource name of the Index. Format: `projects/{project}/locations/{location}/indexes/{index}`
    - `ragEmbeddingModelConfig` GoogleCloudAiplatformV1RagEmbeddingModelConfig — Config for the embedding model to use for RAG.
      - `vertexPredictionEndpoint` GoogleCloudAiplatformV1RagEmbeddingModelConfigVertexPredictionEndpoint — Config representing a model hosted on Vertex Prediction Endpoint.
        - `model` string — Output only. The resource name of the model that is deployed on the endpoint. Present only when the endpoint is not a publisher model. Pattern: `projects/{project}/locations/{location}/models/{model}`
        - `endpoint` string — Required. The endpoint resource name. Format: `projects/{project}/locations/{location}/publishers/{publisher}/models/{model}` or `projects/{project}/locations/{location}/endpoints/{endpoint}`
        - `modelVersionId` string — Output only. Version ID of the model that is deployed on the endpoint. Present only when the endpoint is not a publisher model.
  - `encryptionSpec` GoogleCloudAiplatformV1EncryptionSpec — Represents a customer-managed encryption key specification that can be applied to a Vertex AI resource.
    - `kmsKeyName` string — Required. Resource name of the Cloud KMS key used to protect the resource. The Cloud KMS key must be in the same region as the resource. It must have the format `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
  - `updateTime` string, google-datetime — Output only. Timestamp when this RagCorpus was last updated.

## Response `200`

Successful response

---

[API](https://skmtc.dev/google/apis/aiplatform.md) · [All operations](https://skmtc.dev/google/apis/aiplatform/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/google/aiplatform/revisions/b608d71b91f0/schema)
