## Create build `$client->builds->create(string project, Revision revision, ?bool allowEmpty, ?string branch, ?string commitMessage, ?bool enableAICommitMessage, ?TargetCommitMessages targetCommitMessages, ?list targets): Build` **post** `/v0/builds` Create a build, on top of a project branch, against a given input revision. The project branch will be modified so that its latest set of config files points to the one specified by the input revision. ### Parameters - `project: string` Project name - `revision: Revision` Specifies what to build: a branch name, commit SHA, merge command ("base..head"), or file contents. - `allowEmpty?:optional bool` Whether to allow empty commits (no changes). Defaults to false. - `branch?:optional string` The project branch to use for the build. If not specified, the branch is inferred from the `revision`, and will 400 when that is not possible. - `commitMessage?:optional string` Optional commit message to use when creating a new commit. - `enableAICommitMessage?:optional bool` Whether to generate AI-powered commit messages for the build. Cannot be combined with `commit_message` or `target_commit_messages`. - `targetCommitMessages?:optional TargetCommitMessages` Optional commit messages to use for each SDK when making a new commit. SDKs not represented in this object will fallback to the optional `commit_message` parameter, or will fallback further to the default commit message. - `targets?:optional list` Optional list of SDK targets to build. If not specified, all configured targets will be built. ### Returns - `Build` - `string id` Build ID - `string configCommit` - `\Datetime createdAt` - `?DocumentedSpec documentedSpec` - `Object_ object` - `string org` - `string project` - `Targets targets` - `\Datetime updatedAt` ### Example ```php builds->create( project: 'project', revision: 'string', allowEmpty: true, branch: 'branch', commitMessage: 'commit_message', enableAICommitMessage: true, targetCommitMessages: [ 'cli' => 'cli', 'csharp' => 'csharp', 'go' => 'go', 'java' => 'java', 'kotlin' => 'kotlin', 'node' => 'node', 'openAPI' => 'openapi', 'php' => 'php', 'python' => 'python', 'ruby' => 'ruby', 'sql' => 'sql', 'terraform' => 'terraform', 'typescript' => 'typescript', ], targets: [Target::NODE], ); var_dump($build); ``` #### Response ```json { "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", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "csharp": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "go": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "java": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "kotlin": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "node": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "openapi": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "php": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "python": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "ruby": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "sql": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "terraform": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "typescript": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } } }, "updated_at": "2019-12-27T18:11:19.117Z" } ```