Skip to content

Latest commit

 

History

History
101 lines (70 loc) · 1.51 KB

File metadata and controls

101 lines (70 loc) · 1.51 KB

Delete User Calendar

Deletes a specific calendar for a specific user.

URL : /api/v1/calendars/:user_id/:calendar_id

Method : DELETE

Auth required : YES

Params constraints

:user_id -> "[user id as an int]",
:calendar_id -> "[numeric id of a calendar owned by the user]",

URL example

/api/v1/calendars/jdoe/1

Success Response

Code : 200 OK

Content examples

{
	"status": "success",
	"timestamp": "2026-01-23T15:01:33+01:00"
}

Error Response

Condition : If 'X-Davis-API-Token' is not present or mismatched in headers.

Code : 401 UNAUTHORIZED

Content :

{
	"message": "No API token provided",
	"timestamp": "2026-01-23T15:01:33+01:00"
}

or

{
	"message": "Invalid API token",
	"timestamp": "2026-01-23T15:01:33+01:00"
}

Condition : If user is not found.

Code : 404 NOT FOUND

Content :

{
	"status": "error",
	"message": "User Not Found",
	"timestamp": "2026-01-23T15:01:33+01:00"
}

Condition : If ':calendar_id' is not owned by the specified ':username' or calendar instance is not found.

Code : 400 BAD REQUEST

Content :

{
	"status": "error",
	"message": "Invalid Instance Not Found",
	"timestamp": "2026-01-23T15:01:33+01:00"
}

Condition : If an error occurs while deleting the calendar.

Code : 500 INTERNAL SERVER ERROR

Content :

{
	"status": "error",
	"message": "Failed to Delete Calendar",
	"timestamp": "2026-01-23T15:01:33+01:00"
}