github.com/phrase/openapi@v0.0.0-20240514140800-49e8a106740e/paths/keys/update.yaml (about) 1 --- 2 summary: Update a key 3 description: Update an existing key. 4 operationId: key/update 5 tags: 6 - Keys 7 parameters: 8 - "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" 9 - "$ref": "../../parameters.yaml#/project_id" 10 - "$ref": "../../parameters.yaml#/id" 11 responses: 12 '200': 13 description: OK 14 content: 15 application/json: 16 schema: 17 "$ref": "../../schemas/translation_key_details.yaml#/translation_key_details" 18 headers: 19 X-Rate-Limit-Limit: 20 "$ref": "../../headers.yaml#/X-Rate-Limit-Limit" 21 X-Rate-Limit-Remaining: 22 "$ref": "../../headers.yaml#/X-Rate-Limit-Remaining" 23 X-Rate-Limit-Reset: 24 "$ref": "../../headers.yaml#/X-Rate-Limit-Reset" 25 '400': 26 "$ref": "../../responses.yaml#/400" 27 '404': 28 "$ref": "../../responses.yaml#/404" 29 '429': 30 "$ref": "../../responses.yaml#/429" 31 x-code-samples: 32 - lang: Curl 33 source: |- 34 curl "https://api.phrase.com/v2/projects/:project_id/keys/:id" \ 35 -u USERNAME_OR_ACCESS_TOKEN \ 36 -X PATCH \ 37 -F branch=my-feature-branch \ 38 -F name=home.index.headline \ 39 -F description=Some%20description%20worth%20knowing... \ 40 -F name_plural=home.index.headlines \ 41 -F data_type=number \ 42 -F tags=awesome-feature,needs-proofreading \ 43 -F max_characters_allowed=140 \ 44 -F screenshot=@/path/to/my/screenshot.png 45 -F custom_metadata[property]=value 46 - lang: CLI v2 47 source: |- 48 phrase keys update \ 49 --project_id <project_id> \ 50 --id <id> \ 51 --data '{"branch":"my-feature-branch", "name":"home.index.headline", "description": "Some description worth knowing...", "name_plural":"home.index.headlines", "data_type":"number", "tags":"awesome-feature,needs-proofreading", "max_characters_allowed":"140", "screenshot":"/path/to/my/screenshot.png", "custom_metadata": {"property" => "value"}}' \ 52 --access_token <token> 53 requestBody: 54 required: true 55 content: 56 application/json: 57 schema: 58 type: object 59 title: key/update/parameters 60 properties: 61 branch: 62 description: specify the branch to use 63 type: string 64 example: my-feature-branch 65 name: 66 description: Key name 67 type: string 68 example: home.index.headline 69 description: 70 description: Key description (usually includes contextual information for translators) 71 type: string 72 example: Some description worth knowing... 73 plural: 74 description: Indicates whether key supports pluralization 75 type: boolean 76 example: 77 name_plural: 78 description: Plural name for the key (used in some file formats, e.g. Gettext) 79 type: string 80 example: home.index.headlines 81 data_type: 82 description: 'Type of the key. Can be one of the following: string, number, boolean, array, markdown.' 83 type: string 84 example: number 85 tags: 86 description: List of tags separated by comma to be associated with the key. 87 type: string 88 example: awesome-feature,needs-proofreading 89 max_characters_allowed: 90 description: Max. number of characters translations for this key can have. 91 type: integer 92 example: 140 93 screenshot: 94 description: Screenshot/image for the key. This parameter is deprecated. Please use the Screenshots endpoint instead. 95 type: string 96 format: binary 97 example: "/path/to/my/screenshot.png" 98 deprecated: true 99 remove_screenshot: 100 description: Indicates whether the screenshot will be deleted. This parameter is deprecated. Please use the Screenshots endpoint instead. 101 type: boolean 102 example: 103 deprecated: true 104 unformatted: 105 description: Indicates whether the key should be exported as "unformatted". Supported by Android XML and other formats. 106 type: boolean 107 example: 108 xml_space_preserve: 109 description: Indicates whether the key should be exported with "xml:space=preserve". Supported by several XML-based formats. 110 type: boolean 111 example: 112 original_file: 113 description: Original file attribute. Used in some formats, e.g. XLIFF. 114 type: string 115 example: 116 localized_format_string: 117 description: NSStringLocalizedFormatKey attribute. Used in .stringsdict format. 118 type: string 119 example: 120 localized_format_key: 121 description: NSStringLocalizedFormatKey attribute. Used in .stringsdict format. 122 type: string 123 example: 124 custom_metadata: 125 description: Updates/Creates custom metadata property name and value pairs to be associated with key. If you want to delete a custom metadata property, you can set its value to null. If you want to update a custom metadata property, you can set its value to the new value. 126 type: object 127 example: 128 fruit: Apple 129 vegetable: Tomato 130 x-cli-version: '2.5'