{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-timestream/json-schema/amazon-timestream-write-records-request-schema.json",
  "title": "WriteRecordsRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-timestream-write-api-openapi.yml#/components/schemas/WriteRecordsRequest",
  "type": "object",
  "properties": {
    "DatabaseName": {
      "type": "string",
      "description": "The name of the Timestream database."
    },
    "TableName": {
      "type": "string",
      "description": "The name of the Timestream table."
    },
    "CommonAttributes": {
      "$ref": "#/$defs/Record"
    },
    "Records": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Record"
      },
      "description": "An array of records that contain the unique measure, dimension, time, and version attributes for each time-series data point."
    }
  },
  "required": [
    "DatabaseName",
    "TableName",
    "Records"
  ],
  "$defs": {
    "Dimension": {
      "type": "object",
      "properties": {
        "Name": {
          "type": "string",
          "description": "Dimension represents the metadata attributes of the time series. For example, the name and Availability Zone of an EC2 instance or the name of the manufacturer of a wind turbine are dimensions. For constraints on dimension names, see Naming Constraints."
        },
        "Value": {
          "type": "string",
          "description": "The value of the dimension."
        },
        "DimensionValueType": {
          "type": "string",
          "enum": [
            "VARCHAR"
          ],
          "description": "The data type of the dimension for the time-series data point."
        }
      },
      "required": [
        "Name",
        "Value"
      ]
    },
    "MeasureValue": {
      "type": "object",
      "properties": {
        "Name": {
          "type": "string",
          "description": "The name of the MeasureValue. For constraints on MeasureValue names, see Naming Constraints in the Amazon Timestream Developer Guide."
        },
        "Value": {
          "type": "string",
          "description": "The value for the MeasureValue. For information, see Data types."
        },
        "Type": {
          "type": "string",
          "enum": [
            "DOUBLE",
            "BIGINT",
            "VARCHAR",
            "BOOLEAN",
            "TIMESTAMP",
            "MULTI"
          ],
          "description": "Contains the data type of the MeasureValue for the time-series data point."
        }
      },
      "required": [
        "Name",
        "Value",
        "Type"
      ]
    },
    "Record": {
      "type": "object",
      "properties": {
        "Dimensions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Dimension"
          },
          "description": "Contains the list of dimensions for time-series data points."
        },
        "MeasureName": {
          "type": "string",
          "description": "Measure represents the data attribute of the time series. For example, the CPU utilization of an EC2 instance or the RPM of a wind turbine are measures."
        },
        "MeasureValue": {
          "type": "string",
          "description": "Contains the measure value for the time-series data point."
        },
        "MeasureValueType": {
          "type": "string",
          "enum": [
            "DOUBLE",
            "BIGINT",
            "VARCHAR",
            "BOOLEAN",
            "TIMESTAMP",
            "MULTI"
          ],
          "description": "Contains the data type of the measure value for the time-series data point. Default type is DOUBLE. For more information, see Data types."
        },
        "Time": {
          "type": "string",
          "description": "Contains the time at which the measure value for the data point was collected. The time value plus the unit provides the time elapsed since the epoch. For example, if the time value is 12345 and the unit is ms, then 12345 ms have elapsed since the epoch."
        },
        "TimeUnit": {
          "type": "string",
          "enum": [
            "MILLISECONDS",
            "SECONDS",
            "MICROSECONDS",
            "NANOSECONDS"
          ],
          "description": "The granularity of the timestamp unit. It indicates if the time value is in seconds, milliseconds, nanoseconds, or other supported values. Default is MILLISECONDS."
        },
        "Version": {
          "type": "integer",
          "description": "64-bit attribute used for record updates. Write requests for duplicate data with a higher version number will update the existing measure value and version. In cases where the measure value is the same, Version will still be updated. Default value is 1. Version must be 1 or greater, or you will receive a ValidationException error."
        },
        "MeasureValues": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/MeasureValue"
          },
          "description": "Contains the list of MeasureValue for time-series data points. This is only allowed for type MULTI. For scalar values, use MeasureValue attribute of the record directly."
        }
      }
    }
  }
}