# Generated from agrology/public-api public-api.openapi.internal.yaml by `make public-spec`. Do not edit. openapi: "3.0.1" info: version: 1.0.0 title: Agrology Public API v2 servers: - url: https://api.agrology.ag/v2 paths: /feedback: post: summary: Send feedback to Agrology description: >- Any logged-in caller can send feedback. The 400 for a missing field nests JSON in `message`, so treat it as text. operationId: submitFeedback tags: - Feedback security: - publicApiAuthorizer: [] - apiKey: [] requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/FeedbackSubmission" responses: "201": description: The feedback was sent. `id` is its ID. content: application/json: schema: $ref: "#/components/schemas/Created" "500": description: Feedback could not be delivered. content: application/json: schema: $ref: "#/components/schemas/Error" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /access: get: summary: List the sites and nodes you can access description: >- Every customer, site and node the caller holds a grant for, with the caller's role at each site. Cached for 5 minutes per caller; pass `refresh` to rebuild the cache. operationId: getUserAccess tags: - Identity parameters: - name: refresh in: query description: Any non-empty value clears this caller's 5-minute cache. schema: type: string security: - publicApiAuthorizer: [] - apiKey: [] responses: "200": description: The caller's access list. content: application/json: schema: $ref: "#/components/schemas/AccessList" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /apikey-access: get: summary: Show whether you have API key access description: >- Returns your email if you have API key access, and `{}` if you do not. A valid credential with no customer or site grants gets a 401, and a failed lookup gets a 400. operationId: getApiKeyAccess tags: - Identity security: - publicApiAuthorizer: [] - apiKey: [] responses: "200": description: Your API key access. content: application/json: schema: $ref: "#/components/schemas/ApiKeyAccess" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /whoami: get: summary: Show who the credential belongs to description: >- Works with a Bearer token or an API key. A valid credential with no customer or site grants gets a 401. operationId: getWhoAmI tags: - Identity security: - publicApiAuthorizer: [] - apiKey: [] responses: "200": description: The caller. content: application/json: schema: $ref: "#/components/schemas/WhoAmI" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /apikey: post: summary: Rotate your API key description: >- Replaces your API key. Authorization caches can keep the previous key working for a while afterwards, normally about 10 minutes, so do not rely on rotation to end access at once. Send no body. Returns 401 without API key access. A failed rotation also returns 200, with `status` `error`, and may already have deleted the previous key. Retry at once or with a Bearer token, since a caller using only that key is locked out when the caches expire. The new key is the base64 of `|` and is shown once. operationId: rotateApiKey tags: - Identity security: - publicApiAuthorizer: [] - apiKey: [] responses: "200": description: The result of the rotation. content: application/json: schema: $ref: "#/components/schemas/ApiKeyRotation" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /metrics: get: summary: List all public metrics description: >- Every public metric. `unitOptions` and `defaultUnits` appear where a metric defines display units; timeseries values stay in the metric's `units`. operationId: listMetrics tags: - Metrics security: - publicApiAuthorizer: [] - apiKey: [] responses: "200": description: The metrics. content: application/json: schema: $ref: "#/components/schemas/MetricList" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /sites: get: summary: List your sites description: >- Full fleet records for the sites you can access, leaving out inactive sites. Returns `[]` when none remain. Cached for 5 minutes per caller. operationId: listSites tags: - Sites security: - publicApiAuthorizer: [] - apiKey: [] responses: "200": description: The sites. content: application/json: schema: $ref: "#/components/schemas/Sites" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /nodes: get: summary: List your nodes description: >- Full fleet records for the nodes you can access. For callers with site grants, leaves out inactive nodes, nodes with no latitude or longitude, and every node at a site that is inactive, has no display name or fails to load. An automation credential gets every active node in the fleet instead, with none of the other filters. Cached for 5 minutes per caller. Returns 401 when no nodes remain. operationId: listNodes tags: - Sites security: - publicApiAuthorizer: [] - apiKey: [] responses: "200": description: The nodes. content: application/json: schema: $ref: "#/components/schemas/Nodes" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /geojson/sites: get: summary: Get your sites as GeoJSON description: >- One FeatureCollection with a feature per active site and per node at those sites, including inactive nodes. If one site fails to load, the whole request gets a 400. Returns 401 when no active sites remain. Cached for 5 minutes per caller. operationId: listSitesGeoJSON tags: - Sites security: - publicApiAuthorizer: [] - apiKey: [] responses: "200": description: The FeatureCollection. content: application/json: schema: $ref: "#/components/schemas/GeoJSONCollection" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /geojson/site/{siteID}: get: summary: Get one site as GeoJSON description: >- One FeatureCollection for the site and its nodes, including inactive nodes. A site you cannot access, including an unknown ID, gets a 401, and an inactive site gets a 400. A failure loading the site can surface as a 502 raw Lambda error. Cached for 5 minutes per caller. operationId: getSiteGeoJSON tags: - Sites parameters: - $ref: "#/components/parameters/SiteID" security: - publicApiAuthorizer: [] - apiKey: [] responses: "200": description: The FeatureCollection. content: application/json: schema: $ref: "#/components/schemas/GeoJSONCollection" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /geojson/customer/{customerID}: get: summary: Get a customer's sites as GeoJSON description: >- One FeatureCollection for the customer's active sites and their nodes, including inactive nodes. If one site fails to load, the whole request gets a 400. Returns 401 when no active sites remain. Cached for 5 minutes per caller. operationId: listSitesByCustomerGeoJSON tags: - Sites parameters: - $ref: "#/components/parameters/CustomerID" security: - publicApiAuthorizer: [] - apiKey: [] responses: "200": description: The FeatureCollection. content: application/json: schema: $ref: "#/components/schemas/GeoJSONCollection" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /historical/ground-truth/metrics: get: summary: List ground-truth metrics description: Use these IDs in `metrics` for ground-truth data. operationId: getHistoricalGroundTruthMetrics tags: - Metrics security: - publicApiAuthorizer: [] - apiKey: [] responses: "200": description: The metrics. content: application/json: schema: $ref: "#/components/schemas/MetricList" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /historical/ground-truth/device-types: get: summary: List device types description: >- Use these IDs in `deviceType`. An ID can appear more than once, with different metrics, and selects every device type that has it. operationId: listDeviceTypes tags: - Sites security: - publicApiAuthorizer: [] - apiKey: [] responses: "200": description: The device types. content: application/json: schema: $ref: "#/components/schemas/DeviceTypes" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /historical/ground-truth/{siteID}/{timeRange}: get: summary: Get ground-truth sensor data description: >- Sensor readings for a site. `metrics`, `deviceType`, `position` and `filter` narrow the result and combine. A filter with no known values is dropped, so a mistyped ID in `filter` returns the whole site. operationId: getHistoricalGroundTruth tags: - Timeseries security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/SiteID" - $ref: "#/components/parameters/TimeRange" - $ref: "#/components/parameters/Metrics" - $ref: "#/components/parameters/Resolution" - $ref: "#/components/parameters/Statistic" - $ref: "#/components/parameters/Format" - $ref: "#/components/parameters/ResponseVersion" - $ref: "#/components/parameters/DisableRedirects" - $ref: "#/components/parameters/RefID" - $ref: "#/components/parameters/DeviceType" - $ref: "#/components/parameters/ConsolidateNodePositionMetrics" - $ref: "#/components/parameters/Filter" - $ref: "#/components/parameters/Position" responses: "200": $ref: "#/components/responses/GroundTruthData" "302": $ref: "#/components/responses/Redirect" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /historical/ground-truth/{siteID}/node/{nodeID}/{timeRange}: get: summary: Get ground-truth sensor data description: >- Sensor readings for one node. `metrics`, `deviceType`, `position` and `filter` narrow the result and combine. A filter with no known values is dropped, so a mistyped node or device ID in the path returns the whole site. operationId: getHistoricalGroundTruthNode tags: - Timeseries security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/SiteID" - $ref: "#/components/parameters/NodeID" - $ref: "#/components/parameters/TimeRange" - $ref: "#/components/parameters/Metrics" - $ref: "#/components/parameters/Resolution" - $ref: "#/components/parameters/Statistic" - $ref: "#/components/parameters/Format" - $ref: "#/components/parameters/ResponseVersion" - $ref: "#/components/parameters/DisableRedirects" - $ref: "#/components/parameters/RefID" - $ref: "#/components/parameters/DeviceType" - $ref: "#/components/parameters/ConsolidateNodePositionMetrics" - $ref: "#/components/parameters/Filter" - $ref: "#/components/parameters/Position" responses: "200": $ref: "#/components/responses/GroundTruthData" "302": $ref: "#/components/responses/Redirect" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /historical/ground-truth/{siteID}/device/{deviceID}/{timeRange}: get: summary: Get ground-truth sensor data description: >- Sensor readings for one device. `metrics`, `deviceType`, `position` and `filter` narrow the result and combine. A filter with no known values is dropped, so a mistyped node or device ID in the path returns the whole site. operationId: getHistoricalGroundTruthDevice tags: - Timeseries security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/SiteID" - $ref: "#/components/parameters/DeviceID" - $ref: "#/components/parameters/TimeRange" - $ref: "#/components/parameters/Metrics" - $ref: "#/components/parameters/Resolution" - $ref: "#/components/parameters/Statistic" - $ref: "#/components/parameters/Format" - $ref: "#/components/parameters/ResponseVersion" - $ref: "#/components/parameters/DisableRedirects" - $ref: "#/components/parameters/RefID" - $ref: "#/components/parameters/DeviceType" - $ref: "#/components/parameters/ConsolidateNodePositionMetrics" - $ref: "#/components/parameters/Filter" - $ref: "#/components/parameters/Position" responses: "200": $ref: "#/components/responses/GroundTruthData" "302": $ref: "#/components/responses/Redirect" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /historical/ground-truth/{siteID}/devices: get: summary: List a site's devices description: >- The site's active devices, with their node, position, type and last report time. Devices of a model the API does not recognise are left out. operationId: listDevicesBySite tags: - Sites security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/SiteID" responses: "200": description: The site's devices. content: application/json: schema: $ref: "#/components/schemas/Devices" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /historical/weather/metrics: get: summary: List weather-service metrics description: >- Use these IDs in `metrics` for historical weather. The list is not exact: responses can include metrics it omits, such as `airTemp`, which you can look up in `/metrics`, and they never include `vpd`, which it lists. operationId: getHistoricalWeatherMetrics tags: - Metrics security: - publicApiAuthorizer: [] - apiKey: [] responses: "200": description: The metrics. content: application/json: schema: $ref: "#/components/schemas/MetricList" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /historical/weather/{siteID}/{timeRange}: get: summary: Get historical weather data description: Past weather for a site. operationId: getHistoricalWeather tags: - Timeseries security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/SiteID" - $ref: "#/components/parameters/TimeRange" - $ref: "#/components/parameters/Metrics" - $ref: "#/components/parameters/Resolution" - $ref: "#/components/parameters/Statistic" - $ref: "#/components/parameters/Format" - $ref: "#/components/parameters/ResponseVersion" - $ref: "#/components/parameters/DisableRedirects" - $ref: "#/components/parameters/RefID" responses: "200": $ref: "#/components/responses/TimeseriesData" "302": $ref: "#/components/responses/Redirect" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /historical/weather/{siteID}/node/{nodeID}/{timeRange}: get: summary: Get historical weather data description: Past weather for one node. operationId: getHistoricalWeatherNode tags: - Timeseries security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/SiteID" - $ref: "#/components/parameters/NodeID" - $ref: "#/components/parameters/TimeRange" - $ref: "#/components/parameters/Metrics" - $ref: "#/components/parameters/Resolution" - $ref: "#/components/parameters/Statistic" - $ref: "#/components/parameters/Format" - $ref: "#/components/parameters/ResponseVersion" - $ref: "#/components/parameters/DisableRedirects" - $ref: "#/components/parameters/RefID" responses: "200": $ref: "#/components/responses/TimeseriesData" "302": $ref: "#/components/responses/Redirect" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /predictions/weather/metrics: get: summary: List weather-forecast metrics description: >- The same list as `/historical/weather/metrics`. Forecasts do return `vpd`, and also return `airTemp`, which the list omits. operationId: getPredictionsWeatherMetrics tags: - Metrics security: - publicApiAuthorizer: [] - apiKey: [] responses: "200": description: The metrics. content: application/json: schema: $ref: "#/components/schemas/MetricList" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /predictions/weather/{siteID}: get: summary: Get weather forecasts description: >- Weather forecasts for a site. Runs from now to the last stored forecast point. To set a range or see past times, use the path with `timeRange`. operationId: getPredictionsWeather tags: - Timeseries security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/SiteID" - $ref: "#/components/parameters/Metrics" - $ref: "#/components/parameters/Resolution" - $ref: "#/components/parameters/Statistic" - $ref: "#/components/parameters/Format" - $ref: "#/components/parameters/ResponseVersion" - $ref: "#/components/parameters/DisableRedirects" - $ref: "#/components/parameters/RefID" responses: "200": $ref: "#/components/responses/TimeseriesData" "302": $ref: "#/components/responses/Redirect" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /predictions/weather/{siteID}/node/{nodeID}: get: summary: Get weather forecasts description: >- Weather forecasts for one node. Runs from now to the last stored forecast point. To set a range or see past times, use the path with `timeRange`. `all` as the node ID means every node. operationId: getPredictionsWeatherNode tags: - Timeseries security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/SiteID" - $ref: "#/components/parameters/NodeID" - $ref: "#/components/parameters/Metrics" - $ref: "#/components/parameters/Resolution" - $ref: "#/components/parameters/Statistic" - $ref: "#/components/parameters/Format" - $ref: "#/components/parameters/ResponseVersion" - $ref: "#/components/parameters/DisableRedirects" - $ref: "#/components/parameters/RefID" responses: "200": $ref: "#/components/responses/TimeseriesData" "302": $ref: "#/components/responses/Redirect" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /predictions/weather/{siteID}/{timeRange}: get: summary: Get weather forecasts description: >- Weather forecasts for a site. Past times are left out unless `showPast=1`, except with `newest`; see `timeRange`. operationId: getPredictionsWeatherTimeRange tags: - Timeseries security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/SiteID" - $ref: "#/components/parameters/TimeRange" - $ref: "#/components/parameters/Metrics" - $ref: "#/components/parameters/Resolution" - $ref: "#/components/parameters/Statistic" - $ref: "#/components/parameters/Format" - $ref: "#/components/parameters/ResponseVersion" - $ref: "#/components/parameters/DisableRedirects" - $ref: "#/components/parameters/RefID" - $ref: "#/components/parameters/ShowPast" responses: "200": $ref: "#/components/responses/TimeseriesData" "302": $ref: "#/components/responses/Redirect" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /predictions/weather/{siteID}/node/{nodeID}/{timeRange}: get: summary: Get weather forecasts description: >- Weather forecasts for one node. Past times are left out unless `showPast=1`, except with `newest`; see `timeRange`. `all` as the node ID means every node. operationId: getPredictionsWeatherNodeTimeRange tags: - Timeseries security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/SiteID" - $ref: "#/components/parameters/NodeID" - $ref: "#/components/parameters/TimeRange" - $ref: "#/components/parameters/Metrics" - $ref: "#/components/parameters/Resolution" - $ref: "#/components/parameters/Statistic" - $ref: "#/components/parameters/Format" - $ref: "#/components/parameters/ResponseVersion" - $ref: "#/components/parameters/DisableRedirects" - $ref: "#/components/parameters/RefID" - $ref: "#/components/parameters/ShowPast" responses: "200": $ref: "#/components/responses/TimeseriesData" "302": $ref: "#/components/responses/Redirect" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /predictions/microclimate/metrics: get: summary: List microclimate-prediction metrics description: Use these IDs in `metrics` for microclimate predictions. operationId: getPredictionsMicroclimateMetrics tags: - Metrics security: - publicApiAuthorizer: [] - apiKey: [] responses: "200": description: The metrics. content: application/json: schema: $ref: "#/components/schemas/MetricList" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /predictions/microclimate/{siteID}: get: summary: Get microclimate predictions description: >- Microclimate predictions for a site. Runs from now to the last stored forecast point. To set a range or see past times, use the path with `timeRange`. operationId: getPredictionsMicroclimate tags: - Timeseries security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/SiteID" - $ref: "#/components/parameters/Metrics" - $ref: "#/components/parameters/Resolution" - $ref: "#/components/parameters/Statistic" - $ref: "#/components/parameters/Format" - $ref: "#/components/parameters/ResponseVersion" - $ref: "#/components/parameters/DisableRedirects" - $ref: "#/components/parameters/RefID" responses: "200": $ref: "#/components/responses/TimeseriesData" "302": $ref: "#/components/responses/Redirect" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /predictions/microclimate/{siteID}/node/{nodeID}: get: summary: Get microclimate predictions description: >- Microclimate predictions for one node. Runs from now to the last stored forecast point. To set a range or see past times, use the path with `timeRange`. `all` as the node ID means every node. operationId: getPredictionsMicroclimateNode tags: - Timeseries security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/SiteID" - $ref: "#/components/parameters/NodeID" - $ref: "#/components/parameters/Metrics" - $ref: "#/components/parameters/Resolution" - $ref: "#/components/parameters/Statistic" - $ref: "#/components/parameters/Format" - $ref: "#/components/parameters/ResponseVersion" - $ref: "#/components/parameters/DisableRedirects" - $ref: "#/components/parameters/RefID" responses: "200": $ref: "#/components/responses/TimeseriesData" "302": $ref: "#/components/responses/Redirect" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /predictions/microclimate/{siteID}/{timeRange}: get: summary: Get microclimate predictions description: >- Microclimate predictions for a site. Past times are left out unless `showPast=1`, except with `newest`; see `timeRange`. operationId: getPredictionsMicroclimateTimeRange tags: - Timeseries security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/SiteID" - $ref: "#/components/parameters/TimeRange" - $ref: "#/components/parameters/Metrics" - $ref: "#/components/parameters/Resolution" - $ref: "#/components/parameters/Statistic" - $ref: "#/components/parameters/Format" - $ref: "#/components/parameters/ResponseVersion" - $ref: "#/components/parameters/DisableRedirects" - $ref: "#/components/parameters/RefID" - $ref: "#/components/parameters/ShowPast" responses: "200": $ref: "#/components/responses/TimeseriesData" "302": $ref: "#/components/responses/Redirect" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /predictions/microclimate/{siteID}/node/{nodeID}/{timeRange}: get: summary: Get microclimate predictions description: >- Microclimate predictions for one node. Past times are left out unless `showPast=1`, except with `newest`; see `timeRange`. `all` as the node ID means every node. operationId: getPredictionsMicroclimateNodeTimeRange tags: - Timeseries security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/SiteID" - $ref: "#/components/parameters/NodeID" - $ref: "#/components/parameters/TimeRange" - $ref: "#/components/parameters/Metrics" - $ref: "#/components/parameters/Resolution" - $ref: "#/components/parameters/Statistic" - $ref: "#/components/parameters/Format" - $ref: "#/components/parameters/ResponseVersion" - $ref: "#/components/parameters/DisableRedirects" - $ref: "#/components/parameters/RefID" - $ref: "#/components/parameters/ShowPast" responses: "200": $ref: "#/components/responses/TimeseriesData" "302": $ref: "#/components/responses/Redirect" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /predictions/pest-disease/metrics: get: summary: List pest and disease metrics description: >- Always `[]` today. Pest and disease responses use raw metric keys that start with `pd`. operationId: getPestDiseaseMetrics tags: - Metrics security: - publicApiAuthorizer: [] - apiKey: [] responses: "200": description: An empty list. content: application/json: schema: $ref: "#/components/schemas/MetricList" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /predictions/pest-disease/{siteID}: get: summary: Get pest & disease predictions description: >- Pest and disease predictions for a site. Every metric is returned under its raw `pd`-prefixed name, and `metrics` is ignored. Only `resolution=2592000` at 2.1 or 2.2 buckets anything here. Other accepted values do not bucket, for any `statistic`, though `runningTotal` still accumulates the raw samples at 2.1 or 2.2. Runs from now to the last stored forecast point. To set a range or see past times, use the path with `timeRange`. operationId: getPestDisease tags: - Timeseries security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/SiteID" - $ref: "#/components/parameters/Resolution" - $ref: "#/components/parameters/Statistic" - $ref: "#/components/parameters/Format" - $ref: "#/components/parameters/ResponseVersion" - $ref: "#/components/parameters/DisableRedirects" - $ref: "#/components/parameters/RefID" responses: "200": $ref: "#/components/responses/TimeseriesData" "302": $ref: "#/components/responses/Redirect" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /predictions/pest-disease/{siteID}/node/{nodeID}: get: summary: Get pest & disease predictions description: >- Pest and disease predictions for one node. Every metric is returned under its raw `pd`-prefixed name, and `metrics` is ignored. Only `resolution=2592000` at 2.1 or 2.2 buckets anything here. Other accepted values do not bucket, for any `statistic`, though `runningTotal` still accumulates the raw samples at 2.1 or 2.2. Runs from now to the last stored forecast point. To set a range or see past times, use the path with `timeRange`. `all` as the node ID means every node. operationId: getPestDiseaseNode tags: - Timeseries security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/SiteID" - $ref: "#/components/parameters/NodeID" - $ref: "#/components/parameters/Resolution" - $ref: "#/components/parameters/Statistic" - $ref: "#/components/parameters/Format" - $ref: "#/components/parameters/ResponseVersion" - $ref: "#/components/parameters/DisableRedirects" - $ref: "#/components/parameters/RefID" responses: "200": $ref: "#/components/responses/TimeseriesData" "302": $ref: "#/components/responses/Redirect" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /predictions/pest-disease/{siteID}/{timeRange}: get: summary: Get pest & disease predictions description: >- Pest and disease predictions for a site. Every metric is returned under its raw `pd`-prefixed name, and `metrics` is ignored. Only `resolution=2592000` at 2.1 or 2.2 buckets anything here. Other accepted values do not bucket, for any `statistic`, though `runningTotal` still accumulates the raw samples at 2.1 or 2.2. With `newest`, they cause a 400. Past times are left out unless `showPast=1`, except with `newest`; see `timeRange`. operationId: getPestDiseaseTimeRange tags: - Timeseries security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/SiteID" - $ref: "#/components/parameters/TimeRange" - $ref: "#/components/parameters/Resolution" - $ref: "#/components/parameters/Statistic" - $ref: "#/components/parameters/Format" - $ref: "#/components/parameters/ResponseVersion" - $ref: "#/components/parameters/DisableRedirects" - $ref: "#/components/parameters/RefID" - $ref: "#/components/parameters/ShowPast" responses: "200": $ref: "#/components/responses/TimeseriesData" "302": $ref: "#/components/responses/Redirect" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /predictions/pest-disease/{siteID}/node/{nodeID}/{timeRange}: get: summary: Get pest & disease predictions description: >- Pest and disease predictions for one node. Every metric is returned under its raw `pd`-prefixed name, and `metrics` is ignored. Only `resolution=2592000` at 2.1 or 2.2 buckets anything here. Other accepted values do not bucket, for any `statistic`, though `runningTotal` still accumulates the raw samples at 2.1 or 2.2. With `newest`, they cause a 400. Past times are left out unless `showPast=1`, except with `newest`; see `timeRange`. `all` as the node ID means every node. operationId: getPestDiseaseNodeTimeRange tags: - Timeseries security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/SiteID" - $ref: "#/components/parameters/NodeID" - $ref: "#/components/parameters/TimeRange" - $ref: "#/components/parameters/Resolution" - $ref: "#/components/parameters/Statistic" - $ref: "#/components/parameters/Format" - $ref: "#/components/parameters/ResponseVersion" - $ref: "#/components/parameters/DisableRedirects" - $ref: "#/components/parameters/RefID" - $ref: "#/components/parameters/ShowPast" responses: "200": $ref: "#/components/responses/TimeseriesData" "302": $ref: "#/components/responses/Redirect" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /summaries/microclimate/customer/{customerID}: get: summary: Get forecast and actual summaries for a customer's sites description: >- Maximum, minimum and mean of one metric for every site of the customer you can access. Past rows come from sensors, one per `step`. Forecast rows are not combined: each stored forecast point gets its own row, with `ts` rounded to the nearest `step`, so a `ts` can repeat. Returns 401 when you can access none of the sites. If one site fails, the whole request gets a 400, and a failed database connection can surface as a 502. A missing or out-of-range `step`, `count`, `afterCount`, `afterStep` or `metrics` reads "no valid timeRange provided"; an unknown metric or source reads "invalid metric name provided". Samples are `SummarySample`. Do not ask for `format=csv`: at 2.0 and 2.1 it gives a 200 with an empty body. At 2.1 and 2.2, samples can land on the wrong node when the response has more than one node. operationId: getMicroclimateSummaryByCustomer tags: - Timeseries security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - name: metrics in: query required: true description: The one metric to summarize. `metric` is accepted as an alias. schema: type: string enum: [airTemp, humidity, dewPoint, vpd] - name: step in: query required: true description: Step length in seconds, 3600 to 86400. schema: type: integer - name: count in: query required: true description: >- Past window, 0 to 6: `count` + 1 steps back from the start of the current step. Rows are rounded to the nearest `step`, so the first and last can cover only part of one. `afterCount` defaults to this value, so 6 needs an explicit `afterCount` of 4 or less. schema: type: integer - name: afterCount in: query description: >- Forecast window, 0 to 6, and at most 10 with `count`: forecasts run `afterCount` times `afterStep` seconds past the start of the current step. Defaults to `count`. schema: type: integer - name: afterStep in: query description: >- Seconds per `afterCount`, 3600 to 86400. It sets only the end of the forecast window. Defaults to `step`. schema: type: integer - name: source in: query description: >- Forecast source: `mc` for microclimate predictions (the default) or `ws` for weather forecasts. schema: type: string enum: [mc, ws] - $ref: "#/components/parameters/ResponseVersion" - $ref: "#/components/parameters/DisableRedirects" responses: "200": description: The summaries. content: application/json: schema: $ref: "#/components/schemas/Timeseries" "302": $ref: "#/components/responses/Redirect" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /synthetics/microclimate/metrics: get: summary: List synthetic microclimate metrics description: Use these IDs in `metrics` for synthetic microclimate data. operationId: getSyntheticsMicroclimateMetrics tags: - Metrics security: - publicApiAuthorizer: [] - apiKey: [] responses: "200": description: The metrics. content: application/json: schema: $ref: "#/components/schemas/MetricList" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /synthetics/microclimate/{siteID}/{timeRange}: get: summary: Get synthetic microclimate data description: Synthetic microclimate metrics for past times at a site. operationId: getSyntheticsMicroclimate tags: - Timeseries security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/SiteID" - $ref: "#/components/parameters/TimeRange" - $ref: "#/components/parameters/Metrics" - $ref: "#/components/parameters/Resolution" - $ref: "#/components/parameters/Statistic" - $ref: "#/components/parameters/Format" - $ref: "#/components/parameters/ResponseVersion" - $ref: "#/components/parameters/DisableRedirects" - $ref: "#/components/parameters/RefID" responses: "200": $ref: "#/components/responses/TimeseriesData" "302": $ref: "#/components/responses/Redirect" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /synthetics/microclimate/{siteID}/node/{nodeID}/{timeRange}: get: summary: Get synthetic microclimate data description: >- Synthetic microclimate metrics for past times at one node. `all` as the node ID means every node. operationId: getSyntheticsMicroclimateNode tags: - Timeseries security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/SiteID" - $ref: "#/components/parameters/NodeID" - $ref: "#/components/parameters/TimeRange" - $ref: "#/components/parameters/Metrics" - $ref: "#/components/parameters/Resolution" - $ref: "#/components/parameters/Statistic" - $ref: "#/components/parameters/Format" - $ref: "#/components/parameters/ResponseVersion" - $ref: "#/components/parameters/DisableRedirects" - $ref: "#/components/parameters/RefID" responses: "200": $ref: "#/components/responses/TimeseriesData" "302": $ref: "#/components/responses/Redirect" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /alerts/customer/{customerID}: get: summary: List a customer's active alerts description: >- Active, unmuted alerts for the customer, limited to the sites you can access. The body is shaped for an Apple push notification: `aps.alert` is a title and `alerts` the list. Needs Viewer access to the customer. operationId: listAlertsByCustomer tags: - Alerts security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" responses: "200": description: The alerts. content: application/json: schema: $ref: "#/components/schemas/AlertList" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /fileserver/site/{siteID}: get: summary: Get a download URL for a site file description: >- Returns a presigned URL for a file in the site's storage, valid for 15 minutes, or with `redirect=true` a 302 to it. The file is not checked: a key that does not exist still gets a URL, which then fails. Needs Viewer access to the customer that owns the site; without it you get a 401. operationId: getFileBySite tags: - Files security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/SiteID" - $ref: "#/components/parameters/FilePath" - name: redirect in: query description: '`true` to get a 302 to the file instead of a JSON body.' schema: type: string responses: "200": description: The download URL. content: application/json: schema: $ref: "#/components/schemas/PreSignedURLResponse" "302": description: >- With `redirect=true`. `disableRedirects` does not apply here. The body repeats the URL as `{"code":302,"message":"redirect","location":""}`, with no Content-Type. headers: Location: description: Presigned download URL, valid for 15 minutes. schema: type: string "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /fileserver/customer/{customerID}: get: summary: Get a download URL for a customer file description: >- Returns a presigned URL for a file in the customer's storage, valid for 15 minutes, or with `redirect=true` a 302 to it. The file is not checked: a key that does not exist still gets a URL, which then fails. Needs Viewer access to the customer. operationId: getFileByCustomer tags: - Files security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - $ref: "#/components/parameters/FilePath" - name: redirect in: query description: '`true` to get a 302 to the file instead of a JSON body.' schema: type: string responses: "200": description: The download URL. content: application/json: schema: $ref: "#/components/schemas/PreSignedURLResponse" "302": description: >- With `redirect=true`. `disableRedirects` does not apply here. The body repeats the URL as `{"code":302,"message":"redirect","location":""}`, with no Content-Type. headers: Location: description: Presigned download URL, valid for 15 minutes. schema: type: string "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" put: summary: Get an upload URL for a customer file description: >- No request body. Returns a presigned URL, valid for 15 minutes: PUT the file to `uploadUrl`. `file` must be under `uploads/customer/portal/` and must not end in `/`; anything else is a 400. A timestamp folder goes before the file name, so `uploads/customer/portal/a.csv` is stored as `uploads/customer/portal//a.csv`, and `url` gives the stored location. Needs Editor access to the customer. operationId: putFileByCustomer tags: - Files security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - name: file in: query required: true description: >- Key to store the file under, starting with `uploads/customer/portal/`. The server URL-decodes it once more than usual, so encode a `%` or `+` in the name twice. schema: type: string responses: "200": description: The upload URL. content: application/json: schema: $ref: "#/components/schemas/PreSignedURLResponse" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /fileserver/customer/{customerID}/shared: get: summary: List files shared with a customer description: >- Files marked visible to the customer whose processing succeeded. Needs Viewer access to the customer. operationId: listFilesSharedWithCustomer tags: - Files security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" responses: "200": description: The files. content: application/json: schema: $ref: "#/components/schemas/CustomerFiles" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /report-definitions/{customerID}/{id}: put: summary: Update a report definition description: >- Changes only the fields you send, then publishes the result to the report scheduling topic. If that publish fails, you get a 400 but the change is saved. Needs Editor access to the customer. An ID that does not exist is a 400 with `item does not exist`, not a 404. operationId: updateReportDefinition tags: - Reports security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - $ref: "#/components/parameters/ItemID" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ReportDefinitionInput" responses: "204": description: Updated, or nothing to change. "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" delete: summary: Delete a report definition description: >- Permanent. Also publishes the deletion to the report scheduling topic. If that publish fails, you get a 400 but the definition is gone. Needs Editor access to the customer. An ID that does not exist is a 400 with `item does not exist`, not a 404. operationId: deleteReportDefinition tags: - Reports security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - $ref: "#/components/parameters/ItemID" responses: "204": description: Deleted. "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /report-definitions/customer/{customerID}: get: summary: List a customer's report definitions description: Needs Viewer access to the customer. operationId: listReportDefinitionsByCustomerID tags: - Reports security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" responses: "200": description: The report definitions. content: application/json: schema: $ref: "#/components/schemas/ReportDefinitions" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" post: summary: Create a report definition description: >- Saves the definition, then publishes it to the report scheduling topic. If that publish fails, you get a 400 but the definition is saved. Needs Editor access to the customer. operationId: createReportDefinition tags: - Reports security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ReportDefinitionInput" responses: "201": description: The report definition was created. `id` is its ID. content: application/json: schema: $ref: "#/components/schemas/Created" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /report-runs/{customerID}/{id}: get: summary: Get a report run description: >- `files` are bare file names. To download one, pass `reports//` as `file` to `/fileserver/customer/{customerID}`. Needs Viewer access to the customer. An ID that does not exist is a 400 with `item does not exist`, not a 404. operationId: showReportRun tags: - Reports security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - $ref: "#/components/parameters/ItemID" responses: "200": description: The report run. content: application/json: schema: $ref: "#/components/schemas/ReportRun" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /report-runs/customer/{customerID}: get: summary: List a customer's recent report runs description: >- The latest 10 runs only, newest first. Needs Viewer access to the customer. operationId: listReportRunsByCustomerID tags: - Reports security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" responses: "200": description: The report runs. content: application/json: schema: $ref: "#/components/schemas/ReportRuns" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" post: summary: Run a report now description: >- Starts the report and returns before it finishes. Check the run with `/report-runs/{customerID}/{id}`. `reportDefinitionID` is not checked: an unknown ID adds an empty definition to your list and the run stays `new`. If starting fails, you get a 400 but the run record stays, with `status` `new`. Needs Editor access to the customer. operationId: createReportRun tags: - Reports security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ReportRunInput" responses: "201": description: The report run was created. `id` is its ID. content: application/json: schema: $ref: "#/components/schemas/Created" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /report-runs/report-definition-id/{customerID}/{reportDefinitionID}: get: summary: List runs of a report definition description: >- Every run of the definition for this customer, newest first. Needs Viewer access to the customer. operationId: listReportRunsByReportDefinitionID tags: - Reports security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - name: reportDefinitionID in: path required: true description: Report definition ID. schema: type: string responses: "200": description: The report runs. content: application/json: schema: $ref: "#/components/schemas/ReportRuns" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /library-charts/{customerID}/{id}: get: summary: Get a library chart description: >- Needs Viewer access to the customer. An ID that does not exist is a 400 with `item does not exist`, not a 404. operationId: showLibraryChart tags: - Library Charts security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - $ref: "#/components/parameters/ItemID" responses: "200": description: The chart. content: application/json: schema: $ref: "#/components/schemas/LibraryChart" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" put: summary: Update a library chart description: >- Changes only the fields you send. Needs Editor access to the customer. An ID that does not exist is a 400 with `item does not exist`, not a 404. operationId: updateLibraryChart tags: - Library Charts security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - $ref: "#/components/parameters/ItemID" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/LibraryChartInput" responses: "204": description: Updated, or nothing to change. "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" delete: summary: Delete a library chart description: >- Permanent. Needs Editor access to the customer. An ID that does not exist is a 400 with `item does not exist`, not a 404. operationId: deleteLibraryChart tags: - Library Charts security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - $ref: "#/components/parameters/ItemID" responses: "204": description: Deleted. "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /library-charts/customer/{customerID}: get: summary: List a customer's library charts description: Needs Viewer access to the customer. operationId: listLibraryChartsByCustomerID tags: - Library Charts security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" responses: "200": description: The charts. content: application/json: schema: $ref: "#/components/schemas/LibraryCharts" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" post: summary: Create a library chart description: Needs Editor access to the customer. operationId: createLibraryChart tags: - Library Charts security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/LibraryChartInput" responses: "201": description: The chart was created. `id` is its ID. content: application/json: schema: $ref: "#/components/schemas/Created" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /experiments/{customerID}/{id}: get: summary: Get an experiment description: >- Needs Viewer access to the customer. An ID that does not exist is a 400 with `item does not exist`, not a 404. operationId: showExperiment tags: - Experiments security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - $ref: "#/components/parameters/ItemID" responses: "200": description: The experiment. content: application/json: schema: $ref: "#/components/schemas/Experiment" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" put: summary: Update an experiment description: >- Changes only the fields you send. Even with nothing to change, this updates the experiment's `notice` and marks its rollups for a rebuild, which runs only while `status` is `ongoing`. If that fails, you get a 400 but the change is saved. Needs Editor access to the customer. An ID that does not exist is a 400 with `item does not exist`, not a 404. operationId: updateExperiment tags: - Experiments security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - $ref: "#/components/parameters/ItemID" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ExperimentInput" responses: "204": description: Updated, or nothing to change. "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" delete: summary: Delete an experiment description: >- Permanent. Removes the experiment only: its groups, members, metrics and rollup data stay. Needs Editor access to the customer. An ID that does not exist is a 400 with `item does not exist`, not a 404. operationId: deleteExperiment tags: - Experiments security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - $ref: "#/components/parameters/ItemID" responses: "204": description: Deleted. "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /experiments/customer/{customerID}: get: summary: List a customer's experiments description: Needs Viewer access to the customer. operationId: listExperimentsByCustomerID tags: - Experiments security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" responses: "200": description: The experiments. content: application/json: schema: $ref: "#/components/schemas/Experiments" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" post: summary: Create an experiment description: >- Also sets the experiment's `notice` and marks its rollups for a full build. Once the experiment is `ongoing`, the next rollup run consumes that mark even if it has no groups yet, and group writes do not mark it again, so create groups before members and metrics. If the notice update fails, you get a 400 but the experiment is saved, so check the list before you retry. Needs Editor access to the customer. operationId: createExperiment tags: - Experiments security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ExperimentInput" responses: "201": description: The experiment was created. `id` is its ID. content: application/json: schema: $ref: "#/components/schemas/Created" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /experiments/groups/{customerID}/{experimentID}/{id}: get: summary: Get an experiment group description: >- Needs Viewer access to the customer. An unknown experiment, or one that is not the customer's, is a 404. A group ID that does not exist is a 400 with `item does not exist`. operationId: showExperimentGroup tags: - Experiments security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - $ref: "#/components/parameters/ExperimentID" - $ref: "#/components/parameters/ItemID" responses: "200": description: The group. content: application/json: schema: $ref: "#/components/schemas/ExperimentGroup" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" "404": $ref: "#/components/responses/NotFound" put: summary: Update an experiment group description: >- Changes only the fields you send. Unlike metric changes, this leaves the experiment's `notice` and rollups as they are. Needs Editor access to the customer. An unknown experiment, or one that is not the customer's, is a 404. A group ID that does not exist is a 400 with `item does not exist`. operationId: updateExperimentGroup tags: - Experiments security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - $ref: "#/components/parameters/ExperimentID" - $ref: "#/components/parameters/ItemID" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ExperimentGroupInput" responses: "204": description: Updated, or nothing to change. "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" "404": $ref: "#/components/responses/NotFound" delete: summary: Delete an experiment group description: >- Permanent. Removes the group only: its members stay, and its rows stay in the experiment data until the next rebuild, with placeholder group details. Unlike metric changes, this leaves the experiment's `notice` and rollups as they are. Needs Editor access to the customer. An unknown experiment, or one that is not the customer's, is a 404. A group ID that does not exist is a 400 with `item does not exist`. operationId: deleteExperimentGroup tags: - Experiments security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - $ref: "#/components/parameters/ExperimentID" - $ref: "#/components/parameters/ItemID" responses: "204": description: Deleted. "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" "404": $ref: "#/components/responses/NotFound" /experiments/groups/{customerID}/{experimentID}: get: summary: List groups in an experiment description: >- Needs Viewer access to the customer. An unknown experiment, or one that is not the customer's, is a 404. operationId: listExperimentGroupsByExperimentID tags: - Experiments security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - $ref: "#/components/parameters/ExperimentID" responses: "200": description: The groups. content: application/json: schema: $ref: "#/components/schemas/ExperimentGroups" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" "404": $ref: "#/components/responses/NotFound" post: summary: Create an experiment group description: >- Unlike metric changes, this leaves the experiment's `notice` and rollups as they are. Needs Editor access to the customer. An unknown experiment, or one that is not the customer's, is a 404. operationId: createExperimentGroup tags: - Experiments security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - $ref: "#/components/parameters/ExperimentID" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ExperimentGroupInput" responses: "201": description: The group was created. `id` is its ID. content: application/json: schema: $ref: "#/components/schemas/Created" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" "404": $ref: "#/components/responses/NotFound" /experiments/members/{customerID}/{experimentID}/{groupID}/{nodeID}: get: summary: Get a node in an experiment group description: >- Needs Viewer access to the customer. An unknown experiment or group, or one that is not the customer's, is a 404. A node that is not in the group is a 400 with `item does not exist`. operationId: showExperimentMember tags: - Experiments security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - $ref: "#/components/parameters/ExperimentID" - $ref: "#/components/parameters/GroupID" - $ref: "#/components/parameters/NodeID" responses: "200": description: The member. content: application/json: schema: $ref: "#/components/schemas/ExperimentMember" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" "404": $ref: "#/components/responses/NotFound" post: summary: Add a node to an experiment group description: >- `id` in the response is the node ID. Send `experimentID` in the body as well as the path; see `ExperimentMemberInput`. A node already in the group is a 400. Also updates the experiment's `notice` and marks its rollups for a rebuild, which runs only while `status` is `ongoing`. If that fails, you get a 400 but the change is saved. So a retry after that 400 fails too: list the group to check. Needs Editor access to the customer. An unknown experiment or group, or one that is not the customer's, is a 404. The node must be an active node at one of the customer's active sites, or you get a 404. A body `experimentID` other than the path's must be one of the customer's experiments, or you get a 400. operationId: createExperimentMember tags: - Experiments security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - $ref: "#/components/parameters/ExperimentID" - $ref: "#/components/parameters/GroupID" - $ref: "#/components/parameters/NodeID" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ExperimentMemberInput" responses: "201": description: The node was added. `id` is the node ID. content: application/json: schema: $ref: "#/components/schemas/Created" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" "404": $ref: "#/components/responses/NotFound" put: summary: Update a node in an experiment group description: >- Changes only the fields you send. This does not refresh the experiment's `notice` or rollups. Needs Editor access to the customer. An unknown experiment or group, or one that is not the customer's, is a 404. The node must be an active node at one of the customer's active sites, or you get a 404. A body `experimentID` other than the path's must be one of the customer's experiments, or you get a 400. A node that is not in the group is a 400 with `item does not exist`. operationId: updateExperimentMember tags: - Experiments security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - $ref: "#/components/parameters/ExperimentID" - $ref: "#/components/parameters/GroupID" - $ref: "#/components/parameters/NodeID" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ExperimentMemberInput" responses: "204": description: Updated, or nothing to change. "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" "404": $ref: "#/components/responses/NotFound" delete: summary: Remove a node from an experiment group description: >- Permanent. Also updates the experiment's `notice` and marks its rollups for a rebuild, which runs only while `status` is `ongoing`. If that fails, you get a 400 but the change is saved. Needs Editor access to the customer. An unknown experiment or group, or one that is not the customer's, is a 404. A node that is not in the group is a 400 with `item does not exist`. operationId: deleteExperimentMember tags: - Experiments security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - $ref: "#/components/parameters/ExperimentID" - $ref: "#/components/parameters/GroupID" - $ref: "#/components/parameters/NodeID" responses: "204": description: Removed. "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" "404": $ref: "#/components/responses/NotFound" /experiments/members/{customerID}/group-id/{groupID}: get: summary: List an experiment group's nodes description: >- Needs Viewer access to the customer. A group that is not in one of the customer's experiments is a 404, as is an unknown group. operationId: listExperimentMembersByGroupID tags: - Experiments security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - $ref: "#/components/parameters/GroupID" responses: "200": description: The members. content: application/json: schema: $ref: "#/components/schemas/ExperimentMembers" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" "404": $ref: "#/components/responses/NotFound" /experiments/members/{customerID}/node-id/{nodeID}: get: summary: List a node's experiment memberships description: >- One member for each group the node is in, so an experiment can appear more than once. Only groups in the customer's experiments are listed. Needs Viewer access to the customer. operationId: listExperimentMembersByNodeID tags: - Experiments security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - $ref: "#/components/parameters/NodeID" responses: "200": description: The members. content: application/json: schema: $ref: "#/components/schemas/ExperimentMembers" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /experiments/members/{customerID}/experiment-id/{experimentID}: get: summary: List an experiment's nodes description: >- Lists members by the `experimentID` stored on them, not by group, and only those in the customer's groups. Needs Viewer access to the customer. An unknown experiment, or one that is not the customer's, is a 404. operationId: listExperimentMembersByExperimentID tags: - Experiments security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - $ref: "#/components/parameters/ExperimentID" responses: "200": description: The members. content: application/json: schema: $ref: "#/components/schemas/ExperimentMembers" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" "404": $ref: "#/components/responses/NotFound" /experiments/metrics/{customerID}/{experimentID}/{id}: get: summary: Get an experiment metric description: >- Needs Viewer access to the customer. An unknown experiment, or one that is not the customer's, is a 404. A metric ID that does not exist is a 400 with `item does not exist`. operationId: showExperimentMetric tags: - Experiments security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - $ref: "#/components/parameters/ExperimentID" - $ref: "#/components/parameters/ItemID" responses: "200": description: The experiment metric. content: application/json: schema: $ref: "#/components/schemas/ExperimentMetric" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" "404": $ref: "#/components/responses/NotFound" put: summary: Update an experiment metric description: >- Changes only the fields you send. Even with nothing to change, this updates the experiment's `notice` and marks its rollups for a rebuild, which runs only while `status` is `ongoing`. If that fails, you get a 400 but the change is saved. Changing `resolution` does not drop data at the old resolution, so that data still returns. Needs Editor access to the customer. An unknown experiment, or one that is not the customer's, is a 404. A metric ID that does not exist is a 400 with `item does not exist`. operationId: updateExperimentMetric tags: - Experiments security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - $ref: "#/components/parameters/ExperimentID" - $ref: "#/components/parameters/ItemID" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ExperimentMetricInput" responses: "204": description: Updated, or nothing to change. "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" "404": $ref: "#/components/responses/NotFound" delete: summary: Remove an experiment metric description: >- Permanent. Also updates the experiment's `notice` and marks its rollups for a rebuild, which runs only while `status` is `ongoing`. If that fails, you get a 400 but the change is saved. The rebuild does not drop data at a resolution that no longer has any metric, so that data still returns. Needs Editor access to the customer. An unknown experiment, or one that is not the customer's, is a 404. A metric ID that does not exist is a 400 with `item does not exist`. operationId: deleteExperimentMetric tags: - Experiments security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - $ref: "#/components/parameters/ExperimentID" - $ref: "#/components/parameters/ItemID" responses: "204": description: Removed. "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" "404": $ref: "#/components/responses/NotFound" /experiments/metrics/{customerID}/experiment-id/{experimentID}: get: summary: List an experiment's metrics description: >- Needs Viewer access to the customer. An unknown experiment, or one that is not the customer's, is a 404. operationId: listExperimentMetricsByExperimentID tags: - Experiments security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - $ref: "#/components/parameters/ExperimentID" responses: "200": description: The experiment metrics. content: application/json: schema: $ref: "#/components/schemas/ExperimentMetrics" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" "404": $ref: "#/components/responses/NotFound" post: summary: Add an experiment metric description: >- Metrics that render the same column name at the same `resolution` share one column, so an empty `statistic` and `mean` share one. Also updates the experiment's `notice` and marks its rollups for a rebuild, which runs only while `status` is `ongoing`. If that fails, you get a 400 but the change is saved. A retry after that 400 adds a second metric, so list the metrics first. Needs Editor access to the customer. An unknown experiment, or one that is not the customer's, is a 404. operationId: createExperimentMetric tags: - Experiments security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - $ref: "#/components/parameters/ExperimentID" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ExperimentMetricInput" responses: "201": description: The experiment metric was created. `id` is its ID. content: application/json: schema: $ref: "#/components/schemas/Created" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" "404": $ref: "#/components/responses/NotFound" /experiments/data/{customerID}/e/{experimentID}/{resolution}/{timeRange}: get: summary: Get experiment data description: >- All groups' rollup data for an experiment, under `experiment.groups`. Always response version 2.2, whatever `responseVersion` says, and `format=csv` still returns JSON. operationId: getExperimentDataByExperimentID tags: - Experiments security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - $ref: "#/components/parameters/ExperimentID" - $ref: "#/components/parameters/TimeRange" - $ref: "#/components/parameters/ExperimentResolution" - $ref: "#/components/parameters/ExperimentCols" - $ref: "#/components/parameters/ExperimentMetrics" - $ref: "#/components/parameters/ExperimentStatistic" - $ref: "#/components/parameters/Format" - $ref: "#/components/parameters/DisableRedirects" - $ref: "#/components/parameters/RefID" responses: "200": description: The experiment data. content: application/json: schema: $ref: "#/components/schemas/ExperimentData" "302": $ref: "#/components/responses/Redirect" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /experiments/data/{customerID}/e/{experimentID}/g/{groupID}/{resolution}/{timeRange}: get: summary: Get experiment group data description: >- One group's rollup data for an experiment, under `experiment.groups`. Always response version 2.2, whatever `responseVersion` says, and `format=csv` still returns JSON. operationId: getExperimentDataByExperimentIDAndGroupID tags: - Experiments security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - $ref: "#/components/parameters/ExperimentID" - $ref: "#/components/parameters/TimeRange" - $ref: "#/components/parameters/GroupID" - $ref: "#/components/parameters/ExperimentResolution" - $ref: "#/components/parameters/ExperimentCols" - $ref: "#/components/parameters/ExperimentMetrics" - $ref: "#/components/parameters/ExperimentStatistic" - $ref: "#/components/parameters/Format" - $ref: "#/components/parameters/DisableRedirects" - $ref: "#/components/parameters/RefID" responses: "200": description: The experiment data. content: application/json: schema: $ref: "#/components/schemas/ExperimentData" "302": $ref: "#/components/responses/Redirect" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /experiments/data/{customerID}/e/{experimentID}/run: post: summary: Re-run experiment data description: >- Asks for the experiment rollup to run again. Needs both Editor access to the customer and Agrology debugger access. Automation credentials pass both checks. Callers without that access get a 401 whose body is not valid JSON. operationId: requestExperimentDataReRun tags: - Experiments security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - $ref: "#/components/parameters/ExperimentID" responses: "204": description: Accepted. "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /experiments/data/{customerID}/e/{experimentID}/regenerate: post: summary: Regenerate experiment data description: >- Asks for the experiment rollup to be rebuilt from scratch. Needs both Editor access to the customer and Agrology debugger access. Automation credentials pass both checks. Callers without that access get a 401 whose body is not valid JSON. operationId: requestExperimentDataRegenerate tags: - Experiments security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - $ref: "#/components/parameters/ExperimentID" responses: "204": description: Accepted. "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /dashboards/{owner}/{id}: get: summary: Get a dashboard description: >- Returns a deleted dashboard too, with `status` `deleted`, until it expires. You can read your own dashboards, and those of a `customer.` owner with Viewer access to that customer. An ID that does not exist is a 400 with `item does not exist`, not a 404. operationId: showDashboard tags: - Dashboards security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/Owner" - $ref: "#/components/parameters/ItemID" responses: "200": description: The dashboard. content: application/json: schema: $ref: "#/components/schemas/Dashboard" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" put: summary: Update a dashboard description: >- Changes only the fields you send. You can change your own dashboards, and those of a `customer.` owner with Editor access to that customer. An ID that does not exist is a 400 with `item does not exist`, not a 404. operationId: updateDashboard tags: - Dashboards security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/Owner" - $ref: "#/components/parameters/ItemID" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/DashboardInput" responses: "204": description: Updated, or nothing to change. "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" delete: summary: Delete a dashboard description: >- Soft delete: sets `status` to `deleted`, and the dashboard can be restored for 7 days. You can change your own dashboards, and those of a `customer.` owner with Editor access to that customer. An ID that does not exist is a 400 with `item does not exist`, not a 404. operationId: deleteDashboard tags: - Dashboards security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/Owner" - $ref: "#/components/parameters/ItemID" responses: "204": description: Deleted. "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" post: summary: Restore a deleted dashboard description: >- Sets `status` to `active` and cancels the expiry. You can change your own dashboards, and those of a `customer.` owner with Editor access to that customer. An ID that does not exist is a 400 with `item does not exist`, not a 404. operationId: undeleteDashboard tags: - Dashboards security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/Owner" - $ref: "#/components/parameters/ItemID" responses: "204": description: Restored. "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /dashboards/owner/{owner}: get: summary: List an owner's dashboards description: >- Returns 401 for every caller today, because the access check needs a dashboard or feature ID and this path has neither. Use `/dashboards/owner/{owner}/feature-id/{featureID}`, which lists one feature at a time. No route lists all of an owner's dashboards. operationId: listDashboardsByOwner tags: - Dashboards security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/Owner" responses: "200": description: The dashboards. content: application/json: schema: $ref: "#/components/schemas/Dashboards" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" post: summary: Create a dashboard description: >- `feature` and `featureID` are needed: without them the write fails with a 400. You can create your own dashboards, and those of a `customer.` owner with Editor access to that customer. operationId: createDashboard tags: - Dashboards security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/Owner" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/DashboardInput" responses: "201": description: The dashboard was created. `id` is its ID. content: application/json: schema: $ref: "#/components/schemas/Created" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /dashboards/owner/{owner}/feature-id/{featureID}: get: summary: List an owner's dashboards for a feature description: >- Includes deleted dashboards until they expire. You can read your own dashboards, and those of a `customer.` owner with Viewer access to that customer. operationId: listDashboardsByFeatureIDAndOwner tags: - Dashboards security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/Owner" - name: featureID in: path required: true description: ID of the item within the feature. schema: type: string responses: "200": description: The dashboards. content: application/json: schema: $ref: "#/components/schemas/Dashboards" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /access/manage/{customerID}: get: summary: List who has access to a customer description: >- Customer-level grants only: users with access to single sites are not listed, and neither are `@agrology.ag` addresses. Users need a customer-level Admin grant: Admin of one of the customer's sites is not enough. operationId: listCustomerAccess tags: - Access Management security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" responses: "200": description: The users and their access levels. content: application/json: schema: $ref: "#/components/schemas/CustomerAccessList" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /access/manage/{customerID}/{accessUser}/{accessLevel}: post: summary: Grant or change a user's access description: >- Gives `accessUser` the access level `accessLevel` on the customer, replacing the level they had. No request body. A user who has no login gets one, but no invitation email is sent. Creating the login runs alongside the grant, so if it fails you get a 400 although the access may be saved: list the access to check. Users need a customer-level Admin grant: Admin of one of the customer's sites is not enough. operationId: createOrUpdateCustomerAccess tags: - Access Management security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - name: accessUser in: path required: true description: >- The user's email address, URL-encoded. It is stored in lower case. schema: type: string - name: accessLevel in: path required: true description: '`viewer`, `editor` or `admin`. Anything else is a 400.' schema: type: string enum: [viewer, editor, admin] responses: "201": description: Access granted or changed. The body is empty. "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /access/manage/{customerID}/{accessUser}: delete: summary: Remove a user's access description: >- Removes the user's customer-level access. Their site-level access and their login stay. Removing access the user does not have is also a 204. Users need a customer-level Admin grant: Admin of one of the customer's sites is not enough. operationId: deleteCustomerAccess tags: - Access Management security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - name: accessUser in: path required: true description: >- The user's email address, URL-encoded. It is stored in lower case. schema: type: string responses: "204": description: Removed. "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /customer-inputs/{customerID}/{id}: put: summary: Update a customer input description: >- The same checks as on create, applied to the body you send and not to stored keys, so send `category` even if it is unchanged. `data` replaces the stored object. An array or object value under a key that is already stored can fail with a 502, so keep values to strings and numbers. Needs Editor access to the customer. An ID that does not exist is a 400 with `item does not exist`, not a 404. operationId: updateCustomerInput tags: - Customer Inputs security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - $ref: "#/components/parameters/ItemID" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CustomerInputSubmission" responses: "204": description: Updated, or nothing to change. "502": description: An array or object in `data` could not be compared with the stored value. "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" delete: summary: Delete a customer input description: >- Permanent. Needs Editor access to the customer. An ID that does not exist is a 400 with `item does not exist`, not a 404. operationId: deleteCustomerInput tags: - Customer Inputs security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - $ref: "#/components/parameters/ItemID" responses: "204": description: Deleted. "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /customer-inputs/customer/{customerID}: get: summary: List a customer's inputs description: Needs Viewer access to the customer. operationId: listCustomerInputsByCustomerID tags: - Customer Inputs security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" responses: "200": description: The customer inputs. content: application/json: schema: $ref: "#/components/schemas/CustomerInputs" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" post: summary: Record a customer input description: >- `category` must exist and each `data` key must belong to it. `s3file` values must be upload URLs for this customer; see `data`. Needs Editor access to the customer. operationId: createCustomerInput tags: - Customer Inputs security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CustomerInputSubmission" responses: "201": description: The customer input was created. `id` is its ID. content: application/json: schema: $ref: "#/components/schemas/Created" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /customer-inputs/customer/{customerID}/category/{category}: get: summary: List a customer's inputs in one category description: >- The category is not applied today: this returns every input for the customer, so filter on `category` yourself. Needs Viewer access to the customer. operationId: listCustomerInputsByCustomerIDAndCategory tags: - Customer Inputs security: - publicApiAuthorizer: [] - apiKey: [] parameters: - $ref: "#/components/parameters/CustomerID" - name: category in: path required: true description: Category name. Not applied today. schema: type: string responses: "200": description: The customer inputs. content: application/json: schema: $ref: "#/components/schemas/CustomerInputs" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /customer-inputs/categories: get: summary: List customer input categories description: >- Defines which `data` keys each category takes. Any logged-in caller can read it. operationId: listCustomerInputCategories tags: - Customer Inputs security: - publicApiAuthorizer: [] - apiKey: [] responses: "200": description: The categories. content: application/json: schema: $ref: "#/components/schemas/CustomerInputCategories" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" ## COMPONENTS SCHEMAS components: parameters: SiteID: name: siteID in: path required: true description: Site ID, from /access or /sites. Older sites use a slug (e.g. austin-research-station), newer ones a UUID. schema: type: string NodeID: name: nodeID in: path required: true description: Node ID (a UUID), from /access or /nodes. schema: type: string DeviceID: name: deviceID in: path required: true description: Device ID (EUI), from /historical/ground-truth/{siteID}/devices. schema: type: string CustomerID: name: customerID in: path required: true description: Customer ID, from /access (siteAccess[].customer). schema: type: string TimeRange: name: timeRange in: path required: true description: >- `{start}-{end}`, or a single relative time with no end (`4h` is the same as `4h-`). An empty end means now, except on predictions, where it means the last stored forecast point. Each side is `now`; a relative time `s`, `m`, `h`, `d` or `w` in the past (e.g. `6h`), or in the future with a `+` prefix (`+2d`, used by forecasts); epoch seconds (10 digits); epoch milliseconds (13 digits); or `20yyMMddHHmm` / `20yyMMddHHmmss` in UTC (exactly 12 or 14 digits, with a 24-hour `HH`). The special value `newest` returns the latest-dated sample of each series, not a single sample. On site timeseries, predictions included, it considers samples from 24 hours ago onwards with no upper bound; a series with nothing in that window is left out. A series is one node and metric (ground truth also splits by device and position; historical weather keeps one sample per node). On predictions (weather, microclimate, pest & disease) the latest-dated sample is the furthest-ahead forecast point while the series has future points, and its newest past point otherwise. On experiment data a series is one experiment group, with no time limit. Examples: `4h`, `6h-4h`, `1d-now`, `1618203722-1618290149`, `202108010000-`, `newest`. schema: type: string Resolution: name: resolution in: query description: >- Bucket size in seconds: a positive divisor of 86400 or a multiple of 86400. 2592000 means calendar months, except at `responseVersion` 2.0, which returns raw samples for it. Other positive values are ignored, as if `resolution` were absent. Do not send `0` (the request fails with a 502) or a negative value (negative divisors of 86400 are not rejected and give undefined results). `bucketSize` is accepted as an alias. schema: type: integer Statistic: name: statistic in: query description: >- How samples in a bucket combine, with `resolution`; the default is `mean`, and unknown values also give `mean`. `runningTotal` sums each bucket and accumulates across buckets; without `resolution` it accumulates the raw samples. Without `resolution`, every other value is ignored. `runningTotal` accumulates only on `SampleV21` samples: not at `responseVersion` 2.0, and not at 2.2 on weather and microclimate predictions or synthetics below calendar-month resolution. There it gives bucket sums with `resolution` and raw samples without it. At 2.0, `resolution=2592000` returns raw samples for every statistic. Below calendar-month resolution, use only `mean`, `sum`, `min`, `max` or `runningTotal`: the others are sent to the database as function names MySQL does not have, which gives a 400. On pest and disease, only `resolution=2592000` buckets, so no statistic reaches the database and this 400 does not apply; `runningTotal` still accumulates the raw samples at 2.1 or 2.2, and with `newest` any other accepted `resolution` is a 400. At calendar months, `geomean` of a series with a zero or negative value also gives a 400. `bucketOp` is accepted as an alias. schema: type: string enum: [mean, sum, min, max, median, geomean, varsamp, stddevsamp, varpop, stddevpop, runningTotal] Metrics: name: metrics in: query description: >- Comma-separated metric IDs to include, from the matching `/metrics` endpoint (e.g. `airTemp,humidity`). `metric` is accepted as an alias. On ground truth, predictions and synthetics, unknown IDs are ignored, and if none is known the filter is dropped and every metric comes back. On historical weather, if none is known the samples have no metrics. schema: type: string DeviceType: name: deviceType in: query description: Comma-separated device type IDs to include, from /historical/ground-truth/device-types (e.g. `gV1,co2`). schema: type: string Format: name: format in: query description: >- `json` (default) or `csv`. Any other value is a 400 on every operation. Only timeseries operations at response version 2.0 or 2.1 produce CSV; everything else returns JSON. schema: type: string enum: [json, csv] default: json ResponseVersion: name: responseVersion in: query description: >- Timeseries response shape: `2.0` (the default), `2.1` or `2.2` (the latest). Unknown values are ignored and give 2.0. schema: type: string enum: ["2.0", "2.1", "2.2"] default: "2.0" DisableRedirects: name: disableRedirects in: query description: >- Applies to every operation. Responses over 5,000,000 bytes are uploaded to S3 and answered with a 302 to a presigned URL that expires after 1 hour; the body is a `RedirectBody`. With `1`, the status is 200 instead of 302, but the body is still the `RedirectBody` (`"code": 302`). The timeseries and experiment-data operations include it in their 200 schema; on other operations it is not the documented 200 schema. schema: type: string enum: ["1"] RefID: name: refID in: query description: Any string. Echoed as `request.refID` in 2.1 and 2.2 timeseries responses. schema: type: string ShowPast: name: showPast in: query description: '`1` also returns predictions for times already past.' schema: type: string enum: ["1"] ConsolidateNodePositionMetrics: name: consolidateNodePositionMetrics in: query description: >- `1` merges samples from all of a node's devices at the same position into one series. Samples are then keyed `-` instead of by device ID. schema: type: string enum: ["1"] Owner: name: owner in: path required: true description: >- Dashboard owner: your own email address, or `customer.` for a dashboard shared with a customer. This value is not URL-decoded, so send `@` as it is. schema: type: string ItemID: name: id in: path required: true description: ID of the item, as returned by its create or list operation. schema: type: string ExperimentID: name: experimentID in: path required: true description: Experiment ID, from the experiment list. schema: type: string GroupID: name: groupID in: path required: true description: Experiment group ID, from the group list. schema: type: string FilePath: name: file in: query required: true description: >- Path of the file in storage, URL-encoded, such as the key of an `s3://` location returned by another endpoint. schema: type: string Filter: name: filter in: query description: >- One `key:v1,v2` filter. Keys, in any case: `deviceType`, `metrics` or `metric`, `deviceID`, `nodeID`, `position`. Other keys and unknown values are ignored, and a filter with no known values is dropped. schema: type: string Position: name: position in: query description: >- Comma-separated position names: `Soil Chamber`, `Ground Level`, `Canopy`, `PM` or `GPS`. Unknown names are ignored, and if none is known the filter is dropped. schema: type: string ExperimentResolution: name: resolution in: path required: true description: >- Rollup size in seconds: 1800, 3600, 14400, 21600, 43200, 86400, 259200, 604800 or 2592000. Any other value is a 400. schema: type: integer ExperimentCols: name: cols in: query description: >- Comma-separated `metric|nodeAggregator|statistic` columns to include, in any case. Replaces `metrics` and `statistic`. schema: type: string ExperimentMetrics: name: metrics in: query description: >- Comma-separated metric IDs to include, matched exactly against the metric part of each column. Ignored with `cols`. `metric` is accepted as an alias. schema: type: string ExperimentStatistic: name: statistic in: query description: >- Comma-separated statistics to include, matched exactly against the statistic part of each column. This is a column filter, not an aggregation: the rollup has already applied it. Ignored with `cols`. `runningTotal` drops the filter. Do not also send a query `resolution`: it changes this filter, and sets one even with no `statistic`. `bucketOp` is accepted as an alias. schema: type: string responses: BadRequest: description: >- Invalid input: a bad path or query parameter, an unknown `format`, or a body that fails validation. Many handlers also answer 400 for failures after validation, such as a database error. content: application/json: schema: $ref: "#/components/schemas/Error" Unauthorized: description: >- No valid credential, or no access to this resource. An expired token gives `{"code": 401, "message":"the incoming token has expired"}`. Other failures give `{"code": 401, "message":"{"status":"unauthorized"}"}`, which is not valid JSON, so treat a 401 body as text. content: application/json: schema: $ref: "#/components/schemas/Error" NotFound: description: >- The experiment or group in the path does not exist or is not the customer's, or for a member write, the node is not one of the customer's active nodes. content: application/json: schema: $ref: "#/components/schemas/Error" TimeseriesData: description: >- The data. CSV at response version 2.0 or 2.1: `ts,dateTime,nodeId,nodeName,`, with no `text/csv` Content-Type. With `format=csv` and no columns, the body is empty. Fields are not quoted, so a comma in a node name shifts that row. JSON at 2.2. content: application/json: schema: $ref: "#/components/schemas/Timeseries" text/csv: schema: type: string GroundTruthData: description: >- The readings. CSV at response version 2.0: `ts,dateTime,nodeId,nodeName,`. At 2.1, `dev`, `deviceType` and `position` come before the metric columns when the data has them. No `text/csv` Content-Type is sent. With `format=csv` and no columns, the body is empty. Fields are not quoted, so a comma in a node name shifts that row. JSON at 2.2. content: application/json: schema: $ref: "#/components/schemas/Timeseries" text/csv: schema: type: string Redirect: description: >- The body was over 5,000,000 bytes, so it was uploaded to S3. Follow `Location`, a presigned URL that expires after 1 hour. Any operation can answer this way; the timeseries and experiment-data operations declare it. With `disableRedirects=1` the status is 200 but the body is still this `RedirectBody`. headers: Location: description: Presigned S3 URL of the full response body. schema: type: string content: application/json: schema: $ref: "#/components/schemas/RedirectBody" schemas: AlertList: type: object description: >- Active alerts, shaped for an Apple push notification. With no alerts, the body is `{"aps":{}}`. required: [aps] properties: aps: $ref: "#/components/schemas/AlertPushService" alerts: type: array description: The alerts. Omitted when there are none. items: $ref: "#/components/schemas/Alert" AlertPushService: type: object description: Apple push notification fields. properties: alert: type: string description: >- Notification title, `Alerts for `, or the customer ID when the name cannot be read. Omitted when there are no alerts. Alert: type: object description: One active alert. required: [eventValues] properties: id: type: string description: Alert ID. insight: type: string description: Alert category. startTime: type: string format: date-time description: When the alert started, as an RFC 3339 time in UTC. endTime: type: string format: date-time description: Not set today, so always omitted. updateTime: type: string format: date-time description: Same as `startTime` today. customer: type: string description: Customer the alert is for. site: type: string description: Main site the alert is for. sites: type: array description: Every site the alert affects. items: type: string severity: type: string description: Not set today, so always omitted. certainty: type: string description: Not set today, so always omitted. urgency: type: string description: Not set today, so always omitted. eventValues: $ref: "#/components/schemas/AlertValues" AlertValues: type: object description: What the alert is about. required: [location] properties: origin: type: string description: 'Source of the alert: `Agrology` unless the alert names another.' title: type: string description: >- Short title: the alert's own subject if it has one, otherwise one such as `Fire in Area`, `Red Flag Warning`, `Extreme Temperature Warning` or `Agrology Notification`. headline: type: string description: Alert text. distance: type: number format: double description: Not set today, so always omitted. direction: type: number format: double description: Not set today, so always omitted. location: $ref: "#/components/schemas/AlertLocation" points: type: array description: Points of the affected area, as the alert source sent them. items: type: array items: type: number format: double AlertLocation: type: object description: Where the alert is. `{}` when the alert has no position. properties: type: type: string description: '`Point`.' coordinates: type: array description: '`[latitude, longitude]`: the opposite order to GeoJSON.' items: type: number CustomerAccessEntry: type: object description: One user's access to a customer. Empty fields are omitted. properties: email: type: string description: The user's email address, in lower case. site: type: string description: >- Site of a site-level grant. Always omitted here: this list has customer-level grants only. customer: type: string description: Customer the access is for. role: type: string description: 'Access level: `viewer`, `editor` or `admin`.' fromScope: type: string description: Usually omitted here. addedBy: type: string description: Who granted the access. lastModifiedBy: type: string description: Who last changed the access level. creationDate: type: integer format: int64 description: When the access was granted, in epoch seconds. lastModified: type: integer format: int64 description: When the access level last changed, in epoch seconds. CustomerAccessList: type: array description: Users with customer-level access. items: $ref: "#/components/schemas/CustomerAccessEntry" ExperimentInput: type: object description: >- Fields to set on an experiment. Omitted fields are left unchanged on update. Values are stored as sent. `notice`, `noticeLevel`, `noticeExpires` and `nextOperation` cannot be set here. properties: description: type: string description: Experiment title. status: type: string description: >- `planned`, `ongoing` or `completed`. Not validated; use `unset` to clear it. Rollups run only for `ongoing`. Once `endTime` has passed, a rollup run can set `completed`. notes: type: string description: Free-form notes. startTime: type: integer format: int64 description: >- When the experiment starts, in epoch milliseconds, not seconds. Send it on create: it is not enforced, and without it rollups start from 1970. endTime: type: integer format: int64 description: >- When the experiment ends, in epoch milliseconds, not seconds. A value in the past can end the experiment: a rollup run then sets `status` to `completed`. positionFilter: type: string description: >- Display name of the one position to include, such as `Canopy` or `Soil Chamber`. It applies to ground-truth metrics only; synthetic metrics use every position. An unknown name is ignored. unset: type: array description: >- Names of properties to clear. A property sent in the same body wins, so it is not cleared. items: type: string changeComment: type: string description: Note recorded in the change log with this change. ExperimentGroupInput: type: object description: >- Fields to set on an experiment group. Omitted fields are left unchanged on update. properties: description: type: string description: Group name. groupType: type: string description: >- Kind of group. The portal offers `control`, `trial` and `other`; any string is stored. notes: type: string description: Free-form notes. icon: type: string description: Icon to show for the group. color: type: string description: Color to show for the group. unset: type: array description: >- Names of properties to clear. A property sent in the same body wins, so it is not cleared. items: type: string changeComment: type: string description: Note recorded in the change log with this change. ExperimentMemberInput: type: object description: >- Fields to set on an experiment member. Omitted fields are left unchanged on update. properties: experimentID: type: string description: >- Experiment whose node list includes this member. Required on create: send the same, non-empty value as in the path. A different value on update moves the member to the node list of that experiment. color: type: string description: Color to show for the node. unset: type: array description: >- Names of properties to clear. A property sent in the same body wins, so it is not cleared. Clearing `experimentID` drops the member from that list. items: type: string changeComment: type: string description: Note recorded in the change log with this change. ExperimentMetricInput: type: object description: >- Fields to set on an experiment metric. Omitted fields are left unchanged on update. Values are stored as sent: an unknown `statistic` or `nodeAggregator` is not reported here, but it stops every rollup for the experiment. An experiment whose only metric has an unknown `metricID` also fails, also without an error here. properties: metricID: type: string description: >- ID of the metric to roll up. Needed on create: it is not enforced, and a missing or unknown ID gives no data. statistic: type: string description: >- How the values of the nodes in a group combine: `mean`, `sum`, `min`, `max`, `median`, `geomean`, `varsamp`, `stddevsamp`, `varpop`, `stddevpop`, `runningTotal` or `rawValue`. Case-sensitive. Empty means `mean`. `rawValue` takes one value instead of combining, so use it only for single-node groups. `runningTotal` sums the nodes and accumulates only within each rollup run: after a full rebuild it is a total from `startTime`, until the next scheduled run restarts the latest periods from zero. resolution: type: integer description: >- Rollup size in seconds: 1800, 3600, 14400, 21600, 43200, 86400, 259200, 604800 or 2592000. Needed on create: other values, including a missing one, are stored, but the data operations reject them. nodeAggregator: type: string description: >- How each node's samples in a rollup period combine, before `statistic`. It takes the same values as `statistic`, except that `runningTotal` is a plain sum here and `rawValue` keeps every sample. Empty means `mean`. unset: type: array description: >- Names of properties to clear. A property sent in the same body wins, so it is not cleared. items: type: string changeComment: type: string description: Note recorded in the change log with this change. DashboardInput: type: object description: >- Fields to set on a dashboard. Omitted fields are left unchanged on update. Changing `dataField0` moves the old value to `dataField1`, and each older version down one place; the oldest is lost. properties: feature: type: string description: Feature the dashboard belongs to. Needed on create. featureID: type: string description: ID of the item within that feature. Needed on create. description: type: string description: Dashboard title. notes: type: string description: Free-form notes. notice: type: string description: Temporary message to show the user about this dashboard. noticeLevel: type: string description: 'Severity of `notice`: `info`, `warning`, `error` or `success`.' order: type: integer description: >- Position of the dashboard in its collection (same owner and feature ID). status: type: string description: >- Dashboard status. To delete or restore, use those operations: `deleted` here sets no expiry, and `active` here does not cancel one. dataField0: type: string description: >- The live dashboard content, a free-form string owned by the client. dataField1: type: string description: >- Rollback version 1. Dropped if `dataField0` changes in the same request. Sent with no other change, it is ignored. dataField2: type: string description: >- Rollback version 2. Dropped if `dataField0` changes in the same request. Sent with no other change, it is ignored. dataField3: type: string description: >- Rollback version 3. Dropped if `dataField0` changes in the same request. Sent with no other change, it is ignored. dataField4: type: string description: >- Rollback version 4. Dropped if `dataField0` changes in the same request. Sent with no other change, it is ignored. dataField5: type: string description: >- Rollback version 5. Dropped if `dataField0` changes in the same request. Sent with no other change, it is ignored. dataField6: type: string description: >- Rollback version 6. Dropped if `dataField0` changes in the same request. Sent with no other change, it is ignored. dataField7: type: string description: >- Rollback version 7. Dropped if `dataField0` changes in the same request. Sent with no other change, it is ignored. dataField8: type: string description: >- Rollback version 8. Dropped if `dataField0` changes in the same request. Sent with no other change, it is ignored. dataField9: type: string description: >- Rollback version 9. Dropped if `dataField0` changes in the same request. Sent with no other change, it is ignored. unset: type: array description: >- Names of properties to clear. A property sent in the same body wins, so it is not cleared. `dataField1` to `dataField9` cannot be cleared. Clearing `featureID` drops the dashboard from the feature list, so it can then be reached only by its ID. items: type: string changeComment: type: string description: Note recorded in the change log with this change. LibraryChartInput: type: object description: >- Fields to set on a library chart. Omitted fields are left unchanged on update. properties: description: type: string description: Chart title. folder: type: string description: Folder the chart is filed under. definition: type: string description: >- The chart's query definition, a JSON document encoded as a string. settings: type: string description: Display settings, a JSON document encoded as a string. unset: type: array description: >- Names of properties to clear. A property sent in the same body wins, so it is not cleared. items: type: string changeComment: type: string description: Note recorded in the change log with this change. ReportDefinitionInput: type: object description: >- Fields to set on a report definition. Omitted fields are left unchanged on update. Values are stored as sent, and a bad value is not reported later: a run can show `success` with no `files`. A report needs `scope`, `timeRange` and `reportFormat` to produce anything, and `targetID` unless `scope` is `customer`. properties: description: type: string description: Report title. reportType: type: string description: Report type. Stored as sent. aggregateFiles: type: string description: 'Level each output file covers: `customer`, `site` or `node`.' aggregateCharts: type: string description: 'Level each chart covers: `customer`, `site` or `node`.' entryType: type: string description: 'How the report runs: `daily`, `weekly`, `monthly` or `manual`.' cadenceDayOfMonth: type: integer format: int64 description: >- Day of the month for a monthly report, or `99` for the last day, as the portal uses it. cadenceDayOfWeek: type: integer format: int64 description: >- Day of the week for a weekly report, as the portal numbers it: 1 is Monday and 7 is Sunday. cadenceHour: type: integer format: int64 description: Hour of the scheduled run. cadenceMinute: type: integer format: int64 description: Minute of the scheduled run. emailEnabled: type: integer description: '`1` to email the report to the recipients.' recipients: type: array description: Email addresses that receive the report. items: type: string cc: type: array description: Addresses copied on the email. items: type: string bcc: type: array description: Addresses blind-copied on the email. items: type: string scope: type: string description: 'What the report covers: `customer`, `site` or `node`.' targetID: type: string description: >- ID of the site or node that `scope` names. Ignored for `customer`, which always means the owning customer. timeRange: type: string description: >- Period the report covers: a relative range such as `4w-`, or one of `l7d`, `lw`, `lm`, `ly`, `mtd`, `ytd` or `snl`. reportFormat: type: string description: >- Output format: `pdf` or `csv`. Send one: with none, no file is produced. metadata: type: object description: Further report options, as string keys and values. additionalProperties: type: string unset: type: array description: >- Names of properties to clear. A property sent in the same body wins, so it is not cleared. items: type: string changeComment: type: string description: Note recorded in the change log with this change. ReportRunInput: type: object description: The report to run. required: [reportDefinitionID] properties: reportDefinitionID: type: string description: ID of the report definition to run. changeComment: type: string description: Note recorded in the change log with this change. CustomerInputSubmission: type: object description: >- A customer input. `category` is needed on update as well as on create. required: [category] properties: category: type: string description: Category name, from `/customer-inputs/categories`. data: type: object description: >- Values by key. Each key must be one of the category's `requiredValues` or `optionalValues`; other keys are a 400. Keys in `requiredValues` are not enforced. Only `s3file` values are checked: each must be the HTTPS URL of a key under `uploads/customer/portal/` in this customer's upload bucket. On update, `data` replaces the whole object. Use strings and numbers: an array or object is accepted here but can make a later update fail with a 502. unset: type: array description: >- Names of properties to clear. Only `data` can be cleared, and only when `data` is not also sent. items: type: string changeComment: type: string description: Note recorded in the change log with this change. CustomerInputCategoryValue: type: object description: A key that a category accepts in `data`. required: [key, description, type] properties: key: type: string description: Key to use in `data`. description: type: string description: Label for the value. type: type: string description: >- `string`, `date`, `dateRange`, `number`, `s3file`, `gps`, or `enum.string:` followed by the allowed values, separated by commas. Send a `date` as `YYYY-MM-DD`, a `dateRange` as `YYYY-MM-DD to YYYY-MM-DD` and a `gps` as `latitude, longitude`, all as strings. CustomerInputCategory: type: object description: A kind of customer input. required: [name, requiredValues, optionalValues] properties: name: type: string description: Category name, used as `category`. requiredValues: type: array nullable: true description: Keys the category expects. items: $ref: "#/components/schemas/CustomerInputCategoryValue" optionalValues: type: array nullable: true description: Further keys the category accepts. items: $ref: "#/components/schemas/CustomerInputCategoryValue" CustomerInputCategories: type: array description: Every supported category. items: $ref: "#/components/schemas/CustomerInputCategory" Error: type: object description: >- Body of every error response the API's Lambda returns. (API Gateway's own 403, 429, 502 and 504 errors are `{"message": ...}` instead.) The server inserts `message` without JSON escaping, so a message containing quotes makes the body invalid JSON; see the 401 response. required: [code, message] properties: code: type: integer description: The HTTP status code, repeated. message: type: string description: What went wrong. Created: type: object description: Body of a 201 from a create operation. required: [status] properties: status: type: string description: Always `ok`. id: type: string description: ID of the new item. Omitted by operations that do not assign one. AccessList: type: object description: The customers, sites and nodes the caller can see, and the caller's role at each site. required: [siteAccess] properties: siteAccess: type: array nullable: true description: One entry per customer the caller holds any grant under. items: $ref: "#/components/schemas/AccessCustomer" appRole: type: string description: '`debugger` for Agrology staff with debug access; omitted otherwise.' AccessCustomer: type: object description: A customer and the caller's sites under it. required: [customer, displayName, sites] properties: customer: type: string description: Customer ID. Older customers use a slug, newer ones a UUID. displayName: type: string description: Customer name for display. sites: type: object nullable: true description: The caller's sites under this customer, keyed by site ID. additionalProperties: $ref: "#/components/schemas/AccessSite" AccessSite: type: object description: One site the caller can access. required: [id, role] properties: id: type: string description: Site ID. displayName: type: string description: Site name for display. role: type: string description: The caller's role at this site, e.g. `viewer`, `editor` or `admin`. units: type: string description: The site's display units, `metric` or `imperial`. nodes: type: array description: The site's nodes. items: $ref: "#/components/schemas/AccessNode" AccessNode: type: object description: A node at a site. required: [id, displayName] properties: id: type: string description: Node ID (a UUID). displayName: type: string description: Node name for display. Device: type: object description: A device installed at a site. required: [id, reportTime] properties: id: type: string description: Device ID (EUI). reportTime: type: integer format: int64 description: Time of the device's last report, in epoch milliseconds. reportingStatus: type: string description: Reporting status from fleet monitoring. statusDetail: type: string description: Detail for the reporting status. node: type: string description: ID of the node the device belongs to. serial: type: string description: Manufacturer serial number. position: type: string description: Where on the node the device sits, e.g. `Soil Chamber`. deviceType: type: string description: Device type ID, as listed by /historical/ground-truth/device-types. Devices: type: array description: Devices at a site. items: $ref: "#/components/schemas/Device" UnitOption: type: object description: >- A display unit a client may convert a metric to. Conversion happens in the client; timeseries values stay in the metric's stored `units`. required: [id, label, factor] properties: id: type: string description: Stable unit identifier, e.g. `tCPerHaDay`. Safe to persist. label: type: string description: Display label, e.g. `t C/ha/day`. factor: type: number description: >- Multiplier from the stored unit. For raw values, mean, median, min and max: `display = stored * factor + offset`. For `stddevpop` and `stddevsamp`: `stored * factor`. For `varpop` and `varsamp`: `stored * factor^2`, and the label becomes the unit squared. For `geomean`: `stored * factor` when `offset` is 0. For `sum` and `runningTotal`: `stored * factor` when `offset` is 0 and `rateOnly` is not set. Where none of these applies, show the stored value with the metric's `units`. A `sum` or `runningTotal` of a per-day metric is a total for the period, so drop `/day` from the label. Choose the rule by the aggregation the server applied, not the `statistic` sent: without a usable `resolution`, values are raw unless `runningTotal` accumulated them. `runningTotal` never accumulates at `responseVersion` 2.0, on experiment and summary responses, or at 2.2 on weather and microclimate predictions and synthetics below calendar-month resolution. At 2.0, `resolution=2592000` gives raw values. An experiment column combines two aggregations: use the raw-value rule when both are mean, median, min or max (ignoring case), and otherwise show the stored value. offset: type: number description: Added after `factor`. Omitted when 0; only temperature uses it. rateOnly: type: boolean description: >- True for an option that is valid only for a rate, e.g. `umolCO2PerM2S`. Do not offer it when the applied aggregation is a sum or running total. Omitted when false. DefaultUnits: type: object description: The `UnitOption` to use by default in each unit system. required: [metric, imperial] properties: metric: type: string description: '`UnitOption` id to use when the effective unit system is metric.' imperial: type: string description: '`UnitOption` id to use when the effective unit system is imperial.' Metric: type: object description: A metric the API can return. required: [id] properties: id: type: string description: Metric ID, used in the `metrics` query parameter. displayName: type: string description: Metric name for display. units: type: string description: >- Label of the stored unit. Raw timeseries values are in this unit; `UnitOption.factor` lists the statistics that change it, such as variance and sum. category: type: string description: The group the metric appears under, e.g. `Climate`. sources: type: array description: Data sources whose `/metrics` endpoint lists this metric. items: type: string isPublic: type: boolean description: True if the metric is available in this API. isBeta: type: boolean description: True if the metric is in beta. minValue: type: number description: Lowest possible value, in `units`. maxValue: type: number description: Highest possible value, in `units`. unitOptions: type: array description: Display units a client may convert to. Absent when the metric is shown only in `units`. items: $ref: "#/components/schemas/UnitOption" defaultUnits: $ref: "#/components/schemas/DefaultUnits" MetricList: type: array description: >- Metrics listed for an endpoint. Use `/metrics` to look up units: some endpoints return metric IDs their own list omits. Pest and disease metrics are in no list. items: $ref: "#/components/schemas/Metric" WhoAmI: type: object description: Who the credential on this request belongs to. required: [email] properties: email: type: string description: The caller's email address, lower-cased. ApiKeyAccess: type: object description: >- Whether the caller has API key access. The body is `{}` without it. Only `email` is filled. properties: email: type: string description: The caller's email address. keyID: type: string description: Not filled by this API. createdBy: type: string description: Not filled by this API. createdAt: type: integer format: int64 description: Not filled by this API. ApiKeyRotation: type: object description: >- Result of rotating the caller's API key. Failures also come back as 200, with `status` `error` and a `detail`. required: [status] properties: status: type: string description: '`ok` or `error`.' newKey: type: string description: >- The new API key, to send as the `x-api-key` header. It is the base64 of `|` and is shown once. detail: type: string description: Why the rotation failed. Site: type: object description: >- A site and its monitoring state. Field names, including the snake_case ones, are as the API sends them. required: [id, report_time, hwMonitoringStatus, envMonitoringStatus, customer, siteClassification] properties: id: type: string description: Unique ID. displayName: type: string description: Name for display. aka: type: string description: Another name this record is known by. status: type: string description: Lifecycle status, e.g. `active` or `inactive`. notes: type: string description: Free-form notes. lastModified: type: integer format: int64 description: Time of the last change, in epoch seconds. lastModifiedBy: type: string description: Who made the last change. lat: type: number description: Latitude in decimal degrees. long: type: number description: Longitude in decimal degrees. polygon: type: string description: >- Boundary as text: `long,lat` pairs split by `;`, with `|` between polygons. elevation: type: integer description: Elevation in metres. report_time: type: integer format: int64 description: Time of the last report. report_time_hr: type: string description: '`report_time` in readable form.' reportingStatus: type: string description: Reporting status from fleet monitoring. statusDetail: type: string description: Detail for `reportingStatus`. ingest_time: type: integer format: int64 description: Time the last report was ingested. ingest_time_hr: type: string description: '`ingest_time` in readable form.' isAlarming: type: boolean description: True when monitoring has raised an alarm. lastMonitoredReport: type: integer format: int64 description: Time of the last report seen by monitoring. monitorNum: type: integer format: int64 description: Number passed between monitoring jobs. Not stored. monitorDec: type: number description: Decimal passed between monitoring jobs. Not stored. monitorStr: type: string description: Text passed between monitoring jobs. Not stored. hwMonitoringStatus: type: integer format: int64 description: Hardware monitoring state; 0 means monitoring is off. hwMonitoringDetail: type: integer format: int64 description: Detail code for `hwMonitoringStatus`. hwMonitoringDisableUntil: type: integer format: int64 description: Time hardware monitoring stays disabled until. envMonitoringStatus: type: integer format: int64 description: Environmental monitoring state; 0 means monitoring is off. opNote: type: string description: Operational note. customer: type: string description: ID of the customer that owns the site. customerName: type: string description: Not filled by this API. address1: type: string description: Address line 1. address2: type: string description: Address line 2. city: type: string description: City. state: type: string description: State or province. postalCode: type: string description: Postal code. country: type: string description: Country. contactName: type: string description: Site contact name. email: type: string description: Site contact email. phone: type: string description: Site contact phone. tz: type: string description: Time zone name, e.g. `America/Los_Angeles`. irrigationSummary: type: string description: Free-form irrigation schedule. sizeAcres: type: number description: Approximate size in acres. accessInfo: type: string description: Free-form notes on access to the site. siteClassification: type: string description: Label for the site, such as `Site`, `Facility` or `Lab`. grafanaEnabled: type: boolean description: True if the site can be viewed in Grafana. displayUnits: type: string description: Units of measurement at the site, `metric` or `imperial`. products: type: array description: Products active at the site. items: type: string Sites: type: array description: The sites the caller can access. items: $ref: "#/components/schemas/Site" Node: type: object description: A monitoring location within a site. required: [id, site, crops, lastForecastSync, lastWeatherSync] properties: id: type: string description: Unique ID. displayName: type: string description: Name for display. aka: type: string description: Another name this record is known by. status: type: string description: Lifecycle status, e.g. `active` or `inactive`. notes: type: string description: Free-form notes. lastModified: type: integer format: int64 description: Time of the last change, in epoch seconds. lastModifiedBy: type: string description: Who made the last change. lat: type: number description: Latitude in decimal degrees. long: type: number description: Longitude in decimal degrees. polygon: type: string description: >- Boundary as text: `long,lat` pairs split by `;`, with `|` between polygons. elevation: type: integer description: Elevation in metres. description: type: string description: Free-form description. site: type: string description: ID of the site this node belongs to. crops: type: array nullable: true description: Crops at this node. Can be null. items: type: string lastForecastSync: type: integer format: int64 description: Time of the last forecast sync, in epoch seconds. lastWeatherSync: type: integer format: int64 description: Time of the last weather sync, in epoch seconds. nwsOfficeID: type: string description: National Weather Service office ID. nwsGridX: type: integer description: National Weather Service grid X. nwsGridY: type: integer description: National Weather Service grid Y. nwsForecastZone: type: string description: National Weather Service forecast zone. nwsFireZone: type: string description: National Weather Service fire zone. soilType: type: string description: Soil type. soilDensity: type: number description: Soil density. activeSoilDepth: type: number description: Active soil depth. soilMoistureStdDev: type: number description: Standard deviation of soil moisture. soilMoistureMean: type: number description: Mean soil moisture. role: type: string description: Role of this node at the site. layout: type: string description: Layout of this node. chamberType: type: string description: Chamber type. ventType: type: string description: Vent type. openVentCount: type: integer description: Number of open vents. Nodes: type: array description: The nodes the caller can access. items: $ref: "#/components/schemas/Node" GeoJSONCollection: type: object description: >- A GeoJSON FeatureCollection with one feature per site and per node, plus Agrology URL templates. properties: key: type: string description: >- What the collection covers: a site ID, a customer ID, or `user-access-list`. description: type: string description: Name of what the collection covers. classification: type: string description: Customer classification. Only on customer collections. historicalURL: type: string description: >- `https://api.agrology.ag/v2/historical/ground-truth/{site}`. Fill in `{site}` with a site ID and add `/{timeRange}`, which the route requires. predictionsURL: type: string description: >- `https://api.agrology.ag/v2/predictions/{dataset}/{site}`. `{dataset}` is `weather`, `microclimate` or `pest-disease`, and `{site}` is a site ID. syntheticsURL: type: string description: >- `https://api.agrology.ag/v2/synthetics/{dataset}/{site}`. `{dataset}` is `microclimate` and `{site}` is a site ID. Add `/{timeRange}`, which the route requires. sites: type: array description: IDs of the sites in the collection. items: type: string type: type: string description: Always `FeatureCollection`. features: type: array description: One feature per site and per node. items: $ref: "#/components/schemas/GeoJSONFeature" GeoJSONFeature: type: object description: A GeoJSON feature for one site or node. required: [properties] properties: type: type: string description: Always `Feature`. properties: $ref: "#/components/schemas/GeoJSONProperties" geometry: $ref: "#/components/schemas/GeoJSONGeometry" GeoJSONProperties: type: object description: >- Properties of a feature. `elementType` says which kind it is: address, contact and unit fields appear on site features; `id`, devices and soil fields on node features. properties: elementType: type: string description: '`site` or `node`.' siteClassificaiton: type: string description: Label for the site. The name is a typo kept for compatibility. name: type: string description: Name for display. customer: type: string description: Customer ID. On site features only. deviceIDs: type: array description: Device IDs. Same data as `deviceIds`. items: type: string deviceIds: type: array description: Device IDs. items: type: string devices: type: object description: Device details, keyed by device ID. additionalProperties: $ref: "#/components/schemas/GeoJSONDeviceData" elevationMeters: type: integer description: Elevation in metres. site: type: string description: Site ID. role: type: string description: >- The caller's access role at the site, e.g. `viewer`. On site features only. products: type: array description: Products active at the site. items: type: string crops: type: array description: Crops at this node. items: type: string address1: type: string description: Address line 1. address2: type: string description: Address line 2. city: type: string description: City. state: type: string description: State or province. country: type: string description: Country. postalCode: type: string description: Postal code. contactName: type: string description: Site contact name. contactEmail: type: string description: Site contact email. contactPhone: type: string description: Site contact phone. displayUnits: type: string description: Units at the site, `metric` or `imperial`. latitude: type: number description: Latitude in decimal degrees. longitude: type: number description: Longitude in decimal degrees. acreage: type: number description: Size in acres. timezone: type: string description: Time zone name. id: type: string description: Node ID, on node features only. Site features use `site`. soilType: type: string description: Soil type. soilDensity: type: number description: Soil density. activeSoilDepty: type: number description: Active soil depth. The name is a typo kept for compatibility. soilMoistureStdDev: type: number description: Standard deviation of soil moisture. soilMoistureMean: type: number description: Mean soil moisture. GeoJSONDeviceData: type: object description: A device on a feature. properties: make: type: string description: Device manufacturer. model: type: string description: Device type ID. deviceType: type: string description: Device type ID. probeDepth: type: number description: Probe depth. needsMaintenance: type: boolean description: True when the device reports a status other than `ok`. maintenanceDetail: type: string description: Detail for `needsMaintenance`. lastMessage: type: integer format: int64 description: Time of the last message, in epoch milliseconds. lastPayload: type: string description: Last raw payload. isMonitored: type: boolean description: True unless monitoring is muted for this device. position: type: string description: Position of the device. GeoJSONGeometry: type: object description: >- GeoJSON geometry for a feature. Absent for a site with no boundary or a node with no latitude or longitude. properties: type: type: string description: '`Point`, `Polygon` or `MultiPolygon`.' coordinates: description: >- As in RFC 7946. A Point is `[long, lat]`. A Polygon is a list of rings, each a list of `[long, lat]` positions, so a site boundary is `[[[long, lat], ...]]`. A MultiPolygon is a list of Polygons. DeviceType: type: object description: A type of device and the metrics it reports. required: [id, description, metrics] properties: id: type: string description: >- Device type ID, used in the `deviceType` query parameter. Not unique: entries can share an ID and differ in `metrics`. description: type: string description: Name of the device type. metrics: type: array nullable: true description: Metrics this device type reports. Can be null. items: $ref: "#/components/schemas/Metric" DeviceTypes: type: array description: The device types. items: $ref: "#/components/schemas/DeviceType" ReportRun: type: object description: One execution of a report. required: [customerID, id, ts, reportDefinitionID, createdAt, createdBy, lastModified, lastModifiedBy] properties: customerID: type: string description: Customer that owns the run. id: type: string description: Report run ID. ts: type: integer format: int64 description: When the run was requested, in epoch seconds. status: type: string description: >- `new` until the generator finishes, then `success`. A run that failed can still show `success`, with or without `files`, and `files` can name a file that was never stored. A run whose definition is invalid stays `new`. reportDefinitionID: type: string description: Report definition this run belongs to. executionTimeMS: type: integer format: int64 description: How long the run took, in milliseconds. files: type: array description: >- Names of the generated files. Each is stored at `reports//`: pass that as `file` to `/fileserver/customer/{customerID}`. items: type: string results: type: object description: Run details, if any. createdAt: type: integer format: int64 description: When the report run was created, in epoch seconds. createdBy: type: string description: Who created the report run, usually an email address. lastModified: type: integer format: int64 description: When the report run last changed, in epoch seconds. lastModifiedBy: type: string description: Who last changed the report run, usually an email address. ReportRuns: type: array description: Report runs, newest first. items: $ref: "#/components/schemas/ReportRun" ReportDefinition: type: object description: What a report contains and when it runs. required: [id, customerID, description, reportType, entryType, recipients, scope, targetID, createdAt, createdBy, lastModified, lastModifiedBy] properties: id: type: string description: Report definition ID. customerID: type: string description: Customer that owns the report. description: type: string description: Report title. reportType: type: string description: Report type. Stored as sent. aggregateFiles: type: string description: 'Level each output file covers: `customer`, `site` or `node`.' aggregateCharts: type: string description: 'Level each chart covers: `customer`, `site` or `node`.' entryType: type: string description: 'How the report runs: `daily`, `weekly`, `monthly` or `manual`.' cadenceDayOfMonth: type: integer format: int64 description: >- Day of the month for a monthly report, or `99` for the last day, as the portal uses it. cadenceDayOfWeek: type: integer format: int64 description: >- Day of the week for a weekly report, as the portal numbers it: 1 is Monday and 7 is Sunday. cadenceHour: type: integer format: int64 description: Hour of the scheduled run. cadenceMinute: type: integer format: int64 description: Minute of the scheduled run. emailEnabled: type: integer description: '`1` to email the report to the recipients.' recipients: type: array nullable: true description: Email addresses that receive the report. items: type: string cc: type: array description: Addresses copied on the email. items: type: string bcc: type: array description: Addresses blind-copied on the email. items: type: string scope: type: string description: 'What the report covers: `customer`, `site` or `node`.' targetID: type: string description: >- ID of the site or node that `scope` names. Ignored for `customer`, which always means the owning customer. timeRange: type: string description: >- Period the report covers: a relative range such as `4w-`, or one of `l7d`, `lw`, `lm`, `ly`, `mtd`, `ytd` or `snl`. lastRan: type: integer format: int64 description: When the report last started, in epoch seconds. lastRanStatus: type: string description: Status of the latest run. lastRunID: type: string description: ID of the latest run. reportFormat: type: string description: >- Output format: `pdf` or `csv`. Send one: with none, no file is produced. metadata: type: object description: Further report options, as string keys and values. additionalProperties: type: string createdAt: type: integer format: int64 description: When the report definition was created, in epoch seconds. createdBy: type: string description: Who created the report definition, usually an email address. lastModified: type: integer format: int64 description: When the report definition last changed, in epoch seconds. lastModifiedBy: type: string description: Who last changed the report definition, usually an email address. ReportDefinitions: type: array description: Report definitions. items: $ref: "#/components/schemas/ReportDefinition" LibraryChart: type: object description: A chart in a customer's chart library. required: [id, customerID, definition, settings, createdAt, createdBy, lastModified, lastModifiedBy] properties: id: type: string description: Chart ID. customerID: type: string description: Customer that owns the chart. description: type: string description: Chart title. folder: type: string description: Folder the chart is filed under. definition: type: string description: >- The chart's query definition, a JSON document encoded as a string. settings: type: string description: Display settings, a JSON document encoded as a string. createdAt: type: integer format: int64 description: When the chart was created, in epoch seconds. createdBy: type: string description: Who created the chart, usually an email address. lastModified: type: integer format: int64 description: When the chart last changed, in epoch seconds. lastModifiedBy: type: string description: Who last changed the chart, usually an email address. LibraryCharts: type: array description: Library charts. items: $ref: "#/components/schemas/LibraryChart" FeedbackSubmission: type: object description: >- Feedback about an Agrology app. A missing or empty required field is a 400. required: [client, clientVersion, feedbackType, customer, remarks] properties: id: type: string description: Ignored. The server assigns the ID and returns it. ts: type: integer format: int64 description: Ignored. The server sets the time. submitter: type: string description: Ignored. The server uses the caller. customer: type: string description: ID of the customer selected in the client. client: type: string description: Name of the client sending the feedback, such as Agrology iOS. clientVersion: type: string description: Semantic version of the client. feedbackType: type: string description: >- Subject of the feedback, as free-form text. Any non-empty value is accepted. remarks: type: string description: The user's feedback, as free-form text. wantsFollowUp: type: boolean description: '`true` if the user wants to be contacted about this feedback.' isTestMessage: type: boolean description: >- `true` for a test submission that the customer success team can ignore. appLocation: type: string description: >- URI or description of where in the app the feedback form was opened. Experiment: type: object description: >- A science experiment. `startTime` and `endTime` are in milliseconds; other times here are in seconds. Fields left empty are omitted. required: [customerID, id, startTime, createdAt, createdBy, lastModified, lastModifiedBy] properties: customerID: type: string description: Customer that owns the experiment. id: type: string description: Experiment ID. description: type: string description: Experiment title. status: type: string description: >- `planned`, `ongoing` or `completed`. Not validated; use `unset` to clear it. Rollups run only for `ongoing`. Once `endTime` has passed, a rollup run can set `completed`. notes: type: string description: Free-form notes. startTime: type: integer format: int64 description: >- When the experiment starts, in epoch milliseconds. Rollups start here. endTime: type: integer format: int64 description: >- When the experiment ends, in epoch milliseconds. Omitted while it has no end. notice: type: string description: Temporary message to show the user about this experiment. noticeLevel: type: string description: Severity of `notice`, such as `info`, `warning` or `error`. noticeExpires: type: integer format: int64 description: When `notice` stops applying, in epoch seconds. nextOperation: type: string description: >- Next job for the rollup agent, such as `regenerate`. Rollups run only while the experiment is `ongoing`, and each run clears this, even one that finds nothing to roll up. positionFilter: type: string description: >- Display name of the one position to include, such as `Canopy` or `Soil Chamber`. It applies to ground-truth metrics only; synthetic metrics use every position. An unknown name is ignored. createdAt: type: integer format: int64 description: When the experiment was created, in epoch seconds. createdBy: type: string description: Who created the experiment, usually an email address. lastModified: type: integer format: int64 description: >- When the experiment last changed, in epoch seconds. Rollup runs change this too, as do metric changes and adding or removing members. lastModifiedBy: type: string description: >- Who last changed the experiment. This can be the rollup agent rather than a person. Experiments: type: array description: Experiments. items: $ref: "#/components/schemas/Experiment" ExperimentGroup: type: object description: >- A set of nodes within an experiment, such as the control or the trial. Fields left empty are omitted. required: [experimentID, id, groupType, createdAt, createdBy, lastModified, lastModifiedBy] properties: experimentID: type: string description: Experiment the group belongs to. id: type: string description: Group ID. description: type: string description: Group name. groupType: type: string description: >- Kind of group. The portal offers `control`, `trial` and `other`; any string is stored. notes: type: string description: Free-form notes. icon: type: string description: Icon to show for the group. color: type: string description: Color to show for the group. createdAt: type: integer format: int64 description: When the group was created, in epoch seconds. createdBy: type: string description: Who created the group, usually an email address. lastModified: type: integer format: int64 description: When the group last changed, in epoch seconds. lastModifiedBy: type: string description: Who last changed the group, usually an email address. ExperimentGroups: type: array description: Experiment groups. items: $ref: "#/components/schemas/ExperimentGroup" ExperimentMember: type: object description: A node in an experiment group. Empty optional fields are omitted. required: [groupID, nodeID, experimentID, createdAt, createdBy, lastModified, lastModifiedBy] properties: groupID: type: string description: Group the node is in. nodeID: type: string description: The node. experimentID: type: string description: >- Experiment whose node list includes this member, as last sent in a body. It can differ from the group's experiment, and is an empty string once `unset` removes it. color: type: string description: Color to show for the node. createdAt: type: integer format: int64 description: When the member was created, in epoch seconds. createdBy: type: string description: Who created the member, usually an email address. lastModified: type: integer format: int64 description: When the member last changed, in epoch seconds. lastModifiedBy: type: string description: Who last changed the member, usually an email address. ExperimentMembers: type: array description: Experiment members. items: $ref: "#/components/schemas/ExperimentMember" ExperimentMetric: type: object description: >- A metric rolled up for an experiment. It appears as a `metric|nodeAggregator|statistic` column in the experiment data, with `statistic` lowercased and empty parts as `mean`. Metrics that render the same column name at the same `resolution` share a column. required: [experimentID, id, metricID, statistic, resolution, createdAt, createdBy, lastModified, lastModifiedBy] properties: experimentID: type: string description: Experiment the metric belongs to. id: type: string description: Experiment metric ID. metricID: type: string description: >- ID of the metric to roll up. Needed on create: it is not enforced, and a missing or unknown ID gives no data. statistic: type: string description: >- How the values of the nodes in a group combine: `mean`, `sum`, `min`, `max`, `median`, `geomean`, `varsamp`, `stddevsamp`, `varpop`, `stddevpop`, `runningTotal` or `rawValue`. Case-sensitive. Empty means `mean`. `rawValue` takes one value instead of combining, so use it only for single-node groups. `runningTotal` sums the nodes and accumulates only within each rollup run: after a full rebuild it is a total from `startTime`, until the next scheduled run restarts the latest periods from zero. resolution: type: integer description: >- Rollup size in seconds: 1800, 3600, 14400, 21600, 43200, 86400, 259200, 604800 or 2592000. Needed on create: other values, including a missing one, are stored, but the data operations reject them. nodeAggregator: type: string description: >- How each node's samples in a rollup period combine, before `statistic`. It takes the same values as `statistic`, except that `runningTotal` is a plain sum here and `rawValue` keeps every sample. Empty means `mean`. createdAt: type: integer format: int64 description: When the experiment metric was created, in epoch seconds. createdBy: type: string description: Who created the experiment metric, usually an email address. lastModified: type: integer format: int64 description: When the experiment metric last changed, in epoch seconds. lastModifiedBy: type: string description: Who last changed the experiment metric, usually an email address. ExperimentMetrics: type: array description: Experiment metrics. items: $ref: "#/components/schemas/ExperimentMetric" Dashboard: type: object description: A saved dashboard. Fields left empty are omitted. required: [id, owner, feature, featureID, createdAt, createdBy, lastModified, lastModifiedBy] properties: id: type: string description: Dashboard ID. owner: type: string description: 'Dashboard owner: an email address or `customer.`.' feature: type: string description: Feature the dashboard belongs to. featureID: type: string description: ID of the item within that feature. description: type: string description: Dashboard title. notes: type: string description: Free-form notes. notice: type: string description: Temporary message to show the user about this dashboard. noticeLevel: type: string description: 'Severity of `notice`: `info`, `warning`, `error` or `success`.' status: type: string description: >- Dashboard status. `deleted` after a delete and `active` after a restore. order: type: integer description: >- Position of the dashboard in its collection (same owner and feature ID). dataField0: type: string description: >- The live dashboard content, a free-form string owned by the client. dataField1: type: string description: Rollback version 1, older as the number rises. dataField2: type: string description: Rollback version 2, older as the number rises. dataField3: type: string description: Rollback version 3, older as the number rises. dataField4: type: string description: Rollback version 4, older as the number rises. dataField5: type: string description: Rollback version 5, older as the number rises. dataField6: type: string description: Rollback version 6, older as the number rises. dataField7: type: string description: Rollback version 7, older as the number rises. dataField8: type: string description: Rollback version 8, older as the number rises. dataField9: type: string description: Rollback version 9, older as the number rises. createdAt: type: integer format: int64 description: When the dashboard was created, in epoch seconds. createdBy: type: string description: Who created the dashboard, usually an email address. lastModified: type: integer format: int64 description: When the dashboard last changed, in epoch seconds. lastModifiedBy: type: string description: Who last changed the dashboard, usually an email address. Dashboards: type: array description: Dashboards, including deleted ones until they expire. items: $ref: "#/components/schemas/Dashboard" CustomerInput: type: object description: A record of something the customer did or saw in the field. required: [customerID, id, category, data, createdAt, createdBy, lastModified, lastModifiedBy] properties: customerID: type: string description: Customer that owns the input. id: type: string description: Customer input ID. category: type: string description: Category name, from `/customer-inputs/categories`. data: type: object nullable: true description: Values by key. Null if none were sent. createdAt: type: integer format: int64 description: When the input was created, in epoch seconds. createdBy: type: string description: Who created the input, usually an email address. lastModified: type: integer format: int64 description: When the input last changed, in epoch seconds. lastModifiedBy: type: string description: Who last changed the input, usually an email address. CustomerInputs: type: array description: Customer inputs. items: $ref: "#/components/schemas/CustomerInput" PreSignedURLResponse: type: object description: >- A presigned S3 URL for one file. Presigned URLs are valid for 15 minutes. required: [url, file] properties: uploadUrl: type: string description: Presigned URL to PUT the file to. Upload only. url: type: string description: >- On download, the presigned URL to GET the file. On upload, the URL of the stored object without its signature, which is not a download link. file: type: string description: >- File name: the last part of the key. On upload this is the name you sent; the stored key, with its timestamp folder, is in `url`. CustomerFile: type: object description: >- A file shared with a customer, such as a photo or a PDF. Empty optional fields are omitted. required: [customerID, id, filename, folder, siteID, createdAt, createdBy, lastModified, lastModifiedBy] properties: customerID: type: string description: Customer the file belongs to. id: type: string description: File ID. description: type: string description: File title. filename: type: string description: File name. folder: type: string description: Folder the file is filed under. fileType: type: string description: Kind of file. status: type: string description: Processing status. This list returns only `success`. notes: type: string description: Free-form notes. siteID: type: string description: Site the file relates to. nodeID: type: string description: Node the file relates to. deviceID: type: string description: Device the file relates to. gatewayID: type: string description: Gateway the file relates to. s3url: type: string description: Where the file is stored. s3ThumbUrl: type: string description: Where its thumbnail is stored. gpsLatitude: type: number format: double description: Latitude recorded with the file. gpsLongitude: type: number format: double description: Longitude recorded with the file. gpsBearing: type: number format: double description: Compass bearing recorded with the file. gpsAltitude: type: integer description: Altitude recorded with the file. imageOrientation: type: integer description: Image orientation, from the image metadata. imageHeight: type: integer description: Image height in pixels. imageWidth: type: integer description: Image width in pixels. imageDPI: type: integer description: Image resolution in dots per inch. visibleToCustomer: type: integer description: >- `1` when the customer can see the file. Always `1` in this list. createdAt: type: integer format: int64 description: When the file was created, in epoch seconds. createdBy: type: string description: Who created the file, usually an email address. lastModified: type: integer format: int64 description: When the file last changed, in epoch seconds. lastModifiedBy: type: string description: Who last changed the file, usually an email address. CustomerFiles: type: array description: Files shared with the customer, ordered by ID. items: $ref: "#/components/schemas/CustomerFile" Timeseries: description: >- Timeseries response. The shape depends on `responseVersion`: 2.0, the default, nests nodes in an array; 2.1 and 2.2 key nodes, sites and devices by ID; 2.2, the latest, adds per-metric `metrics` info. With `disableRedirects=1`, a body over 5,000,000 bytes is a `RedirectBody` instead. anyOf: - $ref: "#/components/schemas/TimeseriesV20" - $ref: "#/components/schemas/TimeseriesV21" - $ref: "#/components/schemas/TimeseriesV22" - $ref: "#/components/schemas/RedirectBody" ExperimentData: description: >- Experiment data, always at response version 2.2. With `disableRedirects=1`, a body over 5,000,000 bytes is a `RedirectBody` instead. anyOf: - $ref: "#/components/schemas/TimeseriesV22" - $ref: "#/components/schemas/RedirectBody" TimeseriesV20: type: object description: >- Response version 2.0, the default. `request` is never sent at this version. `metric` is sent only by microclimate summaries, and `site` and `siteId` are absent on those. required: [status] properties: status: type: string description: '`ok` when the request succeeded.' detail: type: string description: Extra information about the response. Usually absent. warnings: type: array description: >- Problems met while building the response. The rest of the response still stands. items: type: string request: $ref: "#/components/schemas/RequestSummary" site: type: string description: Site display name. siteId: type: string description: Site ID. metric: $ref: "#/components/schemas/Metric" nodes: type: array description: >- One entry per node. Ground-truth rows with no known node are under a node with `id` `none`. items: $ref: "#/components/schemas/TimeseriesNodeV20" TimeseriesV21: type: object description: >- Response version 2.1. `request` is absent on microclimate summaries, which also are the only responses with `metric`. required: [status] properties: status: type: string description: '`ok` when the request succeeded.' detail: type: string description: Extra information about the response. Usually absent. warnings: type: array description: >- Problems met while building the response. The rest of the response still stands. items: type: string request: $ref: "#/components/schemas/RequestSummary" sites: type: object description: >- Sites in the response, by site ID. Absent on microclimate summaries. additionalProperties: $ref: "#/components/schemas/TimeseriesSiteInfo" devices: type: object description: >- Devices in the response, by device ID. Ground truth only. With `consolidateNodePositionMetrics=1` the keys are `-`, or `` for a device with no position. additionalProperties: $ref: "#/components/schemas/TimeseriesDeviceInfo" metric: $ref: "#/components/schemas/Metric" nodes: type: object description: >- Nodes by node ID. Except on historical weather, rows with no known node are under `none`, with `id` and `name` also `none` and no `siteId`. additionalProperties: $ref: "#/components/schemas/TimeseriesNodeV21" TimeseriesV22: type: object description: >- Response version 2.2, the latest, and the only version for experiment data. `request` here carries only `format`, `requestTime`, `source`, `timeRange`, `responseVersion` and `refID`, and is absent on microclimate summaries, which also are the only responses with `metric`. required: [status] properties: status: type: string description: '`ok` when the request succeeded.' detail: type: string description: Extra information about the response. Usually absent. warnings: type: array description: >- Problems met while building the response. The rest of the response still stands. items: type: string request: $ref: "#/components/schemas/RequestSummary" organization: type: string description: Customer ID. Sent only on experiment data. metrics: type: object description: >- Metrics in the response, by metric ID. Absent on microclimate summaries and pest and disease. additionalProperties: $ref: "#/components/schemas/MetricInfo" experiment: $ref: "#/components/schemas/TimeseriesExperiment" sites: type: object description: >- Sites in the response, by site ID. Absent on microclimate summaries. Also absent on experiment data. additionalProperties: $ref: "#/components/schemas/TimeseriesSiteInfo" devices: type: object description: >- Devices in the response, by device ID. Ground truth only. With `consolidateNodePositionMetrics=1` the keys are `-`, or `` for a device with no position. additionalProperties: $ref: "#/components/schemas/TimeseriesDeviceInfo" metric: $ref: "#/components/schemas/Metric" nodes: type: object description: >- Nodes by node ID. Except on historical weather, rows with no known node are under `none`, with `id` and `name` also `none` and no `siteId`. Absent on experiment data, which is under `experiment`. additionalProperties: $ref: "#/components/schemas/TimeseriesNodeV22" TimeseriesNodeV20: type: object description: One node at response version 2.0. properties: name: type: string description: Node display name. id: type: string description: Node ID. samples: type: array description: Samples for this node. items: anyOf: - $ref: "#/components/schemas/SampleV20" - $ref: "#/components/schemas/SummarySample" TimeseriesNodeV21: type: object description: One node at response version 2.1. properties: name: type: string description: Node display name. id: type: string description: Node ID. siteId: type: string description: ID of the site the node belongs to. samples: type: array description: Samples for this node. items: anyOf: - $ref: "#/components/schemas/SampleV21" - $ref: "#/components/schemas/SummarySample" TimeseriesNodeV22: type: object description: >- One node at response version 2.2. Weather and microclimate predictions and synthetics use `SampleV20`, except at calendar-month resolution. Microclimate summaries use `SummarySample`. Everything else uses `SampleV21`. properties: name: type: string description: Node display name. id: type: string description: Node ID. siteId: type: string description: ID of the site the node belongs to. samples: type: array description: Samples for this node. items: anyOf: - $ref: "#/components/schemas/SampleV20" - $ref: "#/components/schemas/SampleV21" - $ref: "#/components/schemas/SummarySample" SampleV20: type: object description: >- A flat sample: `ts`, optional `dev`, `position` and `deviceType`, and one number per metric ID. required: [ts] properties: ts: type: integer format: int64 description: Sample time, in epoch seconds. dev: type: string description: >- Device the sample came from (ground truth). With `consolidateNodePositionMetrics=1`, `-`, or absent for a device with no position. position: type: string description: Position name of the device (ground truth). deviceType: type: string description: Device type ID (ground truth). additionalProperties: description: A metric value, or a metadata string. anyOf: - type: number - type: string SampleV21: type: object description: A sample with its metrics under `d`. properties: dev: type: string description: >- Device the sample came from (ground truth). With `consolidateNodePositionMetrics=1`, `-`, or absent for a device with no position. deviceType: type: string description: Never sent. Device types are under `devices`. ts: type: integer format: int64 description: Sample time, in epoch seconds. d: type: object description: Metric values by metric ID. additionalProperties: type: number m: type: object description: Other metadata as strings. additionalProperties: type: string SummarySample: type: object description: >- One summary step. A value is `null` when it has no data. Units are those of the response `metric`. required: [ts, max, min, mean] properties: ts: type: integer format: int64 nullable: true description: Time of the step, in epoch seconds. max: type: number nullable: true description: Largest value in the step. min: type: number nullable: true description: Smallest value in the step. mean: type: number nullable: true description: Mean value in the step. RequestSummary: type: object description: What the server understood the request to be. properties: requestTime: type: integer format: int64 description: Time the request was received, in epoch seconds. source: type: string description: >- Data source: `historical/ground-truth`, `historical/weather`, `predictions/weather`, `predictions/microclimate`, `predictions/pest-disease`, `synthetics/microclimate` or `rollups/experiments`. customerID: type: string description: Customer ID from the path. siteId: type: string description: Site ID from the path. nodeId: type: string description: Node ID from the path. deviceId: type: string description: Device ID from the path. timeRange: type: string description: '`timeRange` as sent.' format: type: string description: '`json` or `csv`.' responseVersion: type: string description: Response version used. metrics: type: array description: Metric IDs requested. items: type: string refID: type: string description: '`refID` as sent.' TimeseriesSiteInfo: type: object description: A site in a timeseries response. properties: name: type: string description: Site display name. id: type: string description: Site ID. TimeseriesDeviceInfo: type: object description: A device, or a consolidated node position, in a timeseries response. properties: id: type: string description: >- Device ID, or `-` when consolidated. Absent for a consolidated device with no position. position: type: string description: Position name. deviceType: type: string description: Device type ID. MetricInfo: type: object description: >- A metric in a 2.2 response. Use `/metrics` for unit options; this has none. required: [id, name] properties: id: type: string description: Metric ID. name: type: string description: Display name on experiment data. Empty on other responses. description: type: string description: Metric description. units: type: string description: Units of the values. type: type: string description: '`number` or `string`. On experiment data, `string` or absent.' TimeseriesExperiment: type: object description: An experiment and its data. properties: id: type: string description: Experiment ID. description: type: string description: Experiment description. notes: type: string description: Experiment notes. groups: type: array description: Experiment groups with data. items: $ref: "#/components/schemas/TimeseriesGroup" TimeseriesGroup: type: object description: An experiment group. required: [id, description] properties: id: type: string description: Group ID. description: type: string description: Group description. groupType: type: string description: Group type. icon: type: string description: Icon name. color: type: string description: Display color. data: $ref: "#/components/schemas/TimeseriesGroupData" TimeseriesGroupData: type: object description: Rows of experiment data for one group. required: [start, end, resolution, metrics, statistics, columns, rows] properties: start: type: integer format: int64 description: Earliest row time, in epoch seconds. end: type: integer format: int64 description: Latest row time, in epoch seconds. resolution: type: integer format: int64 description: Row spacing in seconds. metrics: type: array nullable: true description: Metric IDs in `columns`. items: type: string nodeAggregators: type: array description: Node aggregators in `columns`. items: type: string statistics: type: array nullable: true description: Statistics in `columns`. items: type: string columns: type: array nullable: true description: >- `ts`, then one `metric|nodeAggregator|statistic` per value column. items: type: string rows: type: array nullable: true description: >- One array per row, in `columns` order: `ts` in epoch seconds, then a number or `null` for each value column. items: type: array items: nullable: true description: "`ts`, or a column value." RedirectBody: type: object description: Body of a redirected response. required: [code, message, location] properties: code: type: integer description: Always 302, even when `disableRedirects=1` makes the status 200. message: type: string description: Always `redirect`. location: type: string description: >- Presigned S3 URL of the full response body. It expires after 1 hour. securitySchemes: publicApiAuthorizer: type: http scheme: bearer bearerFormat: JWT apiKey: type: apiKey in: header name: x-api-key description: API key issued by Agrology. Rotate it with POST /apikey.