Skip to main content

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
Productionhttps://api.care360-next.carevalidate.com/api/v1/cases/{caseId}
Staginghttps://api-staging.care360-next.carevalidate.com/api/v1/cases/{caseId}

Parameters

Headers
content-typestringrequired

`application/json`

cv-api-keystringrequired

Organization API key

Path Parameters
caseIdstring<UUID>required

Case identifier

Example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
Request Body
actionstringrequired

The action to perform. Must be `CANCEL_CALENDAR_EVENT`.

Values:CANCEL_CALENDAR_EVENT
calendarobjectrequired

Calendar event identification.

Show 1 child property
idstring<UUID>required

Calendar event ID to cancel.

Example: 987fcdeb-51a2-43d7-9876-543210fedcba

Notes

  • This endpoint performs a soft delete by setting the isDeleted flag to true.
  • 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 --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"
}
}'

Try It Out

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"
}