Close (Token Auth)

  • POST
  • /unit-tests
  • /sessions
  • /:session_id
  • /close

Close a test session using suite token authentication

Request

URL PARAMETERS
session_idrequiredstring
The ID of the test session

Example: "r4nBYXVq"

Response

RESPONSE BODY
urlread-onlystring
API endpoint to GET this object
html_urlread-onlystring
Web URL to view this object in Buddy.works
idinteger
Unique identifier of the test session
relative_idinteger
Sequential ID within the suite
create_datestring
Timestamp when the session was created
start_datestring
Timestamp when the session started
finish_datestring
Timestamp when the session finished
created_byMemberView
User/member reference
ci_providerstring enum
CI provider that initiated the test session
Allowed enum:
NONE,
BUDDY,
GITHUB_ACTION,
CIRCLE_CI
ci_run_urlstring
URL to the external CI/CD run
revisionstring
Ending revision/commit hash for the test range
ref_typestring enum
Type of Git reference
Allowed enum:
BRANCH,
TAG,
PULL_REQUEST
ref_namestring
Name of the Git reference (branch name, tag name, etc.). May be null if ref_type is not provided.
execution_idstring
Execution hash ID. Set when session is a result of BUDDY action execution
action_execution_idstring
Action execution hash ID. Set when session is a result of BUDDY action execution
statusstring enum
Current status of the session
Allowed enum:
IN_PROGRESS,
SUCCESSFUL,
ERROR,
SKIPPED
error_messagestring
Error message if the session failed. Set when status is ERROR.
durationinteger
Total duration in seconds
tests_countinteger
Total number of tests
failed_countinteger
Number of failed tests
skipped_countinteger
Number of skipped tests
error_countinteger
Number of tests with errors

Last modified on Jan 26, 2026

Request example

CURL
curl -X POST "https://api.buddy.works/unit-tests/sessions/:session_id/close" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "Content-Type: application/json"
EXAMPLE RESPONSE
{ "url": "https://api.buddy.works/workspaces/my-workspace/projects/my-project/unit-tests/suites/MNbyVedg/sessions/r4nBYXVq", "html_url": "https://app.buddy.works/my-workspace/my-project/unit-tests/MNbyVedg/r4nBYXVq", "id": "r4nBYXVq", "relative_id": 1, "create_date": "2025-10-21T06:42:08Z", "start_date": "2025-10-21T06:42:08Z", "created_by": { "url": "https://api.buddy.works/workspaces/my-workspace/members/1", "html_url": "https://app.buddy.works/my-workspace/-/profile/1", "id": 1, "name": "John Doe", "avatar_url": "https://app.buddy.works/image-server/user/0/0/0/0/0/0/1/d643744fbe5ebf2906a4d075a5b97110/w/32/32/AVATAR.png?ts=1760014081477", "email": "john.doe@company.com", "admin": true, "workspace_owner": true }, "ci_provider": "BUDDY", "revision": "755b691cfff32e08aba35f2c9b1451ed76cfd583", "ref_type": "BRANCH", "ref_name": "master", "execution_id": "68f72b3d66907cbc77887986", "action_execution_id": "68f72b3d66907cbc77887988", "status": "SUCCESSFUL", "duration": 1, "tests_count": 109, "failed_count": 0, "skipped_count": 0, "error_count": 0 }
STATUS
200 OK