> For a complete page index, fetch https://developer.close.com/llms.txt # Update a Comment PUT https://api.close.com/api/v1/comment/{id}/ Content-Type: application/json You can use this endpoint to edit a comment body. Note that users may only update their own comments. Reference: https://developer.close.com/api/resources/comments/update ## Authentication - `Authorization` header (basic auth, required) — Use your API key as the username and leave the password empty. - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. ## Request ### Path parameters - `id` (string, required) ### Body (application/json) This endpoint expects an UpdateCommentThreads. - `body` (string, required) ## Response ### 200 Successful response ## Errors ### 400 Bad Request Error Bad request - `any` ### 401 Unauthorized Error Unauthorized - `any` ### 404 Not Found Error Not found - `any` ## Examples **Request** ```json { "body": "

Oops, wrong activity

" } ``` **Response** ```json { "body": "

Oops, wrong activity

", "created_at": "2024-03-27T18:57:02.770240+00:00", "created_by": "user_abc123", "id": "comm_abc123", "lead_id": "lead_abc123", "mentions": [], "organization_id": "orga_abc123", "removed_at": null, "removed_by": null, "thread_id": "comthr_abc123", "updated_at": "2024-03-27T18:57:02.770240+00:00", "updated_by": "user_abc123" } ``` **SDK Code** ```python comments_update_example import requests url = "https://api.close.com/api/v1/comment/id/" payload = { "body": "

Oops, wrong activity

" } headers = { "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers, auth=("", "")) print(response.json()) ``` ```javascript comments_update_example const url = 'https://api.close.com/api/v1/comment/id/'; const credentials = btoa(":"); const options = { method: 'PUT', headers: {Authorization: `Basic ${credentials}`, 'Content-Type': 'application/json'}, body: '{"body":"

Oops, wrong activity

"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go comments_update_example package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.close.com/api/v1/comment/id/" payload := strings.NewReader("{\n \"body\": \"

Oops, wrong activity

\"\n}") req, _ := http.NewRequest("PUT", url, payload) req.SetBasicAuth("", "") 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 comments_update_example require 'uri' require 'net/http' url = URI("https://api.close.com/api/v1/comment/id/") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Put.new(url) request.basic_auth("", "") request["Content-Type"] = 'application/json' request.body = "{\n \"body\": \"

Oops, wrong activity

\"\n}" response = http.request(request) puts response.read_body ``` ```java comments_update_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.put("https://api.close.com/api/v1/comment/id/") .basicAuth("", "") .header("Content-Type", "application/json") .body("{\n \"body\": \"

Oops, wrong activity

\"\n}") .asString(); ``` ```php comments_update_example request('PUT', 'https://api.close.com/api/v1/comment/id/', [ 'body' => '{ "body": "

Oops, wrong activity

" }', 'headers' => [ 'Content-Type' => 'application/json', ], 'auth' => ['', ''], ]); echo $response->getBody(); ``` ```csharp comments_update_example using RestSharp; using RestSharp.Authenticators; var client = new RestClient("https://api.close.com/api/v1/comment/id/"); client.Authenticator = new HttpBasicAuthenticator("", ""); var request = new RestRequest(Method.PUT); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"body\": \"

Oops, wrong activity

\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ```