> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.monite.com/v-2024-05-25/api/comments/post-comments/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.monite.com/_mcp/server. # Create a comment POST https://api.sandbox.monite.com/v1/comments Content-Type: application/json Create new comment Reference: https://docs.monite.com/api/comments/post-comments ## Authentication - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. ## Servers - `https://api.sandbox.monite.com/v1` (sandbox, default) - `https://api.monite.com/v1` (eu_production) - `https://us.api.monite.com/v1` (na_production) ## Request ### Headers - `x-monite-version` (string, required) - `x-monite-entity-id` (string, required) — The ID of the entity that owns the requested resource. ### Body (application/json) This endpoint expects an object. - `object_id` (string, required) - `object_type` (string, required) - `text` (string, required) - `reply_to_entity_user_id` (string, optional) ## Response ### 201 Successful Response - `id` (string, required) - `created_by_entity_user_id` (string, required) - `entity_id` (string, required) - `object_id` (string, required) - `object_type` (string, required) - `status` (enum, required) - Allowed values: `active`, `deleted` - `text` (string, required) - `created_at` (datetime, optional) - `updated_at` (datetime, optional) - `reply_to_entity_user_id` (string, optional) ## Errors ### 400 Post Comments Request Bad Request Error Bad Request - `error` (ErrorSchema, required) ### 401 Post Comments Request Unauthorized Error The `Authorization` header is missing or contains an invalid or expired access token. See [Authentication](https://docs.monite.com/api/concepts/authentication) to learn how to authenticate API calls. - `any` ### 403 Post Comments Request Forbidden Error The specified access token does not have permissions to perform this operation. - `error` (ErrorSchema, required) ### 404 Post Comments Request Not Found Error Not Found - `error` (ErrorSchema, required) ### 409 Post Comments Request Conflict Error Possible responses: `Could not notify groups: {not_valid_recipients}. Recipients dont exists`, `groups with ids: {','.join(missed_ids)} dont exists`, `Could not notify groups: {missed_groups}. Only {available_groups} are available`, `Action {action} for {object_type} not allowed`, `Action for {object_type} at permissions not found: {action}`, `Object type at permissions not found: {object_type}``{operation}: status has not changed` - `error` (ErrorSchema, required) ### 422 Post Comments Request Unprocessable Entity Error Validation Error - `detail` (list of ValidationError, optional) ### 429 Post Comments Request Too Many Requests Error API rate limit has been exceeded. Check the response headers for the rate limit information. - `any` ## Types ### ErrorSchema - `message` (string, required) ### ValidationError - `loc` (list of ValidationErrorLocItem, required) - `msg` (string, required) - `type` (string, required) ### ValidationErrorLocItem ## Examples **Request** ```json { "object_id": "object_id", "object_type": "object_type", "text": "text" } ``` **Response** ```json { "id": "id", "created_by_entity_user_id": "created_by_entity_user_id", "entity_id": "entity_id", "object_id": "object_id", "object_type": "object_type", "status": "active", "text": "text", "created_at": "2024-01-15T09:30:00Z", "updated_at": "2024-01-15T09:30:00Z", "reply_to_entity_user_id": "reply_to_entity_user_id" } ``` **SDK Code** ```python import requests url = "https://api.sandbox.monite.com/v1/comments" payload = { "object_id": "object_id", "object_type": "object_type", "text": "text" } headers = { "x-monite-version": "2024-05-25", "x-monite-entity-id": "9d2b4c8f-2087-4738-ba91-7359683c49a4", "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.sandbox.monite.com/v1/comments'; const options = { method: 'POST', headers: { 'x-monite-version': '2024-05-25', 'x-monite-entity-id': '9d2b4c8f-2087-4738-ba91-7359683c49a4', Authorization: 'Bearer ', 'Content-Type': 'application/json' }, body: '{"object_id":"object_id","object_type":"object_type","text":"text"}' }; 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.sandbox.monite.com/v1/comments" payload := strings.NewReader("{\n \"object_id\": \"object_id\",\n \"object_type\": \"object_type\",\n \"text\": \"text\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("x-monite-version", "2024-05-25") req.Header.Add("x-monite-entity-id", "9d2b4c8f-2087-4738-ba91-7359683c49a4") 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.sandbox.monite.com/v1/comments") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["x-monite-version"] = '2024-05-25' request["x-monite-entity-id"] = '9d2b4c8f-2087-4738-ba91-7359683c49a4' request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"object_id\": \"object_id\",\n \"object_type\": \"object_type\",\n \"text\": \"text\"\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.post("https://api.sandbox.monite.com/v1/comments") .header("x-monite-version", "2024-05-25") .header("x-monite-entity-id", "9d2b4c8f-2087-4738-ba91-7359683c49a4") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"object_id\": \"object_id\",\n \"object_type\": \"object_type\",\n \"text\": \"text\"\n}") .asString(); ``` ```php request('POST', 'https://api.sandbox.monite.com/v1/comments', [ 'body' => '{ "object_id": "object_id", "object_type": "object_type", "text": "text" }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', 'x-monite-entity-id' => '9d2b4c8f-2087-4738-ba91-7359683c49a4', 'x-monite-version' => '2024-05-25', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.sandbox.monite.com/v1/comments"); var request = new RestRequest(Method.POST); request.AddHeader("x-monite-version", "2024-05-25"); request.AddHeader("x-monite-entity-id", "9d2b4c8f-2087-4738-ba91-7359683c49a4"); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"object_id\": \"object_id\",\n \"object_type\": \"object_type\",\n \"text\": \"text\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "x-monite-version": "2024-05-25", "x-monite-entity-id": "9d2b4c8f-2087-4738-ba91-7359683c49a4", "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = [ "object_id": "object_id", "object_type": "object_type", "text": "text" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.sandbox.monite.com/v1/comments")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" 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() ```