---
title: "Add or update a test case using suite token authentication"
method: PUT
path: "/unit-tests/sessions/{session_id}/cases"
tags: ["Unit Test API"]
---

# Add or update a test case using suite token authentication

`PUT /unit-tests/sessions/{session_id}/cases`

Authentication: Include the suite token in the header: `Authorization: Bearer <suite_token>`

## Path parameters

- `session_id` string, required

## Request body

- AddTestCaseRequest
  - `name` string, required — Name of the test case
  - `test_group_name` string, required — Name of the test group this case belongs to (typically corresponds to a test suite in JUnit XML)
  - `classname` string, required — Fully qualified class name of the test
  - `status` 'PASSED' | 'FAILED' | 'SKIPPED' | 'ERROR', required — Test execution status
  - `time` number, double, required — Execution time in seconds
  - `data` string — Original XML data from the test report

## Response `201`

- TestCaseView
  - `url` string — API endpoint to GET this object
  - `html_url` string — Web URL to view this object in Buddy.works
  - `id` string — Unique identifier of the test case
  - `name` string — Name of the test case
  - `test_group_name` string — Name of the test group this case belongs to (typically corresponds to a test suite in JUnit XML)
  - `test_group_id` string — ID of the test group this case belongs to
  - `classname` string — Fully qualified class name of the test
  - `status` 'PASSED' | 'FAILED' | 'SKIPPED' | 'ERROR' — Test execution status
  - `time` number, double — Execution time in seconds
  - `data` string — Original XML data from the test report

---

[API](https://skmtc.net/buddy/apis/buddy-api.md) · [All operations](https://skmtc.net/buddy/apis/buddy-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/buddy/buddy-api/versions/2426d67c249a/schema)
