{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/thousandeyes/json-schema/thousandeyes-tests-api-voice-test-request-schema.json",
  "title": "Tests_API_VoiceTestRequest",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/thousandeyes-voice-tests-api-openapi.yml#/components/schemas/Tests_API_VoiceTestRequest",
  "allOf": [
    {
      "$ref": "#/$defs/Tests_API_UnexpandedVoiceTest"
    },
    {
      "$ref": "#/$defs/Tests_API_TestRequest"
    },
    {
      "$ref": "#/$defs/Tests_API_MonitorsRequest"
    }
  ],
  "$defs": {
    "Tests_API_BaseRequest": {
      "type": "object",
      "properties": {
        "labels": {
          "type": "array",
          "description": "Contains list of test label IDs (get `labelId` from `/labels` endpoint)",
          "writeOnly": true,
          "readOnly": false,
          "items": {
            "type": "string"
          }
        },
        "tags": {
          "type": "array",
          "description": "Contains list of test tag IDs (get `id` from `/tags` endpoint).",
          "writeOnly": true,
          "readOnly": false,
          "items": {
            "type": "string"
          }
        },
        "sharedWithAccounts": {
          "type": "array",
          "description": "Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)",
          "writeOnly": true,
          "readOnly": false,
          "items": {
            "type": "string"
          }
        },
        "alertRules": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used)",
          "writeOnly": true,
          "readOnly": false
        }
      }
    },
    "Tests_API_Enabled": {
      "type": "boolean",
      "description": "Test is enabled.",
      "default": true
    },
    "Tests_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"
        }
      }
    },
    "Tests_API_MonitorsRequest": {
      "type": "object",
      "properties": {
        "monitors": {
          "type": "array",
          "description": "Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint)",
          "writeOnly": true,
          "readOnly": false,
          "items": {
            "type": "string"
          }
        }
      }
    },
    "Tests_API_TestAgentRequest": {
      "type": "object",
      "required": [
        "agentId"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "description": "The agent ID. Get `agentId` from `/agents` endpoint."
        },
        "sourceIpAddress": {
          "type": "string",
          "description": "The IP address from the `ipAddresses` field in agent details, used for interface selection. Get `ipAddresses` from the `/agents` endpoint."
        }
      }
    },
    "Tests_API_TestAgentsRequest": {
      "type": "array",
      "description": "Contains list of Agent IDs (get `agentId` from `/agents` endpoint).",
      "items": {
        "$ref": "#/$defs/Tests_API_TestAgentRequest"
      }
    },
    "Tests_API_TestBgpMeasurements": {
      "type": "boolean",
      "description": "Set to `true` to enable bgp measurements.",
      "default": true
    },
    "Tests_API_TestCreatedBy": {
      "type": "string",
      "description": "User that created the test.",
      "readOnly": true
    },
    "Tests_API_TestCreatedDate": {
      "type": "string",
      "format": "date-time",
      "description": "UTC created date (ISO date-time format).",
      "readOnly": true
    },
    "Tests_API_TestDscp": {
      "type": "string",
      "description": "DSCP label.",
      "readOnly": true
    },
    "Tests_API_TestDscpId": {
      "type": "string",
      "enum": [
        "0",
        "8",
        "16",
        "24",
        "32",
        "40",
        "48",
        "56",
        "10",
        "12",
        "14",
        "18",
        "20",
        "22",
        "26",
        "28",
        "30",
        "34",
        "36",
        "38",
        "46",
        "44"
      ],
      "description": "DSCP ID [to see list for acceptable values](https://docs.thousandeyes.com/product-documentation/tests/dscp-options-in-network-tests)",
      "default": "0"
    },
    "Tests_API_TestInterval": {
      "type": "integer",
      "enum": [
        60,
        120,
        300,
        600,
        900,
        1800,
        3600
      ],
      "description": "Interval between test runs in seconds.",
      "default": 60
    },
    "Tests_API_TestLinks": {
      "type": "object",
      "description": "A list of links that can be accessed to get more information",
      "properties": {
        "self": {
          "$ref": "#/$defs/Tests_API_TestSelfLink"
        },
        "testResults": {
          "$ref": "#/$defs/Tests_API_TestResults"
        }
      },
      "readOnly": true
    },
    "Tests_API_TestNumPathTraces": {
      "type": "integer",
      "minimum": 1,
      "maximum": 10,
      "description": "Number of path traces executed by the agent.",
      "default": 3
    },
    "Tests_API_TestRandomizedStartTime": {
      "type": "boolean",
      "description": "Indicates whether agents should randomize the start time in each test round.",
      "default": false
    },
    "Tests_API_TestRequest": {
      "allOf": [
        {
          "$ref": "#/$defs/Tests_API_BaseRequest"
        },
        {
          "type": "object",
          "properties": {
            "agents": {
              "$ref": "#/$defs/Tests_API_TestAgentsRequest"
            }
          }
        }
      ],
      "required": [
        "agents"
      ]
    },
    "Tests_API_TestResults": {
      "type": "array",
      "description": "Reference to the test results.",
      "items": {
        "$ref": "#/$defs/Tests_API_Link"
      }
    },
    "Tests_API_TestSelfLink": {
      "allOf": [
        {
          "$ref": "#/$defs/Tests_API_Link"
        },
        {
          "description": "Reference to the test."
        }
      ]
    },
    "Tests_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
    },
    "Tests_API_TestUsePublicBgp": {
      "type": "boolean",
      "description": "Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.",
      "default": true
    },
    "Tests_API_UnexpandedInstantTest": {
      "type": "object",
      "properties": {
        "createdBy": {
          "$ref": "#/$defs/Tests_API_TestCreatedBy"
        },
        "createdDate": {
          "$ref": "#/$defs/Tests_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/Tests_API_TestType"
        },
        "_links": {
          "$ref": "#/$defs/Tests_API_TestLinks"
        }
      }
    },
    "Tests_API_UnexpandedTest": {
      "type": "object",
      "properties": {
        "interval": {
          "$ref": "#/$defs/Tests_API_TestInterval"
        },
        "alertsEnabled": {
          "type": "boolean",
          "description": "Indicates if alerts are enabled."
        },
        "enabled": {
          "$ref": "#/$defs/Tests_API_Enabled"
        }
      }
    },
    "Tests_API_UnexpandedVoiceTest": {
      "allOf": [
        {
          "$ref": "#/$defs/Tests_API_UnexpandedTest"
        },
        {
          "$ref": "#/$defs/Tests_API_UnexpandedInstantTest"
        },
        {
          "$ref": "#/$defs/Tests_API_VoiceProperties"
        },
        {
          "type": "object",
          "required": [
            "interval"
          ],
          "properties": {
            "bgpMeasurements": {
              "$ref": "#/$defs/Tests_API_TestBgpMeasurements"
            },
            "usePublicBgp": {
              "$ref": "#/$defs/Tests_API_TestUsePublicBgp"
            }
          }
        }
      ]
    },
    "Tests_API_VoiceProperties": {
      "type": "object",
      "required": [
        "targetAgentId"
      ],
      "properties": {
        "codec": {
          "type": "string",
          "description": "Codec label",
          "readOnly": true
        },
        "codecId": {
          "type": "string",
          "description": "Codec identifier for the RTP stream. Valid values:\n\n* `0`: G.711 @ 64 Kbps\n* `1`: G.722.1 @ 24 Kbps (WB)\n* `2`: G.722.1 @ 32 Kbps (WB)\n* `3`: G.726 @ 32 Kbps\n* `4`: G.723.1 @ 6.4 Kbps\n* `5`: G.729a @ 8 Kbps\n* `6`: RTAudio @ 45 Kbps (WB)\n* `7`: RTAudio @ 27.8 Kbps\n* `8`: SILK @ 36 Kbps (WB)\n* `9`: G.722 @ 64 Kbps (WB)\n"
        },
        "dscp": {
          "$ref": "#/$defs/Tests_API_TestDscp"
        },
        "dscpId": {
          "$ref": "#/$defs/Tests_API_TestDscpId"
        },
        "duration": {
          "type": "integer",
          "minimum": 5,
          "maximum": 30,
          "description": "Duration of the test in seconds.",
          "default": 5
        },
        "jitterBuffer": {
          "type": "integer",
          "minimum": 0,
          "maximum": 150,
          "description": "De-jitter buffer size in seconds.",
          "default": 40
        },
        "numPathTraces": {
          "$ref": "#/$defs/Tests_API_TestNumPathTraces"
        },
        "port": {
          "type": "integer",
          "minimum": 1024,
          "maximum": 65535,
          "description": "Port number for the chosen protocol."
        },
        "randomizedStartTime": {
          "$ref": "#/$defs/Tests_API_TestRandomizedStartTime"
        },
        "targetAgentId": {
          "type": "string",
          "description": "Agent ID of the target agent for the test."
        },
        "type": {
          "type": "string",
          "readOnly": true
        }
      }
    }
  }
}