> For clean Markdown of any page, append `.md` to the page URL. > For a complete documentation index, see https://docs.sarvam.ai/llms.txt. > For full documentation content in one file, see https://docs.sarvam.ai/llms-full.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.sarvam.ai/_mcp/server. # Update a test suite PATCH https://apps.sarvam.ai/api/evals/v1/{org_id}/{workspace_id}/test-suites/{test_suite_id} Content-Type: application/json Only the fields you send are changed. Test cases are edited through their own endpoints. Reference: https://docs.sarvam.ai/api-reference/tests/update ## Request ### Path parameters - `org_id` (string, required) — Organization ID - `workspace_id` (string, required) — Workspace ID - `test_suite_id` (string, required) ### Headers - `X-API-Key` (string, required) — Your workspace API key. ### Body (application/json) This endpoint expects a TestSuiteUpdate. - `name` (string, optional, nullable) - `description` (string, optional, nullable) - `variables` (list of SuiteVariable, optional, nullable) - `global_guardrails` (list of string, optional, nullable) — Replacement list, at most 20 entries. ## Response ### 200 Successful Response - `test_suite_id` (string, required) ## Errors ### 401 Unauthorized Error No Bearer token or X-API-Key was supplied, or it is invalid. - `error` (ErrorBody, required) — Details of the error that occurred. ### 403 Forbidden Error The credential is not valid for this org or workspace. - `error` (ErrorBody, required) — Details of the error that occurred. ### 404 Not Found Error No such resource in this org and workspace. - `error` (ErrorBody, required) — Details of the error that occurred. ### 422 Unprocessable Entity Error Validation Error - `detail` (list of ValidationError, optional) ### 429 Too Many Requests Error Rate limit exceeded for this caller. - `error` (ErrorBody, required) — Details of the error that occurred. ## Types ### SuiteVariable - `name` (string, required) - `value` (string, required) ### ErrorBody Details of the error that occurred. - `code` (string, required) — A service-specific error code. - `message` (string, required) — A human-readable description of the error. ### ValidationError - `loc` (list of ValidationErrorLocItems, required) - `msg` (string, required) - `type` (string, required) ### ValidationErrorLocItems ## Examples **Request** ```json { "description": "Booking flows, now including weekend rescheduling." } ``` **Response** ```json { "test_suite_id": "01K5T8A2MZQ4VE6XCJ0RDBHW7N" } ``` **SDK Code** ```python import requests url = "https://apps.sarvam.ai/api/evals/v1/org_id/workspace_id/test-suites/test_suite_id" payload = { "description": "Booking flows, now including weekend rescheduling." } headers = { "X-API-Key": "", "Content-Type": "application/json" } response = requests.patch(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://apps.sarvam.ai/api/evals/v1/org_id/workspace_id/test-suites/test_suite_id'; const options = { method: 'PATCH', headers: {'X-API-Key': '', 'Content-Type': 'application/json'}, body: '{"description":"Booking flows, now including weekend rescheduling."}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://apps.sarvam.ai/api/evals/v1/org_id/workspace_id/test-suites/test_suite_id" payload := strings.NewReader("{\n \"description\": \"Booking flows, now including weekend rescheduling.\"\n}") req, _ := http.NewRequest("PATCH", url, payload) req.Header.Add("X-API-Key", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://apps.sarvam.ai/api/evals/v1/org_id/workspace_id/test-suites/test_suite_id") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Patch.new(url) request["X-API-Key"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"description\": \"Booking flows, now including weekend rescheduling.\"\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.patch("https://apps.sarvam.ai/api/evals/v1/org_id/workspace_id/test-suites/test_suite_id") .header("X-API-Key", "") .header("Content-Type", "application/json") .body("{\n \"description\": \"Booking flows, now including weekend rescheduling.\"\n}") .asString(); ``` ```php request('PATCH', 'https://apps.sarvam.ai/api/evals/v1/org_id/workspace_id/test-suites/test_suite_id', [ 'body' => '{ "description": "Booking flows, now including weekend rescheduling." }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-Key' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://apps.sarvam.ai/api/evals/v1/org_id/workspace_id/test-suites/test_suite_id"); var request = new RestRequest(Method.PATCH); request.AddHeader("X-API-Key", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"description\": \"Booking flows, now including weekend rescheduling.\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "X-API-Key": "", "Content-Type": "application/json" ] let parameters = ["description": "Booking flows, now including weekend rescheduling."] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://apps.sarvam.ai/api/evals/v1/org_id/workspace_id/test-suites/test_suite_id")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PATCH" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```