v1

latestOpenAPI 3.0.32026-07-2415128381.3 KB
Files

Upload a file

Queues a localization file for import and returns a <code>202</code> or <code>302</code> response along with a <a href="#object-queued-processes">Queued process</a> object. <a href="https://docs.lokalise.com/developer-docs/uploading-files" target="`_new`">Learn more</a>. Requires Upload files admin right. <a href="https://docs.lokalise.com/en/collections/2909229-supported-file-formats" target=_new>Supported file types</a>.

Please note that the <code>302</code> response code is not currently used, but in the future it will be returned if the same file is already in the upload queue.

Requires <code>write_files</code> OAuth access scope.

post/projects/{project_id}/files/upload

Path parameters

project_idstring required

A unique project identifier

Request body

datastring required

Base64 encoded file. Must be one of the supported file types.

filenamestring required

Set the filename. You may optionally use a relative path in the filename (e.g admin/main.json), however keep in mind that path would become a unique part of the file.

lang_isostring required

Language code of the translations in the file you are importing.

convert_placeholdersboolean

Enable to automatically convert placeholders to the Lokalise universal placeholders.

detect_icu_pluralsboolean

Enable to automatically detect and parse ICU formatted plurals in your translations.

tagsstring[]

Tag keys with the specified tags. By default tags are applied to created and updated keys.

tag_inserted_keysboolean

Add specified tags to inserted keys.

tag_updated_keysboolean

Add specified tags to updated keys.

tag_skipped_keysboolean

Add specified tags to skipped keys.

tag_parsed_keysboolean

Add tags parsed from the uploaded file (e.g. Structured JSON per-key tags) to the corresponding keys.

replace_modifiedboolean

Enable to replace translations, that have been modified (in the file being uploaded).

replace_metadataboolean

Structured JSON only. Enable to replace key metadata (tags, notes, character limit) with the values from the uploaded file. Tags added manually (via the editor, bulk actions, tasks or connectors) are preserved; only tags previously set by a file upload are replaced. Defaults to false.

slashn_to_linebreakboolean

Enable to replace \n with a line break.

keys_to_valuesboolean

Enable to automatically replace values with key names.

distinguish_by_fileboolean

Enable to allow keys with similar names to coexist, in case they are assigned to different filenames.

apply_tmboolean

Enable to automatically apply 100% translation memory matches. This option will take priority over <code>use_automations</code> if set to <code>true</code>.

use_automationsboolean

Whether to run automations for this upload.

hidden_from_contributorsboolean

Enable to automatically set newly created keys as "Hidden from contributors".

cleanup_modeboolean

Enable to delete all keys with all language translations that are not present in the uploaded file. You may want to make a snapshot of the project before importing new file, just in case.

custom_translation_status_idsstring[]

Custom translation status IDs to be added to translations. By default statuses are applied to created and updated translations.

custom_translation_status_inserted_keysboolean

Add specified custom translation statuses to inserted keys.

custom_translation_status_updated_keysboolean

Add specified custom translation statuses to updated keys.

custom_translation_status_skipped_keysboolean

Add specified custom translation statuses to skipped keys.

skip_detect_lang_isoboolean

Skip automatic language detection by filename.

formatstring

File format (e.g. json, strings, xml). Must be file extension of any of the file formats we support.

filter_task_idnumber

Apply import results as a part of a task. Available only for offline_xliff file format.

titlestring

Set a human-readable title for the uploaded file, displayed in the UI instead of the filename. Maximum 256 characters. Relevant for Marketing and support (M&S) project types only.

Response

OK

project_idstring