Cancel Custom Calendar Event
POST
/api/v1/cases/{caseId}Cancels a custom calendar event. Only events created with agentName set to "custom" can be cancelled through this endpoint.
cv-api-key
Production
https://api.care360-next.carevalidate.com/api/v1/cases/{caseId}Staging
https://api-staging.care360-next.carevalidate.com/api/v1/cases/{caseId}Parameters
Headers
content-typestringrequired`application/json`
cv-api-keystringrequiredOrganization API key
Path Parameters
caseIdstring<UUID>requiredCase identifier
Example:
a1b2c3d4-e5f6-7890-abcd-ef1234567890Request Body
actionstringrequiredThe action to perform. Must be `CANCEL_CALENDAR_EVENT`.
Values:CANCEL_CALENDAR_EVENT
calendarobjectrequiredCalendar event identification.
Show 1 child property
idstring<UUID>requiredCalendar event ID to cancel.
Example:
987fcdeb-51a2-43d7-9876-543210fedcbaNotes
- This endpoint performs a soft delete by setting the
isDeletedflag totrue. - Only calendar events created with
agentName: "custom"can be cancelled. - Once cancelled, a calendar event cannot be uncancelled.
- Attempting to cancel an already cancelled event will result in an error.
Examples
- cURL
- JavaScript
- Python
curl --request POST \
--url "https://api.example.com/api/v1/cases/{caseId}" \
--header "content-type: application/json" \
--header "cv-api-key: your-org-cv-api-key" \
--data '{
"action": "CANCEL_CALENDAR_EVENT",
"calendar": {
"id": "987fcdeb-51a2-43d7-9876-543210fedcba"
}
}'
const caseId = "a1b2c3d4-e5f6-7890-abcd-ef1234567890";
const response = await fetch(`https://api.example.com/api/v1/cases/${caseId}`, {
method: "POST",
headers: {
"Content-Type": "application/json",
"cv-api-key": "your-org-cv-api-key",
},
body: JSON.stringify({
action: "CANCEL_CALENDAR_EVENT",
calendar: {
id: "987fcdeb-51a2-43d7-9876-543210fedcba",
},
}),
});
const data = await response.json();
console.log(data);
import requests
case_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
response = requests.post(
f"https://api.example.com/api/v1/cases/{case_id}",
headers={
"Content-Type": "application/json",
"cv-api-key": "your-org-cv-api-key",
},
json={
"action": "CANCEL_CALENDAR_EVENT",
"calendar": {
"id": "987fcdeb-51a2-43d7-9876-543210fedcba",
},
},
)
print(response.json())
Try It Out
Try itAPI Playground
▶Responses
▶200SuccessCalendar event cancelled successfully.
{
"status": 200,
"success": true,
"message": "Calendar event cancelled successfully",
"data": {
"success": true
}
}
▶400Bad Request — Invalid ActionReturned when the action field is not a recognized value.
{
"status": 400,
"success": false,
"message": "Invalid request",
"error": "Invalid action"
}
▶400Bad Request — Invalid UUIDReturned when the calendar.id field is not a valid UUID format.
{
"status": 400,
"success": false,
"message": "Invalid request",
"error": "id must be a valid UUID"
}
▶400Bad Request — Event Not FoundReturned when no calendar event exists with the provided ID.
{
"status": 400,
"success": false,
"message": "Invalid request",
"error": "Calendar event not found"
}
▶400Bad Request — Already CancelledReturned when the calendar event has already been cancelled.
{
"status": 400,
"success": false,
"message": "Invalid request",
"error": "Calendar event has already been cancelled"
}
▶400Bad Request — Not Custom EventReturned when the calendar event's agentName is not "custom".
{
"status": 400,
"success": false,
"message": "Invalid request",
"error": "Calendar event can only be cancelled if agentName is \"custom\""
}
▶401UnauthorizedReturned when API key is missing or invalid.
{
"status": 401,
"success": false,
"message": "Invalid or missing API key"
}
▶404Not FoundReturned when no case exists with the provided caseId.
{
"status": 404,
"success": false,
"message": "Invalid request",
"error": "No Case found for provided details!"
}
▶500Internal Server ErrorReturned when an unexpected error occurs.
{
"status": 500,
"success": false,
"message": "Internal error"
}