{"type":"api","title":"Create API test","meta":{"id":"/apps/pubhub/media/000-v7-apis/2dc5e5bc4da2f77137711dfa43b22ed976ed149e/78f45443-a63d-31b5-a066-5ca5d2bfbb18","info":{"version":"7.0.86","title":"Tests API","description":"**Note:** The Page Load Tests, API Tests, and Web Transaction Tests APIs are not available for ThousandEyes for Government instance.\n\nThis API allows you to list, create, edit, and delete Network and Application Synthetics tests.\n"},"security":[{"BearerAuth":[]}],"tags":[{"name":"Tests","description":"Get all tests"},{"name":"Agent to Server Tests","description":"Agent to Server test management operations"},{"name":"Agent to Agent Tests","description":"Agent to Agent test management operations"},{"name":"BGP Tests","description":"BGP test management operations"},{"name":"DNS Server Tests","description":"DNS Server test management operations"},{"name":"DNS Trace Tests","description":"DNS Trace test management operations"},{"name":"DNSSEC Tests","description":"DNSSEC test management operations"},{"name":"HTTP Server Tests","description":"HTTP Server test management operations"},{"name":"Page Load Tests","description":"Page Load test management operations"},{"name":"Web Transaction Tests","description":"Web Transactions test management operations"},{"name":"API Tests","description":"API test management operations"},{"name":"FTP Server Tests","description":"FTP Server test management operations"},{"name":"SIP Server Tests","description":"SIP Server test management operations"},{"name":"Voice Tests","description":"Voice test management operations"},{"name":"Path Visualization Interface Groups"}],"externalDocs":{"description":"Find out more about Network and Application Synthetics tests","url":"https://docs.thousandeyes.com/product-documentation/internet-and-wan-monitoring/tests#cloud-and-enterprise-agent-based-tests"},"openapi":"3.0.1","servers":[{"description":"ThousandEyes API production URL","url":"https://api.thousandeyes.com/v7"}],"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"Bearer authentication token"}}},"spec":{"tags":["API Tests"],"summary":"Create API test","operationId":"createApiTest","description":"Creates a new API test. This method requires Account Admin permissions.","parameters":[{"name":"aid","in":"query","description":"A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.","required":false,"schema":{"type":"string","example":"1234"},"$$ref":"#/components/parameters/AccountGroupId"},{"name":"expand","in":"query","description":"Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.","required":false,"style":"form","explode":false,"schema":{"type":"array","items":{"type":"string","enum":["agent","alert-rule","monitor","label","tag","shared-with-account"],"example":"agent","$$ref":"#/components/schemas/ExpandTestOptions"},"example":["agent","monitor"]},"$$ref":"#/components/parameters/ExpandTest"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"interval":{"type":"integer","enum":[60,120,300,600,900,1800,3600],"description":"Interval between test runs in seconds.","default":60,"example":60,"$$ref":"#/components/schemas/TestInterval"},"alertsEnabled":{"type":"boolean","description":"Indicates if alerts are enabled.","example":true},"enabled":{"type":"boolean","description":"Test is enabled.","example":true,"default":true,"$$ref":"#/components/schemas/Enabled"},"createdBy":{"type":"string","description":"User that created the test.","example":"user@user.com","readOnly":true,"$$ref":"#/components/schemas/TestCreatedBy"},"createdDate":{"type":"string","format":"date-time","description":"UTC created date (ISO date-time format).","example":"2022-07-17T22:00:54Z","readOnly":true,"$$ref":"#/components/schemas/TestCreatedDate"},"description":{"type":"string","description":"A description of the test.","example":"ThousandEyes Test"},"liveShare":{"type":"boolean","description":"Indicates if the test is shared with the account group.","example":false,"readOnly":true},"modifiedBy":{"type":"string","description":"User that modified the test.","example":"user@user.com","readOnly":true},"modifiedDate":{"type":"string","format":"date-time","description":"UTC last modification date (ISO date-time format).","readOnly":true,"example":"2022-07-17T22:00:54Z"},"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,"example":"281474976710706"},"testName":{"type":"string","description":"The name of the test. Test name must be unique.","example":"ThousandEyes Test"},"type":{"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,"example":"api","$$ref":"#/components/schemas/TestType"},"_links":{"type":"object","description":"A list of links that can be accessed to get more information","properties":{"self":{"type":"object","description":"Reference to the test.","required":["href"],"properties":{"href":{"type":"string","description":"Its value is either a URI [RFC3986] or a URI template [RFC6570].","example":"https://api.thousandeyes.com/v7/link/to/resource/id"},"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"}},"$$ref":"#/components/schemas/TestSelfLink","example":{"href":"https://api.thousandeyes.com/v7/tests/{type}/281474976710706"}},"testResults":{"type":"array","description":"Reference to the test results.","items":{"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].","example":"https://api.thousandeyes.com/v7/link/to/resource/id"},"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"}},"$$ref":"#/components/schemas/Link"},"example":[{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis"}],"$$ref":"#/components/schemas/TestResults"}},"readOnly":true,"$$ref":"#/components/schemas/TestLinks"},"clientCertificate":{"type":"string","description":"String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.","example":"-----BEGIN PRIVATE KEY-----\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\n-----END PRIVATE KEY-----\n-----BEGIN CERTIFICATE-----\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\n-----END CERTIFICATE-----\n","$$ref":"#/components/schemas/TestClientCertificate"},"clientCertDomainsAllowList":{"type":"string","example":"www.thousandeyes.com","description":"Comma separated list of domains to send the client certificate."},"collectProxyNetworkData":{"type":"boolean","description":"Indicates whether network data to the proxy should be collected.","default":false,"example":false,"$$ref":"#/components/schemas/TestCollectProxyNetworkData"},"distributedTracing":{"type":"boolean","description":"Adds distributed tracing headers to API requests using B3 and W3C standards.","example":false,"$$ref":"#/components/schemas/TestDistributedTracing"},"followRedirects":{"type":"boolean","description":"To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.","default":true,"example":true,"$$ref":"#/components/schemas/TestFollowRedirects"},"mtuMeasurements":{"type":"boolean","description":"Set `true` to measure MTU sizes on network from agents to the target.","example":false,"$$ref":"#/components/schemas/TestMtuMeasurements"},"networkMeasurements":{"type":"boolean","description":"Enable or disable network measurements. Set to true to enable or false to disable network measurements.","default":true,"example":true,"$$ref":"#/components/schemas/TestNetworkMeasurements"},"numPathTraces":{"type":"integer","minimum":1,"maximum":10,"description":"Number of path traces executed by the agent.","default":3,"example":3,"$$ref":"#/components/schemas/TestNumPathTraces"},"overrideAgentProxy":{"type":"boolean","description":"Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`.","default":false,"example":false,"$$ref":"#/components/schemas/TestOverrideAgentProxy"},"overrideProxyId":{"type":"string","description":"ID of the proxy to be used if the default proxy is overridden.","example":"281474976710706","$$ref":"#/components/schemas/TestOverrideProxyId"},"pathTraceMode":{"type":"string","enum":["classic","in-session"],"description":"Select `inSession` to perform the path trace within a TCP session.","default":"classic","example":"classic","$$ref":"#/components/schemas/TestPathTraceMode"},"predefinedVariables":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Variable name. Must be unique.","example":"myUsername"},"value":{"type":"string","description":"Variable value, will be treated as string.","example":"ThousandEyesAccountUserName"}},"$$ref":"#/components/schemas/ApiPredefinedVariable"}},"probeMode":{"type":"string","enum":["auto","sack","syn"],"description":"Probe mode used by network test, only valid when the protocol is set to TCP.","default":"auto","example":"auto","$$ref":"#/components/schemas/TestProbeMode"},"protocol":{"type":"string","enum":["tcp","icmp","udp"],"description":"Protocol used by dependent network tests (end-to-end, path trace, PMTUD).","default":"tcp","example":"tcp","$$ref":"#/components/schemas/TestProtocol"},"randomizedStartTime":{"type":"boolean","description":"Indicates whether agents should randomize the start time in each test round.","default":false,"example":false,"$$ref":"#/components/schemas/TestRandomizedStartTime"},"requests":{"type":"array","items":{"type":"object","required":["name","url"],"properties":{"assertions":{"type":"array","description":"List of assertion objects.","items":{"type":"object","properties":{"name":{"type":"string","enum":["status-code","response-body"],"description":"Set to `status-code` to assert the response status code. Set to `response-body` to assert data is present in the response body. Use `ApiRequestAssertion` to set the value for the assertion.","example":"status-code","$$ref":"#/components/schemas/ApiRequestAssertionName"},"operator":{"type":"string","enum":["is","is-not","includes","not-includes","matches","not-matches"],"description":"If `name = status-code``, accepted values are [is, is-not]. If `name = response-body``, accepted values are [includes, not-includes, matches, not-matches]`.","example":"is","$$ref":"#/components/schemas/ApiRequestAssertionOperator"},"value":{"type":"string","description":"The value of the assertion. If name = `status-code`, the status code to assert. If name = `response-body`, the lookup value to assert.","example":200}},"$$ref":"#/components/schemas/ApiRequestAssertion"}},"authType":{"type":"string","enum":["none","basic","bearer-token","oauth2"],"description":"Will override the Authorization request header.","default":"none","example":"none","$$ref":"#/components/schemas/ApiRequestAuthType"},"bearerToken":{"type":"string","writeOnly":true,"description":"The bearer token if `authType = bearer-token`.","example":"abcd-1234-..."},"body":{"type":"string","description":"POST/PUT request body. Must be in JSON format."},"clientAuthentication":{"type":"string","description":"The OAuth2 client authentication location type.","enum":["basic-auth-header","in-body"],"example":"basic-auth-header","$$ref":"#/components/schemas/ApiClientAuthentication"},"clientId":{"type":"string","description":"The application ID used when `authType` is set to \"oauth2\".","writeOnly":true,"example":"client-id"},"clientSecret":{"type":"string","description":"The private client secret used when `authType` is set to \"oauth2\".","writeOnly":true,"example":"client-secret"},"collectApiResponse":{"type":"boolean","description":"Set to `true` if API response body should be collected and saved. Set to `false` if API response body should not be saved.","default":true,"example":true},"headers":{"type":"array","description":"Array of API Request Header objects.","items":{"type":"object","properties":{"key":{"type":"string","description":"Request header key.","example":"x-custom-header"},"value":{"type":"string","description":"Request header value. Supports variables `{{variableName}}`.","example":"keep-alive"}},"$$ref":"#/components/schemas/ApiRequestHeader"}},"method":{"type":"string","description":"HTTP request method.","enum":["get","post","put","delete","patch"],"example":"get","$$ref":"#/components/schemas/ApiRequestMethod"},"name":{"type":"string","description":"API step name, must be unique.","example":"Step 1"},"password":{"type":"string","writeOnly":true,"description":"The password if `authType = basic`.","example":"basic_pw123"},"scope":{"type":"string","description":"Application-specific scope values for the access token when `authType` is \"oauth2\".","example":"read, write, deploy"},"tokenUrl":{"type":"string","description":"The endpoint used to request the access token when `authType` is \"oauth2\".","example":"https://id.cisco.com/oauth2/default/v1/token"},"url":{"type":"string","description":"Request url. Supports variables in the format `{{variableName}}`.","example":"https://api.thousandeyes.com/v7/status"},"username":{"type":"string","description":"The username if `authType = basic`.","example":"ThousandEyesUserName"},"variables":{"type":"array","description":"Array of API post request variable objects.","items":{"type":"object","properties":{"name":{"type":"string","description":"Variable name","example":"myTestName"},"value":{"type":"string","description":"The JSON path of data within the Response Body to assign to this variable.","example":"tests[0].name"}},"$$ref":"#/components/schemas/ApiRequestVariable"}},"verifyCertificate":{"type":"boolean","description":"Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.","default":false,"example":false,"$$ref":"#/components/schemas/TestVerifyCertificate"},"waitTimeMs":{"type":"integer","description":"Post request delay before executing the next API requests, in milliseconds.","example":0}},"$$ref":"#/components/schemas/ApiRequest"}},"sslVersionId":{"type":"string","description":"SSL version options:\n\n* Use '0' for automatic selection.\n* Use '3' for SSLv3.\n* Use '4' for TLS v1.0.\n* Use '5' for TLS v1.1.\n* Use '6' for TLS v1.2.\n* Use '7' for TLS v1.3.\n","enum":["0","3","4","5","6","7"],"default":"0","example":"0","$$ref":"#/components/schemas/TestSslVersionId"},"targetTime":{"type":"integer","description":"Target time for completion metric, defaults to 50% of time limit specified in seconds. (0 means default behavior)","minimum":0,"maximum":60,"example":1},"timeLimit":{"type":"integer","description":"Time limit for transaction in seconds. Exceeding this limit will result in a Timeout error.","minimum":5,"maximum":180,"default":30},"url":{"type":"string","description":"Target for the test.","example":"www.thousandeyes.com","$$ref":"#/components/schemas/TestUrl"},"bgpMeasurements":{"type":"boolean","description":"Set to `true` to enable bgp measurements.","default":true,"example":true,"$$ref":"#/components/schemas/TestBgpMeasurements"},"usePublicBgp":{"type":"boolean","description":"Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.","default":true,"example":true,"$$ref":"#/components/schemas/TestUsePublicBgp"},"labels":{"type":"array","description":"Contains list of test label IDs (get `labelId` from `/labels` endpoint)","writeOnly":true,"readOnly":false,"items":{"type":"string"},"example":["9842","1283"]},"tags":{"type":"array","description":"Contains list of test tag IDs (get `id` from `/tags` endpoint).","writeOnly":true,"readOnly":false,"items":{"type":"string"},"example":["c6b78e57-81a2-4c5f-a11a-d96c3c664d55","ec8e64fb-6f11-485c-a5d5-488098ad626a"]},"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"},"example":["1234","12345"]},"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,"example":["344753","212697"]},"agents":{"type":"array","description":"Contains list of Agent IDs (get `agentId` from `/agents` endpoint).","items":{"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."}},"example":{"agentId":"125","sourceIpAddress":"1.1.1.1"},"$$ref":"#/components/schemas/TestAgentRequest"},"$$ref":"#/components/schemas/TestAgentsRequest"},"monitors":{"type":"array","description":"Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint)","writeOnly":true,"readOnly":false,"items":{"type":"string"},"example":["17410","5"]},"credentials":{"type":"array","description":"Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint).","items":{"type":"string"},"example":["3247","1051"],"$$ref":"#/components/schemas/TestCredentials"}},"$$ref":"#/components/schemas/ApiTestRequest","required":["requests","url","interval","agents"]}}}},"responses":{"201":{"description":"Created","headers":{"Location":{"schema":{"type":"string","format":"uri","example":"https://api.thousandeyes.com/v7/link/to/resource/id"},"description":"The absolute path to created resource.","$$ref":"#/components/headers/Location"}},"content":{"application/hal+json":{"schema":{"type":"object","properties":{"interval":{"type":"integer","enum":[60,120,300,600,900,1800,3600],"description":"Interval between test runs in seconds.","default":60,"example":60,"$$ref":"#/components/schemas/TestInterval"},"alertsEnabled":{"type":"boolean","description":"Indicates if alerts are enabled.","example":true},"enabled":{"type":"boolean","description":"Test is enabled.","example":true,"default":true,"$$ref":"#/components/schemas/Enabled"},"alertRules":{"type":"array","description":"Contains list of enabled alert rule objects.","items":{"type":"object","properties":{"ruleId":{"type":"string","description":"Unique ID of the rule.","example":"127094","readOnly":true,"$$ref":"#/components/schemas/RuleId"},"ruleName":{"type":"string","description":"Name of the alert rule","example":"The End of the Internet","readOnly":true},"expression":{"type":"string","description":"String expression of alert rule","example":"((hops((hopDelay \u003e= 100 ms))))","readOnly":true},"direction":{"type":"string","enum":["to-target","from-target","bidirectional"],"description":"Direction for applicable alert types (eg. path trace, End-to-End (Agent) etc.)","example":"to-target","$$ref":"#/components/schemas/AlertDirection"},"isDefault":{"type":"boolean","description":"Alert rules allow up to 1 alert rule to be selected as a default for each type. By checking the default option, this alert rule will be automatically included on subsequently created tests that test a metric used in alerting here","example":true,"readOnly":true},"alertType":{"type":"string","description":"Type of alert being triggered. In multi-layered tests, this value represents the layer the alert relates to. See [Alert Details](https://developer.cisco.com/docs/thousandeyes/retrieve-alert-details/) documentation for a list of possible values","example":"http-server","enum":["page-load","http-server","end-to-end-server","end-to-end-agent","voice","dns-server","dns-trace","dnssec","bgp","path-trace","ftp","sip-server","transactions","web-transactions","agent","network-outage","application-outage","device-device","device-interface","endpoint-network-server","endpoint-http-server","endpoint-path-trace","endpoint-browser-sessions-agent","endpoint-browser-sessions-application","api","web-transaction","unknown"],"$$ref":"#/components/schemas/AlertType"},"minimumSources":{"type":"integer","description":"The minimum number of agents or monitors that must meet the specified criteria in order to trigger the alert","example":10,"readOnly":true},"minimumSourcesPct":{"type":"integer","description":"the minimum percentage of all assigned agents or monitors that must meet the specified criteria in order to trigger the alert","example":99,"readOnly":true},"roundsViolatingMode":{"type":"string","description":"`exact` requires the same agents to meet the threshold in consecutive rounds. `auto` is only enabled for CEA and Endpoint Scheduled test rules. The default is `any`.","enum":["exact","any","auto"],"example":"exact","readOnly":true,"$$ref":"#/components/schemas/AlertRoundsViolationMode"},"roundsViolatingOutOf":{"type":"integer","description":"Specifies the divisor (y value) for the “X of Y times” condition.","example":5,"readOnly":true},"roundsViolatingRequired":{"type":"integer","description":"Specifies the numerator (x value) for the “X of Y times” condition","example":2,"readOnly":true},"sensitivityLevel":{"type":"string","description":"Used when `roundsViolatingMode` is set to `auto`. The default is `medium`. Higher sensitivity increases the likelihood of triggering alerts.","enum":["high","medium","low"],"example":"medium","readOnly":true,"$$ref":"#/components/schemas/SensitivityLevel"},"severity":{"type":"string","description":"The severity of the alert.","enum":["info","major","minor","critical","unknown"],"example":"major","$$ref":"#/components/schemas/Severity"}},"$$ref":"#/components/schemas/AlertRule"}},"createdBy":{"type":"string","description":"User that created the test.","example":"user@user.com","readOnly":true,"$$ref":"#/components/schemas/TestCreatedBy"},"createdDate":{"type":"string","format":"date-time","description":"UTC created date (ISO date-time format).","example":"2022-07-17T22:00:54Z","readOnly":true,"$$ref":"#/components/schemas/TestCreatedDate"},"description":{"type":"string","description":"A description of the test.","example":"ThousandEyes Test"},"liveShare":{"type":"boolean","description":"Indicates if the test is shared with the account group.","example":false,"readOnly":true},"modifiedBy":{"type":"string","description":"User that modified the test.","example":"user@user.com","readOnly":true},"modifiedDate":{"type":"string","format":"date-time","description":"UTC last modification date (ISO date-time format).","readOnly":true,"example":"2022-07-17T22:00:54Z"},"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,"example":"281474976710706"},"testName":{"type":"string","description":"The name of the test. Test name must be unique.","example":"ThousandEyes Test"},"type":{"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,"example":"api","$$ref":"#/components/schemas/TestType"},"_links":{"type":"object","description":"A list of links that can be accessed to get more information","properties":{"self":{"type":"object","description":"Reference to the test.","required":["href"],"properties":{"href":{"type":"string","description":"Its value is either a URI [RFC3986] or a URI template [RFC6570].","example":"https://api.thousandeyes.com/v7/link/to/resource/id"},"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"}},"$$ref":"#/components/schemas/TestSelfLink","example":{"href":"https://api.thousandeyes.com/v7/tests/{type}/281474976710706"}},"testResults":{"type":"array","description":"Reference to the test results.","items":{"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].","example":"https://api.thousandeyes.com/v7/link/to/resource/id"},"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"}},"$$ref":"#/components/schemas/Link"},"example":[{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/network"},{"href":"https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis"}],"$$ref":"#/components/schemas/TestResults"}},"readOnly":true,"$$ref":"#/components/schemas/TestLinks"},"labels":{"type":"array","description":"Labels to which the test is assigned. This field is not returned for Instant Tests.","readOnly":true,"items":{"type":"object","properties":{"labelId":{"type":"string","description":"Label ID."},"name":{"type":"string","description":"Name of the label."},"isBuiltin":{"type":"boolean","description":"Value indicating if the label in question is BuiltIn (Account Admin, Organization Admin, Regular User)."}},"example":{"labelId":"961","name":"Artem label","isBuiltin":false},"$$ref":"#/components/schemas/TestLabel"},"$$ref":"#/components/schemas/TestLabels"},"sharedWithAccounts":{"type":"array","readOnly":true,"items":{"type":"object","properties":{"aid":{"type":"string","description":"Account group ID.","example":"1234"},"name":{"type":"string","description":"Account group name.","example":"Account name"}},"$$ref":"#/components/schemas/SharedWithAccount"},"$$ref":"#/components/schemas/TestSharedAccounts"},"clientCertificate":{"type":"string","description":"String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.","example":"-----BEGIN PRIVATE KEY-----\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\n-----END PRIVATE KEY-----\n-----BEGIN CERTIFICATE-----\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\n-----END CERTIFICATE-----\n","$$ref":"#/components/schemas/TestClientCertificate"},"clientCertDomainsAllowList":{"type":"string","example":"www.thousandeyes.com","description":"Comma separated list of domains to send the client certificate."},"collectProxyNetworkData":{"type":"boolean","description":"Indicates whether network data to the proxy should be collected.","default":false,"example":false,"$$ref":"#/components/schemas/TestCollectProxyNetworkData"},"distributedTracing":{"type":"boolean","description":"Adds distributed tracing headers to API requests using B3 and W3C standards.","example":false,"$$ref":"#/components/schemas/TestDistributedTracing"},"followRedirects":{"type":"boolean","description":"To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.","default":true,"example":true,"$$ref":"#/components/schemas/TestFollowRedirects"},"mtuMeasurements":{"type":"boolean","description":"Set `true` to measure MTU sizes on network from agents to the target.","example":false,"$$ref":"#/components/schemas/TestMtuMeasurements"},"networkMeasurements":{"type":"boolean","description":"Enable or disable network measurements. Set to true to enable or false to disable network measurements.","default":true,"example":true,"$$ref":"#/components/schemas/TestNetworkMeasurements"},"numPathTraces":{"type":"integer","minimum":1,"maximum":10,"description":"Number of path traces executed by the agent.","default":3,"example":3,"$$ref":"#/components/schemas/TestNumPathTraces"},"overrideAgentProxy":{"type":"boolean","description":"Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`.","default":false,"example":false,"$$ref":"#/components/schemas/TestOverrideAgentProxy"},"overrideProxyId":{"type":"string","description":"ID of the proxy to be used if the default proxy is overridden.","example":"281474976710706","$$ref":"#/components/schemas/TestOverrideProxyId"},"pathTraceMode":{"type":"string","enum":["classic","in-session"],"description":"Select `inSession` to perform the path trace within a TCP session.","default":"classic","example":"classic","$$ref":"#/components/schemas/TestPathTraceMode"},"predefinedVariables":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Variable name. Must be unique.","example":"myUsername"},"value":{"type":"string","description":"Variable value, will be treated as string.","example":"ThousandEyesAccountUserName"}},"$$ref":"#/components/schemas/ApiPredefinedVariable"}},"probeMode":{"type":"string","enum":["auto","sack","syn"],"description":"Probe mode used by network test, only valid when the protocol is set to TCP.","default":"auto","example":"auto","$$ref":"#/components/schemas/TestProbeMode"},"protocol":{"type":"string","enum":["tcp","icmp","udp"],"description":"Protocol used by dependent network tests (end-to-end, path trace, PMTUD).","default":"tcp","example":"tcp","$$ref":"#/components/schemas/TestProtocol"},"randomizedStartTime":{"type":"boolean","description":"Indicates whether agents should randomize the start time in each test round.","default":false,"example":false,"$$ref":"#/components/schemas/TestRandomizedStartTime"},"requests":{"type":"array","items":{"type":"object","required":["name","url"],"properties":{"assertions":{"type":"array","description":"List of assertion objects.","items":{"type":"object","properties":{"name":{"type":"string","enum":["status-code","response-body"],"description":"Set to `status-code` to assert the response status code. Set to `response-body` to assert data is present in the response body. Use `ApiRequestAssertion` to set the value for the assertion.","example":"status-code","$$ref":"#/components/schemas/ApiRequestAssertionName"},"operator":{"type":"string","enum":["is","is-not","includes","not-includes","matches","not-matches"],"description":"If `name = status-code``, accepted values are [is, is-not]. If `name = response-body``, accepted values are [includes, not-includes, matches, not-matches]`.","example":"is","$$ref":"#/components/schemas/ApiRequestAssertionOperator"},"value":{"type":"string","description":"The value of the assertion. If name = `status-code`, the status code to assert. If name = `response-body`, the lookup value to assert.","example":200}},"$$ref":"#/components/schemas/ApiRequestAssertion"}},"authType":{"type":"string","enum":["none","basic","bearer-token","oauth2"],"description":"Will override the Authorization request header.","default":"none","example":"none","$$ref":"#/components/schemas/ApiRequestAuthType"},"bearerToken":{"type":"string","writeOnly":true,"description":"The bearer token if `authType = bearer-token`.","example":"abcd-1234-..."},"body":{"type":"string","description":"POST/PUT request body. Must be in JSON format."},"clientAuthentication":{"type":"string","description":"The OAuth2 client authentication location type.","enum":["basic-auth-header","in-body"],"example":"basic-auth-header","$$ref":"#/components/schemas/ApiClientAuthentication"},"clientId":{"type":"string","description":"The application ID used when `authType` is set to \"oauth2\".","writeOnly":true,"example":"client-id"},"clientSecret":{"type":"string","description":"The private client secret used when `authType` is set to \"oauth2\".","writeOnly":true,"example":"client-secret"},"collectApiResponse":{"type":"boolean","description":"Set to `true` if API response body should be collected and saved. Set to `false` if API response body should not be saved.","default":true,"example":true},"headers":{"type":"array","description":"Array of API Request Header objects.","items":{"type":"object","properties":{"key":{"type":"string","description":"Request header key.","example":"x-custom-header"},"value":{"type":"string","description":"Request header value. Supports variables `{{variableName}}`.","example":"keep-alive"}},"$$ref":"#/components/schemas/ApiRequestHeader"}},"method":{"type":"string","description":"HTTP request method.","enum":["get","post","put","delete","patch"],"example":"get","$$ref":"#/components/schemas/ApiRequestMethod"},"name":{"type":"string","description":"API step name, must be unique.","example":"Step 1"},"password":{"type":"string","writeOnly":true,"description":"The password if `authType = basic`.","example":"basic_pw123"},"scope":{"type":"string","description":"Application-specific scope values for the access token when `authType` is \"oauth2\".","example":"read, write, deploy"},"tokenUrl":{"type":"string","description":"The endpoint used to request the access token when `authType` is \"oauth2\".","example":"https://id.cisco.com/oauth2/default/v1/token"},"url":{"type":"string","description":"Request url. Supports variables in the format `{{variableName}}`.","example":"https://api.thousandeyes.com/v7/status"},"username":{"type":"string","description":"The username if `authType = basic`.","example":"ThousandEyesUserName"},"variables":{"type":"array","description":"Array of API post request variable objects.","items":{"type":"object","properties":{"name":{"type":"string","description":"Variable name","example":"myTestName"},"value":{"type":"string","description":"The JSON path of data within the Response Body to assign to this variable.","example":"tests[0].name"}},"$$ref":"#/components/schemas/ApiRequestVariable"}},"verifyCertificate":{"type":"boolean","description":"Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.","default":false,"example":false,"$$ref":"#/components/schemas/TestVerifyCertificate"},"waitTimeMs":{"type":"integer","description":"Post request delay before executing the next API requests, in milliseconds.","example":0}},"$$ref":"#/components/schemas/ApiRequest"}},"sslVersionId":{"type":"string","description":"SSL version options:\n\n* Use '0' for automatic selection.\n* Use '3' for SSLv3.\n* Use '4' for TLS v1.0.\n* Use '5' for TLS v1.1.\n* Use '6' for TLS v1.2.\n* Use '7' for TLS v1.3.\n","enum":["0","3","4","5","6","7"],"default":"0","example":"0","$$ref":"#/components/schemas/TestSslVersionId"},"targetTime":{"type":"integer","description":"Target time for completion metric, defaults to 50% of time limit specified in seconds. (0 means default behavior)","minimum":0,"maximum":60,"example":1},"timeLimit":{"type":"integer","description":"Time limit for transaction in seconds. Exceeding this limit will result in a Timeout error.","minimum":5,"maximum":180,"default":30},"url":{"type":"string","description":"Target for the test.","example":"www.thousandeyes.com","$$ref":"#/components/schemas/TestUrl"},"credentials":{"type":"array","description":"Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint).","items":{"type":"string"},"example":["3247","1051"],"$$ref":"#/components/schemas/TestCredentials"},"bgpMeasurements":{"type":"boolean","description":"Set to `true` to enable bgp measurements.","default":true,"example":true,"$$ref":"#/components/schemas/TestBgpMeasurements"},"usePublicBgp":{"type":"boolean","description":"Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.","default":true,"example":true,"$$ref":"#/components/schemas/TestUsePublicBgp"},"monitors":{"type":"array","description":"Contains list of enabled BGP monitors.","readOnly":true,"items":{"type":"object","properties":{"countryId":{"type":"string","description":"Country ID","example":"GB","readOnly":true},"monitorId":{"type":"string","description":"BGP monitor ID","example":"1234","readOnly":true},"ipAddress":{"type":"string","description":"IP address of the BGP monitor","example":"4.69.184.193"},"network":{"type":"string","description":"Name of the autonomous system in which the monitor is found","example":"Level 3 Communications, Inc. (AS 3356)"},"monitorType":{"type":"string","description":"Type of monitor","enum":["public","private"],"example":"public","$$ref":"#/components/schemas/MonitorType"},"monitorName":{"type":"string","description":"Display name of the BGP monitor","example":"Seattle, WA"}},"$$ref":"#/components/schemas/Monitor"},"$$ref":"#/components/schemas/TestBgpMonitors"},"agents":{"type":"array","description":"Contains list of agents.","items":{"required":["agentType"],"properties":{"agentType":{"type":"string","description":"Type of the agent.","enum":["cloud","enterprise-cluster","enterprise"],"example":"enterprise-cluster","readOnly":true,"$$ref":"#/components/schemas/CloudEnterpriseAgentType"},"ipAddresses":{"type":"array","description":"Array of private IP addresses.","readOnly":true,"items":{"type":"string"},"example":["99.139.65.220","9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce"]},"publicIpAddresses":{"type":"array","description":"Array of public IP addresses.","readOnly":true,"items":{"type":"string"},"example":["192.168.1.78","f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c"]},"network":{"type":"string","description":"Network (including ASN) of agent’s public IP.","example":"AT&T Services, Inc. (AS 7018)","readOnly":true},"agentId":{"type":"string","description":"Unique ID of the agent.","example":"281474976710706","readOnly":true},"agentName":{"type":"string","description":"Name of the agent.","example":"thousandeyes-stg-va-254"},"location":{"type":"string","description":"Location of the agent.","example":"San Francisco Bay Area","readOnly":true},"countryId":{"type":"string","description":"2-digit ISO country code","example":"US","readOnly":true},"coordinates":{"type":"object","description":"Geographic coordinates for agent location.","properties":{"latitude":{"type":"number","format":"double","description":"The latitude of the agent location in decimal degrees","example":37.77493,"readOnly":true},"longitude":{"type":"number","format":"double","description":"The longitude of the agent location in decimal degrees","example":-122.41942,"readOnly":true}},"$$ref":"#/components/schemas/Coordinates"},"enabled":{"type":"boolean","description":"Flag indicating if the agent is enabled.","example":true},"verifySslCertificates":{"type":"boolean","description":"Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests.","example":true,"readOnly":true},"prefix":{"type":"string","description":"Prefix containing agents public IP address.","example":"99.128.0.0/11","readOnly":true}},"type":"object","$$ref":"#/components/schemas/AgentResponse"},"$$ref":"#/components/schemas/TestAgentsResponse"}},"$$ref":"#/components/schemas/ApiTestResponse","required":["requests","url","interval"]}}}},"400":{"description":"Bad Request","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\"."},"title":{"type":"string","description":"A short, human-readable summary of the problem type."},"status":{"type":"integer","description":"The HTTP status code generated by the origin server for this occurrence of the problem."},"detail":{"type":"string","description":"A human-readable explanation specific to this occurrence of the problem."},"instance":{"type":"string","description":"A URI reference that identifies the specific occurrence of the problem."},"errors":{"nullable":true,"type":"array","description":"(Optional) When multiple errors occur, the details for each error are listed.","items":{"type":"object","properties":{"code":{"type":"string","description":"(Optional) A unique error type/code that can be referenced in the documentation for further details."},"field":{"type":"string","description":"Identifies the field that triggered this particular error."},"message":{"type":"string","description":"A short, human-readable summary of the error."}},"$$ref":"#/components/schemas/ValidationErrorItem"}}},"$$ref":"#/components/schemas/ValidationError"},"example":{"type":"about:blank","title":"Request validation failed. There are invalid or missing fields","status":400,"detail":"Your request object contains invalid fields.","instance":"/v7","errors":[{"code":"AM-5432","field":"firstName","message":"firstName cannot have fancy characters"},{"code":"DASH-5622","field":"password","message":"Password cannot be blank"}]}}},"$$ref":"#/components/responses/400"},"401":{"description":"Unauthorized","content":{"application/problem+json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"invalid_token"},"error_description":{"type":"string","example":"Invalid access token"}},"$$ref":"#/components/schemas/UnauthorizedError"}}},"$$ref":"#/components/responses/401"},"403":{"description":"Insufficient permissions to query endpoint","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\"."},"title":{"type":"string","description":"A short, human-readable summary of the problem type."},"status":{"type":"integer","description":"The HTTP status code generated by the origin server for this occurrence of the problem."},"detail":{"type":"string","description":"A human-readable explanation specific to this occurrence of the problem."},"instance":{"type":"string","description":"A URI reference that identifies the specific occurrence of the problem."}},"$$ref":"#/components/schemas/Error"}}},"$$ref":"#/components/responses/403"},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\"."},"title":{"type":"string","description":"A short, human-readable summary of the problem type."},"status":{"type":"integer","description":"The HTTP status code generated by the origin server for this occurrence of the problem."},"detail":{"type":"string","description":"A human-readable explanation specific to this occurrence of the problem."},"instance":{"type":"string","description":"A URI reference that identifies the specific occurrence of the problem."}},"$$ref":"#/components/schemas/Error"},"example":{"type":"about:blank","title":"URI Resource Not Found","status":404,"detail":"Details explaining if the 404 error is related to an invalid URI or a wrong ID","instance":"/v7"}}},"$$ref":"#/components/responses/404"},"429":{"description":"Exhausted rate limit for the organization","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\"."},"title":{"type":"string","description":"A short, human-readable summary of the problem type."},"status":{"type":"integer","description":"The HTTP status code generated by the origin server for this occurrence of the problem."},"detail":{"type":"string","description":"A human-readable explanation specific to this occurrence of the problem."},"instance":{"type":"string","description":"A URI reference that identifies the specific occurrence of the problem."}},"$$ref":"#/components/schemas/Error"}}},"$$ref":"#/components/responses/429"},"500":{"description":"Internal server error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\"."},"title":{"type":"string","description":"A short, human-readable summary of the problem type."},"status":{"type":"integer","description":"The HTTP status code generated by the origin server for this occurrence of the problem."},"detail":{"type":"string","description":"A human-readable explanation specific to this occurrence of the problem."},"instance":{"type":"string","description":"A URI reference that identifies the specific occurrence of the problem."}},"$$ref":"#/components/schemas/Error"},"example":{"type":"about:blank","title":"Internal server error","status":500,"detail":"Optional detail about the internal error message.","instance":"/v7"}}},"$$ref":"#/components/responses/500"},"502":{"description":"Bad Gateway","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\"."},"title":{"type":"string","description":"A short, human-readable summary of the problem type."},"status":{"type":"integer","description":"The HTTP status code generated by the origin server for this occurrence of the problem."},"detail":{"type":"string","description":"A human-readable explanation specific to this occurrence of the problem."},"instance":{"type":"string","description":"A URI reference that identifies the specific occurrence of the problem."}},"$$ref":"#/components/schemas/Error"}}},"$$ref":"#/components/responses/502"},"default":{"description":"An error occurred","$$ref":"#/components/responses/GeneralError"}},"__originalOperationId":"createApiTest","security":[{"BearerAuth":[]}],"method":"post","path":"/tests/api"}}