Skip to main content
Experience faster, smarter testing with BrowserStack AI Agents. See what your workflow’s been missing. Explore now!
No Result Found
Connect & Get help from fellow developers on our Discord community. Ask the CommunityAsk the Community

Test results

Test results within test runs are important for analyzing and understanding the outcomes of your testing efforts. Our REST API offers comprehensive endpoints for managing test results in test runs, enabling you to automate the collection and evaluation of testing data. With these endpoints, you can add one or more test results in your test runs within your project.

Get all test results for a test run

GET /api/v2/projects/{project_id}/test-runs/{test_run_id}/results

Use this API to fetch the list of all test results for a test run in a project. You will need the id of the project and the id of the test run (eg: TR-2343).

This list is paginated; for more information, refer Pagination.

Request Parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
https://test-management.browserstack.com/api/v2/projects/{project_id}/test-runs/{test_run_id}/results
  • project_id* String

    Identifier of the project.

  • test_run_id* String

    Identifier of the test run.

Response Attributes 200 OK json

Response

{
  "success": true,
  "test-results": [
    {
      "id": 425536077,
      "created_by": "abc@email.com",
      "created_at": "2024-08-19T07:38:55.000Z",
      "description": "This is the notes added with result",
      "test_run_id": "TR-321",
      "test_case_id": "TC-123",
      "result_status": {
        "field_value": "Passed"
      },
      "updated_at": "2024-08-19T07:38:55.000Z",
      "issues": [
        {
          "issue_id": "UI-393854",
          "created_at": "2024-08-19T07:35:42.000Z",
          "issue_type": "jira"
        }
      ],
      "configuration_id": 39724475,
      "custom_fields": [
        {
          "field_name": "custom estimates",
          "value": "10.23"
        }
      ],
      "step_result": {
        "step": "Launch the App",
        "result": "Open the Android app on the device or emulator.",
        "result_status": {
          "field_value": "Passed"
        },
        "created_by": "user@email.com",
        "created_at": "2024-08-19T07:38:55.000Z",
        "custom_fields": [
          {
            "field_name": "step custom field",
            "value": "step value"
          }
        ]
      }
    }
  ],
  "info": {
    "page": 1,
    "page_size": 30,
    "count": 20,
    "prev": null,
    "next": null
  }
}
  • success Boolean

    Indicates whether the API call was executed successfully.

  • test-results Array

    List of test results associated with the test run or test case.

    β–Ά SHOW VALUES
    • id Integer

      Unique identifier of the test result.

    • created_by String

      Email of the user who created the test result.

    • created_at String

      Timestamp (ISO 8601) when the test result was created.

    • description String

      Notes or additional information added to the test result.

    • test_run_id String

      Unique identifier of the test run to which the test result belongs.

    • test_case_id String

      Unique identifier of the test case to which the test result belongs.

    • result_status Object

      Contains the status of the test result.

    • result_status.field_value String

      The result status value, e.g., β€œPassed” or β€œFailed.”

    • updated_at String

      Timestamp (ISO 8601) when the test result was last updated.

  • issues Array

    List of issues linked to the test result.

    β–Ά SHOW VALUES
    • issue_id String

      Unique identifier of the linked issue.

    • created_at String

      Timestamp (ISO 8601) when the issue was created.

    • issue_type String

      Type of the issue, e.g., β€œJira.”

  • configuration_id Integer

    The unique identifier for the configuration associated with the test result.

  • custom_fields Array

    List of custom fields associated with the test result.

    β–Ά SHOW VALUES
    • field_name String

      Name of the custom field.

    • value String

      Value of the custom field.

  • step_result Object

    Contains the detailed execution steps associated with this specific test result. It includes each step’s definition, outcome, and status.

    β–Ά SHOW VALUES
    • step String

      Action or instruction for the step.

    • result String

      Expected or observed result for the step.

    • result_status Object

      Status of the step result.

      β–Ά SHOW VALUES
      • field_value String

        The result status value. For example, Passed or Failed.

    • created_by String

      Email of the user who created the step result.

    • created_at String

      Timestamp (ISO 8601) when the step result was created.

    • custom_fields Array

      List of custom field objects for the step result.

      β–Ά SHOW VALUES
      • field_name String

        Name of the custom field.

      • value String

        Value of the custom field.

Handle unmatched test case IDs

GET /api/v2/projects/PR-75/test-runs/TR-152/results?validate_tc=true

To ensure successful data submission, every test result must map to a valid Test Case ID already present in the specified test run. If you submit a result referencing a test case ID that does not exist within the test run, the API will return a 400 Bad Request error with a message indicating the ID is invalid or not found.

A single API request for result submission can process a maximum of 300 unique test case IDs. Validate test case IDs against the test run before initiating the API call to prevent request failures and ensure data integrity.

Request Parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST https://test-management.browserstack.com/api/v2/projects/PR-75/test-runs/TR-152/results?validate_tc=true
  • project_id* String

    Identifier of the project.

  • test_run_id* String

    Identifier of the test run.

Response Attributes 200 OK json

Response

{
  "success": false,
  "message": "Invalid test case IDs: TC-10171233"
}
  • success Boolean

    Indicates whether the API call was not executed successfully.

  • message String

    Message describing the issue with the missing test case IDs.

