メインコンテンツまでスキップ

ブランチ - Create branch

ルートURL

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

説明

既存のブランチから、オプションで特定のチェックポイントを指定して、新しいブランチを作成します。

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 リクエスト

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

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

パラメーター

名前タイプRequired説明
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.
sourceCheckpointIdstringThe id of the checkpoint to create the new branch from. Must belong to the source branch. If not specified, the latest checkpoint of the source branch will be used.

レスポンススキーマ

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

エラー

コード説明
400Invalid request / branch name already exists
401Unauthorized
403Forbidden
404Project not found / Branch not found
429Too many requests

レート制限

このルートは通常のレート制限を使用します。