---
title: "Update a key"
method: PATCH
path: "/projects/{project_id}/keys/{id}"
tags: ["Keys"]
---

# Update a key

`PATCH /projects/{project_id}/keys/{id}`

Update an existing key.

## Path parameters

- `project_id` string, required
- `id` string, required

## Headers

- `X-PhraseApp-OTP` string

## Request body

- object
  - `branch` string — specify the branch to use
  - `name` string — Key name
  - `description` string — Key description (usually includes contextual information for translators)
  - `plural` boolean — Indicates whether key supports pluralization
  - `use_ordinal_rules` boolean — Indicates whether key uses ordinal rules for pluralization
  - `name_plural` string — Plural name for the key (used in some file formats, e.g. Gettext)
  - `data_type` string — Type of the key. Can be one of the following: string, number, boolean, array, markdown.
  - `tags` string — List of tags separated by comma to be associated with the key.
  - `max_characters_allowed` integer — Max. number of characters translations for this key can have.
  - `screenshot` string, binary — Screenshot/image for the key. This parameter is deprecated. Please use the Screenshots endpoint instead.
  - `remove_screenshot` boolean — Indicates whether the screenshot will be deleted. This parameter is deprecated. Please use the Screenshots endpoint instead.
  - `unformatted` boolean — Indicates whether the key should be exported as "unformatted". Supported by Android XML and other formats.
  - `xml_space_preserve` boolean — Indicates whether the key should be exported with "xml:space=preserve". Supported by several XML-based formats.
  - `original_file` string — Original file attribute. Used in some formats, e.g. XLIFF.
  - `localized_format_string` string — NSStringLocalizedFormatKey attribute. Used in .stringsdict format.
  - `localized_format_key` string — NSStringLocalizedFormatKey attribute. Used in .stringsdict format.
  - `custom_metadata` object — 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.
  - `excluded_in_locales` string[] — Locales for which translations of this key are excluded from exports. Pass an empty array to clear exclusions.
  - `format_value_type` string — Override of the value type for the key in the export. Most useful for formats like Android XML that distinguish string vs. plural resources.

## Response `200`

OK

- TranslationKeyDetails
  - `id` string
  - `name` string
  - `description` string
  - `name_hash` string
  - `plural` boolean
  - `use_ordinal_rules` boolean
  - `tags` string[]
  - `data_type` string
  - `created_at` string, date-time
  - `updated_at` string, date-time
  - `name_plural` string
  - `comments_count` integer
  - `max_characters_allowed` integer
  - `screenshot_url` string
  - `unformatted` boolean
  - `xml_space_preserve` boolean
  - `original_file` string
  - `format_value_type` string
  - `creator` UserPreview
    - `id` string
    - `username` string
    - `name` string
    - `gravatar_uid` string
  - `custom_metadata` object

## Other responses

- `400` — Bad request. The request could not be parsed or a parameter failed validation. Verify the request body, the content type, and the parameter types, then retry.
- `401` — Unauthorized. Authentication failed because the access token is missing, expired, or invalid. Supply a valid access token and retry.
- `403` — Forbidden. The credentials are valid but not permitted for this request: the access token may lack the required scope, the user may lack permission on the resource, or the account plan may not include the feature. Use a token with the required scope on an account and user that hold the necessary permissions.
- `404` — Not found. The requested resource does not exist or is not visible to the authenticated user. Verify the identifiers in the request path and that the token has access to them, then retry.
- `422` — Unprocessable entity. The request was well-formed but failed validation. The response body lists each offending field in the `errors` array, with its resource, field, and a human-readable message. Correct the listed fields and retry.
- `429` — Too many requests. The rate limit has been exceeded. Wait until the time indicated by the `X-Rate-Limit-Reset` response header before retrying.

---

[API](https://skmtc.net/phrase/apis/control-hub-service.md) · [All operations](https://skmtc.net/phrase/apis/control-hub-service/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/phrase/control-hub-service/revisions/98ecac7ba2bf/schema)
