{"type":"api","title":"Create endpoint dynamic test","meta":{"id":"/apps/pubhub/media/000-v7-apis/eb73ef9d6f95b0e73b23b4642ac64f87b00a2845/fb944e6d-6400-3b77-a981-83f695a8f9f8","info":{"title":"Endpoint Tests API","version":"7.0.88","description":"Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API.\n"},"security":[{"BearerAuth":[]}],"tags":[{"name":"Endpoint Scheduled Tests"},{"name":"Agent to Server Endpoint Scheduled Tests"},{"name":"HTTP Server Endpoint Scheduled Tests"},{"name":"Agent To Server Endpoint Dynamic Tests"}],"externalDocs":{"description":"Find out more about Endpoint Agent Scheduled Tests","url":"https://docs.thousandeyes.com/product-documentation/end-user-monitoring/scheduled-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":["Agent To Server Endpoint Dynamic Tests"],"summary":"Create endpoint dynamic test","operationId":"createAgentToServerEndpointDynamicTest","description":"Create a new endpoint dynamic test in ThousandEyes using properties specified in the POST data.\nPlease note that only Account Admins have the authorization to create new tests; regular users are restricted from using POST-based methods.\n","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"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["testName","application"],"properties":{"agentSelectorType":{"type":"string","enum":["all-agents","specific-agents","agent-labels"],"description":"Retrieve either all available agents, a specific list of agents, or a list of agent labels.","default":"all-agents","example":"all-agents","$$ref":"#/components/schemas/EndpointTestAgentSelectorType"},"agents":{"type":"array","description":"List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`.","items":{"type":"string","format":"uuid"},"example":["0a3b9998-dc3a-4ff2-b50d-ac4a7cd986e1","66eec0f1-72b4-4755-aa83-3aed61d17f3c"],"$$ref":"#/components/schemas/EndpointTestAgents"},"endpointAgentLabels":{"type":"array","description":"List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`.","items":{"type":"string"},"example":["567","214"],"$$ref":"#/components/schemas/EndpointAgentLabels"},"isPrioritized":{"type":"boolean","description":"Indicates whether the test should be prioritized when the number of tests assigned to an agent exceeds the license limit.","default":false,"example":false,"$$ref":"#/components/schemas/TestIsPrioritized"},"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"},"maxMachines":{"type":"integer","description":"Maximum number of agents which can execute the test.","default":25,"example":25,"$$ref":"#/components/schemas/EndpointTestMaxMachines"},"application":{"type":"string","description":"Which supported application to monitor, can be one of `webex`, `zoom`, `microsoft-teams`.","example":"webex","$$ref":"#/components/schemas/DynamicTestApplication"},"protocol":{"type":"string","enum":["icmp","icmp-with-tcp-connect","tcp","prefer-tcp","ast-autodetect","autodetect"],"description":"Protocol requested for the test.","default":"icmp","example":"icmp","$$ref":"#/components/schemas/EndpointTestProtocol"},"tcpProbeMode":{"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"},"testName":{"type":"string","description":"Name of the test.","example":"Test name","$$ref":"#/components/schemas/TestName"},"hasPathTraceInSession":{"type":"boolean","description":"Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.","example":true,"$$ref":"#/components/schemas/TestHasPathTraceInSession"},"ipVersion":{"description":"For configuring network tests, the IP version of the test.","type":"string","enum":["V4_ONLY","V6_ONLY","V6_PREFER","OS_DEFAULT"],"example":"V4_ONLY","$$ref":"#/components/schemas/EndpointIpVersionIn"}},"$$ref":"#/components/schemas/DynamicTestRequest"}}}},"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":{"aid":{"type":"string","description":"A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.","example":"1234","$$ref":"#/components/schemas/AccountGroupId"},"_links":{"type":"object","description":"A list of links that can be accessed to get more information.","properties":{"self":{"description":"A hyperlink from the containing resource to a URI.","example":{"href":"https://api.thousandeyes.com/v7/dynamic-tests/agent-to-server/281474976710706"},"type":"object","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/DynamicTestSelfLink"},"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/endpoint/test-results/dynamic-tests/281474976710706/network/filter"},{"href":"https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/pathvis"}],"$$ref":"#/components/schemas/DynamicTestResults"}},"readOnly":true,"$$ref":"#/components/schemas/DynamicTestLinks"},"agentSelectorConfig":{"type":"object","description":"Agents selection object based on agentSelectorType.","readOnly":true,"oneOf":[{"type":"object","description":"Any agent selection object.","readOnly":true,"properties":{"agentSelectorType":{"example":"all-agents","pattern":"^all-agents$","type":"string"},"maxMachines":{"type":"integer","description":"Maximum number of agents which can execute the test.","default":25,"example":25,"$$ref":"#/components/schemas/EndpointTestMaxMachines"}},"required":["agentSelectorType"],"$$ref":"#/components/schemas/EndpointAllAgentsSelectorConfig"},{"type":"object","description":"Agent labels selection object.","readOnly":true,"properties":{"agentSelectorType":{"example":"agent-labels","pattern":"^agent-labels$","type":"string"},"maxMachines":{"type":"integer","description":"Maximum number of agents which can execute the test.","default":25,"example":25,"$$ref":"#/components/schemas/EndpointTestMaxMachines"},"endpointAgentLabels":{"type":"array","description":"List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`.","items":{"type":"string"},"example":["567","214"],"$$ref":"#/components/schemas/EndpointAgentLabels"}},"required":["agentSelectorType"],"$$ref":"#/components/schemas/EndpointAgentLabelsSelectorConfig"},{"type":"object","description":"Specific agents selection object.","readOnly":true,"properties":{"agentSelectorType":{"type":"string","pattern":"^specific-agents$","example":"specific-agents"},"maxMachines":{"type":"integer","description":"Maximum number of agents which can execute the test.","default":25,"example":25,"$$ref":"#/components/schemas/EndpointTestMaxMachines"},"agents":{"type":"array","description":"List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`.","items":{"type":"string","format":"uuid"},"example":["0a3b9998-dc3a-4ff2-b50d-ac4a7cd986e1","66eec0f1-72b4-4755-aa83-3aed61d17f3c"],"$$ref":"#/components/schemas/EndpointTestAgents"}},"required":["agentSelectorType"],"$$ref":"#/components/schemas/EndpointSpecificAgentsSelectorConfig"}],"discriminator":{"propertyName":"agentSelectorType","mapping":{"all-agents":"#/components/schemas/EndpointAllAgentsSelectorConfig","specific-agents":"#/components/schemas/EndpointSpecificAgentsSelectorConfig","agent-labels":"#/components/schemas/EndpointAgentLabelsSelectorConfig"}},"required":["agentSelectorType"],"$$ref":"#/components/schemas/EndpointAgentSelectorConfig"},"application":{"type":"string","description":"Which supported application to monitor, can be one of `webex`, `zoom`, `microsoft-teams`.","example":"webex","$$ref":"#/components/schemas/DynamicTestApplication"},"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"},"isPrioritized":{"type":"boolean","description":"Indicates whether the test should be prioritized when the number of tests assigned to an agent exceeds the license limit.","default":false,"example":false,"$$ref":"#/components/schemas/TestIsPrioritized"},"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"},"isEnabled":{"type":"boolean","description":"Indicates if test is enabled.","example":true,"default":true,"$$ref":"#/components/schemas/TestIsEnabled"},"hasPathTraceInSession":{"type":"boolean","description":"Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.","example":true,"$$ref":"#/components/schemas/TestHasPathTraceInSession"},"hasPing":{"type":"boolean","description":"Optional flag indicating if the test should run ping.","default":true,"$$ref":"#/components/schemas/TestHasPing"},"hasTraceroute":{"type":"boolean","description":"Optional flag indicating if the test should run traceroute.","default":true,"$$ref":"#/components/schemas/TestHasTraceRoute"},"modifiedDate":{"type":"string","format":"date-time","description":"UTC last modification date (ISO date-time format).","readOnly":true,"example":"2022-07-17T22:00:54Z"},"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"},"protocol":{"type":"string","enum":["icmp","icmp-with-tcp-connect","tcp","prefer-tcp","ast-autodetect","autodetect"],"description":"Protocol requested for the test.","default":"icmp","example":"icmp","$$ref":"#/components/schemas/EndpointTestProtocol"},"ipVersion":{"description":"For reading current network test configurations, the IP version of the test. Values include V4_ONLY, V6_ONLY, V6_PREFER, and OS_DEFAULT.","type":"string","example":"V4_ONLY","$$ref":"#/components/schemas/EndpointIpVersionOut"},"tcpProbeMode":{"type":"string","enum":["auto","sack","syn","syn-pcap","syn-socket","unknown"],"description":"Probe mode returned by network test APIs, only valid when the protocol is set to TCP. Configuration responses return user-selectable values, while result responses may also return resolved driver values.","default":"auto","example":"auto","$$ref":"#/components/schemas/TestProbeModeResponse"},"testId":{"type":"string","description":"Each test is assigned a unique ID; this is used to access test information and results from other endpoints.","readOnly":true,"example":"281474976710706"},"testName":{"type":"string","description":"Name of the test.","example":"Test name","$$ref":"#/components/schemas/TestName"},"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"}},"$$ref":"#/components/schemas/DynamicTest"}}}},"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":"createAgentToServerEndpointDynamicTest","security":[{"BearerAuth":[]}],"method":"post","path":"/endpoint/tests/dynamic-tests/agent-to-server"}}