---
title: "Edit String"
method: PATCH
path: "/projects/{projectId}/strings/{stringId}"
tags: ["Source Strings"]
---

# Edit String

`PATCH /projects/{projectId}/strings/{stringId}`

## Request

- Base URL: `https://api.crowdin.com/api/v2`
- URL: `https://api.crowdin.com/api/v2/projects/{projectId}/strings/{stringId}`
- Auth: none declared
- TypeScript: <https://skmtc.dev/crowdin/apis/crowdin-enterprise-api-v2/docs/projects/:projectId/strings/:stringId/patch.ts> (a function with typed inputs; its response is checked against the schema)

**Required scopes:** `project.source.string` (Read and Write).

## Path parameters

- `projectId` integer, required
- `stringId` integer, required

## Query parameters

- `updateOption` 'keep_translations_and_approvals' | 'keep_translations' | 'clear_translations_and_approvals'

## Request body

- EnterpriseStringOperation[]: A JSON Patch document as defined by <a href="https://tools.ietf.org/html/rfc6902#section-3" target="_blank">RFC 6902</a>
  - `op` 'replace' | 'test', required: Patch operation to perform
  - `path` '/identifier' | '/text' | '/context' | '/isHidden' | '/maxLength' | '/labelIds' | '/fields' | '/fields/{fieldSlug}', json-pointer, required: A JSON Pointer as defined by <a href="https://tools.ietf.org/html/rfc6901" target="_blank">RFC 6901</a>

## Response `200`

String was successfully updated

- EnterpriseFileBasedStringResource: Base schema of resource container. Container is a wrapper object that contains payload in required `data` property and provides space for adding any other metadata.
  - `data` FileBasedString, required
    - `id` integer
    - `projectId` integer
    - `branchId` integer, nullable
    - `identifier` string
    - `text` union
      - string
      - object
    - `type` string
    - `context` string
    - `maxLength` integer
    - `isHidden` boolean
    - `isDuplicate` boolean
    - `masterStringId` integer, nullable
    - `hasPlurals` boolean: Use fields `type` and `text` instead
    - `isIcu` boolean: Use field `type` instead
    - `labelIds` integer[]
    - `webUrl` string
    - `createdAt` string, date-time, nullable
    - `updatedAt` string, date-time, nullable
    - `fields` EnterpriseAdditionalFields: Fields. Keys get via [List Fields](#operation/api.fields.getMany)
    - `fileId` integer
    - `directoryId` integer, nullable
    - `revision` integer

## Other responses

- `400`: Invalid Request Body
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Project or string with specified id was not found
- `405`: Method Not Allowed
- `409`: Conflict
- `500`: Internal Server Error
- `503`: Service Unavailable

---

[API](https://skmtc.dev/crowdin/apis/crowdin-enterprise-api-v2.md) - [All operations](https://skmtc.dev/crowdin/apis/crowdin-enterprise-api-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/crowdin/apis/crowdin-enterprise-api-v2/revisions/dc68744c5384?raw)
