POST/v2/projects/{projectId}/branches

Create a project branch

Creates a branch in a project from an origin branch. Supply the new branch name and the originBranchId to identify the branch to copy from.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 parameter · 2 body fields
projectIdintegerrequired
The project identifier, as a 64-bit integer.

Details for the new branch, including its name and origin branch.

namestringrequired
Branch name
originBranchIdintegerrequired
Origin branch id

5 status codes
200Returns the created branch, including its identifier, name, active state, default and protected flags, and available origin and creation details.
activebooleanrequired
Indicates whether this branch is currently active (visible and usable for editing translations and keys). Inactive branches are hidden but still stored in the project.
authorobjectoptional
createdAtintegeroptional
Date of branch creation
idintegerrequired
Unique identifier of the branch
isDefaultbooleanrequired
Is branch default
isProtectedbooleanrequired
Is branch protected
mergeobjectoptional
namestringrequired
Human-readable name of the branch. Similar to Git branch names, it identifies the feature or purpose of this branch (e.g. 'feature-login-page')
originBranchNamestringoptional
Name of the branch this branch was created from
400Returned when the request body is invalid or does not include `name` or `originBranchId`.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
401Returned when the request is not authenticated.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
403Returned when the authenticated user is not permitted to access the requested resource.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
404Returned when the project or origin branch does not exist.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional

Error handling

A 400 is returned when the request body is invalid or omits name or originBranchId. A 401 is returned when the request is unauthenticated, a 403 when the authenticated user lacks access, and a 404 when the project or origin branch does not exist. The projectId path parameter must be a 64-bit integer identifier.