---
updatedAt: 2026-09-30T16:49:22.000Z
agentTools:
  projectIndex: https://developers.localizejs.com/llms.txt
---

# Create phrase(s)

Create 1 or more new source language phrases for a project

NOTES:

1. When you create a new phrase, its state is set to `active` by default.
   1. You can change this by setting the `state` field.
2. If the phrase already exists in your Localize dashboard, the endpoint will return `success` and the `existingPhrase` field will be set to `1`.
3. For new phrases, the internal phrase IDs will be returned in a successful call.

<br />

<Callout icon="📘" theme="info">
  ### Max 500

  You can create up to the maximum of 500 new phrases in one call.
</Callout>

<Callout icon="🚧" theme="warn">
  ### Using Variables

  If your phrases include variables, you are required to provide a `name` attribute for the variable, or the phrase won't work properly in your Localize dashboard.

  Correct:<br />`Welcome back, <var username>theC00lkid</var>.`

  Incorrect:<br />`Welcome back, <var>theC00lkid</var>.`
</Callout>

You can <Anchor target="_blank" href="https://localizejs.com/settings/organization/api-keys">create and view your private API Key here</Anchor>.

<HTMLBlock>{`

<div class="param-type-header" style="margin-left: 0px;"><h3>Try it</h3></div>
<div style="margin: 0% 2%;">

<div style="background-color: #fff3cd; border-left: 4px solid #f0ad4e; padding: 12px 16px; margin: 16px 0; border-radius: 4px;">
  <p style="margin: 0;"><strong>⚠️ This uses your production account</strong></p>
  <p style="margin: 8px 0 0;">The <b>Try It</b> feature sends <strong>real API requests directly to your production Localize account</strong>. There is no sandbox, demo, or test environment. Requests are authenticated using your Localize API Key and operate directly on your production data.</p>
</div>

<p>To use the <b>Try It</b> feature:</p>
<ol>
  <li>Enter your <strong>production Localize API Key</strong> in the <b>Header</b> field in the AUTHENTICATION section on the right.</li>
  <li>Fill in all required fields below, and any optional fields as needed.</li>
  <li>Click the <b>Try it</b> button to send the request.</li>
  <li>View the API response and any errors on the right side of the screen.</li>
</ol>

<div style="background-color: #f8d7da; border-left: 4px solid #dc3545; padding: 12px 16px; margin: 16px 0; border-radius: 4px;">
  <p style="margin: 0;"><strong>🚨 Changes are applied to production</strong></p>
  <p style="margin: 8px 0 0;">Any changes made by the API request will affect your <strong>production Localize account</strong>. Use this feature with the same care as you would when making the request from your own application.</p>
</div>

<p>You can also copy the sample code provided on the right side of the screen and use it as a starting point for making requests from your own application.</p>

</div>
`}</HTMLBlock>

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "rest-api",
    "version": "4.0"
  },
  "servers": [
    {
      "url": "https://api.localizejs.com/v2.0",
      "description": "Production Public API",
      "variables": {
        "env": {
          "default": "prod",
          "description": "Environment: production",
          "enum": [
            "prod"
          ]
        },
        "version": {
          "default": "v2",
          "description": "API version"
        }
      }
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "x-bearer-format": "bearer",
        "x-default": "API_TOKEN_HERE"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/projects/{projectKey}/phrases": {
      "post": {
        "summary": "Create phrase(s)",
        "description": "Create 1 or more new source language phrases for a project",
        "operationId": "projectsprojectkeyphrases",
        "parameters": [
          {
            "name": "projectKey",
            "in": "path",
            "description": "The Project Key (this is NOT the Project ID)",
            "required": true,
            "schema": {
              "type": "string",
              "default": "YOUR_PROJECT_KEY"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "phrases"
                ],
                "properties": {
                  "phrases": {
                    "type": "array",
                    "description": "<p>An array of new phrases to add. Each new phrase is a phrase object. (max 500 phrases per call)</p><br><b>Phrase Object Properties:</b><br><dl><dt>phrase<sup>*</sup></dt><dd>String; REQUIRED; Your new phrase in the source language.</dd><dt>phraseKey</dt><dd>String; The unique 'key' of the phrase, often used in mobile app frameworks. (required for phrases in mobile/files projects, but not allowed for Web projects and Glossary entries)</dd><dt>type*</dt><dd>String; REQUIRED; Valid values are \"phrase\" or \"glossary\". Defaults to \"phrase\" if not specified. If set to \"glossary\", context and labels are ignored.</dd><dt>state*</dt><dd>String; REQUIRED; The desired state of the phrase, defaults to \"active\".</dd><dt>translations</dt><dd>An array of the translations of the source string for any or all target languages.</dt><dt>context</dt><dd>String; Provides your translators with some context for the phrase.</dd><dt>labels</dt><dd>An optional array of labels (can include \"auto-approve\").</dd></dl><br>Click the '+' below to add a new phrase.",
                    "items": {
                      "properties": {
                        "phrase": {
                          "type": "string",
                          "description": "This is the new phrase in the source language."
                        },
                        "phraseKey": {
                          "type": "string",
                          "description": "The unique 'key' of the phrase, often used in mobile app frameworks. (required for phrases in mobile/files projects, but not allowed for Web projects and Glossary entries)"
                        },
                        "type": {
                          "type": "string",
                          "description": "Valid values are **phrase** or **glossary**. Defaults to **phrase** if not specified. If set to **glossary**, context and labels are ignored.",
                          "default": "phrase",
                          "enum": [
                            "phrase",
                            "glossary"
                          ]
                        },
                        "state": {
                          "type": "string",
                          "description": "The desired \"state\" of the phrase. Possible values are `active`, `pending`, `spam`, `outdated`, `blocked`, and `inactive`. Defaults to `active` if not specified. <br/>- Corresponding bins for the various phrase states:<ul><li>`active` = Published and all In-Progress bins</li><li>`pending` = Needs Approval</li><li>`spam` = Spam</li><li>`outdated` = Deprecated</li><li>`blocked` = Blocked</li><li>`inactive` = Trash</li></ul>",
                          "default": "active",
                          "enum": [
                            "active",
                            "pending",
                            "spam",
                            "outdated",
                            "blocked",
                            "inactive"
                          ]
                        },
                        "translations": {
                          "type": "array",
                          "description": "An array of the translations of the source string for any or all target languages.",
                          "items": {
                            "properties": {
                              "language": {
                                "type": "string",
                                "description": "The language code for the translation."
                              },
                              "value": {
                                "type": "string",
                                "description": "The translation."
                              }
                            },
                            "type": "object"
                          }
                        },
                        "context": {
                          "type": "string",
                          "description": "Give your translators some context for the phrase."
                        },
                        "labels": {
                          "type": "array",
                          "description": "Add custom or reserved labels to the phrase. Must be an ARRAY of labels to add (as strings NOT objects). One reserved label you can add here is \"auto-approve\" - this will automatically put the phrase into the Published bin.",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "phrase",
                        "type",
                        "state"
                      ],
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "\"meta\": {\n  \"status\": 200,\n  \"success\": true\n}"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```