Case comments
/api/v1/cases/:caseIdAdds a comment to an existing case with optional attachments. Can also add internal notes or tag case assignees.
https://api.care360-next.carevalidate.com/api/v1/cases/:caseIdhttps://api-staging.care360-next.carevalidate.com/api/v1/cases/:caseIdPath Parameters
caseIdstringrequiredThe unique identifier (UUID) of the case.
Headers
cv-api-keystringrequiredYour unique API key for authentication.
Content-TypestringrequiredMust be application/json.
application/jsonRequest Body
actionstringrequiredThe action to be performed.
communicationobjectrequiredCommunication details for the comment.
Show 5 child properties
textstringrequiredThe message to be added to the case.
isRestrictedbooleanrequiredIndicates if the communication should be restricted. False by default.
webhookNotifybooleanoptionalIndicates if the comment webhook notification should be sent. True by default.
authorobjectrequiredAuthor details for the comment.
Show 3 child properties
emailstringrequiredThe author's email address.
firstNamestringoptionalThe author's first name.
lastNamestringoptionalThe author's last name.
attachmentsarray of objectsoptionalOptional array of file attachments.
Show 4 child properties
isRestrictedbooleanoptionalIndicates if the attachment should be restricted.
isPHIbooleanoptionalIndicates if the attachment contains Protected Health Information.
fileNamestringrequiredThe file name of the attachment (e.g., document.pdf).
contentstringrequiredThe file content encoded as a Base64 string.
Request Examples
- cURL
- JavaScript
- Python
curl -X POST "https://api.care360-next.carevalidate.com/api/v1/cases/YOUR_CASE_ID" \
-H "cv-api-key: YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"action": "ADD_COMMUNICATION",
"communication": {
"text": "Comment text",
"isRestricted": false,
"author": {
"email": "support_user@carevalidate.com",
"firstName": "John",
"lastName": "Doe"
},
"webhookNotify": true,
"attachments": [
{
"isRestricted": false,
"isPHI": false,
"fileName": "Screenshot_01.png",
"content": "BASE64_STRING"
}
]
}
}'
const caseId = 'YOUR_CASE_ID';
const response = await fetch(
`https://api.care360-next.carevalidate.com/api/v1/cases/${caseId}`,
{
method: 'POST',
headers: {
'cv-api-key': 'YOUR_SECRET_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
action: 'ADD_COMMUNICATION',
communication: {
text: 'Comment text',
isRestricted: false,
author: {
email: 'support_user@carevalidate.com',
firstName: 'John',
lastName: 'Doe',
},
webhookNotify: true,
attachments: [
{
isRestricted: false,
isPHI: false,
fileName: 'Screenshot_01.png',
content: 'BASE64_STRING',
},
],
},
}),
}
);
const data = await response.json();
console.log(data);
import requests
case_id = "YOUR_CASE_ID"
url = f"https://api.care360-next.carevalidate.com/api/v1/cases/{case_id}"
headers = {
"cv-api-key": "YOUR_SECRET_KEY",
"Content-Type": "application/json",
}
payload = {
"action": "ADD_COMMUNICATION",
"communication": {
"text": "Comment text",
"isRestricted": False,
"author": {
"email": "support_user@carevalidate.com",
"firstName": "John",
"lastName": "Doe",
},
"webhookNotify": True,
"attachments": [
{
"isRestricted": False,
"isPHI": False,
"fileName": "Screenshot_01.png",
"content": "BASE64_STRING",
}
],
},
}
response = requests.post(url, headers=headers, json=payload)
data = response.json()
print(data)
Responses
▶200SuccessCase comment created successfully.
{
"status": 200,
"success": true,
"message": "Case comment created successfully",
"data": {
"commentId": "e4f8d5a2-9b2f-4c5c-8d1f-8c6f1d9e2a3b",
"createdAt": "2024-09-04T12:00:00.000Z"
}
}
▶400Invalid ActionThe action field is not a recognized value.
{
"status": 400,
"success": false,
"message": "Invalid request",
"error": "Invalid action"
}
▶400Missing Required FieldsRequired fields (text, isRestricted, or author) are missing from the communication object.
{
"status": 400,
"success": false,
"message": "Invalid request",
"error": "Missing required field `text`"
}
▶400Missing Attachment FieldsAn attachment object is missing the content or fileName field.
{
"status": 400,
"success": false,
"message": "Invalid request",
"error": "`content` field is required for attachments"
}
▶400Invalid Tagged UserA tagged user object is missing the required email field.
{
"status": 400,
"success": false,
"message": "Invalid request",
"error": "`email` field is required for tagged users"
}
▶404Case Not FoundNo case exists with the provided caseId.
{
"status": 404,
"success": false,
"message": "Invalid request",
"error": "No Case found for provided details!"
}
▶403Permission DeniedThe case belongs to a different organization than the one associated with the API key.
{
"status": 403,
"success": false,
"message": "Invalid request",
"error": "Permission denied!"
}