---
title: "AI File Translations"
method: POST
path: "/ai/file-translations"
tags: ["AI"]
---

# AI File Translations

`POST /ai/file-translations`

## Request

- Base URL: `https://api.crowdin.com/api/v2`
- URL: `https://api.crowdin.com/api/v2/ai/file-translations`
- Auth: none declared
- TypeScript: <https://skmtc.dev/crowdin/apis/crowdin-enterprise-api-v2/docs/ai/file-translations/post.ts> (a function with typed inputs; its response is checked against the schema)

**Required scopes:** `ai.translate` (Read and Write).

## Request body

- AiFileTranslationsForm
  - `storageId` integer, required: Storage Identifier of the file to translate. Get via [List Storages](#operation/api.storages.getMany)
  - `sourceLanguageId` string: Source Language Identifier. Get via [List Supported Languages](#operation/api.languages.getMany). If not specified, auto-detection will be used.
  - `targetLanguageId` string, required: Target Language Identifier. Get via [List Supported Languages](#operation/api.languages.getMany)
  - `type` 'auto' | 'android' | 'macosx' | 'resx' | 'properties' | 'gettext' | 'yaml' | 'php' | 'json' | 'xml' | 'ini' | 'rc' | 'resw' | 'resjson' | 'qtts' | 'joomla' | 'chrome' | 'dtd' | 'dklang' | 'flex' | 'nsh' | 'wxl' | 'xliff' | 'xliff_two' | 'html' | 'haml' | 'txt' | 'csv' | 'md' | 'mdx_v1' | 'mdx_v2' | 'flsnp' | 'fm_html' | 'fm_md' | 'mediawiki' | 'docx' | 'vsdx' | 'xlsx' | 'sbv' | 'properties_play' | 'properties_xml' | 'maxthon' | 'go_json' | 'dita' | 'idml' | 'mif' | 'stringsdict' | 'plist' | 'vtt' | 'vdf' | 'srt' | 'stf' | 'toml' | 'contentful_rt' | 'svg' | 'js' | 'coffee' | 'ts' | 'i18next_json' | 'xaml' | 'arb' | 'adoc' | 'fbt' | 'webxml' | 'nestjs_i18n' | 'loc': Values available: - empty value or 'auto' — Try to detect file type by extension or MIME type - 'android' — Android (*.xml) - 'macosx' — Mac OS X / iOS (*.strings) - 'resx' — .NET, Windows Phone (*.resx) - 'properties' — Java (*.properties) - 'gettext' — GNU GetText (*.po, *.pot) - 'yaml' — Ruby On Rails (*.yaml, *.yml) - 'php' — Hypertext Preprocessor (*.php) - 'json' — Generic JSON (*.json) - 'xml' — Generic XML (*.xml) - 'ini' — Generic INI (*.ini) - 'rc' — Windows Resources (*.rc) - 'resw' — Windows 8 Metro (*.resw) - 'resjson' — Windows 8 Metro (*.resjson) - 'qtts' — Nokia Qt (*.ts) - 'joomla' — Joomla localizable resources (*.ini) - 'chrome' — Google Chrome Extension (*.json) - 'dtd' — Mozilla DTD (*.dtd) - 'dklang' — Delphi DKLang (*.dklang) - 'flex' — Flex (*.properties) - 'nsh' — NSIS Installer Resources (*.nsh) - 'wxl' — WiX Installer (*.wxl) - 'xliff' — XLIFF (*.xliff, *.xlf) - 'xliff_two' — XLIFF 2.0 (*.xliff, *.xlf) - 'html' — HTML (*.html, *.htm, *.xhtml, *.xhtm, *.xht, *.hbs, *.liquid) - 'haml' — Haml (*.haml) - 'txt' — Plain Text (*.txt) - 'csv' — Comma Separated Values (*.csv) - 'md' — Markdown (*.md, *.text, *.markdown...) - 'flsnp' — MadCap Flare (*.flnsp, .flpgpl .fltoc) - 'fm_html' — Jekyll HTML (*.html) - 'fm_md' — Jekyll Markdown (*.md) - 'mediawiki' — MediaWiki (*.wiki, *.wikitext, *.mediawiki) - 'docx' — Microsoft Office, OpenOffice.org Documents, Adobe InDesign, Adobe FrameMaker(*.docx, *.dotx, *.docm, *.dotm, *.xlsx, *.xltx, *.xlsm, *.xltm, *.pptx, *.potx, *.ppsx, *.pptm, *.potm, *.ppsm, *.odt, *.ods, *.odg, *.odp, *.imdl, *.mif) - 'vsdx' — Microsoft Visio (*.vsdx, *.vsdm) - 'xlsx' — Microsoft Excel (*.xlsx) - 'sbv' — Youtube .sbv (*.sbv) - 'properties_play' — Play Framework - 'properties_xml' — Java Application (*.xml) - 'maxthon' — Maxthon Browser (*.ini) - 'go_json' — Go (*.gotext.json) - 'dita' — DITA Document (*.dita, *.ditamap) - 'mif' — Adobe FrameMaker (*.mif) - 'idml' — Adobe InDesign (*.idml) - 'stringsdict' — iOS (*.stringsdict) - 'plist' — Mac OS property list (*.plist) - 'vtt' — Video Subtitling and WebVTT (*.vtt) - 'vdf' — Steamworks Localization Valve Data File (*.vdf) - 'srt' — SubRip .srt (*.srt) - 'stf' — Salesforce (*.stf) - 'toml' — Toml (*.toml) - 'contentful_rt' — Contentful (*.json) - 'svg' — SVG (*.svg) - 'js' — JavaScript (*.js) - 'coffee' — CoffeeScript (*.coffee) - 'nestjs_i18n' - NestJS i18n - 'loc' — LOC (*.loc) __Note__: Use `docx` type to import each cell as a separate source string for XLSX file
  - `parserVersion` integer: Using latest parser version by default. __Note:__ Must be used together with `type`
  - `tmIds` integer[]: Array of Translation Memory IDs. Get via [List TMs](#operation/api.tms.getMany)
  - `glossaryIds` integer[]: Array of Glossary Identifiers. Get via [List Glossaries](#operation/api.glossaries.getMany)
  - `styleGuideIds` integer[]: Array of Style Guide Identifiers. Get via [List Style Guides](#operation/api.style-guides.getMany)
  - `aiPromptId` integer: Pre-Translation Prompt Identifier. Get via [List Prompts](#operation/api.ai.prompts.getMany) __Note:__ Can't be used with `aiProviderId` or `aiModelId` in same request
  - `aiProviderId` integer: AI Provider Identifier. Get via [List AI Providers](#operation/api.ai.providers.getMany) __Note:__ Must be used together with `aiModelId`. Can't be used with `aiPromptId` in same request
  - `aiModelId` string: AI Model ID. Get via [List AI Provider Models](#operation/api.ai.providers.models.getMany) __Note:__ Must be used together with `aiProviderId`. Can't be used with `aiPromptId` in same request
  - `instructions` string[]: Custom instructions for translation
  - `attachmentIds` integer[]: Storage IDs of images to pass to AI as attachments (max 10). Get via [List Storages](#operation/api.storages.getMany) Only image files are allowed: * jpeg * jpg * png * gif * webp

## Response `201`

AI File Translations job created successfully

- AiFileTranslationsJobResource: Base schema of resource container. Container is a wrapper object that contains payload in required `data` property and provides space for adding any other metadata.
  - `data` AiFileTranslationsJobResponseModel, required
    - `identifier` string
    - `status` string
    - `progress` integer: in percentages
    - `attributes` object: Job attributes including error info, stage, and metadata
      - `stage` string: Current stage (start, import, translate, export, done)
      - `error` object, nullable
        - `stage` string
        - `message` string
      - `downloadName` string, nullable
      - `sourceLanguageId` string, nullable: Source language code. If not passed in the request, would be resolved after file parse.
      - `targetLanguageId` string: Target language code
      - `originalFileName` string: Original uploaded file name
      - `detectedType` string, nullable: Detected base file type
      - `parserVersion` integer, nullable: Parser version for the detected file type (if applicable)
    - `createdAt` string, date-time
    - `updatedAt` string, date-time, nullable
    - `startedAt` string, date-time, nullable
    - `finishedAt` string, date-time, nullable

## Other responses

- `400`: Invalid Request Parameters
- `401`: Unauthorized
- `403`: Forbidden
- `404`: AI provider, AI prompt, TM, glossary, style guide or storage with specified id was not found

---

[API](https://skmtc.dev/crowdin/apis/crowdin-enterprise-api-v2.md) - [All operations](https://skmtc.dev/crowdin/apis/crowdin-enterprise-api-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/crowdin/apis/crowdin-enterprise-api-v2/revisions/dc68744c5384?raw)
