> For a complete page index, fetch https://docs.synthflow.ai/llms.txt. For full documentation content, fetch https://docs.synthflow.ai/llms-full.txt. # Delete a chat DELETE https://api.synthflow.ai/v2/chat/{chat_id} Delete a chat session. Reference: https://docs.synthflow.ai/api-reference/platform-api/chat/delete-chat ## Authentication - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. ## Servers - `https://api.synthflow.ai/v2` (Global, default) - `https://api.us.synthflow.ai/v2` (United States) - `https://api.eu.synthflow.ai/v2` (European Union) ## Request ### Path parameters - `chat_id` (string, required) ## Response ### 200 200 - `status` (string, optional) — Whether the request was successful. ## Errors ### 400 Bad Request Error 400 ## Examples **Response** ```json { "status": "ok" } ``` **SDK Code** ```python Chat_delete-chat_example import requests url = "https://api.synthflow.ai/v2/chat/5ce87965-bc81-4df1-985a-91b9a5fcf7fa" headers = {"Authorization": "Bearer "} response = requests.delete(url, headers=headers) print(response.json()) ``` ```go Chat_delete-chat_example package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.synthflow.ai/v2/chat/5ce87965-bc81-4df1-985a-91b9a5fcf7fa" req, _ := http.NewRequest("DELETE", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Chat_delete-chat_example require 'uri' require 'net/http' url = URI("https://api.synthflow.ai/v2/chat/5ce87965-bc81-4df1-985a-91b9a5fcf7fa") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Delete.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java Chat_delete-chat_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.delete("https://api.synthflow.ai/v2/chat/5ce87965-bc81-4df1-985a-91b9a5fcf7fa") .header("Authorization", "Bearer ") .asString(); ``` ```csharp Chat_delete-chat_example using RestSharp; var client = new RestClient("https://api.synthflow.ai/v2/chat/5ce87965-bc81-4df1-985a-91b9a5fcf7fa"); var request = new RestRequest(Method.DELETE); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift Chat_delete-chat_example import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.synthflow.ai/v2/chat/5ce87965-bc81-4df1-985a-91b9a5fcf7fa")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "DELETE" request.allHTTPHeaderFields = headers 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() ```