Tomorrow.io · JSON Structure

Insight Create Request Structure

Payload to create or update an insight.

Type: object Properties: 6 Required: 2
WeatherClimateForecastHistorical WeatherAir QualityPollenFireFloodRoutesMap TilesAviationMaritimePublic APIs

InsightCreateRequest is a JSON Structure definition published by Tomorrow.io, describing 6 properties, of which 2 are required. It conforms to the https://json-structure.org/meta/core/v0/# meta-schema.

Properties

name description conditions logical timestep units

Meta-schema: https://json-structure.org/meta/core/v0/#

JSON Structure

Raw ↑
{
  "$schema": "https://json-structure.org/meta/core/v0/#",
  "$id": "https://raw.githubusercontent.com/api-evangelist/tomorrow/refs/heads/main/json-structure/insight-create-request-structure.json",
  "name": "InsightCreateRequest",
  "description": "Payload to create or update an insight.",
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object",
        "description": "A single condition that must hold for an insight to fire.",
        "properties": {
          "field": {
            "type": "string",
            "example": "windSpeed"
          },
          "operator": {
            "type": "string",
            "enum": [
              "eq",
              "neq",
              "gt",
              "gte",
              "lt",
              "lte"
            ],
            "example": "gt"
          },
          "value": {
            "type": "double",
            "example": 15
          }
        },
        "required": [
          "field",
          "operator",
          "value"
        ]
      }
    },
    "logical": {
      "type": "string",
      "enum": [
        "and",
        "or"
      ],
      "default": "and"
    },
    "timestep": {
      "type": "string",
      "example": "1h"
    },
    "units": {
      "type": "string",
      "enum": [
        "metric",
        "imperial"
      ]
    }
  },
  "required": [
    "name",
    "conditions"
  ]
}