{
  "openapi": "3.0.3",
  "info": {
    "title": "Endpoint Time Series service",
    "version": "1.0.0",
    "description": ""
  },
  "servers": [
    {
      "url": "https://cloud.kaaiot.com/epts/api/v1",
      "description": "API Server"
    }
  ],
  "paths": {
    "/api/v1/time-series/config": {
      "get": {
        "description": "Returns configurations of all time series in application(s).",
        "responses": {
          "200": {
            "description": "Map of time series configurations by application name.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "smart-house": [
                    {
                      "name": "temperature",
                      "values": [
                        "value"
                      ]
                    },
                    {
                      "name": "humidity",
                      "values": [
                        "value"
                      ]
                    }
                  ],
                  "smart-lamp": [
                    {
                      "name": "location",
                      "values": [
                        "lattitude",
                        "longitude"
                      ]
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth_2_0": [
              "application:timeseries-config:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "applicationNames",
            "in": "query",
            "description": "Zero or more application name(s). If not specified, data is returned for all available applications.",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "smart-house, smart-lamp"
          }
        ]
      }
    },
    "/api/v1/applications/config/status": {
      "get": {
        "description": "Returns the time series extraction configuration status of all available applications.\nApplications and application versions having a malformed time series extraction configuration are skipped by the\nservice: their data samples and API requests are rejected as unknown, while the rest of the applications keep\nworking. This resource reports which applications and application versions were skipped and why.\nUse `/api/v1/applications/{applicationName}/config/status` to request the status of a single application.\n",
        "responses": {
          "200": {
            "description": "Map of configuration statuses by application name.\nEach entry contains `valid` — whether the application level configuration was applied, `error` — the reason of\nthe rejection (only present when `valid` is `false`), and `appVersions` — the same pair per application version.\nA version of a valid application may be invalid on its own if its configuration override is malformed. All\nversions of an invalid application are reported as invalid.\n",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "smart-house": {
                    "valid": true,
                    "appVersions": {
                      "smart-house-v1": {
                        "valid": true
                      },
                      "smart-house-v2": {
                        "valid": false,
                        "error": "error loading timestamp extraction config: unsupported timestamp format \"sec-unix-epcoh\""
                      }
                    }
                  },
                  "smart-lamp": {
                    "valid": false,
                    "error": "malformed auto-extract config: unable to cast \"maybe\" of type string to bool",
                    "appVersions": {
                      "smart-lamp-v1": {
                        "valid": false,
                        "error": "skipped due to the invalid application configuration"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth_2_0": [
              "application:timeseries-config:read"
            ]
          }
        ]
      }
    },
    "/api/v1/applications/{applicationName}/config/status": {
      "get": {
        "description": "Returns the time series extraction configuration status of a single application.\nAn application, or one of its versions, having a malformed time series extraction configuration is skipped by the\nservice: its data samples and API requests are rejected as unknown. This resource reports whether the application\nconfiguration was applied and, if not, why it was rejected.\n",
        "responses": {
          "200": {
            "description": "Configuration status of the application. Contains `valid` — whether the application level configuration was\napplied, `error` — the reason of the rejection (only present when `valid` is `false`), and `appVersions` —\nthe same pair per application version. A version of a valid application may be invalid on its own if its\nconfiguration override is malformed. All versions of an invalid application are reported as invalid.\n",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "valid": false,
                  "error": "malformed auto-extract config: unable to cast \"maybe\" of type string to bool",
                  "appVersions": {
                    "smart-lamp-v1": {
                      "valid": false,
                      "error": "skipped due to the invalid application configuration"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "The application name is unknown to the service."
          }
        },
        "security": [
          {
            "oauth_2_0": [
              "application:timeseries-config:read"
            ]
          }
        ]
      }
    },
    "/api/v1/applications/{applicationName}/time-series/last": {
      "parameters": [
        {
          "name": "applicationName",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "Application name",
          "example": "clpg49rtl4es7380a2bg"
        }
      ],
      "get": {
        "description": "Returns the most recent time series data.",
        "responses": {
          "200": {
            "description": "Arrays of most recent data points mapped by time series names and endpoint IDs.\nEach data point contains `ingestionTimestamp` (ISO 8601, UTC) — the server-assigned time when the data point was ingested by the platform,\n`timestamp` — the time of the measurement, and `values` — a map of named values.\n",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "2ebaf0ab-76f3-4211-a27f-af310be8987f": {
                    "temperature": [
                      {
                        "ingestionTimestamp": "2017-04-20T11:19:58.000Z",
                        "timestamp": "2017-04-20T11:19:57.848Z",
                        "values": {
                          "value": 20.2,
                          "lat": 40.766892,
                          "lon": -74.344482
                        }
                      }
                    ],
                    "humidity": [
                      {
                        "ingestionTimestamp": "2017-04-20T11:19:58.000Z",
                        "timestamp": "2017-04-20T11:19:57.848Z",
                        "values": {
                          "value": 63,
                          "lat": 40.766892,
                          "lon": -74.344482
                        }
                      }
                    ]
                  },
                  "8b4aec8a-0a13-4b92-ba0b-0a39cfd5e297": {
                    "temperature": [
                      {
                        "ingestionTimestamp": "2017-04-20T11:19:58.000Z",
                        "timestamp": "2017-04-20T11:19:57.848Z",
                        "values": {
                          "value": 23.1,
                          "lat": 40.766892,
                          "lon": -74.344482
                        }
                      }
                    ],
                    "humidity": [
                      {
                        "ingestionTimestamp": "2017-04-20T11:19:58.000Z",
                        "timestamp": "2017-04-20T11:19:57.848Z",
                        "values": {
                          "value": 75,
                          "lat": 40.766892,
                          "lon": -74.344482
                        }
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth_2_0": [
              "endpoint:read",
              "time-series:read"
            ]
          }
        ]
      },
      "post": {
        "description": "Returns the most recent time series data.",
        "responses": {
          "200": {
            "description": "Arrays of most recent data points mapped by time series names and endpoint IDs.\nEach data point contains `ingestionTimestamp` (ISO 8601, UTC) — the server-assigned time when the data point was ingested by the platform,\n`timestamp` — the time of the measurement, and `values` — a map of named values.\n",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "2ebaf0ab-76f3-4211-a27f-af310be8987f": {
                    "temperature": [
                      {
                        "ingestionTimestamp": "2017-04-20T11:19:58.000Z",
                        "timestamp": "2017-04-20T11:19:57.848Z",
                        "values": {
                          "value": 20.2,
                          "lat": 40.766892,
                          "lon": -74.344482
                        }
                      }
                    ],
                    "humidity": [
                      {
                        "ingestionTimestamp": "2017-04-20T11:19:58.000Z",
                        "timestamp": "2017-04-20T11:19:57.848Z",
                        "values": {
                          "value": 63,
                          "lat": 40.766892,
                          "lon": -74.344482
                        }
                      }
                    ]
                  },
                  "8b4aec8a-0a13-4b92-ba0b-0a39cfd5e297": {
                    "temperature": [
                      {
                        "ingestionTimestamp": "2017-04-20T11:19:58.000Z",
                        "timestamp": "2017-04-20T11:19:57.848Z",
                        "values": {
                          "value": 23.1,
                          "lat": 40.766892,
                          "lon": -74.344482
                        }
                      }
                    ],
                    "humidity": [
                      {
                        "ingestionTimestamp": "2017-04-20T11:19:58.000Z",
                        "timestamp": "2017-04-20T11:19:57.848Z",
                        "values": {
                          "value": 75,
                          "lat": 40.766892,
                          "lon": -74.344482
                        }
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth_2_0": [
              "endpoint:read",
              "time-series:read"
            ]
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RetrieveWithPostRequest"
              },
              "example": {
                "timeSeriesNames": [
                  "temperature",
                  "humidity"
                ],
                "beforeDate": "2019-01-01T00:00:00Z",
                "offset": 10,
                "limit": 5,
                "endpointIDs": [
                  "2ebaf0ab-76f3-4211-a27f-af310be8987f",
                  "8b4aec8a-0a13-4b92-ba0b-0a39cfd5e297"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v1/applications/{applicationName}/time-series/data": {
      "parameters": [
        {
          "name": "applicationName",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "Application name",
          "example": "clpg49rtl4es7380a2bg"
        }
      ],
      "get": {
        "description": "Returns historical time series data within the specified time range.\nEach data point in the response contains `ingestionTimestamp` (ISO 8601, UTC) — the server-assigned time when the data point was ingested by the platform.\n",
        "responses": {
          "200": {
            "description": "Array of objects, each contains arrays of most recent data points mapped by time series names and endpoint IDs.\nThe response is returned in chunks. Each chunk is guaranteed to contain an integer number of top-level array elements.\nThe same endpoint ID (and time series name) may occur in several chunks (note an example of that below).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": [
                  {
                    "2ebaf0ab-76f3-4211-a27f-af310be8987f": {
                      "temperature": [
                        {
                          "ingestionTimestamp": "2017-04-20T11:19:58.000Z",
                          "timestamp": "2017-04-20T11:19:57.848Z",
                          "values": {
                            "value": 20.2,
                            "lat": 40.766892,
                            "lon": -74.344482
                          }
                        },
                        {
                          "ingestionTimestamp": "2017-04-20T11:20:58.000Z",
                          "timestamp": "2017-04-20T11:20:57.848Z",
                          "values": {
                            "value": 20.7,
                            "lat": 40.766892,
                            "lon": -74.344482
                          }
                        }
                      ],
                      "humidity": [
                        {
                          "ingestionTimestamp": "2017-04-20T11:19:58.000Z",
                          "timestamp": "2017-04-20T11:19:57.848Z",
                          "values": {
                            "value": 63,
                            "lat": 40.766892,
                            "lon": -74.344482
                          }
                        }
                      ]
                    }
                  },
                  {
                    "2ebaf0ab-76f3-4211-a27f-af310be8987f": {
                      "temperature": [
                        {
                          "ingestionTimestamp": "2017-04-20T11:21:58.000Z",
                          "timestamp": "2017-04-20T11:21:57.848Z",
                          "values": {
                            "value": 20.9,
                            "lat": 40.766892,
                            "lon": -74.344482
                          }
                        }
                      ]
                    },
                    "8b4aec8a-0a13-4b92-ba0b-0a39cfd5e297": {
                      "temperature": [
                        {
                          "ingestionTimestamp": "2017-04-20T11:19:58.000Z",
                          "timestamp": "2017-04-20T11:19:57.848Z",
                          "values": {
                            "value": 23.1,
                            "lat": 40.766892,
                            "lon": -74.344482
                          }
                        },
                        {
                          "ingestionTimestamp": "2017-04-20T11:20:58.000Z",
                          "timestamp": "2017-04-20T11:20:57.848Z",
                          "values": {
                            "value": 22.8,
                            "lat": 40.766892,
                            "lon": -74.344482
                          }
                        }
                      ],
                      "humidity": [
                        {
                          "ingestionTimestamp": "2017-04-20T11:19:58.000Z",
                          "timestamp": "2017-04-20T11:19:57.848Z",
                          "values": {
                            "value": 75,
                            "lat": 40.766892,
                            "lon": -74.344482
                          }
                        }
                      ]
                    }
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "oauth_2_0": [
              "endpoint:read",
              "time-series:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "timeSeriesName",
            "in": "query",
            "description": "One or more time series names.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "temperature,humidity"
          },
          {
            "name": "endpointId",
            "in": "query",
            "description": "Zero or more endpoint IDs. If not specified, data is returned for all available endpoints.",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "2ebaf0ab-76f3-4211-a27f-af310be8987f,8b4aec8a-0a13-4b92-ba0b-0a39cfd5e297"
          },
          {
            "name": "fromDate",
            "in": "query",
            "description": "ISO-8601 encoded start time to retrieve data points from.\nRelative time range is supported by using `now` keyword.\nSupported time units are `s`, `m`, `h`, `d`, `w`, `M` and `y`.\n`now` can be used directly or with subtracting time value, such as `now-3d`.",
            "required": true,
            "schema": {
              "type": "datetime"
            },
            "example": "2017-04-20T00:00:00+00:00"
          },
          {
            "name": "toDate",
            "in": "query",
            "description": "ISO 8601 encoded end time to retrieve data points to.\nRelative time range is supported by using `now` keyword.\nSupported time units are `s`, `m`, `h`, `d`, `w`, `M` and `y`.\n`now` can be used directly or with subtracting time value, such as `now-3d`.",
            "required": true,
            "schema": {
              "type": "datetime"
            },
            "example": "2017-04-22T00:00:00+00:00"
          },
          {
            "name": "includeTime",
            "in": "query",
            "description": "Defines which of the `fromDate` and `toDate` are inclusive.",
            "required": false,
            "schema": {
              "type": "string",
              "default": "none",
              "enum": [
                "from",
                "to",
                "both",
                "none"
              ]
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "Sorting order by timestamp.",
            "required": false,
            "schema": {
              "type": "string",
              "default": "ASC",
              "enum": [
                "ASC",
                "DESC"
              ]
            }
          }
        ]
      },
      "post": {
        "description": "Returns historical time series data within the specified time range.\nEach data point in the response contains `ingestionTimestamp` (ISO 8601, UTC) — the server-assigned time when the data point was ingested by the platform.\n",
        "responses": {
          "200": {
            "description": "Array of objects, each contains arrays of most recent data points mapped by time series names and endpoint IDs.\nThe response is returned in chunks. Each chunk is guaranteed to contain an integer number of top-level array elements.\nThe same endpoint ID (and time series name) may occur in several chunks (note an example of that below).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": [
                  {
                    "2ebaf0ab-76f3-4211-a27f-af310be8987f": {
                      "temperature": [
                        {
                          "ingestionTimestamp": "2017-04-20T11:19:58.000Z",
                          "timestamp": "2017-04-20T11:19:57.848Z",
                          "values": {
                            "value": 20.2,
                            "lat": 40.766892,
                            "lon": -74.344482
                          }
                        },
                        {
                          "ingestionTimestamp": "2017-04-20T11:20:58.000Z",
                          "timestamp": "2017-04-20T11:20:57.848Z",
                          "values": {
                            "value": 20.7,
                            "lat": 40.766892,
                            "lon": -74.344482
                          }
                        }
                      ],
                      "humidity": [
                        {
                          "ingestionTimestamp": "2017-04-20T11:19:58.000Z",
                          "timestamp": "2017-04-20T11:19:57.848Z",
                          "values": {
                            "value": 63,
                            "lat": 40.766892,
                            "lon": -74.344482
                          }
                        }
                      ]
                    }
                  },
                  {
                    "2ebaf0ab-76f3-4211-a27f-af310be8987f": {
                      "temperature": [
                        {
                          "ingestionTimestamp": "2017-04-20T11:21:58.000Z",
                          "timestamp": "2017-04-20T11:21:57.848Z",
                          "values": {
                            "value": 20.9,
                            "lat": 40.766892,
                            "lon": -74.344482
                          }
                        }
                      ]
                    },
                    "8b4aec8a-0a13-4b92-ba0b-0a39cfd5e297": {
                      "temperature": [
                        {
                          "ingestionTimestamp": "2017-04-20T11:19:58.000Z",
                          "timestamp": "2017-04-20T11:19:57.848Z",
                          "values": {
                            "value": 23.1,
                            "lat": 40.766892,
                            "lon": -74.344482
                          }
                        },
                        {
                          "ingestionTimestamp": "2017-04-20T11:20:58.000Z",
                          "timestamp": "2017-04-20T11:20:57.848Z",
                          "values": {
                            "value": 22.8,
                            "lat": 40.766892,
                            "lon": -74.344482
                          }
                        }
                      ],
                      "humidity": [
                        {
                          "ingestionTimestamp": "2017-04-20T11:19:58.000Z",
                          "timestamp": "2017-04-20T11:19:57.848Z",
                          "values": {
                            "value": 75,
                            "lat": 40.766892,
                            "lon": -74.344482
                          }
                        }
                      ]
                    }
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "oauth_2_0": [
              "endpoint:read",
              "time-series:read"
            ]
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "timeSeriesNames": [
                  "temperature",
                  "humidity"
                ],
                "fromDate": "2019-01-01T00:00:00Z",
                "toDate": "2019-01-02T00:00:00Z",
                "sort": "DESC",
                "includeTime": "both",
                "endpointIDs": [
                  "2ebaf0ab-76f3-4211-a27f-af310be8987f",
                  "8b4aec8a-0a13-4b92-ba0b-0a39cfd5e297"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v1/applications/{applicationName}/series/delete": {
      "parameters": [
        {
          "name": "applicationName",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "Application name",
          "example": "clpg49rtl4es7380a2bg"
        }
      ],
      "post": {
        "description": "Deletes series from application.",
        "responses": {
          "204": {
            "description": "Series successfully deleted."
          }
        },
        "security": [
          {
            "oauth_2_0": [
              "application:timeseries-config:delete"
            ]
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TimeSeriesNames"
              },
              "example": {
                "timeSeriesNames": [
                  "temperature",
                  "humidity",
                  "location"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v1/applications/{applicationName}/endpoints/{endpointID}/time-series/list": {
      "parameters": [
        {
          "name": "applicationName",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "Application name",
          "example": "clpg49rtl4es7380a2bg"
        },
        {
          "name": "endpointID",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "Endpoint ID",
          "example": "2ebaf0ab-76f3-4211-a27f-af310be8987f"
        }
      ],
      "post": {
        "description": "Retrieves a paginated list of the latest time series data records.",
        "responses": {
          "200": {
            "description": "Time series data records successfully retrieved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataPointRecordsResponse"
                },
                "example": {
                  "data": [
                    {
                      "timestamp": "2017-04-20T11:19:57.848Z",
                      "temperature": 60.2,
                      "humidity": 88,
                      "location": {
                        "lat": 40.766892,
                        "lon": -74.344482
                      }
                    },
                    {
                      "timestamp": "2017-04-20T11:19:56.932Z",
                      "humidity": 75
                    },
                    {
                      "timestamp": "2017-04-20T11:19:55.534Z",
                      "temperature": 20.2
                    }
                  ],
                  "hasNextPage": true,
                  "nextPageOffsetDate": "2017-04-20T11:19:55.534Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth_2_0": [
              "endpoint:read",
              "time-series:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "fromDate",
            "in": "query",
            "description": "ISO-8601 encoded start time to retrieve data points from.\nRelative time is supported by using `now` keyword.\nSupported time units are `s`, `m`, `h`, `d`, `w`, `M` and `y`.\n`now` can be used directly or with subtracting time value, such as `now-3d`.",
            "required": false,
            "schema": {
              "type": "datetime"
            }
          },
          {
            "name": "offsetDate",
            "in": "query",
            "description": "The reference point in time for pagination, used to skip records after this time.\nRelative time is supported by using `now` keyword.\nSupported time units are `s`, `m`, `h`, `d`, `w`, `M` and `y`.\n`now` can be used directly or with subtracting time value, such as `now-3d`.",
            "required": false,
            "schema": {
              "type": "datetime"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of data points to return.",
            "required": false,
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "timeSeriesNames": [
                  "temperature",
                  "humidity",
                  "location"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v1/applications/{applicationName}/endpoints/{endpointID}/time-series/data/delete": {
      "parameters": [
        {
          "name": "applicationName",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "Application name",
          "example": "clpg49rtl4es7380a2bg"
        },
        {
          "name": "endpointID",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "Endpoint ID",
          "example": "2ebaf0ab-76f3-4211-a27f-af310be8987f"
        }
      ],
      "post": {
        "description": "Deletes time series data within a specified time range.",
        "responses": {
          "204": {
            "description": "Time series data successfully deleted."
          }
        },
        "security": [
          {
            "oauth_2_0": [
              "endpoint:update",
              "time-series:delete"
            ]
          }
        ],
        "parameters": [
          {
            "name": "fromDate",
            "in": "query",
            "description": "ISO-8601 encoded start time to retrieve data points from.\nRelative time is supported by using `now` keyword.\nSupported time units are `s`, `m`, `h`, `d`, `w`, `M` and `y`.\n`now` can be used directly or with subtracting time value, such as `now-3d`.",
            "required": true,
            "schema": {
              "type": "datetime"
            }
          },
          {
            "name": "toDate",
            "in": "query",
            "description": "ISO-8601 encoded end time to retrieve data points from.\nRelative time is supported by using `now` keyword.\nSupported time units are `s`, `m`, `h`, `d`, `w`, `M` and `y`.\n`now` can be used directly or with subtracting time value, such as `now-3d`.",
            "required": true,
            "schema": {
              "type": "datetime"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "timeSeriesNames": [
                  "temperature",
                  "humidity",
                  "location"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v1/app-versions/{appVersionName}/time-series/data": {
      "put": {
        "description": "Updates time series data for the specified endpoints.\n\nTime series data structure must match the configured time series definition (explicit JSON null values are permitted for any data point value).\nData points with the same timestamp are re-writen on subsequent updates.\n",
        "responses": {
          "204": {
            "description": "Endpoints time series data successfully updated."
          },
          "400": {
            "description": "Request is not valid (payload is not a JSON object, time series name is not valid, content does not match the time series definition, etc)."
          },
          "404": {
            "description": "Some of the requested endpoints are not found or the querying user is denied access."
          }
        },
        "security": [
          {
            "oauth_2_0": [
              "endpoint:update"
            ]
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "2ebaf0ab-76f3-4211-a27f-af310be8987f": {
                  "temperature": [
                    {
                      "timestamp": "2017-04-20T11:19:57.848Z",
                      "values": {
                        "value": 20.2,
                        "lat": 40.766892,
                        "lon": -74.344482
                      }
                    },
                    {
                      "timestamp": "2017-04-20T11:20:57.848Z",
                      "values": {
                        "value": 20.7,
                        "lat": 40.766892,
                        "lon": -74.344482
                      }
                    }
                  ],
                  "humidity": [
                    {
                      "timestamp": "2017-04-20T11:19:57.848Z",
                      "values": {
                        "value": 63,
                        "lat": 40.766892,
                        "lon": -74.344482
                      }
                    }
                  ]
                },
                "8b4aec8a-0a13-4b92-ba0b-0a39cfd5e297": {
                  "temperature": [
                    {
                      "timestamp": "2017-04-20T11:19:57.848Z",
                      "values": {
                        "value": 23.1,
                        "lat": 40.766892,
                        "lon": -74.344482
                      }
                    },
                    {
                      "timestamp": "2017-04-20T11:20:57.848Z",
                      "values": {
                        "value": 22.8,
                        "lat": 40.766892,
                        "lon": -74.344482
                      }
                    }
                  ],
                  "humidity": [
                    {
                      "timestamp": "2017-04-20T11:19:57.848Z",
                      "values": {
                        "value": 75,
                        "lat": 40.766892,
                        "lon": -74.344482
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "oauth_2_0": {
        "type": "oauth2",
        "description": "EPTS supports OAuth 2.0 for authenticating all API requests.\n",
        "flows": {
          "implicit": {
            "authorizationUrl": "https://auth.example.com/oauth/authorize",
            "scopes": {}
          }
        }
      }
    },
    "schemas": {
      "RetrieveWithPostRequest": {
        "type": "object",
        "properties": {
          "timeSeriesNames": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "One or more time series names."
          },
          "fromDate": {
            "type": "string",
            "format": "rfc3339",
            "description": "ISO-8601 encoded start time to retrieve data points from.\nRelative time range is supported by using `now` keyword.\nSupported time units are `s`, `m`, `h`, `d`, `w`, `M` and `y`.\n`now` can be used directly or with subtracting time value, such as `now-3d`.\n"
          },
          "toDate": {
            "type": "string",
            "format": "rfc3339",
            "description": "ISO 8601 encoded end time to retrieve data points to.\nRelative time range is supported by using `now` keyword.\nSupported time units are `s`, `m`, `h`, `d`, `w`, `M` and `y`.\n`now` can be used directly or with subtracting time value, such as `now-3d`.\n"
          },
          "sort": {
            "type": "string",
            "description": "Sorting order by timestamp.",
            "enum": [
              "ASC",
              "DESC"
            ]
          },
          "includeTime": {
            "type": "string",
            "description": "Defines which of the `fromDate` and `toDate` are inclusive.",
            "enum": [
              "from",
              "to",
              "both",
              "none"
            ]
          },
          "endpointIDs": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Zero or more endpoint IDs. If not specified, data is returned for all available endpoints."
          }
        },
        "required": [
          "timeSeriesNames",
          "fromDate",
          "toDate"
        ]
      },
      "TimeSeriesNames": {
        "type": "object",
        "properties": {
          "timeSeriesNames": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "One or more time series names."
          }
        }
      },
      "DataPointRecordsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "List of time series data points records."
          },
          "hasNextPage": {
            "type": "boolean",
            "description": "If `hasNextPage` is true, use the nextPageOffsetDate to request the next page."
          },
          "nextPageOffsetDate": {
            "type": "string",
            "format": "rfc3339",
            "description": "ISO-8601 encoded time to skip records after this point for pagination."
          }
        },
        "required": [
          "hasNextPage"
        ]
      }
    }
  }
}