Add build logs API in Test Reporting & Analytics
Use this API to upload logs for tests and hooks within a build. Supports multiple log types including test logs, HTTP interactions, screenshots, and file attachments. You can send up to 500 log entries per request.
Add logs to a build
Request parameters
Request
curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-automation.browserstack.com/ext/v1/builds/BUILD_HASHED_ID/logs" \
-H "Content-Type: application/json" \
-d '{
"logs": [
{
"kind": "TEST_LOG",
"test_run_uuid": "2d1cacf9-6872-430f-b3ec-38d49102a3f3",
"timestamp": "2025-11-11T10:30:06Z",
"level": "INFO",
"message": "Navigating to login page"
}
]
}'
-
logs* Array
â–¶ SHOW VALUESArray of log entry objects. Maximum 500 entries per request.
-
kind* String
Type of log entry. Allowed values are TEST_LOG, HTTP, TEST_SCREENSHOT, HOOK_LOG, TEST_STEP, or TEST_ATTACHMENT.
-
test_run_uuid String
UUID of the test run to associate this log entry with. Use the uuid returned by the start test run API.
-
hook_run_uuid String
UUID of the hook run to associate this log entry with. Use the uuid returned by the start hook run API.
-
timestamp String (ISO 8601)
Timestamp of the log entry in ISO 8601 format.
-
level String
Log level (for example, DEBUG, INFO, WARN, ERROR).
-
message String
Log message content. Maximum 10000 characters.
-
duration Integer
Duration in milliseconds associated with the log entry (for example, HTTP response time).
-
failure Boolean
Indicates whether this log entry represents a failure event.
-
file_name String
Name of the file being attached or uploaded (applicable for TEST_SCREENSHOT and TEST_ATTACHMENT kinds).
-
file_size Integer
Size of the attached file in bytes.
-
attachment_type String
Type of attachment. Allowed values are MANUAL_UPLOAD, AUTO_UPLOAD, SCREENSHOT, or LOG_FILE.
-
http_response Object
â–¶ SHOW VALUESHTTP response details for log entries of kind HTTP.
-
status_code Integer
HTTP response status code (100-599).
-
method String
HTTP method of the request. Allowed values are GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS, or TRACE.
-
path String
Request path or URL. Maximum 2000 characters.
-
headers Object
HTTP request or response headers as key-value pairs.
-
body Any
HTTP request or response body.
-
-
Response attributes 200 OK JSON
Response
{
"success": true,
"message": "Logs ingested successfully."
}
-
success Boolean
Indicates if the logs were added successfully.
-
message String
A success message describing how many log entries were added.
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.