v1

latestOpenAPI 3.0.0Proprietary2026-07-26316155742.7 KB
Keys

Create a key

Create a new key.

post/projects/{project_id}/keys

Path parameters

project_idstring required

Project ID

Headers

X-PhraseApp-OTPstring

Two-Factor-Authentication token (optional)

Request body

branchstring

specify the branch to use

namestring required

Key name

descriptionstring

Key description (usually includes contextual information for translators)

pluralboolean

Indicates whether key supports pluralization

use_ordinal_rulesboolean

Indicates whether key uses ordinal rules for pluralization

name_pluralstring

Plural name for the key (used in some file formats, e.g. Gettext)

data_typestring

Type of the key. Can be one of the following: string, number, boolean, array, markdown.

tagsstring

List of tags separated by comma to be associated with the key.

max_characters_allowedinteger

Max. number of characters translations for this key can have.

screenshotstring binary

Screenshot/image for the key. This parameter is deprecated. Please use the Screenshots endpoint instead.

remove_screenshotboolean

Indicates whether the screenshot will be deleted. This parameter is deprecated. Please use the Screenshots endpoint instead.

unformattedboolean

Indicates whether the key should be exported as "unformatted". Supported by Android XML and other formats.

default_translation_contentstring

Creates a translation in the default locale with the specified content

autotranslateboolean

Indicates whether the key should be autotranslated to other locales based on the copy provided in default_translation_content.

xml_space_preserveboolean

Indicates whether the key should be exported with "xml:space=preserve". Supported by several XML-based formats.

original_filestring

Original file attribute. Used in some formats, e.g. XLIFF.

localized_format_stringstring

NSStringLocalizedFormatKey attribute. Used in .stringsdict format.

localized_format_keystring

NSStringLocalizedFormatKey attribute. Used in .stringsdict format.

custom_metadataobject

Custom metadata property name and value pairs to be associated with key.

excluded_in_localesstring[]

Locales for which translations of this key are excluded from exports. Pass an empty array to clear exclusions.

format_value_typestring

Override of the value type for the key in the export. Most useful for formats like Android XML that distinguish string vs. plural resources.

Example request

{
  "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",
  "default_translation_content": "Default translation content",
  "custom_metadata": {
    "fruit": "Apple",
    "vegetable": "Tomato"
  },
  "excluded_in_locales": [
    "de",
    "fr"
  ],
  "format_value_type": "string"
}

Response

Created

idstring
namestring
descriptionstring
name_hashstring
pluralboolean
use_ordinal_rulesboolean
tagsstring[]
data_typestring
created_atstring date-time
updated_atstring date-time
name_pluralstring
comments_countinteger
max_characters_allowedinteger
screenshot_urlstring
unformattedboolean
xml_space_preserveboolean
original_filestring
format_value_typestring
custom_metadataobject

Example response

{
  "name_plural": "home.index.headlines",
  "comments_count": 2,
  "data_type": "string",
  "max_characters_allowed": 140,
  "screenshot_url": "http://assets.example.com/screenshot.png",
  "unformatted": false,
  "xml_space_preserve": false,
  "original_file": "",
  "format_value_type": "",
  "creator": {
    "id": "abcd1234cdef1234abcd1234cdef1234",
    "username": "joe.doe",
    "name": "Joe Doe"
  },
  "custom_metadata": {
    "fruit": "Apple",
    "vegetable": "Tomato"
  }
}