Tomorrow.io Insights API

Define and manage reusable Insights — named rules combining Tomorrow.io data layers, operators, and thresholds — that power the Events and Alerts APIs.

OpenAPI Specification

tomorrow-io-insights-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Tomorrow.io Alerts Insights API
  version: '4.0'
  description: 'Create, manage, and trigger weather-based alerts. Alerts evaluate Tomorrow.io

    weather data layers against custom thresholds for one or more linked locations

    and deliver notifications via webhook, email, and the Tomorrow.io app.

    '
  contact:
    name: Tomorrow.io Support
    url: https://support.tomorrow.io
servers:
- url: https://api.tomorrow.io/v4
  description: Tomorrow.io Production
security:
- apikeyAuth: []
tags:
- name: Insights
  description: Manage custom weather insight definitions.
paths:
  /insights:
    get:
      tags:
      - Insights
      summary: List Insights
      operationId: listInsights
      parameters:
      - name: apikey
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Insight list.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsightList'
    post:
      tags:
      - Insights
      summary: Create an Insight
      operationId: createInsight
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Insight'
      parameters:
      - name: apikey
        in: query
        required: true
        schema:
          type: string
      responses:
        '201':
          description: Insight created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Insight'
  /insights/{insightId}:
    get:
      tags:
      - Insights
      summary: Retrieve an Insight
      operationId: getInsight
      parameters:
      - name: insightId
        in: path
        required: true
        schema:
          type: string
      - name: apikey
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Insight resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Insight'
    put:
      tags:
      - Insights
      summary: Update an Insight
      operationId: updateInsight
      parameters:
      - name: insightId
        in: path
        required: true
        schema:
          type: string
      - name: apikey
        in: query
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Insight'
      responses:
        '200':
          description: Updated insight.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Insight'
    delete:
      tags:
      - Insights
      summary: Delete an Insight
      operationId: deleteInsight
      parameters:
      - name: insightId
        in: path
        required: true
        schema:
          type: string
      - name: apikey
        in: query
        required: true
        schema:
          type: string
      responses:
        '204':
          description: Deleted.
components:
  schemas:
    InsightList:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Insight'
    Insight:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
        conditions:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
              operator:
                type: string
              value:
                type: number
        severity:
          type: string
          enum:
          - info
          - low
          - medium
          - high
          - severe
  securitySchemes:
    apikeyAuth:
      type: apiKey
      in: query
      name: apikey