---
title: "Upload a file"
method: POST
path: "/projects/{project_id}/files/upload"
tags: ["Files"]
---

# Upload a file

`POST /projects/{project_id}/files/upload`

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.

## Path parameters

- `project_id` string, required

## Request body

- object
  - `data` string, required — Base64 encoded file. Must be one of the supported file types.
  - `filename` string, 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_iso` string, required — Language code of the translations in the file you are importing.
  - `convert_placeholders` boolean — Enable to automatically convert placeholders to the Lokalise universal placeholders.
  - `detect_icu_plurals` boolean — Enable to automatically detect and parse ICU formatted plurals in your translations.
  - `tags` string[] — Tag keys with the specified tags. By default tags are applied to created and updated keys.
  - `tag_inserted_keys` boolean — Add specified tags to inserted keys.
  - `tag_updated_keys` boolean — Add specified tags to updated keys.
  - `tag_skipped_keys` boolean — Add specified tags to skipped keys.
  - `tag_parsed_keys` boolean — Add tags parsed from the uploaded file (e.g. Structured JSON per-key tags) to the corresponding keys.
  - `replace_modified` boolean — Enable to replace translations, that have been modified (in the file being uploaded).
  - `replace_metadata` boolean — 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_linebreak` boolean — Enable to replace \n with a line break.
  - `keys_to_values` boolean — Enable to automatically replace values with key names.
  - `distinguish_by_file` boolean — Enable to allow keys with similar names to coexist, in case they are assigned to different filenames.
  - `apply_tm` boolean — 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_automations` boolean — Whether to run automations for this upload.
  - `hidden_from_contributors` boolean — Enable to automatically set newly created keys as "Hidden from contributors".
  - `cleanup_mode` boolean — 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_ids` string[] — Custom translation status IDs to be added to translations. By default statuses are applied to created and updated translations.
  - `custom_translation_status_inserted_keys` boolean — Add specified custom translation statuses to inserted keys.
  - `custom_translation_status_updated_keys` boolean — Add specified custom translation statuses to updated keys.
  - `custom_translation_status_skipped_keys` boolean — Add specified custom translation statuses to skipped keys.
  - `skip_detect_lang_iso` boolean — Skip automatic language detection by filename.
  - `format` string — File format (e.g. json, strings, xml). Must be file extension of any of the file formats we support.
  - `filter_task_id` number — Apply import results as a part of a task. Available only for offline_xliff file format.
  - `title` string — 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 `200`

OK

- object
  - `project_id` string
  - `process` QueuedProcesses
    - `process_id` string — A unique process identifier.
    - `type` string — The type of the process. Can be <code>file-import</code>, <code>sketch-import</code> or <code>bulk-apply-tm</code>.
    - `status` string — Current status of the process. Can be <code>queued</code>, <code>pre_processing</code>, <code>running</code>, <code>post_processing</code>, <code>cancelled</code>, <code>finished</code> or <code>failed</code>.
    - `message` string — Can contain a message related to the current process status (such as an error message).
    - `created_by` number — ID of a user who initiated the process.
    - `created_by_email` string — email of a user who initiated the process.
    - `created_at` string — Date of when the process was created in the queue.
    - `created_at_timestamp` number — Unix timestamp of when the process was created in the queue.

## Other responses

- `202` — Accepted
- `302` — Found

---

[API](https://skmtc.net/lokalise/apis/default-projects.md) · [All operations](https://skmtc.net/lokalise/apis/default-projects/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/lokalise/default-projects/revisions/7bceba421b12/schema)
