---
title: "POST /v1/projects/{projectsId}/locations/{locationsId}/datasets/{datasetsId}/conversations:ingest"
method: POST
path: "/v1/projects/{projectsId}/locations/{locationsId}/datasets/{datasetsId}/conversations:ingest"
tags: ["projects"]
---

# POST /v1/projects/{projectsId}/locations/{locationsId}/datasets/{datasetsId}/conversations:ingest

`POST /v1/projects/{projectsId}/locations/{locationsId}/datasets/{datasetsId}/conversations:ingest`

## Request

- Base URL: `https://contactcenterinsights.googleapis.com`
- URL: `https://contactcenterinsights.googleapis.com/v1/projects/{projectsId}/locations/{locationsId}/datasets/{datasetsId}/conversations:ingest`
- Auth: OAuth 2 and OAuth 2
  - Implicit: `https://accounts.google.com/o/oauth2/auth`
  - Scopes: `https://www.googleapis.com/auth/cloud-platform`
  - Authorization code: `https://accounts.google.com/o/oauth2/auth`
  - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/cloud-platform`

Imports conversations and processes them according to the user's configuration.

## Path parameters

- `projectsId` string, required
- `locationsId` string, required
- `datasetsId` string, required

## Request body

- GoogleCloudContactcenterinsightsV1IngestConversationsRequest: The request to ingest conversations.
  - `conversationConfig` GoogleCloudContactcenterinsightsV1IngestConversationsRequestConversationConfig: Configuration that applies to all conversations.
    - `agentChannel` integer: Optional. Indicates which of the channels, 1 or 2, contains the agent. Note that this must be set for conversations to be properly displayed and analyzed.
    - `agentId` string: Optional. An opaque, user-specified string representing a human agent who handled all conversations in the import. Note that this will be overridden if per-conversation metadata is provided through the `metadata_bucket_uri`.
    - `customerChannel` integer: Optional. Indicates which of the channels, 1 or 2, contains the agent. Note that this must be set for conversations to be properly displayed and analyzed.
  - `gcsSource` GoogleCloudContactcenterinsightsV1IngestConversationsRequestGcsSource: Configuration for Cloud Storage bucket sources.
    - `audioBucketUri` string: Optional. The Cloud Storage path to the conversation audio file. Note that: [1] Audio files will be transcribed if not already. [2] Audio files and transcript files must be in separate buckets / folders. [3] A source file and its corresponding audio file must share the same name to be properly ingested, E.g. `gs://bucket/transcript/conversation1.json` and `gs://bucket/audio/conversation1.mp3`.
    - `bucketObjectType` 'BUCKET_OBJECT_TYPE_UNSPECIFIED' | 'TRANSCRIPT' | 'AUDIO': Optional. Specifies the type of the objects in `bucket_uri`. Avoid passing this. This is inferred from the `transcript_bucket_uri`, `audio_bucket_uri`.
    - `bucketUri` string: Optional. The Cloud Storage bucket containing source objects. Avoid passing this. Pass this through one of `transcript_bucket_uri` or `audio_bucket_uri`.
    - `customMetadataKeys` string[]: Optional. Custom keys to extract as conversation labels from metadata files in `metadata_bucket_uri`. Keys not included in this field will be ignored. Note that there is a limit of 100 labels per conversation.
    - `metadataBucketUri` string: Optional. The Cloud Storage path to the conversation metadata. Note that: [1] Metadata files are expected to be in JSON format. [2] Metadata and source files (transcripts or audio) must be in separate buckets / folders. [3] A source file and its corresponding metadata file must share the same name to be properly ingested, E.g. `gs://bucket/audio/conversation1.mp3` and `gs://bucket/metadata/conversation1.json`.
    - `transcriptBucketUri` string: Optional. The Cloud Storage path to the conversation transcripts. Note that: [1] Transcript files are expected to be in JSON format. [2] Transcript, audio, metadata files must be in separate buckets / folders. [3] A source file and its corresponding metadata file must share the same name to be properly ingested, E.g. `gs://bucket/audio/conversation1.mp3` and `gs://bucket/metadata/conversation1.json`.
  - `parent` string: Required. The parent resource for new conversations.
  - `redactionConfig` GoogleCloudContactcenterinsightsV1RedactionConfig: DLP resources used for redaction while ingesting conversations. DLP settings are applied to conversations ingested from the `UploadConversation` and `IngestConversations` endpoints, including conversation coming from CCAI Platform. They are not applied to conversations ingested from the `CreateConversation` endpoint or the Dialogflow / Agent Assist runtime integrations. When using Dialogflow / Agent Assist runtime integrations, redaction should be performed in Dialogflow / Agent Assist.
    - `deidentifyTemplate` string: The fully-qualified DLP deidentify template resource name. Format: `projects/{project}/deidentifyTemplates/{template}`
    - `inspectTemplate` string: The fully-qualified DLP inspect template resource name. Format: `projects/{project}/locations/{location}/inspectTemplates/{template}`
  - `sampleSize` integer: Optional. If set, this fields indicates the number of objects to ingest from the Cloud Storage bucket. If empty, the entire bucket will be ingested. Unless they are first deleted, conversations produced through sampling won't be ingested by subsequent ingest requests.
  - `speechConfig` GoogleCloudContactcenterinsightsV1SpeechConfig: Speech-to-Text configuration. Speech-to-Text settings are applied to conversations ingested from the `UploadConversation` and `IngestConversations` endpoints, including conversation coming from CCAI Platform. They are not applied to conversations ingested from the `CreateConversation` endpoint.
    - `disableWordTimeOffsets` boolean: Whether to disable word time offsets. If true, the `enable_word_time_offsets` field in the recognition config will be set to false.
    - `speechRecognizer` string: The fully-qualified Speech Recognizer resource name. Format: `projects/{project_id}/locations/{location}/recognizer/{recognizer}`
  - `transcriptObjectConfig` GoogleCloudContactcenterinsightsV1IngestConversationsRequestTranscriptObjectConfig: Configuration for processing transcript objects.
    - `medium` 'MEDIUM_UNSPECIFIED' | 'PHONE_CALL' | 'CHAT': Required. The medium transcript objects represent.

## Response `200`

Successful response

- GoogleLongrunningOperation: This resource represents a long-running operation that is the result of a network API call.
  - `done` boolean: If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
  - `error` GoogleRpcStatus: The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
    - `code` integer: The status code, which should be an enum value of google.rpc.Code.
    - `details` object[]: A list of messages that carry the error details. There is a common set of message types for APIs to use.
    - `message` string: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
  - `metadata` object: Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
  - `name` string: The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.
  - `response` object: The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.

---

[API](https://skmtc.dev/google/apis/contactcenterinsights.md) - [All operations](https://skmtc.dev/google/apis/contactcenterinsights/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/contactcenterinsights/revisions/895c3ce55ea0?raw)
