Create a new project branch
/v0/projects/{project}/branches
Create a new branch for a project.
The branch inherits the config files from the revision pointed to by the
branch_from parameter. In addition, if the revision is a branch name,
the branch will also inherit custom code changes from that branch.
Path Parameters
project: optional string
Body Parameters
Returns
Create a new project branch
curl https://api.stainless.com/v0/projects/$PROJECT/branches \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $STAINLESS_API_KEY" \
-d '{
"branch": "branch",
"branch_from": "branch_from"
}'
{
"branch": "branch",
"config_commit": {
"repo": {
"branch": "branch",
"name": "name",
"owner": "owner"
},
"sha": "sha"
},
"latest_build": {
"id": "id",
"config_commit": "config_commit",
"created_at": "2019-12-27T18:11:19.117Z",
"documented_spec": {
"content": "content",
"type": "content"
},
"object": "build",
"org": "org",
"project": "project",
"targets": {
"cli": {
"commit": {
"status": "not_started"
},
"install_url": "install_url",
"lint": {
"status": "not_started"
},
"object": "build_target",
"status": "not_started",
"test": {
"status": "not_started"
},
"build": {
"status": "not_started"
}
},
"csharp": {
"commit": {
"status": "not_started"
},
"install_url": "install_url",
"lint": {
"status": "not_started"
},
"object": "build_target",
"status": "not_started",
"test": {
"status": "not_started"
},
"build": {
"status": "not_started"
}
},
"go": {
"commit": {
"status": "not_started"
},
"install_url": "install_url",
"lint": {
"status": "not_started"
},
"object": "build_target",
"status": "not_started",
"test": {
"status": "not_started"
},
"build": {
"status": "not_started"
}
},
"java": {
"commit": {
"status": "not_started"
},
"install_url": "install_url",
"lint": {
"status": "not_started"
},
"object": "build_target",
"status": "not_started",
"test": {
"status": "not_started"
},
"build": {
"status": "not_started"
}
},
"kotlin": {
"commit": {
"status": "not_started"
},
"install_url": "install_url",
"lint": {
"status": "not_started"
},
"object": "build_target",
"status": "not_started",
"test": {
"status": "not_started"
},
"build": {
"status": "not_started"
}
},
"node": {
"commit": {
"status": "not_started"
},
"install_url": "install_url",
"lint": {
"status": "not_started"
},
"object": "build_target",
"status": "not_started",
"test": {
"status": "not_started"
},
"build": {
"status": "not_started"
}
},
"php": {
"commit": {
"status": "not_started"
},
"install_url": "install_url",
"lint": {
"status": "not_started"
},
"object": "build_target",
"status": "not_started",
"test": {
"status": "not_started"
},
"build": {
"status": "not_started"
}
},
"python": {
"commit": {
"status": "not_started"
},
"install_url": "install_url",
"lint": {
"status": "not_started"
},
"object": "build_target",
"status": "not_started",
"test": {
"status": "not_started"
},
"build": {
"status": "not_started"
}
},
"ruby": {
"commit": {
"status": "not_started"
},
"install_url": "install_url",
"lint": {
"status": "not_started"
},
"object": "build_target",
"status": "not_started",
"test": {
"status": "not_started"
},
"build": {
"status": "not_started"
}
},
"terraform": {
"commit": {
"status": "not_started"
},
"install_url": "install_url",
"lint": {
"status": "not_started"
},
"object": "build_target",
"status": "not_started",
"test": {
"status": "not_started"
},
"build": {
"status": "not_started"
}
},
"typescript": {
"commit": {
"status": "not_started"
},
"install_url": "install_url",
"lint": {
"status": "not_started"
},
"object": "build_target",
"status": "not_started",
"test": {
"status": "not_started"
},
"build": {
"status": "not_started"
}
}
},
"updated_at": "2019-12-27T18:11:19.117Z"
},
"object": "project_branch",
"org": "org",
"project": "project"
}
Returns Examples
{
"branch": "branch",
"config_commit": {
"repo": {
"branch": "branch",
"name": "name",
"owner": "owner"
},
"sha": "sha"
},
"latest_build": {
"id": "id",
"config_commit": "config_commit",
"created_at": "2019-12-27T18:11:19.117Z",
"documented_spec": {
"content": "content",
"type": "content"
},
"object": "build",
"org": "org",
"project": "project",
"targets": {
"cli": {
"commit": {
"status": "not_started"
},
"install_url": "install_url",
"lint": {
"status": "not_started"
},
"object": "build_target",
"status": "not_started",
"test": {
"status": "not_started"
},
"build": {
"status": "not_started"
}
},
"csharp": {
"commit": {
"status": "not_started"
},
"install_url": "install_url",
"lint": {
"status": "not_started"
},
"object": "build_target",
"status": "not_started",
"test": {
"status": "not_started"
},
"build": {
"status": "not_started"
}
},
"go": {
"commit": {
"status": "not_started"
},
"install_url": "install_url",
"lint": {
"status": "not_started"
},
"object": "build_target",
"status": "not_started",
"test": {
"status": "not_started"
},
"build": {
"status": "not_started"
}
},
"java": {
"commit": {
"status": "not_started"
},
"install_url": "install_url",
"lint": {
"status": "not_started"
},
"object": "build_target",
"status": "not_started",
"test": {
"status": "not_started"
},
"build": {
"status": "not_started"
}
},
"kotlin": {
"commit": {
"status": "not_started"
},
"install_url": "install_url",
"lint": {
"status": "not_started"
},
"object": "build_target",
"status": "not_started",
"test": {
"status": "not_started"
},
"build": {
"status": "not_started"
}
},
"node": {
"commit": {
"status": "not_started"
},
"install_url": "install_url",
"lint": {
"status": "not_started"
},
"object": "build_target",
"status": "not_started",
"test": {
"status": "not_started"
},
"build": {
"status": "not_started"
}
},
"php": {
"commit": {
"status": "not_started"
},
"install_url": "install_url",
"lint": {
"status": "not_started"
},
"object": "build_target",
"status": "not_started",
"test": {
"status": "not_started"
},
"build": {
"status": "not_started"
}
},
"python": {
"commit": {
"status": "not_started"
},
"install_url": "install_url",
"lint": {
"status": "not_started"
},
"object": "build_target",
"status": "not_started",
"test": {
"status": "not_started"
},
"build": {
"status": "not_started"
}
},
"ruby": {
"commit": {
"status": "not_started"
},
"install_url": "install_url",
"lint": {
"status": "not_started"
},
"object": "build_target",
"status": "not_started",
"test": {
"status": "not_started"
},
"build": {
"status": "not_started"
}
},
"terraform": {
"commit": {
"status": "not_started"
},
"install_url": "install_url",
"lint": {
"status": "not_started"
},
"object": "build_target",
"status": "not_started",
"test": {
"status": "not_started"
},
"build": {
"status": "not_started"
}
},
"typescript": {
"commit": {
"status": "not_started"
},
"install_url": "install_url",
"lint": {
"status": "not_started"
},
"object": "build_target",
"status": "not_started",
"test": {
"status": "not_started"
},
"build": {
"status": "not_started"
}
}
},
"updated_at": "2019-12-27T18:11:19.117Z"
},
"object": "project_branch",
"org": "org",
"project": "project"
}