--
:api: put-calendar
:request: PutCalendarRequest
:response: PutCalendarResponse
--
[role="xpack"]
[id="{upid}-{api}"]
=== Create calendars API

Creates a new {ml} calendar.
The API accepts a +{request}+ and responds
with a +{response}+ object.

[id="{upid}-{api}-request"]
==== Request

A +{request}+ is constructed with a calendar object

["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests-file}[{api}-request]
--------------------------------------------------
<1> Create a request with the given calendar.


[id="{upid}-{api}-response"]
==== Response

The returned +{response}+ contains the created calendar:

["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests-file}[{api}-response]
--------------------------------------------------
<1> The created calendar.

include::../execution.asciidoc[]
