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

# POST /v3/{+parent}:translateDocument

`POST /v3/{+parent}:translateDocument`

Translates documents in synchronous mode.

## Path parameters

- `parent` string, required

## Request body

- TranslateDocumentRequest — A document translation request.
  - `documentInputConfig` DocumentInputConfig — A document translation request input config.
    - `gcsSource` GcsSource — The Google Cloud Storage location for the input content.
      - `inputUri` string — Required. Source data URI. For example, `gs://my_bucket/my_object`.
    - `content` string, byte — Document's content represented as a stream of bytes.
    - `mimeType` string — Specifies the input document's mime_type. If not specified it will be determined using the file extension for gcs_source provided files. For a file provided through bytes content the mime_type must be provided. Currently supported mime types are: - application/pdf - application/vnd.openxmlformats-officedocument.wordprocessingml.document - application/vnd.openxmlformats-officedocument.presentationml.presentation - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
  - `labels` object — Optional. The labels with user-defined metadata for the request. Label keys and values can be no longer than 63 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter. See https://cloud.google.com/translate/docs/advanced/labels for more information.
  - `model` string — Optional. The `model` type requested for this translation. The format depends on model type: - AutoML Translation models: `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - General (built-in) models: `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, If not provided, the default Google model (NMT) will be used for translation.
  - `customizedAttribution` string — Optional. This flag is to support user customized attribution. If not provided, the default is `Machine Translated by Google`. Customized attribution should follow rules in https://cloud.google.com/translate/attribution#attribution_and_logos
  - `sourceLanguageCode` string — Optional. The ISO-639 language code of the input document if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in [Language Support](https://cloud.google.com/translate/docs/languages). If the source language isn't specified, the API attempts to identify the source language automatically and returns the source language within the response. Source language must be specified if the request contains a glossary or a custom model.
  - `glossaryConfig` TranslateTextGlossaryConfig — Configures which glossary is used for a specific target language and defines options for applying that glossary.
    - `ignoreCase` boolean — Optional. Indicates match is case insensitive. The default value is `false` if missing.
    - `contextualTranslationEnabled` boolean — Optional. If set to true, the glossary will be used for contextual translation.
    - `glossary` string — Required. The `glossary` to be applied for this translation. The format depends on the glossary: - User-provided custom glossary: `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`
  - `isTranslateNativePdfOnly` boolean — Optional. is_translate_native_pdf_only field for external customers. If true, the page limit of online native pdf translation is 300 and only native pdf pages will be translated.
  - `enableShadowRemovalNativePdf` boolean — Optional. If true, use the text removal server to remove the shadow text on background image for native pdf translation. Shadow removal feature can only be enabled when is_translate_native_pdf_only: false && pdf_native_only: false
  - `targetLanguageCode` string — Required. The ISO-639 language code to use for translation of the input document, set to one of the language codes listed in [Language Support](https://cloud.google.com/translate/docs/languages).
  - `documentOutputConfig` DocumentOutputConfig — A document translation request output config.
    - `gcsDestination` GcsDestination — The Google Cloud Storage location for the output content.
      - `outputUriPrefix` string — Required. The bucket used in 'output_uri_prefix' must exist and there must be no files under 'output_uri_prefix'. 'output_uri_prefix' must end with "/" and start with "gs://". One 'output_uri_prefix' can only be used by one batch translation job at a time. Otherwise an INVALID_ARGUMENT (400) error is returned.
    - `mimeType` string — Optional. Specifies the translated document's mime_type. If not specified, the translated file's mime type will be the same as the input file's mime type. Currently only support the output mime type to be the same as input mime type. - application/pdf - application/vnd.openxmlformats-officedocument.wordprocessingml.document - application/vnd.openxmlformats-officedocument.presentationml.presentation - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
  - `enableRotationCorrection` boolean — Optional. If true, enable auto rotation correction in DVS.

## Response `200`

Successful response

---

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