Get all test results for a test case in a test run

GET /api/v2/projects/{project_id}/test-runs/{test_run_id}/test-cases/{test-case-identifier}/results

Use this API to fetch all test results for a test case in a test run in a project. You will need the id of the project, the id of the run and the id of the test case.

This list is paginated; for more information, refer Pagination.

Request Parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
https://test-management.browserstack.com/api/v2/projects/{project_id}/test-runs/{test_run_id}/test-cases/{test-case-identifier}/results
  • project_id* String

    Identifier of the project.

  • test_run_id* String

    Identifier of the test run.

  • test-case-identifier* String

    Identifier of the test case.

Response Attributes 200 OK json

Response

{
  "success": true,
  "test-results": [
    {
      "id": 425536077,
      "created_by": "abc@email.com",
      "created_at": "2024-08-19T07:38:55.000Z",
      "description": "This is the notes added with result",
      "test_run_id": "TR-321",
      "test_case_id": "TC-123",
      "result_status": {
        "field_value": "Passed"
      },
      "updated_at": "2024-08-19T07:38:55.000Z",
      "issues": [
        {
          "issue_id": "UI-393854",
          "created_at": "2024-08-19T07:35:42.000Z",
          "issue_type": "jira"
        }
      ],
      "custom_fields": [
        {
          "field_name": "custom estimates",
          "value": "10.23"
        }
      ],
      "step_result": {
        "step": "Launch the App",
        "result": "Open the Android app on the device or emulator.",
        "result_status": {
          "field_value": "Passed"
        },
        "created_by": "user@email.com",
        "created_at": "2024-08-19T07:38:55.000Z",
        "custom_fields": [
          {
            "field_name": "step custom field",
            "value": "step value"
          }
        ]
      }
    }
  ],
  "info": {
    "page": 1,
    "page_size": 30,
    "count": 20,
    "prev": null,
    "next": null
  }
}
  • success Boolean

    Indicates whether the API call was executed successfully.

  • test-results Array

    List of test results associated with the test run or test case.

    β–Ά SHOW VALUES
    • id Integer

      Unique identifier of the test result.

    • created_by String

      Email of the user who created the test result.

    • created_at String

      Timestamp (ISO 8601) when the test result was created.

    • description String

      Notes or additional information added to the test result.

    • test_run_id String

      Unique identifier of the test run to which the test result belongs.

    • test_case_id String

      Unique identifier of the test case to which the test result belongs.

    • result_status Object

      Contains the status of the test result.

    • result_status.field_value String

      The result status value, e.g., β€œPassed” or β€œFailed.”

    • updated_at String

      Timestamp (ISO 8601) when the test result was last updated.

  • issues Array

    List of issues linked to the test result.

    β–Ά SHOW VALUES
    • issue_id String

      Unique identifier of the linked issue.

    • created_at String

      Timestamp (ISO 8601) when the issue was created.

    • issue_type String

      Type of the issue, e.g., β€œJira.”

  • custom_fields Array

    List of custom fields associated with the test result.

    β–Ά SHOW VALUES
    • field_name String

      Name of the custom field.

    • value String

      Value of the custom field.

  • step_result Object

    Contains the detailed execution steps associated with this specific test result. It includes each step’s definition, outcome, and status.

    β–Ά SHOW VALUES
    • step String

      Action or instruction for the step.

    • result String

      Expected or observed result for the step.

    • result_status Object

      Status of the step result.

      β–Ά SHOW VALUES
      • field_value String

        The result status value. For example, Passed or Failed.

    • created_by String

      Email of the user who created the step result.

    • created_at String

      Timestamp (ISO 8601) when the step result was created.

    • custom_fields Array

      List of custom field objects for the step result.

      β–Ά SHOW VALUES
      • field_name String

        Name of the custom field.

      • value String

        Value of the custom field.

Get all test results for a test case across test runs

GET /api/v2/projects/{project_id}/test-cases/{test-case-identifier}/results

Use this API to fetch the list of all test results for a test case across test runs in a project. You will need the id of the project and the id of the test case.

This list is paginated; for more information, refer Pagination.

Request Parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
https://test-management.browserstack.com/api/v2/projects/{project_id}/test-cases/{test-case-identifier}/results
  • project_id* String

    Identifier of the project.

  • test-case-identifier* String

    Identifier of the test case.

Response Attributes 200 OK json

Response

