Trigger a new build/pipeline

POST /apps/{app-slug}/builds

Trigger a new build/pipeline. Specify an app slug and at least one parameter out of three: a git tag or git commit hash, a branch, or a workflow/pipeline ID. You can also set specific parameters for Pull Request builds/pipelines and define additional environment variables for your build/pipeline. Check out our detailed guide.

Path parameters

  • app-slug string Required

    App slug

Body Required

Build trigger parameters

  • build_params object

    The public part of the SSH key you would like to use

    Additional properties are allowed.

    Hide build_params attributes Show build_params attributes object
    • base_repository_url string
    • branch string
    • branch_dest string
    • branch_dest_repo_owner string
    • branch_repo_owner string
    • build_request_slug string
    • commit_hash string
    • commit_message string
    • commit_paths array[object]
      Hide commit_paths attributes Show commit_paths attributes object
      • added array[string]
      • modified array[string]
      • removed array[string]
    • diff_url string
    • environments array[object]
      Hide environments attributes Show environments attributes object
      • is_expand boolean
      • mapped_to string
      • value string
    • head_repository_url string
    • pipeline_id string
    • pull_request_author string
    • pull_request_head_branch string
    • pull_request_id
    • pull_request_merge_branch string
    • pull_request_repository_url string
    • pull_request_unverified_merge_branch string
    • skip_git_status_report boolean
    • tag string
    • workflow_id string
  • hook_info object

    Additional properties are allowed.

    Hide hook_info attribute Show hook_info attribute object
    • type string

      Should be "bitrise"

Responses

  • 201

    Created

    Hide response attributes Show response attributes object
    • build_number integer

      Deprecated

    • build_slug string

      Deprecated

    • build_url string

      Deprecated

    • message string
    • results array[object]
      Hide results attributes Show results attributes object
      • build_number integer
      • build_slug string
      • build_url string
      • message string
      • status string
      • triggered_pipeline string
      • triggered_workflow string
    • service string
    • slug string
    • status string
    • triggered_workflow string

      Deprecated

  • 400

    Bad Request

    Hide response attribute Show response attribute object
    • message string
  • 401

    Unauthorized

    Hide response attribute Show response attribute object
    • message string
  • 404

    Not Found

    Hide response attribute Show response attribute object
    • message string
  • 500

    Internal Server Error

    Hide response attribute Show response attribute object
    • message string
POST /apps/{app-slug}/builds
curl \
 --request POST 'https://api.bitrise.io/v0.1/apps/{app-slug}/builds' \
 --header "Authorization: $API_KEY" \
 --data '{"build_params":{"base_repository_url":"string","branch":"string","branch_dest":"string","branch_dest_repo_owner":"string","branch_repo_owner":"string","build_request_slug":"string","commit_hash":"string","commit_message":"string","commit_paths":[{"added":["string"],"modified":["string"],"removed":["string"]}],"diff_url":"string","environments":[{"is_expand":true,"mapped_to":"string","value":"string"}],"head_repository_url":"string","pipeline_id":"string","pull_request_author":"string","pull_request_head_branch":"string","pull_request_merge_branch":"string","pull_request_repository_url":"string","pull_request_unverified_merge_branch":"string","skip_git_status_report":true,"tag":"string","workflow_id":"string"},"hook_info":{"type":"bitrise"}}'
Request examples
{
  "build_params": {
    "base_repository_url": "string",
    "branch": "string",
    "branch_dest": "string",
    "branch_dest_repo_owner": "string",
    "branch_repo_owner": "string",
    "build_request_slug": "string",
    "commit_hash": "string",
    "commit_message": "string",
    "commit_paths": [
      {
        "added": [
          "string"
        ],
        "modified": [
          "string"
        ],
        "removed": [
          "string"
        ]
      }
    ],
    "diff_url": "string",
    "environments": [
      {
        "is_expand": true,
        "mapped_to": "string",
        "value": "string"
      }
    ],
    "head_repository_url": "string",
    "pipeline_id": "string",
    "pull_request_author": "string",
    "pull_request_head_branch": "string",
    "pull_request_merge_branch": "string",
    "pull_request_repository_url": "string",
    "pull_request_unverified_merge_branch": "string",
    "skip_git_status_report": true,
    "tag": "string",
    "workflow_id": "string"
  },
  "hook_info": {
    "type": "bitrise"
  }
}
Response examples (201)
{
  "build_number": 42,
  "build_slug": "string",
  "build_url": "string",
  "message": "string",
  "results": [
    {
      "build_number": 42,
      "build_slug": "string",
      "build_url": "string",
      "message": "string",
      "status": "string",
      "triggered_pipeline": "string",
      "triggered_workflow": "string"
    }
  ],
  "service": "string",
  "slug": "string",
  "status": "string",
  "triggered_workflow": "string"
}
Response examples (400)
{
  "message": "string"
}
Response examples (401)
{
  "message": "string"
}
Response examples (404)
{
  "message": "string"
}
Response examples (500)
{
  "message": "string"
}