Skip to main content

POST /calendars

Description

Creates a new calendar (event type) and returns a json object with the calendar ID in it

The route handles the POST request made to the /calendars path.

HTTP methodRoute
POST/calendars

Payload

The server needs to receive a json object with the next properties:

NameTypeDescription
labelstringRequired. The name of a new calendar to be added.
descriptionstringOptional. Calendar description.
colorobjectRequired. An object with the style parameters applied to the events of the calendar: background - (optional) a HEX code of the event background color related to the calendar, border - (optional) a HEX code of the event border color related to the calendar, textColor - (optional) a HEX code of the event text color related to the calendar.

Example:

{
"label": "New Calendar",
"description": "Some description",
"color": {
"background": "#5890DC",
"border": "#2D74D3"
}
}

Response

The route returns a json object with the ID of a new calendar.

Example:

"id": 1

The HTTP status code shows whether the request succeeds (response.status == 200) or fails (response.status == 500).


Related articles: Working with server