{
  "success": true,
  "test-results": [
    {
      "id": 425536077,
      "created_by": "abc@email.com",
      "created_at": "2024-08-19T07:38:55.000Z",
      "description": "This is the notes added with result",
      "test_run_id": "TR-321",
      "test_case_id": "TC-123",
      "result_status": {
        "field_value": "Passed"
      },
      "updated_at": "2024-08-19T07:38:55.000Z",
      "issues": [
        {
          "issue_id": "UI-393854",
          "created_at": "2024-08-19T07:35:42.000Z",
          "issue_type": "jira"
        }
      ],
      "custom_fields": [
        {
          "field_name": "custom estimates",
          "value": "10.23"
        }
      ],
      "step_result": {
        "step": "Launch the App",
        "result": "Open the Android app on the device or emulator.",
        "result_status": {
          "field_value": "Passed"
        },
        "created_by": "user@email.com",
        "created_at": "2024-08-19T07:38:55.000Z",
        "custom_fields": [
          {
            "field_name": "step custom field",
            "value": "step value"
          }
        ]
      }
    }
  ],
  "info": {
    "page": 1,
    "page_size": 30,
    "count": 20,
    "prev": null,
    "next": null
  }
}
  • success Boolean

    Indicates whether the API call was executed successfully.

  • test-results Array

    List of test results associated with the test run or test case.

    β–Ά SHOW VALUES
    • id Integer

      Unique identifier of the test result.

    • created_by String

      Email of the user who created the test result.

    • created_at String

      Timestamp (ISO 8601) when the test result was created.

    • description String

      Notes or additional information added to the test result.

    • test_run_id String

      Unique identifier of the test run to which the test result belongs.

    • test_case_id String

      Unique identifier of the test case to which the test result belongs.

    • result_status Object

      Contains the status of the test result.

    • result_status.field_value String

      The result status value, e.g., β€œPassed” or β€œFailed.”

    • updated_at String

      Timestamp (ISO 8601) when the test result was last updated.

  • issues Array

    List of issues linked to the test result.

    β–Ά SHOW VALUES
    • issue_id String

      Unique identifier of the linked issue.

    • created_at String

      Timestamp (ISO 8601) when the issue was created.

    • issue_type String

      Type of the issue, e.g., β€œJira.”

  • custom_fields Array

    List of custom fields associated with the test result.

    β–Ά SHOW VALUES
    • field_name String

      Name of the custom field.

    • value String

      Value of the custom field.

  • step_result Object

    Contains the detailed execution steps associated with this specific test result. It includes each step’s definition, outcome, and status.

    β–Ά SHOW VALUES
    • step String

      Action or instruction for the step.

    • result String

      Expected or observed result for the step.

    • result_status Object

      Status of the step result.

      β–Ά SHOW VALUES
      • field_value String

        The result status value. For example, Passed or Failed.

    • created_by String

      Email of the user who created the step result.

    • created_at String

      Timestamp (ISO 8601) when the step result was created.

    • custom_fields Array

      List of custom field objects for the step result.

      β–Ά SHOW VALUES
      • field_name String

        Name of the custom field.

      • value String

        Value of the custom field.

Add test result to test run

POST /api/v2/projects/{project_id}/test-runs/{test_run_id}/results

Use this API to add test results to test runs in a given project. To add a test result to a specific test run, you will need both the id of the project (eg: PR-2134) and the id of the test run (eg: TR-2343) within that project.

Request Parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST https://test-management.browserstack.com/api/v2/projects/{project_id}/test-runs/{test_run_id}/results
  • project_id* String

    Identifier of the project.

  • test_run_id* String

    Identifier of the test run.

Request Body

Request Body

{
  "test_result": {
    "status": "passed",
    "description": "Login functionality under high user load",
    "issues": [
      "TR-2",
      "XYZ-2"
    ],
    "issue_tracker": {
      "name": "jira",
      "host": "https://demo.atlassian.net"
    },
    "custom_fields": {
      "custom_fields_name": "value"
    }
  },
  "test_case_id": "TC-13",
  "configuration_id": 116
}
  • status* String

    The status field is mandatory.Β Use either a system value (e.g., ”Passed,” β€œFailed,” etc.) or a custom value defined in Test Management.Β Attempting to define new status values via this API will result in an error response.

  • description String

    Brief information about the test run.

  • issues Array

    List of the linked Jira, Asana or Azure issues.

  • issue_tracker Object

    Ensures that issue IDs are correctly associated with their respective issue tracking tool, facilitating accurate linking and management.

    β–Ά SHOW VALUES
    • name String

      ​Specifies the issue tracking system to integrate with. Set to one of jira (Jira), azure (Azure DevOps), asana (Asana), or clickup (ClickUp).​

    • host String

      The base URL of your issue tracking system. For Jira Cloud instances, this typically follows the format https://your-domain.atlassian.net.

  • custom_fields Object

    List of the custom fields and their corresponding values.

  • test_case_id* String

    Identifier of each test case.

  • configuration_id Integer

    Unique identifier for a specific operating system, browser, and device configuration. This optional parameter is required only if a test run includes configurations.

  • attachments Array

    Optional list of attachment filenames to bind to this result when you send the request as multipart/form-data. Each entry must exactly match the filename of a file part in the same request. Up to 10 entries per result, each 1 to 255 characters. A JSON-only request ignores this field.

To upload a file with the result, send the request as multipart/form-data. Send the JSON above as the payload part, add one part per file keyed by filename, and list each filename in the attachments array. For limits, errors, and response fields, see Add attachments while adding test results.

Request (multipart/form-data)

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST https://test-management.browserstack.com/api/v2/projects/PR-1/test-runs/TR-45/results \
-F 'payload={"test_result":{"status":"passed"},"test_case_id":"TC-13","attachments":["screenshot.png"]};type=application/json' \
-F 'screenshot.png=@./screenshot.png'

Response Attributes 200 OK json

Response


