Table of Contents
AUTOMATE API

Build

You can organize your test sessions on BrowserStack into builds. You can use this REST API to access the list of builds, update a specific build name, delete a build, and delete multiple builds at the same time.

Note: If you did not use the build capability in your tests, then your sessions would be put in an Untitled Build.
It is recommended that you organize your tests into builds and give them relevant names for you to be able to debug them properly using the Automate Dashboard

Get build list

GET /automate/builds.json

Fetch the 10 recent test builds that have run on BrowserStack using your username and access key. You can also limit the number of builds and paginate through your data.

Request Parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
https://api.browserstack.com/automate/builds.json

# Limit the number of builds to be displayed using "limit" parameter
curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
https://api.browserstack.com/automate/builds.json?limit=5

# Start the retrieval of records from a particular point using "offset" parameter
curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
https://api.browserstack.com/automate/builds.json?limit=2\&offset=2

# View a subset of results using "status" parameter
curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
https://api.browserstack.com/automate/builds.json?status=running
  • limit String

    Specify the number of results to be displayed. The default value is 10, and the maximum value is 100.

  • offset String

    Specify the retrieval of build records from a particular point using the offset parameter.

  • status String

    The status parameter is used to filter your results by the status of the build. The values this parameter takes are running, done, timeout, and failed.

Response Attributes 200 OK Array

Response

[
    {
        "automation_build":{
            "name":"pricing_build",
            "duration":15611,
            "status":"running",
            "hashed_id":"ca9cccc228cf0e3ff3cb90dd62e2e2bfb4b20bc7",
            "build_tag":null
        }
    },
    {
        "automation_build":{
            "name":"navigation_build",
            "duration":15601,
            "status":"running",
            "hashed_id":"3b20f82b878c120e6edc7a2b373e65d20fb3ab7c",
            "build_tag":null
        }
    },
    {...}
]
  • name String

    Name of your build.

  • duration Integer

    Duration of build execution.

  • status String

    Status of the build (Either running, done, timeout, or failed).

  • hashed_id String

    ID of the build. (This hashed_id would be required for invoking the other endpoints in the Build API)

Update build details

PUT /automate/builds/{build_id}.json

You can update the name of your build after the build is complete using the PUT method.

Request Parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X PUT -H "Content-Type: application/json" \
-d "{\"name\":\"<build-name>\"}" https://api.browserstack.com/automate/builds/<build-id>.json
  • id* String

    ID of the build.

  • name* String

    The new build-name that you want to set

Response Attributes 200 OK JSON

Response

{
    "name":"pricing_updated_build",
    "duration":20,
    "status":"done",
    "hashed_id":"ede5ec7d6f24799707aa13860c0856dc4718d927",
    "build_tag":null
}
  • name String

    Updated name of your build.

  • duration Integer

    Duration of build execution.

  • status String

    Status of the build.

  • hashed_id String

    ID of the build (the same that is passed in the request parameter as well)

Delete build

DELETE /automate/builds/{build_id}.json

You can delete a build on the server using the DELETE method. Please note that deleting a build will delete all the sessions contained within it.

Request Parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X DELETE https://api.browserstack.com/automate/builds/<build-id>.json
  • id* String

    ID of the build.

Response Attributes 200 OK JSON

Response

{
    "status":"ok",
    "message":"Build a4fb480a55efd6b3c558afb1ee051a7c337b8ef0 was deleted successfully."
}
  • status String

    Status of deletion.

  • message String

    Build deletion message.

Delete multiple builds

DELETE /automate/builds?buildId={build_id}

You can delete multiple builds on the server using the DELETE method. You can delete a maximum of 5 builds at a time.

Request Parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X DELETE "https://api.browserstack.com/automate/builds?buildId=<build-id-1>\&buildId=<build-id-2>\&buildId=<build-id-3>"
  • id* String

    IDs of the builds to be deleted.

Response Attributes 200 OK JSON

Response

{
    "message":"The following build(s) were deleted successfully: 83078c39baf5c12cbbfcbd26a788d05ddfad626c,55e9782d749f601d09571023f56a8f0101929428."
}
  • message String

    Builds deletion message.

We're sorry to hear that. Please share your feedback so we can do better







Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback