# Add case note

### Description

This service allows an authenticated operator or party to add a new comment (note) to an existing case.

***

### Request

#### Restrictions

* Authentication: Requires a successful operator or party login.
* Authorization: The request will fail if the authenticated user or touchpoint does not have permission to add notes to the specific case.

#### Endpoint

```
POST https://<server-url>/api/v4/cases/{case_id}/notes
```

#### Path Parameters

| **Parameter** | **Type** | **Description**                                               |
| ------------- | -------- | ------------------------------------------------------------- |
| `case_id`     | Integer  | The unique ID of the case to which the comment will be added. |

#### Parameters

| **Parameter**  | **Location**   | **Description**                                                                    |
| -------------- | -------------- | ---------------------------------------------------------------------------------- |
| `touchpoint`   | Query / Header | The identifier for the touchpoint. Use `Thalamus-Touchpoint` for the header.       |
| `token`        | Query / Header | The authentication token for the API session. Use `Thalamus-Token` for the header. |
| `Content-Type` | Header         | Must be `application/json`.                                                        |

#### Request Body

The body contains the text of the note to be added.

| **Field**     | **Type** | **Description**                               |
| ------------- | -------- | --------------------------------------------- |
| `description` | String   | Required. The content of the comment or note. |

Example Body:

```
{  
   "description": "This is a note!" 
}
```

***

### Response

#### ✅ Successful Response: `201 Created`

The comment was successfully added. The response returns the session `context` and the newly created `comment` object.

JSON

```
{  
   "context": {  
      "simpleProfile": {  
         "firstname": "test",
         "lastname": "test",
         "email": "test@test.com"
      }
   },
   "comment": {  
      "caseInstanceId": 1,
      "description": "This is a note!"
   }
}
```

***

### ❌ Unsuccessful Response

#### `400 Bad Request`

| **Error Code** | **Description**                                                                                                                       |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `invalidId`    | The `case_id` provided does not exist, or the authenticated operator/touchpoint is not authorized to add notes to this specific case. |
