Skip to main content

Branches - Create branch

Route URL​

POST https://playcanvas.com/api/branches

Description​

Create a new branch from an existing branch and optionally from a specific checkpoint.

Example​

curl -H "Authorization: Bearer {accessToken}" -H "Content-Type: application/json" -X POST -d '{"projectId": {projectId}, "name": "My New Branch", "sourceBranchId": "{sourceBranchId}"}' "https://playcanvas.com/api/branches"

HTTP Request

POST https://playcanvas.com/api/branches
Authorization: Bearer {accessToken}
Content-Type: application/json

{
"projectId": {projectId},
"name": "My New Branch",
"sourceBranchId": "{sourceBranchId}"
}

Parameters​

NameTypeRequiredDefaultDescription
namestring✔️—The name of the new branch. Must be non-empty and cannot exceed 1000 characters.
projectIdnumber✔️—The id of the project.
sourceBranchIdstring✔️—The id of the branch to create the new branch from.
sourceCheckpointIdstringLatest checkpointThe id of the checkpoint to create the new branch from. Must belong to the source branch.

Response Schema​

Status: 201 Created
{
"id": string,
"projectId": int,
"name": string,
"createdAt": date,
"closed": bool,
"permanent": bool,
"latestCheckpointId": string,
"user": {
"id": int,
"fullName": string,
"username": string
}
}

Errors​

CodeDescription
400Invalid request / branch name already exists
401Unauthorized
403Forbidden
404Project not found / Branch not found
429Too many requests

Rate Limiting​

This route uses a normal rate limit.