# Update conversation PATCH https://api.moveworks.ai/rest/v1beta1/conversations/{conversation_id} Content-Type: application/json Updates title, or archive a conversation. Reference: https://docs.moveworks.com/api-reference/conversations-api/conversations/update-conversation ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Update conversation version: endpoint_conversations.updateConversation paths: /conversations/{conversation_id}: patch: operationId: update-conversation summary: Update conversation description: Updates title, or archive a conversation. tags: - - subpackage_conversations parameters: - name: conversation_id in: path description: 'Unique conversation identifier (format: conv_)' required: true schema: type: string - name: Authorization in: header description: >- JWT bearer token authentication. Obtain an access token from the Moveworks auth endpoint and include it in the Authorization header as 'Bearer '. required: true schema: type: string - name: Assistant-Name in: header description: >- The Moveworks assistant identifier that was configured for your organization. required: true schema: type: string responses: '200': description: Conversation updated successfully content: application/json: schema: $ref: '#/components/schemas/Conversation' '400': description: Bad request - Invalid input parameters content: {} '401': description: Unauthorized - Invalid or missing authentication content: {} '404': description: Not found - Resource does not exist content: {} '429': description: Rate limit exceeded content: {} '500': description: Internal server error content: {} requestBody: content: application/json: schema: $ref: '#/components/schemas/UpdateConversationRequest' components: schemas: UpdateConversationRequest: type: object properties: title: type: string description: New conversation title (max 256 characters) archived: type: boolean description: New archived status Conversation: type: object properties: conversation_id: type: string description: 'Unique conversation identifier (format: conv_)' title: type: string description: Optional user-defined title (max 256 characters) archived: type: boolean description: User-controlled flag to mark conversation as archived created_at: type: string format: date-time description: Creation timestamp (ISO 8601) updated_at: type: string format: date-time description: Last update timestamp (ISO 8601) required: - conversation_id - archived - created_at - updated_at ``` ## SDK Code Examples ```python import requests url = "https://api.moveworks.ai/rest/v1beta1/conversations/conv_01ARZ3NDEKTSV4RRFFQ69G5FAV" payload = { "title": "User permissions discussion", "archived": True } headers = { "Assistant-Name": "acmecorp-conversations-rest-api", "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.patch(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.moveworks.ai/rest/v1beta1/conversations/conv_01ARZ3NDEKTSV4RRFFQ69G5FAV'; const options = { method: 'PATCH', headers: { 'Assistant-Name': 'acmecorp-conversations-rest-api', Authorization: 'Bearer ', 'Content-Type': 'application/json' }, body: '{"title":"User permissions discussion","archived":true}' }; 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://api.moveworks.ai/rest/v1beta1/conversations/conv_01ARZ3NDEKTSV4RRFFQ69G5FAV" payload := strings.NewReader("{\n \"title\": \"User permissions discussion\",\n \"archived\": true\n}") req, _ := http.NewRequest("PATCH", url, payload) req.Header.Add("Assistant-Name", "acmecorp-conversations-rest-api") req.Header.Add("Authorization", "Bearer ") 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://api.moveworks.ai/rest/v1beta1/conversations/conv_01ARZ3NDEKTSV4RRFFQ69G5FAV") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Patch.new(url) request["Assistant-Name"] = 'acmecorp-conversations-rest-api' request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"title\": \"User permissions discussion\",\n \"archived\": true\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://api.moveworks.ai/rest/v1beta1/conversations/conv_01ARZ3NDEKTSV4RRFFQ69G5FAV") .header("Assistant-Name", "acmecorp-conversations-rest-api") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"title\": \"User permissions discussion\",\n \"archived\": true\n}") .asString(); ``` ```php request('PATCH', 'https://api.moveworks.ai/rest/v1beta1/conversations/conv_01ARZ3NDEKTSV4RRFFQ69G5FAV', [ 'body' => '{ "title": "User permissions discussion", "archived": true }', 'headers' => [ 'Assistant-Name' => 'acmecorp-conversations-rest-api', 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.moveworks.ai/rest/v1beta1/conversations/conv_01ARZ3NDEKTSV4RRFFQ69G5FAV"); var request = new RestRequest(Method.PATCH); request.AddHeader("Assistant-Name", "acmecorp-conversations-rest-api"); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"title\": \"User permissions discussion\",\n \"archived\": true\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "Assistant-Name": "acmecorp-conversations-rest-api", "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = [ "title": "User permissions discussion", "archived": true ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.moveworks.ai/rest/v1beta1/conversations/conv_01ARZ3NDEKTSV4RRFFQ69G5FAV")! 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() ```