{
  "success": true,
  "test-result": {
    "id": 66782871,
    "created_at": "2023-11-29T06:30:36.000Z",
    "description": "Test passed successfully, but with some issues noted",
    "status": "passed",
    "issues": [
      "TR-2",
      "XYZ-2"
    ]
  },
  "attachments": [
    {
      "id": 4521,
      "name": "screenshot.png",
      "url": "https://test-management.browserstack.com/media/genric/3/10334/8857111d-screenshot.png?signature=...",
      "url_expires_at": "2026-05-27T14:48:00.000Z",
      "test_result_id": 66782871
    }
  ],
  "attachment_errors": []
}
  • success Boolean

    API call is executed successfully.

  • id Integer

    Identifier for the test result.

  • created_at String

    The time at which the test result was created on BrowserStack servers.

  • status String

    Gives the status of the test result.

  • description String

    Brief information about the Test Run.

  • issues Array

    List of the linked Jira, Asana or Azure issues.

  • attachments Array

    Files attached to the result. Present when the request uploads attachments as multipart/form-data.

    β–Ά SHOW VALUES
    • id Integer

      Unique identifier of the uploaded attachment.

    • name String

      Filename of the attachment, matching the file part sent in the request.

    • url String

      Pre-signed download URL for the attachment, valid for 30 minutes. Fetch the result’s attachments again to get a fresh URL after it expires.

    • url_expires_at String

      Absolute time at which the pre-signed url expires.

    • test_result_id Integer

      Identifier of the test result the attachment is bound to.

  • attachment_errors Array

    Files that uploaded but could not be linked to the result. Present only when at least one attachment fails. The result is still created.

    β–Ά SHOW VALUES
    • filename String

      Filename of the attachment that could not be linked to the result.

    • code String

      Machine-readable error code for the failed attachment (for example, ATTACHMENT_BIND_FAILED).

    • message String

      Human-readable explanation of why the attachment failed.

Add attachments while adding test results

POST /api/v2/projects/{project_id}/test-runs/{test_run_id}/results

Use this API to upload files in the same request that creates a test result. Send the request as multipart/form-data instead of application/json. This works whether you add one result or many. The multipart mode is opt-in. It activates only when you set Content-Type: multipart/form-data, so existing JSON requests are unaffected.

A multipart request has one payload part and one part per file. The payload part holds the same JSON body you send today, with its type set to application/json. Each file part is keyed by its filename. To attach a file to a result, list its filename in an attachments array inside that result. You can reference the same file from more than one result. BrowserStack uploads the file once and links it to every result that names it.

The following limits apply to attachments:

Limit Value
Maximum file size 50 MB
Maximum files per result 10
Maximum files per request 100
Maximum total request size 50 MB, including all file parts and the JSON payload

Split large uploads across multiple requests.

