{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sig-ai/json-schema/sig-ai-sleep-ingest-schema.json",
  "title": "SleepIngest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sig-ai-sleep-api-openapi.yml#/components/schemas/SleepIngest",
  "properties": {
    "readings": {
      "items": {
        "$ref": "#/$defs/SleepReadingIn"
      },
      "type": "array",
      "title": "Readings"
    }
  },
  "type": "object",
  "required": [
    "readings"
  ],
  "$defs": {
    "SleepReadingIn": {
      "properties": {
        "date": {
          "type": "string",
          "format": "date",
          "title": "Date"
        },
        "sleep_score": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Sleep Score"
        },
        "hrv": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Hrv"
        },
        "deep_sleep_min": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Deep Sleep Min"
        },
        "rem_sleep_min": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Rem Sleep Min"
        },
        "total_min": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Total Min"
        },
        "source": {
          "type": "string",
          "title": "Source",
          "default": "manual"
        },
        "external_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "External Id"
        }
      },
      "type": "object",
      "required": [
        "date"
      ],
      "title": "SleepReadingIn"
    }
  }
}