github.com/phrase/openapi@v0.0.0-20240514140800-49e8a106740e/paths/uploads/create.yaml (about) 1 --- 2 summary: Upload a new file 3 description: Upload a new language file. Creates necessary resources in your project. 4 operationId: upload/create 5 tags: 6 - Uploads 7 parameters: 8 - "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" 9 - "$ref": "../../parameters.yaml#/project_id" 10 responses: 11 '201': 12 description: Created 13 content: 14 application/json: 15 schema: 16 "$ref": "../../schemas/upload.yaml#/upload" 17 headers: 18 X-Rate-Limit-Limit: 19 "$ref": "../../headers.yaml#/X-Rate-Limit-Limit" 20 X-Rate-Limit-Remaining: 21 "$ref": "../../headers.yaml#/X-Rate-Limit-Remaining" 22 X-Rate-Limit-Reset: 23 "$ref": "../../headers.yaml#/X-Rate-Limit-Reset" 24 '400': 25 "$ref": "../../responses.yaml#/400" 26 '404': 27 "$ref": "../../responses.yaml#/404" 28 '429': 29 "$ref": "../../responses.yaml#/429" 30 x-code-samples: 31 - lang: Curl 32 source: |- 33 curl "https://api.phrase.com/v2/projects/:project_id/uploads" \ 34 -u USERNAME_OR_ACCESS_TOKEN \ 35 -X POST \ 36 -F branch=my-feature-branch \ 37 -F file=@/path/to/my/file.json \ 38 -F file_format=json \ 39 -F locale_id=abcd1234cdef1234abcd1234cdef1234 \ 40 -F tags=awesome-feature,needs-proofreading \ 41 -F locale_mapping[en]=2 \ 42 -F format_options[foo]=bar 43 - lang: CLI v2 44 source: |- 45 phrase uploads create \ 46 --project_id <project_id> \ 47 --branch my-feature-branch \ 48 --file /path/to/my/file.json \ 49 --file_format json \ 50 --locale_id abcd1234cdef1234abcd1234cdef1234 \ 51 --tags awesome-feature,needs-proofreading \ 52 --locale_mapping '{"en": "2"}' \ 53 --format_options '{"foo": "bar"}' \ 54 --access_token <token> 55 requestBody: 56 required: true 57 content: 58 multipart/form-data: 59 schema: 60 type: object 61 title: upload/create/parameters 62 required: 63 - file 64 - file_format 65 - locale_id 66 properties: 67 branch: 68 description: specify the branch to use 69 type: string 70 example: my-feature-branch 71 file: 72 description: File to be imported 73 type: string 74 format: binary 75 example: "/path/to/my/file.json" 76 file_format: 77 description: File format. Auto-detected when possible and not specified. 78 type: string 79 example: json 80 locale_id: 81 description: Locale of the file's content. Can be the name or id of the locale. Preferred is id. 82 type: string 83 example: abcd1234cdef1234abcd1234cdef1234 84 tags: 85 description: List of tags separated by comma to be associated with the new keys contained in the upload. 86 type: string 87 example: awesome-feature,needs-proofreading 88 update_translations: 89 description: Indicates whether existing translations should be updated with the file content. 90 type: boolean 91 example: 92 update_translation_keys: 93 description: Pass `false` here to prevent new keys from being created and existing keys updated. 94 type: boolean 95 default: true 96 example: 97 update_descriptions: 98 description: Existing key descriptions will be updated with the file content. Empty descriptions overwrite existing descriptions. 99 type: boolean 100 example: 101 convert_emoji: 102 description: This option is obsolete. Providing the option will cause a bad request error. 103 type: boolean 104 example: 105 deprecated: true 106 skip_upload_tags: 107 description: Indicates whether the upload should not create upload tags. 108 type: boolean 109 example: 110 skip_unverification: 111 description: Indicates whether the upload should unverify updated translations. 112 type: boolean 113 example: 114 file_encoding: 115 description: Enforces a specific encoding on the file contents. Valid options are "UTF-8", "UTF-16" and "ISO-8859-1". 116 type: string 117 example: 118 locale_mapping: 119 description: Mapping between locale names and translation columns. Required in some formats like CSV or XLSX. 120 type: object 121 properties: {} 122 example: '{"en": "2"}' 123 format_options: 124 description: Additional options available for specific formats. See our format guide for complete list. 125 type: object 126 properties: {} 127 example: '{"foo": "bar"}' 128 autotranslate: 129 description: If set, translations for the uploaded language will be fetched automatically. 130 type: boolean 131 example: 132 mark_reviewed: 133 description: Indicated whether the imported translations should be marked as reviewed. This setting is available if the review workflow is enabled for the project. 134 type: boolean 135 example: 136 tag_only_affected_keys: 137 description: Indicates whether only keys affected (created or updated) by the upload should be tagged. The default is `false` 138 type: boolean 139 default: false 140 example: 141 x-cli-version: '2.12'