Every file part needs a unique filename. The attachments field references files by name. A filename is rejected when it:

  • is empty or contains only whitespace.
  • is longer than 255 bytes.
  • contains a path separator (/ or \).
  • contains a control character.
  • contains a Unicode bidirectional-override character.
  • contains a character that can break HTTP download headers (", \, or ;).

Use plain filenames such as screenshot.png or run-2026-05-27.log.

Request Parameters

Request (multipart/form-data)

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST https://test-management.browserstack.com/api/v2/projects/PR-1/test-runs/TR-45/results \
-F 'payload={"test_result":{"status":"passed"},"test_case_id":"TC-13","attachments":["screenshot.png"]};type=application/json' \
-F 'screenshot.png=@./screenshot.png'
  • project_id* String

    Identifier of the project.

  • test_run_id* String

    Identifier of the test run.

Request Body

Request Body

{
  "test_result": {
    "status": "passed"
  },
  "test_case_id": "TC-13",
  "attachments": ["screenshot.png"]
}
  • status* String

    The status field is mandatory.Β Use either a system value (e.g., ”Passed,” β€œFailed,” etc.) or a custom value defined in Test Management.Β Attempting to define new status values via this API will result in an error response.

  • description String

    Brief information about the test run.

  • issues Array

    List of the linked Jira, Asana or Azure issues.

  • issue_tracker Object

    Ensures that issue IDs are correctly associated with their respective issue tracking tool, facilitating accurate linking and management.

    β–Ά SHOW VALUES
    • name String

      ​Specifies the issue tracking system to integrate with. Set to one of jira (Jira), azure (Azure DevOps), asana (Asana), or clickup (ClickUp).​

    • host String

      The base URL of your issue tracking system. For Jira Cloud instances, this typically follows the format https://your-domain.atlassian.net.

  • custom_fields Object

    List of the custom fields and their corresponding values.

  • test_case_id* String

    Identifier of each test case.

  • configuration_id Integer

    Unique identifier for a specific operating system, browser, and device configuration. This optional parameter is required only if a test run includes configurations.

  • attachments Array

    Optional list of attachment filenames to bind to this result when you send the request as multipart/form-data. Each entry must exactly match the filename of a file part in the same request. Up to 10 entries per result, each 1 to 255 characters. A JSON-only request ignores this field.

Response Attributes 200 OK json

Response

{
  "success": true,
  "test-result": {
    "id": 66782871,
    "created_at": "2023-11-29T06:30:36.000Z",
    "status": "passed"
  },
  "attachments": [
    {
      "id": 4521,
      "name": "screenshot.png",
      "url": "https://test-management.browserstack.com/media/genric/3/10334/8857111d-screenshot.png?signature=...",
      "url_expires_at": "2026-05-27T14:48:00.000Z",
      "test_result_id": 66782871
    }
  ],
  "attachment_errors": []
}
  • success Boolean

    API call is executed successfully.

  • id Integer

    Identifier for the test result.

  • created_at String

    The time at which the test result was created on BrowserStack servers.

  • status String

    Gives the status of the test result.

  • description String

    Brief information about the Test Run.

  • issues Array

    List of the linked Jira, Asana or Azure issues.

  • attachments Array

    Files attached to the result. Present when the request uploads attachments as multipart/form-data.

    β–Ά SHOW VALUES
    • id Integer

      Unique identifier of the uploaded attachment.

    • name String

      Filename of the attachment, matching the file part sent in the request.

    • url String

      Pre-signed download URL for the attachment, valid for 30 minutes. Fetch the result’s attachments again to get a fresh URL after it expires.

    • url_expires_at String

      Absolute time at which the pre-signed url expires.

    • test_result_id Integer

      Identifier of the test result the attachment is bound to.

  • attachment_errors Array

    Files that uploaded but could not be linked to the result. Present only when at least one attachment fails. The result is still created.

    β–Ά SHOW VALUES
    • filename String

      Filename of the attachment that could not be linked to the result.

    • code String

      Machine-readable error code for the failed attachment (for example, ATTACHMENT_BIND_FAILED).

    • message String

      Human-readable explanation of why the attachment failed.

For a bulk request, the response stays { "success": true }. When status validation rejects a result, BrowserStack does not attach that result’s files and adds a dropped_attachments array. Each entry names the test_case_id, the dropped filenames, and the reason.

Error responses

Response

{
  "message": "A file in the request exceeds the 50 MB limit.",
  "code": "MAX_FILE_SIZE"
}

A multipart problem returns 400 Bad Request with a message and a machine-readable code. When any file fails validation or upload, BrowserStack rejects the whole request. No results are created and no files are stored, so you can fix the issue and retry.

code When it appears
MULTIPART_PAYLOAD_MISSING The request has no payload part.
INVALID_JSON_PAYLOAD The payload part is not valid JSON.
SCHEMA_VALIDATION_FAILED The JSON body fails validation. The message lists the first field errors.
CLOSED_TEST_RUN The target test run is closed, so results cannot be added.
DUPLICATE_FILENAME Two file parts share the same filename.
ATTACHMENT_REFERENCE_UNRESOLVED An attachments entry names a file that was not sent as a part.
FILES_PER_RESULT_EXCEEDED A single result references more than 10 files.
FILES_PER_REQUEST_EXCEEDED The request contains more than 100 file parts.
MAX_FILE_SIZE A file exceeds 50 MB.
ATTACHMENT_UPLOAD_FAILED A file failed to upload to storage. Retry the request.
ATTACHMENTS_NOT_SUPPORTED_WITH_STEP_RESULTS_IN_BULK A bulk result combines attachments with step_results. The message names the result’s index and test_case_id.

After a single result is created, an individual file can still fail to attach. These errors appear in the result’s attachment_errors field instead of failing the request.

code Meaning
ATTACHMENT_BIND_FAILED The file uploaded but could not be linked to the result. Reattach it with the Add an Attachment to a test result endpoint.
ATTACHMENT_BIND_INCOMPLETE The file was linked but its attachment ID was not returned. Fetch the result’s attachments to recover the ID.

Note: A bulk result cannot combine attachments with step_results, because a step result has no single parent to hold the file. A single result with steps can still take attachments.

Add multiple test results in a test run

POST /api/v2/projects/{project_id}/test-runs/{test_run_id}/results

Use this API to add multiple test results in a test run in a given project. To do so, you will need the id of the project, the id of the test run (eg: TR-2343) within that project, status of the test result and the id of the test case.

Request Parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST https://test-management.browserstack.com/api/v2/projects/{project_id}/test-runs/{test_run_id}/results
  • project_id* String

    Identifier of the project.

  • test_run_id* String

    Identifier of the test run.

Request Body

Request Body

{
  "results": [
    {
      "test_result": {
        "status": "passed",
        "description": "Login functionality under high user load",
        "issues": [
          "TR-2",
          "XYZ-2"
        ],
        "issue_tracker": {
        "name": "jira",
        "host": "https://demo.atlassian.net"
        },
        "custom_fields": {
          "custom_fields_name": "value"
        }
      },
      "test_case_id": "TC-337204",
      "configuration_id": 116
    },
    {
      "test_result": {
        "status": "skipped",
        "description": "Sensitive data is masked or encrypted",
        "issues": [
          "TR-23",
          "XYZ-27"
        ],
        "issue_tracker": {
        "name": "jira",
        "host": "https://demo.atlassian.net"
        },
        "custom_fields": {
          "custom_fields_name": "value"
        }
      },
      "test_case_id": "TC-337205",
      "configuration_id": 126
    }
  ]
}
  • test_result Object

    This list has information about test results.

    β–Ά SHOW VALUES
    • status* String

      The status field is mandatory.Β Use either a system value (e.g., ”Passed,” β€œFailed,” etc.) or a custom value defined in Test Management.Β Attempting to define new status values via this API will not record those statuses.

    • description String

      Brief information/notes about the test result.

    • issues Array

      List of the linked Jira, Asana or Azure issues.

    • custom_fields Object

      List of the custom fields and their corresponding values.

  • test_case_id* String

    Identifier of each test case.

  • issues Array

    List of the linked Jira, Asana or Azure issues.

  • issue_tracker Object

    Ensures that issue IDs are correctly associated with their respective issue tracking tool, facilitating accurate linking and management.

    β–Ά SHOW VALUES
    • name String

      ​Specifies the issue tracking system to integrate with. Set to one of jira (Jira), azure (Azure DevOps), asana (Asana), or clickup (ClickUp).​

    • host String

      The base URL of your issue tracking system. For Jira Cloud instances, this typically follows the format https://your-domain.atlassian.net.

  • configuration_id Integer

    Unique identifier for a specific operating system, browser, and device configuration. This optional parameter is required only if a test run includes configurations.

  • attachments Array

    Optional list of attachment filenames to bind to this result when you send the request as multipart/form-data. Each entry must exactly match the filename of a file part in the same request. The same filename can appear on more than one result. Up to 10 entries per result, each 1 to 255 characters. A JSON-only request ignores this field.

To upload files with the results, send the request as multipart/form-data. Send the JSON above as the payload part, add one part per file keyed by filename, and list each filename in that result’s attachments array. The same file can serve more than one result. For limits, errors, and response fields, see Add attachments while adding test results.

Request (multipart/form-data)

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST https://test-management.browserstack.com/api/v2/projects/PR-1/test-runs/TR-45/results \
-F 'payload={"results":[{"test_case_id":"TC-337204","test_result":{"status":"passed"},"attachments":["run.log"]},{"test_case_id":"TC-337205","test_result":{"status":"failed"},"attachments":["run.log","error.png"]}]};type=application/json' \
-F 'run.log=@./run.log' \
-F 'error.png=@./error.png'

Response Attributes 200 OK json

Response


{
    "success": true
}
  • success Boolean

    API call is executed successfully.

  • dropped_attachments Array

    Attachments that were not linked because their result was rejected by status validation. Present only when at least one result is rejected.

    β–Ά SHOW VALUES
    • test_case_id String

      Identifier of the test case whose result was rejected, causing its attachments to be dropped.

    • filenames Array

      Filenames that were not attached because the parent result was rejected.

    • reason String

      Reason the attachments were dropped (for example, status_validation_failed).

When status validation rejects a result, BrowserStack does not attach that result’s files. The response reports them in a dropped_attachments array.

Response (rejected result)

{
  "success": false,
  "message": "Status ['flaky'] is not configured. Ask your Test Management admin to configure it.",
  "dropped_attachments": [
    {
      "test_case_id": "TC-337205",
      "filenames": ["error.png"],
      "reason": "status_validation_failed"
    }
  ]
}

Add test result with steps to a test run

POST /api/v2/projects/{project_id}/test-runs/{test_run_id}/results

This API adds a single test result to a specific test case within a test run. Use this endpoint when you need to include the status of individual test steps within your result payload. To add a test result to a specific test run, you need both the id of the project and the id of the test run (eg: TR-2343) within that project.

If you do not need to report step-level results, you can use the simpler Add test result to test run endpoint.

Request Parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST https://test-management.browserstack.com/api/v2/projects/PR-45592/test-runs/TR-839042/results
  • project_id* String

    Identifier of the project.

  • test_run_id* String

    Identifier of the test run.

Request Body

Request Body

{
   "test_result":{
      "status":"passed",
      "step_results":[
         {
            "step_index":1,
            "status":"failed",
            "description":"This is actually step 1",
            "issues": [
                "TR-2",
                "XYZ-2"
              ]
         },
         {
            "step_index":2,
            "status":"passed",
            "description":"This is actually step 1",
            "issues": [
                "TR-23",
                "XYZ-12"
              ]
         },
         {
            "step_index":3,
            "status":"failed",
            "description":"This is actually step 1"
         },
         {
            "step_index":4,
            "status":"passed",
            "description":"This is actually step 1"
         }
      ]
   },
   "test_case_id":"TC-972130"
}
  • test_result* Object

    The overall test result object, including status and step results.

    β–Ά SHOW VALUES
    • status* String

      The overall status of the test case result (e.g., passed, failed).

    • step_results* Array

      Array of step-level results for the test case.

      β–Ά SHOW VALUES
      • step_index* Integer

        The index of the step in the test case (starts from 1). Use with caution, as this index will change if the order of steps is modified in the test case. You either pass step_id or step_index.

      • step_id* Integer

        The unique and permanent identifier for the step. This ID remains the same even if steps are reordered. You either pass step_id or step_index.

      • status* String

        The status of the step (e.g., passed, failed).

      • description String

        Description or notes for the step result.

  • test_case_id* String

    Identifier of the test case.

  • attachments Array

    Optional list of attachment filenames to bind to this result when you send the request as multipart/form-data. Each entry must exactly match the filename of a file part in the same request. A single result with steps can take attachments. Up to 10 entries per result, each 1 to 255 characters. A JSON-only request ignores this field.

A single result with steps can also carry attachments. Send the request as multipart/form-data, add one part per file keyed by filename, and list each filename in the top-level attachments array next to test_case_id. On success, the response adds the attachments and attachment_errors fields. For limits and errors, see Add attachments while adding test results.

Request (multipart/form-data)

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST https://test-management.browserstack.com/api/v2/projects/PR-45592/test-runs/TR-839042/results \
-F 'payload={"test_result":{"status":"passed","step_results":[{"step_index":1,"status":"passed","description":"This is actually step 1"}]},"test_case_id":"TC-972130","attachments":["report.pdf"]};type=application/json' \
-F 'report.pdf=@./report.pdf'

Response Attributes 200 OK json

Response

{
   "success":true,
   "test-run-step-results":[
      {
         "id":1261084955,
         "created_at":"2025-08-29T16:11:32.000Z",
         "description":"This is actually step 1",
         "status":"failed",
         "test_run_test_case_step_details":{
            "id":3522947,
            "status":"failed",
            "status_id":982101,
            "step_mapping_id":34001034,
            "colour":"#F87171",
            "field_value":"Failed",
            "step":"Initiate multiple password reset requests (simulating normal load) for different test user accounts.",
            "result":"The system should accept all reset requests without errors.",
            "order":1
         },
         "issues":[
            
         ]
      },
      {
         "id":1261084957,
         "created_at":"2025-08-29T16:11:32.000Z",
         "description":"This is actually step 1",
         "status":"passed",
         "test_run_test_case_step_details":{
            "id":3522948,
            "status":"passed",
            "status_id":982100,
            "step_mapping_id":34001035,
            "colour":"#059669",
            "field_value":"Passed",
            "step":"Measure the time taken for the system to process each reset request.",
            "result":"The processing time for each request should be within the predefined acceptable range for normal load (e.g., < 2 seconds).",
            "order":2
         },
         "issues":[
            
         ]
      },
      {
         "id":1261084959,
         "created_at":"2025-08-29T16:11:32.000Z",
         "description":"This is actually step 1",
         "status":"failed",
         "test_run_test_case_step_details":{
            "id":3522949,
            "status":"failed",
            "status_id":982101,
            "step_mapping_id":34001036,
            "colour":"#F87171",
            "field_value":"Failed",
            "step":"Monitor the time taken to generate and send recovery emails for each request.",
            "result":"Recovery emails should be generated and sent within the predefined acceptable time frame (e.g., < 5 seconds).",
            "order":3
         },
         "issues":[
                "TR-2",
                "XYZ-2"
              ]
      }
   ],
   "overall-result-status":"Passed",
   "attachments":[
      {
         "id":4533,
         "name":"report.pdf",
         "url":"https://test-management.browserstack.com/media/genric/3/10334/9a72c1d-report.pdf?signature=...",
         "url_expires_at":"2026-05-27T14:48:00.000Z",
         "test_result_id":1261084950
      }
   ],
   "attachment_errors":[]
}
  • success Boolean

    API call is executed successfully.

  • test-run-step-results Array

    Array of step-level test results for the test case.

    β–Ά SHOW VALUES
    • id Integer

      Unique identifier for the step result.

    • created_at String

      The time at which the step result was created on BrowserStack servers.

    • description String

      Description or notes for the step result.

    • status String

      Status of the step result (e.g., passed, failed).

    • test_run_test_case_step_details Object

      Details of the test case step executed in the test run.

      β–Ά SHOW VALUES
      • id Integer

        Unique identifier for the test case step.

      • status String

        Status of the test case step (e.g., passed, failed).

      • status_id Integer

        Unique identifier for the status value.

      • step_mapping_id Integer

        Unique identifier for the step mapping.

      • colour String

        Colour code representing the status.

      • field_value String

        Human-readable status value (e.g., Passed, Failed).

      • step String

        The defined action or instruction for the test step.

      • result String

        The expected or observed outcome for the test step.

      • order Integer

        The sequence order of the step in the test case.

    • issues Array

      List of the linked issues for the step result.

  • overall-result-status String

    The overall result status for the test case (e.g., Passed, Failed).

  • attachments Array

    Files attached to the result. Present when the request uploads attachments as multipart/form-data.

    β–Ά SHOW VALUES
    • id Integer

      Unique identifier of the uploaded attachment.

    • name String

      Filename of the attachment, matching the file part sent in the request.

    • url String

      Pre-signed download URL for the attachment, valid for 30 minutes. Fetch the result’s attachments again to get a fresh URL after it expires.

    • url_expires_at String

      Absolute time at which the pre-signed url expires.

    • test_result_id Integer

      Identifier of the test result the attachment is bound to.

  • attachment_errors Array

    Files that uploaded but could not be linked to the result. Present only when at least one attachment fails.

    β–Ά SHOW VALUES
    • filename String

      Filename of the attachment that could not be linked to the result.

    • code String

      Machine-readable error code for the failed attachment (for example, ATTACHMENT_BIND_FAILED).

    • message String

      Human-readable explanation of why the attachment failed.

Add multiple test results with steps to a test run

POST /api/v2/projects/{project_id}/test-runs/{test_run_id}/results

This endpoint adds multiple test results to their respective test cases within a test run in a single API call. Use this endpoint for bulk operations where you need to include the status of individual test steps for one or more results in the payload. To do so, you will need the id of the project, the id of the test run (eg: TR-2343) within that project, status of the test result and the id of the test case.

If you do not need to report step-level results, you can use the simpler Add multiple test results in a test run endpoint.

Note: To identify a step, you must provide either step_id or step_index in each step result object.

Request Parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST https://test-management.browserstack.com/api/v2/projects/PR-45592/test-runs/TR-839042/results
  • project_id* String

    Identifier of the project.

  • test_run_id* String

    Identifier of the test run.

Request Body

Request Body

{
   "results":[
      {
         "test_result":{
            "step_results":[
               {
                  "step_id":34001040,
                  "status":"passed",
                  "description":"This is actually step 1",
                  "issues": [
                    "TR-2",
                    "XYZ-2"
                    ]
               },
               
               {
                  "step_index":2,
                  "status":"passed",
                  "description":"This is actually step 1",
                  "issues": [
                            "TR-12",
                            "XYZ-23"
                          ]
               }
            ]
         },
         "test_case_id":"TC-972131"
      },
      {
         "test_result":{
            "status":"passed",
            "step_results":[
               {
                  "step_index":1,
                  "status":"passed",
                  "description":"This is actually step 1"
               },
               {
                  "step_index":2,
                  "status":"failed",
                  "description":"This is actually step 1"
               }
            ]
         },
         "test_case_id":"TC-972132"
      }
   ]
}
  • results* Array

    Array of test case result objects, each containing test_result and test_case_id.

    β–Ά SHOW VALUES
    • test_result* Object

      The test result object, including step-level results.

      β–Ά SHOW VALUES
      • status* String

        The overall status of the test case result (e.g., passed, failed).

      • step_results* Array

        Array of step-level results for the test case.

        β–Ά SHOW VALUES
        • step_index* Integer

          The index of the step in the test case (starts from 1). Use with caution, as this index will change if the order of steps is modified in the test case. You either pass step_id or step_index.

        • step_id* Integer

          The unique and permanent identifier for the step. This ID remains the same even if steps are reordered. You either pass step_id or step_index.

        • status* String

          The status of the step (e.g., passed, failed).

        • description String

          Description or notes for the step result.

    • test_case_id* String

      Unique identifier of the test case.

Note: Inline file attachments are not supported on this endpoint. Every result here carries step_results, and a bulk result cannot combine step_results with attachments. Such a result returns ATTACHMENTS_NOT_SUPPORTED_WITH_STEP_RESULTS_IN_BULK. To attach files in bulk, use Add multiple test results in a test run. For details, see Add attachments while adding test results.

Response Attributes 200 OK json

Response


{
    "success": true
}
  • success Boolean

    API call is executed successfully.

Update a test result (PATCH)

PATCH /api/v2/projects/{project_id}/test-runs/{test_run_id}/test-results/{result_id}

Use this API to update a test result. The PATCH request updates only the fields you include in the request body. To update a test result, you need the id of the project, the id of the test run (eg: TR-2343), and the id of the test result. Omitted fields keep their current values.

Request Parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X PATCH https://test-management.browserstack.com/api/v2/projects/{project_id}/test-runs/{test_run_id}/test-results/{result_id}
  • project_id* String

    Unique identifier of the project.

  • test_run_id* String

    Unique identifier of the test run.

  • result_id* Integer

    Unique identifier of the test result.

Request Body

Request Body

{
  "test_result": {
    "status": "failed",
    "description": "Failure due to API timeout observed during analysis",
    "custom_fields": {
      "root_cause": "backend_timeout",
      "severity": "high"
    }
  }
}
  • status String

    Status of the test result. Use either a system value (e.g., β€œPassed” or β€œFailed”) or a custom value defined in Test Management. Attempting to define new status values through this API returns an error response.

  • description String

    Notes or additional information added to the test result.

  • custom_fields Object

    List of the custom fields and their corresponding values.

Response Attributes 200 OK json

Response

{
  "success": true,
  "test-result": {
    "id": 425536077,
    "test_run_id": "TR-321",
    "result_status": {
      "field_value": "Failed"
    },
    "description": "Failure due to API timeout observed during analysis",
    "custom_fields": [
      {
        "field_name": "root_cause",
        "value": "backend_timeout"
      },
      {
        "field_name": "severity",
        "value": "high"
      }
    ],
    "updated_at": "2026-04-02T12:30:00.000Z"
  }
}
  • success Boolean

    Indicates that the API call is executed successfully.

  • id Integer

    Unique identifier of the test result.

  • test_run_id String

    Unique identifier of the test run to which the test result belongs.

  • result_status Object

    Contains the status of the test result.

  • result_status.field_value String

    The result status value, e.g., β€œPassed” or β€œFailed.”

  • description String

    Notes or additional information added to the test result.

  • custom_fields Array

    List of the custom fields and their corresponding values.

    β–Ά SHOW VALUES
    • field_name String

      Name of the custom field.

    • value String

      Value of the custom field.

  • updated_at String

    Timestamp (ISO 8601) when the test result was last updated.

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

Download Copy Check Circle