{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/thousandeyes/json-schema/thousandeyes-test-results-api-network-test-results-schema.json",
  "title": "Test_Results_API_NetworkTestResults",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/thousandeyes-network-test-results-api-openapi.yml#/components/schemas/Test_Results_API_NetworkTestResults",
  "type": "object",
  "properties": {
    "results": {
      "x-paginated-items": true,
      "type": "array",
      "items": {
        "$ref": "#/$defs/Test_Results_API_NetworkTestResult"
      }
    },
    "test": {
      "$ref": "#/$defs/Test_Results_API_SimpleTest"
    },
    "startDate": {
      "$ref": "#/$defs/Test_Results_API_StartDate"
    },
    "endDate": {
      "$ref": "#/$defs/Test_Results_API_EndDate"
    },
    "_links": {
      "$ref": "#/$defs/Test_Results_API_PaginationLinks"
    }
  },
  "$defs": {
    "Test_Results_API_AppLinks": {
      "type": "object",
      "description": "A links object containing the ThousandEyes App link",
      "readOnly": true,
      "properties": {
        "appLink": {
          "$ref": "#/$defs/Test_Results_API_Link"
        }
      }
    },
    "Test_Results_API_Enabled": {
      "type": "boolean",
      "description": "Test is enabled.",
      "default": true
    },
    "Test_Results_API_EndDate": {
      "type": "string",
      "format": "date-time",
      "description": "(Optional) When passing `window` or `endDate` parameter,  the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved  (ISO date-time format).",
      "readOnly": true
    },
    "Test_Results_API_EndTime": {
      "type": "integer",
      "description": "Epoch time (seconds) indicating the end time of the round",
      "readOnly": true
    },
    "Test_Results_API_EpochTimeWindow": {
      "type": "object",
      "properties": {
        "startTime": {
          "$ref": "#/$defs/Test_Results_API_StartTime"
        },
        "endTime": {
          "$ref": "#/$defs/Test_Results_API_EndTime"
        }
      }
    },
    "Test_Results_API_Link": {
      "type": "object",
      "description": "A hyperlink from the containing resource to a URI.",
      "required": [
        "href"
      ],
      "properties": {
        "href": {
          "type": "string",
          "description": "Its value is either a URI [RFC3986] or a URI template [RFC6570]."
        },
        "templated": {
          "type": "boolean",
          "description": "Should be true when the link object's \"href\" property is a URI template."
        },
        "type": {
          "type": "string",
          "description": "Used as a hint to indicate the media type expected when dereferencing the target resource."
        },
        "deprecation": {
          "type": "string",
          "description": "Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation."
        },
        "name": {
          "type": "string",
          "description": "Its value may be used as a secondary key for selecting link objects that share the same relation type."
        },
        "profile": {
          "type": "string",
          "description": "A URI that hints about the profile of the target resource."
        },
        "title": {
          "type": "string",
          "description": "Intended for labelling the link with a human-readable identifier"
        },
        "hreflang": {
          "type": "string",
          "description": "Indicates the language of the target resource"
        }
      }
    },
    "Test_Results_API_NetworkTestResult": {
      "allOf": [
        {
          "type": "object",
          "properties": {
            "availableBandwidth": {
              "type": "number",
              "description": "The bandwidth from the client to the server measured in Mbps. This value is not available if bandwidth testing is disabled, if no value could be calculated, or if the target is a proxy.",
              "format": "double",
              "readOnly": true
            },
            "avgLatency": {
              "type": "number",
              "description": "Average RTT for packets sent to destination",
              "format": "double",
              "readOnly": true
            },
            "bandwidth": {
              "type": "number",
              "format": "double",
              "readOnly": true
            },
            "capacity": {
              "type": "number",
              "description": "The capacity from the client to the server measured in Mbps. This value is not available if bandwidth testing is disabled, if no value could be calculated, or if the target is a proxy.",
              "format": "double",
              "readOnly": true
            },
            "jitter": {
              "type": "number",
              "description": "Standard deviation of latency",
              "format": "double",
              "readOnly": true
            },
            "loss": {
              "type": "number",
              "description": "Percentage of packets not reaching the destination. This field is omitted when no loss measurement is available.",
              "format": "double",
              "readOnly": true
            },
            "maxLatency": {
              "type": "number",
              "description": "Maximum RTT for packets sent to destination",
              "format": "double",
              "readOnly": true
            },
            "minLatency": {
              "type": "number",
              "description": "Minimum RTT for packets sent to destination",
              "format": "double",
              "readOnly": true
            },
            "proxyLoss": {
              "type": "number",
              "description": "Percentage of packets not reaching proxy.",
              "format": "float",
              "readOnly": true
            },
            "proxyAverageLatency": {
              "type": "number",
              "description": "Average RTT for packets sent to proxy, in milliseconds.",
              "format": "float",
              "readOnly": true
            },
            "proxyMinLatency": {
              "type": "number",
              "description": "Minimum RTT for packets sent to proxy, in milliseconds.",
              "format": "float",
              "readOnly": true
            },
            "proxyMaxLatency": {
              "type": "number",
              "description": "Maximum RTT for packets sent to proxy, in milliseconds.",
              "format": "float",
              "readOnly": true
            },
            "proxyJitter": {
              "type": "number",
              "description": "Standard deviation of proxy latency, in milliseconds.",
              "format": "float",
              "readOnly": true
            },
            "packetsBySecond": {
              "type": "array",
              "description": "Number of packets sent and received in a second.",
              "items": {
                "type": "array",
                "items": {
                  "type": "integer"
                }
              },
              "readOnly": true
            },
            "agent": {
              "$ref": "#/$defs/Test_Results_API_TestResultAgent"
            },
            "date": {
              "type": "string",
              "description": "Data point date in UTC (ISO date-time format).",
              "format": "date-time",
              "readOnly": true
            },
            "roundId": {
              "type": "integer",
              "description": "Epoch time (seconds) indicating the start time of the round",
              "readOnly": true
            },
            "serverIp": {
              "type": "string",
              "description": "IP of target server",
              "readOnly": true
            },
            "server": {
              "type": "string",
              "description": "Target server, including port (if method used is TCP)",
              "readOnly": true
            },
            "healthScore": {
              "type": "number",
              "description": "A normalized value (0.0-1.0) representing the network connection health of the test target. Returns negative values as error codes. -1.0 indicates there was insufficient data to calculate the health score."
            },
            "direction": {
              "$ref": "#/$defs/Test_Results_API_TestDirection"
            },
            "errorDetails": {
              "allOf": [
                {
                  "$ref": "#/$defs/Test_Results_API_TestResultErrorDetails"
                }
              ],
              "description": "Error details. This field is omitted when no error occurs."
            }
          }
        },
        {
          "$ref": "#/$defs/Test_Results_API_TestResult"
        },
        {
          "$ref": "#/$defs/Test_Results_API_EpochTimeWindow"
        }
      ]
    },
    "Test_Results_API_PaginationLinks": {
      "type": "object",
      "description": "A links object containing pagination related link(s).",
      "properties": {
        "previous": {
          "$ref": "#/$defs/Test_Results_API_Link"
        },
        "next": {
          "$ref": "#/$defs/Test_Results_API_Link"
        },
        "self": {
          "$ref": "#/$defs/Test_Results_API_Link"
        }
      }
    },
    "Test_Results_API_SimpleTest": {
      "description": "Each test includes additional fields depending on its `type`. Refer `/tests/{type}` endpoint to know the set of fields returned by a given `type`.",
      "additionalProperties": true,
      "type": "object",
      "properties": {
        "interval": {
          "$ref": "#/$defs/Test_Results_API_TestInterval"
        },
        "alertsEnabled": {
          "type": "boolean",
          "description": "Indicates if alerts are enabled."
        },
        "enabled": {
          "$ref": "#/$defs/Test_Results_API_Enabled"
        },
        "createdBy": {
          "$ref": "#/$defs/Test_Results_API_TestCreatedBy"
        },
        "createdDate": {
          "$ref": "#/$defs/Test_Results_API_TestCreatedDate"
        },
        "description": {
          "type": "string",
          "description": "A description of the test."
        },
        "liveShare": {
          "type": "boolean",
          "description": "Indicates if the test is shared with the account group.",
          "readOnly": true
        },
        "modifiedBy": {
          "type": "string",
          "description": "User that modified the test.",
          "readOnly": true
        },
        "modifiedDate": {
          "type": "string",
          "format": "date-time",
          "description": "UTC last modification date (ISO date-time format).",
          "readOnly": true
        },
        "savedEvent": {
          "type": "boolean",
          "description": "Indicates if the test is a saved event.\n\n**Note**: **Saved Events** are now called **Private Snapshots** in the user interface. This change does not affect API.\n",
          "readOnly": true
        },
        "testId": {
          "type": "string",
          "description": "Each test is assigned an unique ID; this is used to access test information and results from other endpoints.",
          "readOnly": true
        },
        "testName": {
          "type": "string",
          "description": "The name of the test. Test name must be unique."
        },
        "type": {
          "$ref": "#/$defs/Test_Results_API_TestType"
        },
        "_links": {
          "$ref": "#/$defs/Test_Results_API_TestLinks"
        }
      }
    },
    "Test_Results_API_StartDate": {
      "type": "string",
      "format": "date-time",
      "description": "(Optional) When passing `window` or `startDate` parameter,  the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved  (ISO date-time format).",
      "readOnly": true
    },
    "Test_Results_API_StartTime": {
      "type": "integer",
      "description": "Epoch time (seconds) indicating the start time of the round",
      "readOnly": true
    },
    "Test_Results_API_TestCreatedBy": {
      "type": "string",
      "description": "User that created the test.",
      "readOnly": true
    },
    "Test_Results_API_TestCreatedDate": {
      "type": "string",
      "format": "date-time",
      "description": "UTC created date (ISO date-time format).",
      "readOnly": true
    },
    "Test_Results_API_TestDirection": {
      "type": "string",
      "enum": [
        "to-target",
        "from-target",
        "bidirectional"
      ],
      "description": "Direction of the test, which affects how results are shown.",
      "default": "to-target"
    },
    "Test_Results_API_TestInterval": {
      "type": "integer",
      "enum": [
        60,
        120,
        300,
        600,
        900,
        1800,
        3600
      ],
      "description": "Interval between test runs in seconds.",
      "default": 60
    },
    "Test_Results_API_TestLinks": {
      "type": "object",
      "description": "A list of links that can be accessed to get more information",
      "properties": {
        "self": {
          "$ref": "#/$defs/Test_Results_API_TestSelfLink"
        },
        "testResults": {
          "$ref": "#/$defs/Test_Results_API_TestResults"
        }
      },
      "readOnly": true
    },
    "Test_Results_API_TestResult": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "description": "Data point date UTC (ISO date-time format).",
          "format": "date-time",
          "readOnly": true
        },
        "roundId": {
          "type": "integer",
          "description": "Epoch time (seconds) indicating the start time of the round",
          "readOnly": true
        },
        "_links": {
          "$ref": "#/$defs/Test_Results_API_TestResultAppLinks"
        }
      }
    },
    "Test_Results_API_TestResultAgent": {
      "type": "object",
      "properties": {
        "agentId": {
          "type": "string",
          "description": "Unique agent ID",
          "readOnly": true
        },
        "agentName": {
          "type": "string",
          "description": "Agent name",
          "readOnly": true
        },
        "countryId": {
          "type": "string",
          "description": "2-digit ISO country code",
          "readOnly": true
        },
        "location": {
          "type": "string",
          "description": "Location of the agent.",
          "readOnly": true
        }
      }
    },
    "Test_Results_API_TestResultAppLinks": {
      "allOf": [
        {
          "$ref": "#/$defs/Test_Results_API_AppLinks"
        },
        {}
      ]
    },
    "Test_Results_API_TestResultErrorDetails": {
      "type": "string",
      "description": "Error details, if an error were encountered",
      "readOnly": true
    },
    "Test_Results_API_TestResults": {
      "type": "array",
      "description": "Reference to the test results.",
      "items": {
        "$ref": "#/$defs/Test_Results_API_Link"
      }
    },
    "Test_Results_API_TestSelfLink": {
      "allOf": [
        {
          "$ref": "#/$defs/Test_Results_API_Link"
        },
        {
          "description": "Reference to the test."
        }
      ]
    },
    "Test_Results_API_TestType": {
      "type": "string",
      "enum": [
        "api",
        "agent-to-agent",
        "agent-to-server",
        "bgp",
        "http-server",
        "page-load",
        "web-transactions",
        "ftp-server",
        "dns-trace",
        "dns-server",
        "dnssec",
        "sip-server",
        "voice"
      ],
      "description": "This is a read only value, as test type is implicit in the test creation url.",
      "readOnly": true
    }
  }
}