---
sourceDocument: Yokohama API Reference
sourceDocumentLink: https://www.servicenow.com/docs/r/yokohama/api-reference

 Release :

    - yokohama

ft:locale :

    - en-US

ft:publication_title :

    - Yokohama API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# Service Test Management Open API

# Service Test Management Open API {#ariaid-title1}

* Release version: Yokohama
* 
* Updated January 30, 2025
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 83 minutes to read

The Service Test Management Open API provides endpoints to create and retrieve service test definitions and service tests.
Use this API to manage service problem management information between external systems and the ServiceNow AI Platform. The Service Test Management Open API is a ServiceNow implementation of the TM Forum Service Problem Management API REST specification. This implementation is based on <https://www.tmforum.org/resources/specification/tmf653-service-test-management-api-user-guide-v4-1-0/>.

This REST API is designed to manage and execute service tests within a telecommunications environment. It allows users to define, trigger, and monitor service tests, ensuring that services meet quality and performance standards. The
API provides capabilities for test management, including creating and updating test definitions, executing tests, retrieving test results, and managing test schedules.

The Service Test Management Open API requires the Customer Service Problem Management (com.sn_sprb_mgmt) plugin and the sn_sprb_mgmt.test_integrator role. This API belongs to the sn_sprb_mgmt namespace. For more
information about Service Problem Management. See [Customer Service Problem Management](https://www.servicenow.com/docs/access?context=cspm-landing-page&version=yokohama&pubname=yokohama-proactive-service-exp-workflows&ft:locale=en-US) for more information about this application.  
The Service Test Management Open API creates or updates data in the following tables:

* Test Run \[sn_st_mgmt_test\]
* Service Test definition \[sn_st_mgmt_test_definition\]
* Test Definition Characteristic \[sn_st_mgmt_test_definition_characteristic\]
* Test Characteristic \[sn_st_mgmt_test_characteristic\]
* Specification to Test Definition Relationship \[sn_st_mgmt_test_definition_m2m\]
* Test Definition Relationship \[sn_st_mgmt_test_definition_rel\]
* Test Measure \[sn_st_mgmt_test_measure\]
* Measure Consequence \[sn_st_mgmt_measure_consequence\]
* Test Measure Definition \[sn_st_mgmt_test_measure_definition\]
* Applied Consequence \[sn_st_mgmt_applied_consequence\]
* Threshold Rule \[sn_st_mgmt_threshold_rule\]
* Threshold Rule Violation \[sn_st_mgmt_threshold_rule_violation\]
{#service-test-management-api__ul_a4n_gcw_4bc}

## Service Test Management Open API -- GET /sn_sprb_mgmt/servicetestmanagement/serviceTest {#ariaid-title2}

Retrieves a list of all service tests.

### URL format

Default URL: /api/sn_sprb_mgmt/servicetestmanagement/serviceTest

### Supported request parameters

{#servicetestmgmt-GET-serviceTest__entry__2}

| Name | Description |
|-|-|
| None |   |
[Table 1. Path parameters]

{#servicetestmgmt-GET-serviceTest__entry__6}

| Name | Description |
|-|-|
| fields | List of fields to return in the response. Invalid fields are ignored. If this parameter isn't used, all fields are returned. Located in the Service Test \[sn_st_mgmt_test\] table. Valid fields: * characteristic * description * endDateTime * id * mode * relatedService * startDateTime * state * testMeasure * testSpecification * validFor {#servicetestmgmt-GET-serviceTest__ul_mtw_b3v_bcc} Data type: String |
| limit | Maximum number of records to return. For requests that exceed this number of records, use the offset parameter to paginate record retrieval. Data type: Number Maximum value: 100 Default: 20 |
| offset | Starting index at which to begin retrieving records. Use this parameter to paginate results in small and manageable chunks. The first record is indexed at 0. Data type: Number Default: 0 |
| state | Filter test definitions by the test's current state. Only test definitions in the specified state are returned in the response. Valid values: * acknowledged * canceled * completed * failed * inProgress * pending * rejected {#servicetestmgmt-GET-serviceTest__ul_vzj_npn_xbc} Data type: String |
[Table 2. Query parameters]

{#servicetestmgmt-GET-serviceTest__entry__16}

| Name | Description |
|-|-|
| None |   |
[Table 3. Request body parameters (XML or JSON)]

### Headers

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#servicetestmgmt-GET-serviceTest__entry__20}

| Header | Description |
|-|-|
| None |   |
[Table 4. Request headers]

{#servicetestmgmt-GET-serviceTest__entry__24}

| Header | Description |
|-|-|
| Content-Range | Specifies the range of content returned in a paginated call. For example, if `offset=2` and `limit=3`, the value of the Content-Range header is items `3-5`. |
| Content-Type | Data format of the response body. Only supports application/json. |
| Link | Contains the following links to navigate through query results. * first * last * next * previous {#servicetestmgmt-GET-serviceTest__ul_yy3_2fs_pbc} |
| X-Total-Count | For paginated queries, this header specifies the total number of records available on the server. |
[Table 5. Response headers]

### Status codes

The following status codes apply to this HTTP action. For a
list of possible status codes used in the REST API, see [REST API HTTP response
codes](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#servicetestmgmt-GET-serviceTest__entry__34}{#servicetestmgmt-GET-serviceTest__entry-200-status-code}{#servicetestmgmt-GET-serviceTest__entry-400-status-code}{#servicetestmgmt-GET-serviceTest__entry-404-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 206 | Partial resource returned in response (with pagination). |
| 400 | Bad Request. A bad request type or malformed request was detected. |
| 404 | Not found. The requested item wasn't found. |
[Table 6. Status codes]

{#servicetestmgmt-GET-serviceTest__table_ash_mhx_vbc__entry__2}

| Name | Description |
|-|-|
| characteristic | List that describes the characteristics of the associated service test. For more information about test definition characteristics, see Data type: Array of Objects "characteristic": [ { "id": "String", "name": "String", "value": "String", "valueType": "String" } ] |
| characteristic.id | Sys_id or external_id of characteristics. If external_id is present for that record, the response returns the external_id otherwise it returns the sys_id. Data type: String Table: Characteristics \[sn_prd_pm_characteristic\] |
| characteristic.name | Name of the characteristic. Data type: String |
| characteristic.value | Characteristic options associated with the service test. Characteristics vary based on the customer instance. Data type: String |
| characteristic.valueType | Type of characteristic value. * choice * date * date/time * duration * email * label * single line test * yes/no {#servicetestmgmt-GET-serviceTest__ul_zfr_twr_dcc} Data type: String |
| description | Description of the service test. Data type: String |
| endDateTime | End date and time of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| href | Hyperlink reference to the service test. Data type: String |
| id | Sys_id or external_id of the service test definition. Data type: String Table: Service Test \[sn_st_mgmt_test\] |
| mode | Mode that the service test is running in. Valid values: * ONDEMAND: Triggers the service test manually. * PROACTIVE: Triggers the service test automatically. {#servicetestmgmt-GET-serviceTest__ul_ybc_mqn_xbc} Data type: String Default: ONDEMAND |
| name | Required. Name of the service test. Data type: String |
| relatedService | Required. Test definition associated with the service test. Data type: Object "relatedService": { "href": "String", "id": "String", "name": "String" } |
| relatedService.id | Sys_id or external_id of the product inventory. Data type: String Table: In the sys_id or external_id field of the product Inventory \[sn_prd_invt_product_inventory\] table. |
| relatedService.name | Name of the product inventory. Data type: String |
| startDateTime | Start date and time of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| state | State the service test is in. Valid values: * acknowledged * canceled * completed * failed * inProgress * pending * rejected {#servicetestmgmt-GET-serviceTest__ul_gym_mqn_xbc} Data type: String |
| testMeasure | Measure of a specific aspect of a product, service, or resource test, such as lost packets or connectivity status. Data type: Array of Objects "testMeasure": [ { "accuracy": "String", "captureDateTime": "String", "captureMethod": "String", "id": "String", "metricDescription": "String", "metricName": "String", "ruleViolation": [Array], "unitOfMeasure": "String", "value": {Object} } ] |
| testMeasure.accuracy | Float decimal value representing the test measure accuracy captured for the associated metrics. Data type: Number Maximum value: 40 |
| testMeasure.captureDateTime | The date and time that the metric was captured. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| testMeasure.id | Sys_id or external_id of the Test Measures. Data type: String Table: In the sys_id or external_id fields of the Test Measures table \[sn_st_mgmt_test_measure\] table. |
| testMeasure.Measure.captureMethod | Method used to capture the metric. Valid values: * automatic: Automatically capture the metric. * manual: Manually capture the metric. * none: Don't capture the metric. {#servicetestmgmt-GET-serviceTest__ul_ed2_gxv_xbc} Data type: String |
| testMeasure.metricDescription | Brief description of the metric. Data type: String |
| testMeasure.metricName | Name of the test measure metric. Data type: String |
| testMeasure.ruleViolation | An object for defining a rule in the threshold rule definition, along with consequences if the rule is violated. Data type: Array of Objects "ruleViolation"[ { appliedConsequence: [Array], conformanceTargetUpper: Number, conformanceComparatorUpper: "String", description: "String", id: "String", name: "String", numberOfAllowedCrossing: Number, thresholdRuleSeverity: "String", tolerancePeriod: "String" } ] |
| testMeasure.ruleViolation.tolerancePeriod.amount | Number of periods before applying the consequence. Data type: Number |
| testMeasure.ruleViolation.appliedConsequence | Action (prescribed action or notification) to take when a threshold rule is crossed. Data type: Array of Objects "appliedConsequence": [ { "appliedAction": "String", "description": "String", "id": "String", "name": "String", "repeatAction": Boolean } ] |
| testMeasure.ruleViolation.appliedConsequence.appliedAction | Action to take when a threshold rule is violated. For example, sending a warning or generating a report. Applied actions can vary between instances. Data type: String |
| testMeasure.ruleViolation.appliedConsequence.description | Description of the applied consequence. Data type: String |
| testMeasure.ruleViolation.appliedConsequence.id | Sys_id or external_id of the applied consequence. Data type: String |
| testMeasure.ruleViolation.appliedConsequence.name | Name of the applied consequence. Data type: String |
| testMeasure.ruleViolation.appliedConsequence.repeatAction | Flag that indicates whether to repeat the consequence when a second violation occurs. Valid values: * true: Repeat the action. * false: Don't repeat the action. {#servicetestmgmt-GET-serviceTest__ul_ld2_gxv_xbc} Data type: Boolean Default: false |
| testMeasure.ruleViolation.conformanceComporatorExact | Flag that indicates whether a value is identical. Valid values: * true: The value is identical. * false: The value isn't identical. {#servicetestmgmt-GET-serviceTest__ul_od2_gxv_xbc} Data type: Boolean Default: false |
| testMeasure.ruleViolation.conformanceComporatorLower | Operator for checking if a value falls below the threshold. Valid values: * greater than * greater than or is {#servicetestmgmt-GET-serviceTest__ul_sd2_gxv_xbc} Data type: String |
| testMeasure.ruleViolation.conformanceComporatorUpper | Operator for checking if a value is above the threshold. Valid values: * less than * less than or is {#servicetestmgmt-GET-serviceTest__ul_vd2_gxv_xbc} Data type: String |
| testMeasure.ruleViolation.conformanceTargetExact | Required if conformanceComparatorExact is set to true. If the conformanceComparatorExact value is set to true, its value matches the value defined in conformanceTargetExact. Data type: Number |
| testMeasure.ruleViolation.conformanceTargetLower | Lower threshold value for comparing the test measure results. Determines if the threshold is crossed or no longer crossed. Data type: Number |
| testMeasure.ruleViolation.conformanceTargetUpper | Upper threshold value for comparing the test measure results. Determines if the threshold is crossed or no longer crossed. Data type: Number |
| testMeasure.ruleViolation.description | Description of the threshold rule. Data type: String |
| testMeasure.ruleViolation.id | Sys_id or external_id of the threshold rule violation. Data type: String Table: Threshold Rule Violation \[sn_st_mgmt_threshold_rule_violation\] |
| testMeasure.ruleViolation.name | Name of the threshold rule. Data type: String |
| testMeasure.ruleViolation.numberOfAllowedCrossing | Maximum crossings allowed within the tolerance period before consequences are applied. Data type: Number Maximum value: 40 |
| testMeasure.ruleViolation.thresholdRuleSeverity | Severity of the threshold rule. Valid values: * high * medium * low {#servicetestmgmt-GET-serviceTest__ul_xd2_gxv_xbc} Data type: String |
| testMeasure.ruleViolation.tolerancePeriod | Specified time interval during which crossing occurrences are enabled without triggering any immediate consequences or actions. Date type: Object "tolerancePeriod": { "amount": Number, "units": "String" } |
| testMeasure.ruleViolation.tolerancePeriod.units | Units of the period. Valid values: * days * hours * minutes * seconds {#servicetestmgmt-GET-serviceTest__ul_qbw_qds_dcc} Data type: String |
| testMeasure.unitOfMeasure | Unit of measurement for the conformance target values of the test measure. Data type: String |
| testMeasure.value | Value of the test measure. Data type: Object "value": { "id": "String", "name": "String", "valueType": "String", "value": "String } |
| testMeasure.value.id | ID of the test measure value. Data type: String |
| testMeasure.value.name | Name of the test measure value. Data type: String |
| testMeasure.value.value | Value of the test measure. Data type: String |
| testMeasure.value.valueType | Type of test measure value such as numeric, text, and so forth. Data type: String |
| testSpecification | Required. Test definition associated with this test. Data type: Object "testSpecification": { "href": "String", "id": "String" } |
| testSpecification.href | Hyperlink reference to the service test definition. Data type: String |
| testSpecification.id | Sys_id or external_id of the service test definition. Data type: String Table: In the sys_id or external_id field of the Service Test Definition \[sn_st_mgmt_test_definition\] table. |
| validFor | Date range the service test is valid for. Data type: Object "validFor": { "endDateTime ": "String", "startDateTime": "String" } |
| validFor.endDateTime | Validity end date of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| validFor.startDateTime | Validity start date of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
[Table 7. Response body parameters (XML or JSON)]

{#servicetestmgmt-GET-serviceTest__table_ash_mhx_vbc}  

### cURL request

The following example retrieves information about the two service tests in the instance.

    curl --location --request GET "https://instance.servicenow.com/api/sn_sprb_mgmt/servicetestmanagement/serviceTest" \
    --user 'username': 'password'

Response body.

    [
      {
        "href": "/api/sn_sprb_mgmt/servicetestmanagement/serviceTest/09d1f42e3be28210d140068aa4e45ae2",
        "id": "09d1f42e3be28210d140068aa4e45ae2",
        "description": "Service test",
        "endDateTime": "2025-01-31 15:05:43",
        "mode": "proactive",
        "name": "Speed Test TR0001002",
        "startDateTime": "2024-06-05 09:07:10",
        "validFor": {
          "startDateTime": "",
          "endDateTime": ""
        },
        "relatedService": {
          "id": "fa6d13f45b5620102dff5e92dc81c77f",
          "name": "Internet_VPLS_PI0000011"
        },
        "testSpecification": {
          "href": "/api/sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification/7d3854864316c6500e51203d5fb8f2d8",
          "id": "7d3854864316c6500e51203d5fb8f2d8"
        },
        "characteristic": [],
        "testMeasure": [
          {
            "id": "61d1382e3be28210d140068aa4e45a2e",
            "accuracy": "0.0001",
            "captureDateTime": "",
            "captureMethod": "automatic",
            "metricDescription": "",
            "metricName": "Flow speed",
            "unitOfMeasure": "A second",
            "value": "3000",
            "ruleViolation": [
              {
                "id": "61d1382e3be28210d140068aa4e45a2f",
                "description": "This speed is greater than the target",
                "name": "tooMuchTraffic",
                "numberOfAllowedCrossing": "0",
                "thresholdRuleSeverity": "high",
                "tolerancePeriod": "",
                "conformanceTargetLower": "2500",
                "conformanceComparatorLower": "greater than",
                "appliedConsequence": [
                  {
                    "id": "65d1382e3be28210d140068aa4e45a31",
                    "appliedAction": "sendWarning",
                    "description": "send a warning to the system",
                    "name": "sendWarning",
                    "repeatAction": "0"
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "href": "/api/sn_sprb_mgmt/servicetestmanagement/serviceTest/18682a2a3b2682107222bf9985e45a55",
        "id": "18682a2a3b2682107222bf9985e45a55",
        "description": "Service test",
        "endDateTime": "2025-01-31 15:05:43",
        "mode": "proactive",
        "name": "Speed Test TR0001012",
        "startDateTime": "2024-06-05 17:45:07",
        "validFor": {
          "startDateTime": "",
          "endDateTime": ""
        },
        "relatedService": {
          "id": "fa6d13f45b5620102dff5e92dc81c77f",
          "name": "Internet_VPLS_PI0000011"
        },
        "testSpecification": {
          "href": "/api/sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification/7d3854864316c6500e51203d5fb8f2d8",
          "id": "7d3854864316c6500e51203d5fb8f2d8"
        },
        "characteristic": [
          {
            "id": "5c682a2a3b2682107222bf9985e45a5a",
            "name": "url",
            "valueType": "single_line_text",
            "value": "http://abc.com"
          }
        ],
        "testMeasure": [
          {
            "id": "7c686a2a3b2682107222bf9985e45a4d",
            "accuracy": "0.0001",
            "captureDateTime": "",
            "captureMethod": "automatic",
            "metricDescription": "",
            "metricName": "Flow speed",
            "unitOfMeasure": "A second",
            "value": "3000",
            "ruleViolation": [
              {
                "id": "38686a2a3b2682107222bf9985e45a4e",
                "description": "This speed is greater than the target",
                "name": "tooMuchTraffic",
                "numberOfAllowedCrossing": "0",
                "thresholdRuleSeverity": "high",
                "tolerancePeriod": "",
                "conformanceTargetLower": "2500",
                "conformanceComparatorLower": "greater than",
                "appliedConsequence": [
                  {
                    "id": "34686a2a3b2682107222bf9985e45a50",
                    "appliedAction": "sendWarning",
                    "description": "send a warning to the system",
                    "name": "sendWarning",
                    "repeatAction": "0"
                  }
                ]
              }
            ]
          }
        ]
      }
    ]

## Service Test Management Open API -- GET /sn_sprb_mgmt/servicetestmanagement/serviceTest/{id} {#ariaid-title3}

Retrieves a service test entity based on the given ID of a service test.

### URL format

Default URL: /api/sn_sprb_mgmt/servicetestmanagement/serviceTest/{id}

### Supported request parameters

{#servicetestmgmt-GET-serviceTest-id__entry__2}

| Name | Description |
|-|-|
| id | Sys_id or external_id of the service test to retrieve. Data type: String Table: Service Test \[sn_st_mgmt_test\] |
[Table 8. Path parameters]

{#servicetestmgmt-GET-serviceTest-id__entry__6}

| Name | Description |
|-|-|
| fields | List of fields to return in the response. Invalid fields are ignored. If this parameter isn't used, all fields are returned. Located in the Service Test \[sn_st_mgmt_test\] table. Valid fields: * characteristic * description * endDateTime * id * mode * relatedService * startDateTime * state * testMeasure * testSpecification * validFor {#servicetestmgmt-GET-serviceTest-id__ul_mtw_b3v_bcc} Data type: String |
[Table 9. Query parameters]

{#servicetestmgmt-GET-serviceTest-id__entry__10}

| Name | Description |
|-|-|
| None |   |
[Table 10. Request body parameters (XML or JSON)]

### Headers

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#servicetestmgmt-GET-serviceTest-id__entry__14}

| Header | Description |
|-|-|
| None |   |
[Table 11. Request headers]

{#servicetestmgmt-GET-serviceTest-id__entry__18}

| Header | Description |
|-|-|
| Content-Type | Data format of the response body. Only supports application/json. |
[Table 12. Response headers]

### Status codes

The following status codes apply to this HTTP action. For a
list of possible status codes used in the REST API, see [REST API HTTP response
codes](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#servicetestmgmt-GET-serviceTest-id__entry__22}{#servicetestmgmt-GET-serviceTest-id__entry-200-status-code}{#servicetestmgmt-GET-serviceTest-id__entry-400-status-code}{#servicetestmgmt-GET-serviceTest-id__entry-404-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 400 | Bad Request. A bad request type or malformed request was detected. |
| 404 | Not found. The requested item wasn't found. |
[Table 13. Status codes]

### Response body parameters (JSON or XML) {#servicetestmgmt-GET-serviceTest-id__section_vkd_xwr_pbc}

{#servicetestmgmt-GET-serviceTest-id__section_vkd_xwr_pbc__entry__2}

| Name | Description |
|-|-|
| characteristic | List that describes the characteristics of the associated service test. Data type: Array of Objects "characteristic": [ { "id": "String", "name": "String", "value": "String", "valueType": "String" } ] |
| characteristic.id | Sys_id or external_id of characteristics.If external_id is present for that record, the response returns the external_id otherwise it returns the sys_id. Data type: String Table: Characteristics \[sn_prd_pm_characteristic\] |
| characteristic.name | Name of the characteristic. Data type: String |
| characteristic.value | Characteristic options associated with the service test. Characteristics vary based on the customer instance. Data type: String |
| characteristic.valueType | Type of characteristic value. * choice * date * date/time * duration * email * label * single line test * yes/no {#servicetestmgmt-GET-serviceTest-id__ul_egw_twr_dcc} Data type: String |
| description | Description of the service test. Data type: String |
| endDateTime | End date and time of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| href | Hyperlink reference to the service test. Data type: String |
| id | Sys_id or external_id of the service test definition. Data type: String Table: Service Test \[sn_st_mgmt_test\] |
| mode | Mode that the service test is running in. Valid values: * ONDEMAND: Triggers the service test manually. * PROACTIVE: Triggers the service test automatically. {#servicetestmgmt-GET-serviceTest-id__ul_itl_ksn_xbc} Data type: String Default: ONDEMAND |
| name | Name of the service test. Data type: String |
| relatedService | Test definition associated with this test. Data type: Object "relatedService": { "href": "String", "id": "String", "name": "String" } |
| relatedService.id | Sys_id or external_id of the product inventory. Data type: String Table: In the sys_id or external_id field of the Product Inventory \[sn_prd_invt_product_inventory\] table. |
| relatedService.name | Name of the product inventory item. Data type: String |
| startDateTime | Start date and time of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| state | State of the service test. Valid values: * acknowledged * canceled * completed * failed * inProgress * pending * rejected {#servicetestmgmt-GET-serviceTest-id__ul_prs_txv_xbc} Data type: String |
| testMeasure | Measure of a specific aspect of a product, service, or resource test, such as lost packets or connectivity status. Data type: Array of Objects "testMeasureDefinition": [ { "accuracy": "String", "captureDateTime": "String", "captureMethod": "String", "id": "String", "metricDescription": "String", "metricName": "String", "ruleViolation": [Array] "unitOfMeasure": "String", "value": {Object} } ] |
| testMeasure.accuracy | Float decimal value representing the test measure accuracy captured for the associated metrics. Data type: Number Maximum value: 40 |
| testMeasure.captureDateTime | The date and time that the metric was captured. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| testMeasure.captureMethod | Method used to capture the metric. Valid values: * automatic: Automatically capture the metric. * manual: Manually capture the metric. * none: Don't capture the metric. {#servicetestmgmt-GET-serviceTest-id__ul_zrs_txv_xbc} Data type: String |
| testMeasure.id | Sys_id or external_id of the test measure. Data type: String Table: Test Measures \[sn_st_mgmt_test_measure\] |
| testMeasure.metricDescription | Brief description of the metric. Data type: String |
| testMeasure.metricName | Name of a metric in the test measure. Data type: String |
| testMeasure.ruleViolation | Object for defining a rule in the threshold rule definition, along with consequences if the rule is violated. Data type: Array of Objects "RuleViolation": [ { "appliedConsequence": [Array], "conformanceComparatorExact": Boolean, "conformanceComparatorLower": "String", "conformanceComparatorUpper": "String", "conformanceTargetExact": "String", "conformanceTargetLower": "String", "conformanceTargetUpper": "String", "description": "String", "id": "String", "name": "String", "numberOfAllowedCrossing": Number, "thresholdRuleSeverity": "String", "tolerancePeriod": {Object} } ] |
| testMeasure.ruleViolation.appliedConsequence | Action (prescribed action or notification) to take when a threshold rule is violated. Data type: Array of Objects "appliedConsequence": [ { "appliedAction": "String", "description": "String", "id": "String", "name": "String", "repeatAction": Boolean } ] |
| testMeasure.ruleViolation.appliedConsequence.appliedAction | Action to take when a threshold rule is violated. For example, sending a warning or generating a report. Applied actions can vary between instances. Data type: String |
| testMeasure.ruleViolation.appliedConsequence.appliedAction.repeatAction | Flag that indicates whether to repeat the applied action or not. Valid values: * true: Repeats the action. * false: Doesn't repeat the action. {#servicetestmgmt-GET-serviceTest-id__ul_kss_txv_xbc} Data type: Boolean Default: false |
| testMeasure.ruleViolation.appliedConsequence.description | Description of the applied consequence. Data type: String |
| testMeasure.ruleViolation.appliedConsequence.id | Sys_id or external_id of the applied consequence. Data type: String |
| testMeasure.ruleViolation.appliedConsequence.name | Name of the applied consequence. Data type: String |
| testMeasure.ruleViolation.conformanceComparatorExact | Flag that indicates whether a value is identical to the value of conformanceTargetExact. Valid values: * true: The value is identical. * false: The value isn't identical. {#servicetestmgmt-GET-serviceTest-id__ul_uss_txv_xbc} Data type: Boolean Default: false |
| testMeasure.ruleViolation.conformanceComparatorLower | An operator that checks if a value falls below the threshold. Valid values: * greater than * is {#servicetestmgmt-GET-serviceTest-id__ul_fts_txv_xbc} Data type: String |
| testMeasure.ruleViolation.conformanceComparatorUpper | An operator that checks if a value exceeds the threshold. Valid values: * is * lesser than {#servicetestmgmt-GET-serviceTest-id__ul_mts_txv_xbc} Data type: String |
| testMeasure.ruleViolation.conformanceTargetExact | Required if conformanceComparatorExact is set to true. If the conformanceComparatorExact value is set to true, its value matches the value defined in conformanceTargetExact. Data type: Number |
| testMeasure.ruleViolation.conformanceTargetLower | Lower threshold value for comparing the test measure results. Determines if the threshold is crossed or no longer crossed. Data type: Number |
| testMeasure.ruleViolation.conformanceTargetUpper | Upper threshold value for comparing the test measure results. Determines if the threshold is crossed or no longer crossed. Data type: Number |
| testMeasure.ruleViolation.description | Description of the threshold rule violation. Data type: String |
| testMeasure.ruleViolation.id | Sys_id or external_id of the threshold rule violation. Data type: String Table: Threshold Rule Violation \[sn_st_mgmt_threshold_rule_violation\] |
| testMeasure.ruleViolation.name | Name of the threshold rule violation. Date type: String |
| testMeasure.ruleViolation.numberOfAllowedCrossing | Maximum crossings allowed within the tolerance period before consequences are applied. Data type: Number Maximum: 40 |
| testMeasure.ruleViolation.thresholdRuleSeverity | Severity of the threshold rule. Valid values: * high * low * medium {#servicetestmgmt-GET-serviceTest-id__ul_tts_txv_xbc} Data type: String |
| testMeasure.ruleViolation.tolerancePeriod | Duration or time interval in which allowed crossings can occur before a consequence is initiated. Date type: Object "tolerancePeriod": { "amount": Number, "units": "String" } |
| testMeasure.ruleViolation.tolerancePeriod.amount | Amount of the period in number. Data type: Number |
| testMeasure.ruleViolation.tolerancePeriod.units | Units of the period. Valid values: * days * hours * minutes * seconds {#servicetestmgmt-GET-serviceTest-id__ul_my3_qds_dcc} Data type: String |
| testMeasure.unitOfMeasure | Measurable value of time used to calculate the performance of a service in days, minutes, and seconds. Data type: String |
| testMeasure.value | Value of metric in the test. Data type: Object "value": { "id": "String", "name": "String", "valueType": "String", "value": "String" } |
| testMeasure.value.id | ID of the metric value in the test. Data type: String |
| testMeasure.value.name | Name of the metric value in the test. Data type: String |
| testMeasure.value.value | Value of metric in the test. Data type: String |
| testMeasure.value.valueType | Type of test measure value such as numeric, text, and so forth. Data type: String |
| testSpecification | Test definition associated for this test. Data type: Object "testSpecification": { "href": "String", "id": "String" } |
| testSpecification.href | Hyperlink reference to the service test definition. Data type: String |
| testSpecification.id | Sys_id or external_id of the service test definition. Data type: String Table: Service Test Definition \[sn_st_mgmt_test_definition\] |
| validFor | Date range that the service test is valid for. Data type: Object "validFor": { "endDateTime": "String", "startDateTime": "String" } |
| validFor.endDateTime | End date and timestamp of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| validFor.startDateTime | Start date and timestamp of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
[ ]

### cURL request {#servicetestmgmt-GET-serviceTest-id__example_z5y_hvr_rbc}

The following example retrieves details about the service test entity associated with the given ID, 44b7a8ea3b6a42107222bf9985e45a45.

    curl --location --request GET "https://instance.servicenow.com/api/sn_sprb_mgmt/servicetestmanagement/serviceTest/44b7a8ea3b6a42107222bf9985e45a45 \
    --user 'username': 'password'

Response body.

    {
      "href": "/api/sn_sprb_mgmt/servicetestmanagement/serviceTest/44b7a8ea3b6a42107222bf9985e45a45",
      "id": "44b7a8ea3b6a42107222bf9985e45a45",
      "description": "Service test",
      "endDateTime": "2025-01-31 15:05:43",
      "mode": "proactive",
      "name": "Speed Test TR0001001",
      "startDateTime": "2024-06-05 08:22:52",
      "validFor": {
        "startDateTime": "",
        "endDateTime": ""
      },
      "relatedService": {
        "id": "fa6d13f45b5620102dff5e92dc81c77f",
        "name": "Internet_VPLS_PI0000011"
      },
      "testSpecification": {
        "href": "/api/sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification/7d3854864316c6500e51203d5fb8f2d8",
        "id": "7d3854864316c6500e51203d5fb8f2d8"
      },
      "characteristic": [
            { 
            "id": "5c682a2a3b2682107222bf9985e45a5a", 
            "name": "url", 
            "valueType": "single_line_text", 
            "value": "test" 
             }
    ],
      "testMeasure": [
        {
          "id": "62ade42a3ba28210d140068aa4e45a71",
          "accuracy": "0.0001",
          "captureDateTime": "",
          "captureMethod": "automatic",
          "metricDescription": "",
          "metricName": "Downstream Speed",
          "unitOfMeasure": "",
          "value": "16",
          "ruleViolation": [
            {
              "id": "b9bee4ae3ba28210d140068aa4e45a3a",
              "description": "This speed is less than the target upper",
              "name": "tooMuchTraffic",
              "numberOfAllowedCrossing": "0",
              "thresholdRuleSeverity": "high",
              "tolerancePeriod": "",
              "conformanceTargetUpper": "75",
              "conformanceComparatorUpper": "less than",
              "appliedConsequence": [
                {
                  "id": "489074aa3be28210d140068aa4e45a42",
                  "appliedAction": "generateReport",
                  "description": "",
                  "name": "generateReport",
                  "repeatAction": "0"
                },
                {
                  "id": "785f2ce23be28210d140068aa4e45a75",
                  "appliedAction": "sendWarning",
                  "description": "",
                  "name": "sendWarning",
                  "repeatAction": "0"
                }
              ]
            }
          ]
        }
      ]
    }

## Service Test Management Open API - GET /sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification {#ariaid-title4}

Retrieves a list of all service test definitions.

### URL format

Default URL: GET /api/sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification

### Supported request parameters

{#servicetestmgmt-GET-servTestSpecif__entry__2}

| Name | Description |
|-|-|
| None |   |
[Table 14. Path parameters]

{#servicetestmgmt-GET-servTestSpecif__entry__6}

| Name | Description |
|-|-|
| fields | List of fields to return in the response. Invalid fields are ignored. If this parameter isn't used, all fields are returned. Located in the Service Test Definition \[sn_st_mgmt_test_definition\] table. Valid values: * description * id * name * relatedServiceSpecification * serviceTestSpecRelationship * specCharacteristic * testMeasureDefinition * validFor {#servicetestmgmt-GET-servTestSpecif__ul_hss_b3v_bcc} Data type: String |
| limit | Maximum number of records to return. For requests that exceed this number of records, use the offset parameter to paginate record retrieval. Data type: Number Maximum value: 100 Default: 20 |
| offset | Starting index at which to begin retrieving records. Use this parameter to paginate results in small and manageable chunks. The first record is indexed at 0. Data type: Number Default: 0 |
| state | Filter test definitions by the test's current state. Only test definitions in the specified state are returned in the response. Valid values: * archived * draft * published * retired Data type: String |
[Table 15. Query parameters]

{#servicetestmgmt-GET-servTestSpecif__entry__16}

| Name | Description |
|-|-|
| None |   |
[Table 16. Request body parameters (XML or JSON)]

### Headers

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#servicetestmgmt-GET-servTestSpecif__entry__20}{#servicetestmgmt-GET-servTestSpecif__accept-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Supported types: application/json or application/xml. Default: application/json |
[Table 17. Request headers]

{#servicetestmgmt-GET-servTestSpecif__entry__24}

| Header | Description |
|-|-|
| Content-Range | Specifies the range of content returned in a paginated call. For example, if `offset=2` and `limit=3`, the value of the Content-Range header is items `3-5`. |
| Content-Type | Data format of the response body. Only supports application/json. |
| Link | Contains the following links to navigate through query results: * first * last * next * previous {#servicetestmgmt-GET-servTestSpecif__ul_acj_pkx_4bc} |
| X-Total-Count | For paginated queries, this header specifies the total number of records available on the server. |
[Table 18. Response headers]

### Status codes

The following status codes apply to this HTTP action. For a
list of possible status codes used in the REST API, see [REST API HTTP response
codes](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#servicetestmgmt-GET-servTestSpecif__entry__34}{#servicetestmgmt-GET-servTestSpecif__entry-200-status-code}{#servicetestmgmt-GET-servTestSpecif__entry-400-status-code}{#servicetestmgmt-GET-servTestSpecif__entry-404-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 206 | Partial resource returned in response (with pagination). |
| 400 | Bad Request. A bad request type or malformed request was detected. |
| 404 | Not found. The requested item wasn't found. |
[Table 19. Status codes]

### Response body parameters (JSON or XML) {#servicetestmgmt-GET-servTestSpecif__section_xvz_1lx_4bc}

{#servicetestmgmt-GET-servTestSpecif__table_yvz_1lx_4bc__entry__2}

| Name | Description |
|-|-|
| description | Description of the service test definition. Data type: String |
| id | Sys_id or external_id of the service test definition. Data type: String Table: Service Test Definition \[sn_st_mgmt_test_definition\] |
| name | Required. Name of the service test definition. Data type: String |
| relatedServiceSpecification | Required. Service specifications of the test definition. Data type: Array of Objects "relatedServiceSpecification": [ { "id": "String", "name": "String" } ] |
| relatedServiceSpecification.id | Sys_id or external_id of the service specification. Data type: String Table: In the sys_id or external_id field of the Specification \[sn_prd_pm_specification\] table. |
| relatedServiceSpecification.name | Name of the service specification. Data type: String |
| serviceTestSpecRelationship | Related service test definition. Data type: Array of Objects "serviceTestSpecRelationship": [ { "id": "String", "name": "String", "relationshipType": "String" } ] |
| serviceTestSpecRelationship.id | Sys_id or external_id of the related service test definition. Data type: String Table: Test Definition \[sn_st_mgmt_test_definition\] |
| serviceTestSpecRelationship.name | Name of the related test definition. Data type: String |
| serviceTestSpecRelationship.relationshipType | Type of relationship. Accepted values: * dependency * exclusivity * substitution {#servicetestmgmt-GET-servTestSpecif__ul_hpg_xtr_dcc} Data type: String |
| specCharacteristic | Characteristics of the test definition. Data type: Array of Objects "specCharacteristic": [ { "characteristicValueSpecification": [Array], "description": "String", "name": "String", "validFor": {Object}, "valueType": "String" } ] |
| specCharacteristic.characteristicValueSpecification | Possible values of the characteristic. Data type: Array of Objects "characteristicValueSpecification": [ { "value": "String" } ] |
| specCharacteristic.characteristicValueSpecification.value | Value of the characteristic. Data type: String |
| specCharacteristic.description | Description of the characteristic. Data type: String |
| specCharacteristic.name | Name of the characteristic. Data type: String |
| specCharacteristic.validFor | Date range that the characteristic is valid for. Data type: Object "validFor": { "endDateTime": "String", "startDateTime": "String" } |
| specCharacteristic.validFor.endDateTime | End date of the characteristic. Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. Data type: String |
| specCharacteristic.validFor.startDateTime | Start date of the characteristic. Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. Data type: String |
| specCharacteristic.valueType | Type of characteristic value. * choice * date * date/time * duration * email * label * single line test * yes/no {#servicetestmgmt-GET-servTestSpecif__ul_i3m_twr_dcc} Data type: String |
| testMeasureDefinition | Test measure definitions for this service test definition. For more information, see [Define test measure definitions for a service test](https://www.servicenow.com/docs/access?context=define-test-measure-spm&version=yokohama&pubname=yokohama-proactive-service-exp-workflows&ft:locale=en-US). Data type: Array of objects "testMeasureDefinition": [ { "captureFrequency": "String", "captureMethod": "String", "capturePeriod": {Object}, "id": "String", "metricDescription": "String", "metricName": "String", "name": "String", "unitOfMeasure": "String", "thresholdRule": [Array], "validFor": {Object}, "valueType": "String" } ] |
| testMeasureDefinition.captureFrequency | The frequency at which to capture the metric. Valid values: * daily * monthly * none * once * weekly {#servicetestmgmt-GET-servTestSpecif__ul_lsw_jxv_xbc} Data type: String |
| testMeasureDefinition.captureMethod | Method used to capture the metric. Valid values: * automatic: Automatically capture the metric. * manual: Manually capture the metric. * none: Doesn't capture the metric. {#servicetestmgmt-GET-servTestSpecif__ul_gsw_jxv_xbc} Data type: String |
| testMeasureDefinition.capturePeriod | Period or duration of the metric capture. Data type: Object "capturePeriod": { "amount": Number, "units": "String" } |
| testMeasureDefinition.capturePeriod.amount | Number of capture periods. Data type: Number |
| testMeasureDefinition.capturePeriod.units | Units of the period. Valid values: * days * hours * minutes * seconds {#servicetestmgmt-GET-servTestSpecif__ul_rn1_3ds_dcc} Data type: String |
| testMeasureDefinition.id | Sys_id or external_id of the test measure definitions. Data type: String Table: Test Measure definition table \[sn_st_mgmt_test_measure_definition\] |
| testMeasureDefinition.metricDescription | Brief description of the metric. Data type: String |
| testMeasureDefinition.metricName | User-defined name of a metric in the test measure. Data type: String |
| testMeasureDefinition.name | Name of the test measure definition. Data type: String |
| testMeasureDefinition.thresholdRule | Rule that defines conditions to achieve before applying consequences when a threshold is crossed (or not crossed)​ in the test measure definition. For more information, see [Define threshold rules for a test measure definition](https://www.servicenow.com/docs/access?context=define-threshold-rules&version=yokohama&pubname=yokohama-proactive-service-exp-workflows&ft:locale=en-US). Data type: Array of Objects { "thresholdRule": { "consequence": [Array], "conformanceComparatorExact": Boolean, "conformanceComparatorLower": "String", "conformanceComparatorUpper": "String", "conformanceTargetExact": "String", "conformanceTargetLower": "String", "conformanceTargetUpper": "String", "consequence": [Array], "description": "String", "id": "String", "name": "String", "numberOfAllowedCrossing": Number, "thresholdRuleSeverity": "String", "tolerancePeriod": {Object} } } |
| testMeasureDefinition.thresholdRule.conformanceComparatorExact | Flag that indicates whether a value is identical to the value set for testMeasureDefinition.thresholdRule.conformanceTargetExact. If set to true, testMeasureDefinition.thresholdRule.conformanceTargetExact is required. Valid values: * true: The value is identical to the value of conformanceTargetExact. * false: The value isn't identical conformanceTargetExact. {#servicetestmgmt-GET-servTestSpecif__ul_bsw_jxv_xbc} Data type: Boolean Default: false |
| testMeasureDefinition.thresholdRule.conformanceComparatorLower | Operator that checks if a value falls below the threshold. Valid values: * greater than * greater than or is {#servicetestmgmt-GET-servTestSpecif__ul_zrw_jxv_xbc} Data type: String |
| testMeasureDefinition.thresholdRule.conformanceComparatorUpper | Operator that checks if a value exceeds the threshold. Valid values: * less than * less than or is {#servicetestmgmt-GET-servTestSpecif__ul_wrw_jxv_xbc} Data type: String |
| testMeasureDefinition.thresholdRule.conformanceTargetExact | Required if conformanceComparatorExact is set to true. If the conformanceComparatorExact value is set to true, its value matches the value defined in conformanceTargetExact. Data type: Number |
| testMeasureDefinition.thresholdRule.conformanceTargetLower | Lower threshold value for comparing the test measure results. Data type: Number |
| testMeasureDefinition.thresholdRule.conformanceTargetUpper | Upper threshold value for comparing the test measure results. Data type: Number |
| testMeasureDefinition.thresholdRule.consequence | Action (prescribed action or notification) to take when a threshold rule is crossed. For more information, see [Define measure consequences for the threshold rules](https://www.servicenow.com/docs/access?context=define-threshold-consequences-spm&version=yokohama&pubname=yokohama-proactive-service-exp-workflows&ft:locale=en-US). Data type: Array of objects "consequence": [ { "description": "String", "id": "String", "name": "String", "prescribeAction": "String", "repeatAction": Boolean, "validFor": { "endDateTime": "String", "startDateTime": "String" } ] |
| testMeasureDefinition.thresholdRule.consequence.description | Description of the consequence. Data type: String |
| testMeasureDefinition.thresholdRule.consequence.id | Sys_id or external_id of the measure consequence. Data type: String |
| testMeasureDefinition.thresholdRule.consequence.name | Name of the consequence. Data type: String |
| testMeasureDefinition.thresholdRule.consequence.prescribeAction | User-defined action to take for threshold violations. Actions vary between instances. Data type: String |
| testMeasureDefinition.thresholdRule.consequence.repeatAction | Flag that indicates whether to repeat the applied consequence. Valid values: * true: Repeats the action. * false: Doesn't repeat the action. {#servicetestmgmt-GET-servTestSpecif__ul_srw_jxv_xbc} Data type: Boolean Default: false |
| testMeasureDefinition.thresholdRule.consequence.validFor | Date range that the consequence is valid for. Data type: Object "validFor": { "startDateTime": "String", "endDateTime ": "String" } |
| testMeasureDefinition.thresholdRule.consequence.validFor.endDateTime | Validity end date of the consequence. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| testMeasureDefinition.thresholdRule.consequence.validFor.startDateTime | Validity start date of the consequence. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| testMeasureDefinition.thresholdRule.description | Description of the threshold rule. Data type: String |
| testMeasureDefinition.thresholdRule.id | Sys_id or external_id of the threshold rules. Data type: String Table: In the sys_id or external_id field of the Threshold Rules \[sn_st_mgmt_threshold_rule\] table. |
| testMeasureDefinition.thresholdRule.name | Name of the threshold rule. Data type: String |
| testMeasureDefinition.thresholdRule.numberOfAllowedCrossing | Maximum crossings allowed within the tolerance period before consequences are applied. Data type: Number Maximum value: 40 |
| testMeasureDefinition.thresholdRule.thresholdRuleSeverity | Severity level of the threshold rule. Valid values: * high * medium * low {#servicetestmgmt-GET-servTestSpecif__ul_orw_jxv_xbc} Data type: String |
| testMeasureDefinition.unitOfMeasure | Measurable value of time used to calculate the performance of a service in days, minutes, and seconds. Data type: String |
| testMeasureDefinition.validFor | Date range that the test measure definition is valid for. Data type: String "validFor": { "endDateTime": "String", "startDateTime": "String" } |
| testMeasureDefinition.validFor.endDateTime | Validity end date of the test measure definition. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| testMeasureDefinition.validFor.startDateTime | Validity start date of the test measure definition. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| validFor | Date range that the test definition is valid for. Data type: Object "validFor": { "endDateTime": "String", "startDateTime": "String" } |
| validFor.endDateTime | Date and time of the test definition on which the state of it is retired. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| validFor.startDateTime | Date and time of the test definition on which the state of it is published. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
[ ]

{#servicetestmgmt-GET-servTestSpecif__table_yvz_1lx_4bc}  

### cURL request

This example retrieves details about all test service test definitions in the instance. In this case, two definitions are returned.

    curl --location --request GET 
    "https://instance.servicenow.com//api/sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification" \
    --user 'username': 'password'

Response body.

    [
      {
        "description": "Operation, Administration and Maintenance",
        "id": "76a3b160432a02104fefe4511fb8f2ad",
        "name": "OAM Test",
        "validFor": {
          "startDateTime": "",
          "endDateTime": ""
        },
        "testMeasureDefinition": [
          {
            "id": "77b9b964432a02104fefe4511fb8f26e",
            "captureFrequency": "once",
            "captureMethod": "automatic",
            "metricDescription": "This is the Rx signal level",
            "metricName": "Rx Optical Signal Level",
            "name": "Rx Optical Signal Level",
            "unitOfMeasure": "a minute",
            "valueType": "",
            "capturePeriod": "",
            "validFor": {
              "startDateTime": "",
              "endDateTime": ""
            },
            "thresholdRule": [
              {
                "id": "d3e97d64432a02104fefe4511fb8f281",
                "description": "",
                "name": "gponOntAniOpInfoRxOpticalSignalLevel",
                "numberOfAllowedCrossing": "",
                "thresholdRuleSeverity": "",
                "tolerancePeriod": "",
                "conformanceTargetUpper": "0",
                "conformanceComparatorUpper": "less than",
                "conformanceTargetLower": "-50",
                "conformanceComparatorLower": "greater than",
                "consequence": []
              }
            ]
          },
          {
            "id": "878afd64432a02104fefe4511fb8f28d",
            "captureFrequency": "once",
            "captureMethod": "automatic",
            "metricDescription": "This is the Tx signal level",
            "metricName": "TX Optical Signal Level",
            "name": "TX Optical Signal Level",
            "unitOfMeasure": "a minute",
            "valueType": "",
            "capturePeriod": "",
            "validFor": {
              "startDateTime": "",
              "endDateTime": ""
            },
            "thresholdRule": [
              {
                "id": "b3dab5a4432a02104fefe4511fb8f2d3",
                "description": "",
                "name": "gponOntAniOpInfoTxOpticalSignalLevel",
                "numberOfAllowedCrossing": "",
                "thresholdRuleSeverity": "",
                "tolerancePeriod": "",
                "conformanceTargetUpper": "65",
                "conformanceComparatorUpper": "less than",
                "conformanceTargetLower": "-65",
                "conformanceComparatorLower": "greater than",
                "consequence": []
              }
            ]
          }
        ],
        "specCharacteristic": [
          {
            "name": "AccessRequired",
            "description": "AccessRequired",
            "valueType": "yes_no",
            "validFor": {
              "startDatetime": "2024-05-30 09:09:57"
            },
            "characteristicValueSpecification": [
              {
                "value": "Yes",
                "validFor": {
                  "startDateTime": "",
                  "endDateTime": ""
                }
              },
              {
                "value": "No",
                "validFor": {
                  "startDateTime": "",
                  "endDateTime": ""
                }
              }
            ]
          }
        ],
        "serviceTestSpecRelationship": [],
        "relatedServiceSpecification": [
          {
            "id": "f559b564432a02104fefe4511fb8f2e0",
            "name": "OAM"
          }
        ]
      },
      {
        "description": "Upstream and Downstream speed ",
        "id": "89d2b920432a02104fefe4511fb8f22e",
        "name": "Speed Test",
        "validFor": {
          "startDateTime": "2024-05-31",
          "endDateTime": "2024-06-27"
        },
        "testMeasureDefinition": [
          {
            "id": "1a04f560432a02104fefe4511fb8f2ad",
            "captureFrequency": "once",
            "captureMethod": "automatic",
            "metricDescription": "This is the downstream speed in a service",
            "metricName": "Downstream Speed",
            "name": "Downstream Speed",
            "unitOfMeasure": "a second",
            "valueType": "",
            "capturePeriod": "30 Minutes",
            "validFor": {
              "startDateTime": "2024-05-30 08:49:26",
              "endDateTime": "2024-05-31 08:49:29"
            },
            "thresholdRule": [
              {
                "id": "a754f960432a02104fefe4511fb8f2d0",
                "description": "This speed is greater than the target upper",
                "name": "InternetSpeedValue",
                "numberOfAllowedCrossing": "0",
                "thresholdRuleSeverity": "high",
                "tolerancePeriod": "15 Minutes",
                "conformanceTargetLower": "75",
                "conformanceComparatorLower": "greater than",
                "consequence": [
                  {
                    "id": "15a4bd60432a02104fefe4511fb8f2b8",
                    "prescribeAction": "null",
                    "description": "generate a waring report",
                    "name": "degradedQualityOfService",
                    "repeatAction": "0",
                    "validFor": {
                      "startDateTime": "2024-05-30 08:51:29",
                      "endDateTime": "2024-08-06 08:51:31"
                    }
                  },
                  {
                    "id": "e6847d60432a02104fefe4511fb8f2c3",
                    "prescribeAction": "null",
                    "description": "send a warning to the system",
                    "name": "packetdrop",
                    "repeatAction": "0",
                    "validFor": {
                      "startDateTime": "2024-05-30 08:50:53",
                      "endDateTime": "2024-08-06 08:50:55"
                    }
                  }
                ]
              },
              {
                "id": "cb55b5a0432a02104fefe4511fb8f201",
                "description": "",
                "name": "InternetSpeedValue",
                "numberOfAllowedCrossing": "0",
                "thresholdRuleSeverity": "medium",
                "tolerancePeriod": "",
                "conformanceTargetUpper": "120",
                "conformanceComparatorUpper": "less than",
                "consequence": []
              }
            ]
          },
          {
            "id": "8f987524432a02104fefe4511fb8f2f0",
            "captureFrequency": "once",
            "captureMethod": "automatic",
            "metricDescription": "This is the upstream speed in the service",
            "metricName": "Upstream Speed",
            "name": "Upstream Speed",
            "unitOfMeasure": "a second",
            "valueType": "",
            "capturePeriod": "",
            "validFor": {
              "startDateTime": "",
              "endDateTime": ""
            },
            "thresholdRule": []
          }
        ],
        "specCharacteristic": [
          {
            "name": "restart",
            "description": "restart",
            "valueType": "yes_no",
            "validFor": {
              "startDatetime": "2024-05-30 08:45:49"
            },
            "characteristicValueSpecification": [
              {
                "value": "No",
                "validFor": {
                  "startDateTime": "",
                  "endDateTime": ""
                }
              },
              {
                "value": "Yes",
                "validFor": {
                  "startDateTime": "",
                  "endDateTime": ""
                }
              }
            ]
          }
        ],
        "serviceTestSpecRelationship": [
          {
            "id": "76a3b160432a02104fefe4511fb8f2ad",
            "name": "OAM Test",
            "relationshipType": ""
          }
        ],
        "relatedServiceSpecification": [
          {
            "id": "aeddcd1fb7d69910ff00f203ae11a990",
            "name": "Home Internet"
          }
        ]
      }
    ]

## Service Test Management Open API - GET /sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification/{id} {#ariaid-title5}

Retrieves a service test definition entity.

### URL format

Default URL: /api/sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification/{id}

### Supported request parameters

{#servicetestmanagement-GET-id__entry__2}

| Name | Description |
|-|-|
| id | Sys_id or external_id of the service test definition to retrieve. Data type: String Table: Service Test Definition \[sn_st_mgmt_test_definition\] |
[Table 20. Path parameters]

{#servicetestmanagement-GET-id__entry__6}

| Name | Description |
|-|-|
| fields | List of fields to return in the response. Invalid fields are ignored. If this parameter isn't used, all fields are returned. Located in the Service Test Definition \[sn_st_mgmt_test_definition\] table. Valid values: * description * id * name * relatedServiceSpecification * serviceTestSpecRelationship * specCharacteristic * testMeasureDefinition * validFor {#servicetestmanagement-GET-id__ul_hss_b3v_bcc} Data type: String |
| state | Filter test definitions by the test's current state. Only test definitions in the specified state are returned in the response. Valid values: * archived * draft * published * retired Data type: String |
[Table 21. Query parameters]

{#servicetestmanagement-GET-id__entry__12}

| Name | Description |
|-|-|
| None |   |
[Table 22. Request body parameters (XML or JSON)]

### Headers

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#servicetestmanagement-GET-id__entry__16}{#servicetestmanagement-GET-id__accept-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Supported types: application/json or application/xml. Default: application/json |
[Table 23. Request headers]

{#servicetestmanagement-GET-id__entry__20}{#servicetestmanagement-GET-id__content_type-JSON-only-entry-RESTAPI}

| Header | Description |
|-|-|
| Content-Type | Data format of the request body. Only supports application/json. |
[Table 24. Response headers]

### Status codes

The following status codes apply to this HTTP action. For a
list of possible status codes used in the REST API, see [REST API HTTP response
codes](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#servicetestmanagement-GET-id__entry__24}{#servicetestmanagement-GET-id__entry-200-status-code}{#servicetestmanagement-GET-id__entry-400-status-code}{#servicetestmanagement-GET-id__entry-404-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 400 | Bad Request. A bad request type or malformed request was detected. |
| 404 | Not found. The requested item wasn't found. |
[Table 25. Status codes]

### Response body parameters (JSON or XML)

{#servicetestmanagement-GET-id__entry__32}

| Name | Description |
|-|-|
| description | Description of the service test definition. Data type: String |
| id | Sys_id or external_id of the service test definition. Data type: String Table: Service Test Definition \[sn_st_mgmt_test_definition\] |
| name | Required. Name of the service test definition. Data type: String |
| relatedServiceSpecification | Required. Service specifications of the test definition. Data type: Array of Objects "relatedServiceSpecification": [ { "id": "String", "name": "String" } ] |
| relatedServiceSpecification.id | Sys_id or external_id of the service specification. Data type: String Table: In the sys_id or external_id field of the Specification \[sn_prd_pm_specification\] table. |
| relatedServiceSpecification.name | Name of the service specification. Data type: String |
| serviceTestSpecRelationship | Related service test definition. Data type: Array of Objects "serviceTestSpecRelationship": [ { "id": "String", "name": "String", "relationshipType": "String" } ] |
| serviceTestSpecRelationship.id | Sys_id or external_id of the related service test definition. Data type: String Table: Test Definition \[sn_st_mgmt_test_definition\] |
| serviceTestSpecRelationship.name | Name of the related test definition. Data type: String |
| serviceTestSpecRelationship.relationshipType | Type of relationship. Accepted values: * dependency * exclusivity * substitution {#servicetestmanagement-GET-id__ul_hpg_xtr_dcc} Data type: String |
| specCharacteristic | Characteristics of the test definition. Data type: Array of Objects "specCharacteristic": [ { "characteristicValueSpecification": [Array], "description": "String", "name": "String", "validFor": {Object}, "valueType": "String" } ] |
| specCharacteristic.characteristicValueSpecification | Possible values of the characteristic. Data type: Array of Objects "characteristicValueSpecification": [ { "value": "String" } ] |
| specCharacteristic.characteristicValueSpecification.value | Value of the characteristic. Data type: String |
| specCharacteristic.description | Description of the characteristic. Data type: String |
| specCharacteristic.name | Name of the characteristic. Data type: String |
| specCharacteristic.validFor | Date range that the characteristic is valid for. Data type: Object "validFor": { "endDateTime": "String", "startDateTime": "String" } |
| specCharacteristic.validFor.endDateTime | End date of the characteristic. Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. Data type: String |
| specCharacteristic.validFor.startDateTime | Start date of the characteristic. Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. Data type: String |
| specCharacteristic.valueType | Type of characteristic value. * choice * date * date/time * duration * email * label * single line test * yes/no {#servicetestmanagement-GET-id__ul_i3m_twr_dcc} Data type: String |
| testMeasureDefinition | Test measure definitions for this service test definition. For more information, see [Define test measure definitions for a service test](https://www.servicenow.com/docs/access?context=define-test-measure-spm&version=yokohama&pubname=yokohama-proactive-service-exp-workflows&ft:locale=en-US). Data type: Array of objects "testMeasureDefinition": [ { "captureFrequency": "String", "captureMethod": "String", "capturePeriod": {Object}, "id": "String", "metricDescription": "String", "metricName": "String", "name": "String", "unitOfMeasure": "String", "thresholdRule": [Array], "validFor": {Object}, "valueType": "String" } ] |
| testMeasureDefinition.captureFrequency | The frequency at which to capture the metric. Valid values: * daily * monthly * none * once * weekly {#servicetestmanagement-GET-id__ul_lsw_jxv_xbc} Data type: String |
| testMeasureDefinition.captureMethod | Method used to capture the metric. Valid values: * automatic: Automatically capture the metric. * manual: Manually capture the metric. * none: Doesn't capture the metric. {#servicetestmanagement-GET-id__ul_gsw_jxv_xbc} Data type: String |
| testMeasureDefinition.capturePeriod | Period or duration of the metric capture. Data type: Object "capturePeriod": { "amount": Number, "units": "String" } |
| testMeasureDefinition.capturePeriod.amount | Number of capture periods. Data type: Number |
| testMeasureDefinition.capturePeriod.units | Units of the period. Valid values: * days * hours * minutes * seconds {#servicetestmanagement-GET-id__ul_rn1_3ds_dcc} Data type: String |
| testMeasureDefinition.id | Sys_id or external_id of the test measure definitions. Data type: String Table: Test Measure definition table \[sn_st_mgmt_test_measure_definition\] |
| testMeasureDefinition.metricDescription | Brief description of the metric. Data type: String |
| testMeasureDefinition.metricName | User-defined name of a metric in the test measure. Data type: String |
| testMeasureDefinition.name | Name of the test measure definition. Data type: String |
| testMeasureDefinition.thresholdRule | Rule that defines conditions to achieve before applying consequences when a threshold is crossed (or not crossed)​ in the test measure definition. For more information, see [Define threshold rules for a test measure definition](https://www.servicenow.com/docs/access?context=define-threshold-rules&version=yokohama&pubname=yokohama-proactive-service-exp-workflows&ft:locale=en-US). Data type: Array of Objects { "thresholdRule": { "consequence": [Array], "conformanceComparatorExact": Boolean, "conformanceComparatorLower": "String", "conformanceComparatorUpper": "String", "conformanceTargetExact": "String", "conformanceTargetLower": "String", "conformanceTargetUpper": "String", "consequence": [Array], "description": "String", "id": "String", "name": "String", "numberOfAllowedCrossing": Number, "thresholdRuleSeverity": "String", "tolerancePeriod": {Object} } } |
| testMeasureDefinition.thresholdRule.conformanceComparatorExact | Flag that indicates whether a value is identical to the value set for testMeasureDefinition.thresholdRule.conformanceTargetExact. If set to true, testMeasureDefinition.thresholdRule.conformanceTargetExact is required. Valid values: * true: The value is identical to the value of conformanceTargetExact. * false: The value isn't identical conformanceTargetExact. {#servicetestmanagement-GET-id__ul_bsw_jxv_xbc} Data type: Boolean Default: false |
| testMeasureDefinition.thresholdRule.conformanceComparatorLower | Operator that checks if a value falls below the threshold. Valid values: * greater than * greater than or is {#servicetestmanagement-GET-id__ul_zrw_jxv_xbc} Data type: String |
| testMeasureDefinition.thresholdRule.conformanceComparatorUpper | Operator that checks if a value exceeds the threshold. Valid values: * less than * less than or is {#servicetestmanagement-GET-id__ul_wrw_jxv_xbc} Data type: String |
| testMeasureDefinition.thresholdRule.conformanceTargetExact | Required if conformanceComparatorExact is set to true. If the conformanceComparatorExact value is set to true, its value matches the value defined in conformanceTargetExact. Data type: Number |
| testMeasureDefinition.thresholdRule.conformanceTargetLower | Lower threshold value for comparing the test measure results. Data type: Number |
| testMeasureDefinition.thresholdRule.conformanceTargetUpper | Upper threshold value for comparing the test measure results. Data type: Number |
| testMeasureDefinition.thresholdRule.consequence | Action (prescribed action or notification) to take when a threshold rule is crossed. For more information, see [Define measure consequences for the threshold rules](https://www.servicenow.com/docs/access?context=define-threshold-consequences-spm&version=yokohama&pubname=yokohama-proactive-service-exp-workflows&ft:locale=en-US). Data type: Array of objects "consequence": [ { "description": "String", "id": "String", "name": "String", "prescribeAction": "String", "repeatAction": Boolean, "validFor": { "endDateTime": "String", "startDateTime": "String" } ] |
| testMeasureDefinition.thresholdRule.consequence.description | Description of the consequence. Data type: String |
| testMeasureDefinition.thresholdRule.consequence.id | Sys_id or external_id of the measure consequence. Data type: String |
| testMeasureDefinition.thresholdRule.consequence.name | Name of the consequence. Data type: String |
| testMeasureDefinition.thresholdRule.consequence.prescribeAction | User-defined action to take for threshold violations. Actions vary between instances. Data type: String |
| testMeasureDefinition.thresholdRule.consequence.repeatAction | Flag that indicates whether to repeat the applied consequence. Valid values: * true: Repeats the action. * false: Doesn't repeat the action. {#servicetestmanagement-GET-id__ul_srw_jxv_xbc} Data type: Boolean Default: false |
| testMeasureDefinition.thresholdRule.consequence.validFor | Date range that the consequence is valid for. Data type: Object "validFor": { "startDateTime": "String", "endDateTime ": "String" } |
| testMeasureDefinition.thresholdRule.consequence.validFor.endDateTime | Validity end date of the consequence. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| testMeasureDefinition.thresholdRule.consequence.validFor.startDateTime | Validity start date of the consequence. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| testMeasureDefinition.thresholdRule.description | Description of the threshold rule. Data type: String |
| testMeasureDefinition.thresholdRule.id | Sys_id or external_id of the threshold rules. Data type: String Table: In the sys_id or external_id field of the Threshold Rules \[sn_st_mgmt_threshold_rule\] table. |
| testMeasureDefinition.thresholdRule.name | Name of the threshold rule. Data type: String |
| testMeasureDefinition.thresholdRule.numberOfAllowedCrossing | Maximum crossings allowed within the tolerance period before consequences are applied. Data type: Number Maximum value: 40 |
| testMeasureDefinition.thresholdRule.thresholdRuleSeverity | Severity level of the threshold rule. Valid values: * high * medium * low {#servicetestmanagement-GET-id__ul_orw_jxv_xbc} Data type: String |
| testMeasureDefinition.unitOfMeasure | Measurable value of time used to calculate the performance of a service in days, minutes, and seconds. Data type: String |
| testMeasureDefinition.validFor | Date range that the test measure definition is valid for. Data type: String "validFor": { "endDateTime": "String", "startDateTime": "String" } |
| testMeasureDefinition.validFor.endDateTime | Validity end date of the test measure definition. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| testMeasureDefinition.validFor.startDateTime | Validity start date of the test measure definition. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| validFor | Date range that the test definition is valid for. Data type: Object "validFor": { "endDateTime": "String", "startDateTime": "String" } |
| validFor.endDateTime | Date and time of the test definition on which the state of it is retired. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| validFor.startDateTime | Date and time of the test definition on which the state of it is published. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
[ ]

### cURL request

This example retrieves details of a service test definition with a given ID.

    curl --location --request GET "https:/instance.servicenow.com/api/sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification/89d2b920432a02104fefe4511fb8f22e" \
    --user 'username': 'password'

Response body.

    {
      "description": "Upstream and Downstream speed ",
      "id": "89d2b920432a02104fefe4511fb8f22e",
      "name": "Speed Test",
      "validFor": {
        "startDateTime": "2024-05-31",
        "endDateTime": "2024-06-27"
      },
      "testMeasureDefinition": [
        {
          "id": "1a04f560432a02104fefe4511fb8f2ad",
          "captureFrequency": "once",
          "captureMethod": "automatic",
          "metricDescription": "This is the downstream speed in a service",
          "metricName": "Downstream Speed",
          "name": "Downstream Speed",
          "unitOfMeasure": "a second",
          "valueType": "",
          "capturePeriod": "30 Minutes",
          "validFor": {
            "startDateTime": "2024-05-30 08:49:26",
            "endDateTime": "2024-05-31 08:49:29"
          },
          "thresholdRule": [
            {
              "id": "a754f960432a02104fefe4511fb8f2d0",
              "description": "This speed is greater than the target upper",
              "name": "InternetSpeedValue",
              "numberOfAllowedCrossing": "0",
              "thresholdRuleSeverity": "high",
              "tolerancePeriod": "15 Minutes",
              "conformanceTargetLower": "75",
              "conformanceComparatorLower": "greater than",
              "consequence": [
                {
                  "id": "15a4bd60432a02104fefe4511fb8f2b8",
                  "prescribeAction": "null",
                  "description": "generate a waring report",
                  "name": "degradedQualityOfService",
                  "repeatAction": "0",
                  "validFor": {
                    "startDateTime": "2024-05-30 08:51:29",
                    "endDateTime": "2024-08-06 08:51:31"
                  }
                },
                {
                  "id": "e6847d60432a02104fefe4511fb8f2c3",
                  "prescribeAction": "null",
                  "description": "send a warning to the system",
                  "name": "packetdrop",
                  "repeatAction": "0",
                  "validFor": {
                    "startDateTime": "2024-05-30 08:50:53",
                    "endDateTime": "2024-08-06 08:50:55"
                  }
                }
              ]
            },
            {
              "id": "cb55b5a0432a02104fefe4511fb8f201",
              "description": "",
              "name": "InternetSpeedValue",
              "numberOfAllowedCrossing": "0",
              "thresholdRuleSeverity": "medium",
              "tolerancePeriod": "",
              "conformanceTargetUpper": "120",
              "conformanceComparatorUpper": "less than",
              "consequence": []
            }
          ]
        }
      ],
      "specCharacteristic": [
        {
          "name": "restart",
          "description": "restart",
          "valueType": "yes_no",
          "validFor": {
            "startDatetime": "2024-05-30 08:45:49"
          },
          "characteristicValueSpecification": [
            {
              "value": "No",
              "validFor": {
                "startDateTime": "",
                "endDateTime": ""
              }
            },
            {
              "value": "Yes",
              "validFor": {
                "startDateTime": "",
                "endDateTime": ""
              }
            }
          ]
        }
      ],
      "serviceTestSpecRelationship": [
        {
          "id": "76a3b160432a02104fefe4511fb8f2ad",
          "name": "OAM Test",
          "relationshipType": ""
        }
      ],
      "relatedServiceSpecification": [
        {
          "id": "aeddcd1fb7d69910ff00f203ae11a990",
          "name": "Home Internet"
        }
      ]
    }

## Service Test Management Open API - PATCH /sn_sprb_mgmt/servicetestmanagement/serviceTest/{id} {#ariaid-title6}

Updates a service test entity.

### URL format

Default URL: /api/sn_sprb_mgmt/servicetestmanagement/serviceTest/{id}

### Supported request parameters

{#servicetestmgmt-PATCH-serviceTestid__entry__2}

| Name | Description |
|-|-|
| id | Sys_id or external_id of the service test to retrieve. Data type: String Table: Service Test \[sn_st_mgmt_test\] |
[Table 26. Path parameters]

{#servicetestmgmt-PATCH-serviceTestid__entry__6}

| Name | Description |
|-|-|
| None |   |
[Table 27. Query parameters]

{#servicetestmgmt-PATCH-serviceTestid__entry__10}

| Name | Description |
|-|-|
| characteristic | List that describes the characteristics of the associated service test. For more information about test definition characteristics, see Data type: Array of Objects "characteristic": [ { "id": "String", "name": "String", "value": "String", "valueType": "String" } ] |
| characteristic.id | Sys_id or external_id of characteristics. If external_id is present for that record, the response returns the external_id otherwise it returns the sys_id. Data type: String Table: Characteristics \[sn_prd_pm_characteristic\] |
| characteristic.name | Name of the characteristic. Data type: String |
| characteristic.value | Characteristic options associated with the service test. Characteristics vary based on the customer instance. Data type: String |
| characteristic.valueType | Type of characteristic value. * choice * date * date/time * duration * email * label * single line test * yes/no {#servicetestmgmt-PATCH-serviceTestid__ul_zfr_twr_dcc} Data type: String |
| description | Description of the service test. Data type: String |
| endDateTime | End date and time of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| mode | Mode that the service test is running in. Valid values: * ONDEMAND: Triggers the service test manually. * PROACTIVE: Triggers the service test automatically. {#servicetestmgmt-PATCH-serviceTestid__ul_ybc_mqn_xbc} Data type: String Default: ONDEMAND |
| name | Required. Name of the service test. Data type: String |
| relatedService | Required. Test definition associated with the service test. Data type: Object "relatedService": { "href": "String", "id": "String", "name": "String" } |
| relatedService.href | Hyperlink reference to the related service. Data type: String |
| relatedService.id | Sys_id or external_id of the product inventory. Data type: String Table: In the sys_id or external_id field of the product Inventory \[sn_prd_invt_product_inventory\] table. |
| startDateTime | Start date and time of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| state | State the service test is in. Valid values: * acknowledged * canceled * completed * failed * inProgress * pending * rejected {#servicetestmgmt-PATCH-serviceTestid__ul_gym_mqn_xbc} Data type: String |
| testMeasure | Measure of a specific aspect of a product, service, or resource test, such as lost packets or connectivity status. Data type: Array of Objects "testMeasure": [ { "accuracy": "String", "captureDateTime": "String", "captureMethod": "String", "id": "String", "metricDescription": "String", "metricName": "String", "ruleViolation": [Array], "unitOfMeasure": "String", "value": {Object} } ] |
| testMeasure.accuracy | Float decimal value representing the test measure accuracy captured for the associated metrics. Data type: Number Maximum value: 40 |
| testMeasure.captureDateTime | The date and time that the metric was captured. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| testMeasure.id | Sys_id or external_id of the Test Measures. Data type: String Table: In the sys_id or external_id fields of the Test Measures table \[sn_st_mgmt_test_measure\] table. |
| testMeasure.Measure.captureMethod | Method used to capture the metric. Valid values: * automatic: Automatically capture the metric. * manual: Manually capture the metric. * none: Don't capture the metric. {#servicetestmgmt-PATCH-serviceTestid__ul_ed2_gxv_xbc} Data type: String |
| testMeasure.metricDescription | Brief description of the metric. Data type: String |
| testMeasure.metricName | Name of the test measure metric. Data type: String |
| testMeasure.ruleViolation | An object for defining a rule in the threshold rule definition, along with consequences if the rule is violated. Data type: Array of Objects "ruleViolation"[ { appliedConsequence: [Array], conformanceTargetUpper: Number, conformanceComparatorUpper: "String", description: "String", id: "String", name: "String", numberOfAllowedCrossing: Number, thresholdRuleSeverity: "String", tolerancePeriod: "String" } ] |
| testMeasure.ruleViolation.tolerancePeriod.amount | Number of periods before applying the consequence. Data type: Number |
| testMeasure.ruleViolation.appliedConsequence | Action (prescribed action or notification) to take when a threshold rule is crossed. Data type: Array of Objects "appliedConsequence": [ { "appliedAction": "String", "description": "String", "id": "String", "name": "String", "repeatAction": Boolean } ] |
| testMeasure.ruleViolation.appliedConsequence.appliedAction | Action to take when a threshold rule is violated. For example, sending a warning or generating a report. Applied actions can vary between instances. Data type: String |
| testMeasure.ruleViolation.appliedConsequence.description | Description of the applied consequence. Data type: String |
| testMeasure.ruleViolation.appliedConsequence.id | Sys_id or external_id of the applied consequence. Data type: String |
| testMeasure.ruleViolation.appliedConsequence.name | Name of the applied consequence. Data type: String |
| testMeasure.ruleViolation.appliedConsequence.repeatAction | Flag that indicates whether to repeat the consequence when a second violation occurs. Valid values: * true: Repeat the action. * false: Don't repeat the action. {#servicetestmgmt-PATCH-serviceTestid__ul_ld2_gxv_xbc} Data type: Boolean Default: false |
| testMeasure.ruleViolation.conformanceComporatorExact | Flag that indicates whether a value is identical. Valid values: * true: The value is identical. * false: The value isn't identical. {#servicetestmgmt-PATCH-serviceTestid__ul_od2_gxv_xbc} Data type: Boolean Default: false |
| testMeasure.ruleViolation.conformanceComporatorLower | Operator for checking if a value falls below the threshold. Valid values: * greater than * greater than or is {#servicetestmgmt-PATCH-serviceTestid__ul_sd2_gxv_xbc} Data type: String |
| testMeasure.ruleViolation.conformanceComporatorUpper | Operator for checking if a value is above the threshold. Valid values: * less than * less than or is {#servicetestmgmt-PATCH-serviceTestid__ul_vd2_gxv_xbc} Data type: String |
| testMeasure.ruleViolation.conformanceTargetExact | Required if conformanceComparatorExact is set to true. If the conformanceComparatorExact value is set to true, its value matches the value defined in conformanceTargetExact. Data type: Number |
| testMeasure.ruleViolation.conformanceTargetLower | Lower threshold value for comparing the test measure results. Determines if the threshold is crossed or no longer crossed. Data type: Number |
| testMeasure.ruleViolation.conformanceTargetUpper | Upper threshold value for comparing the test measure results. Determines if the threshold is crossed or no longer crossed. Data type: Number |
| testMeasure.ruleViolation.description | Description of the threshold rule. Data type: String |
| testMeasure.ruleViolation.id | Sys_id or external_id of the threshold rule violation. Data type: String Table: Threshold Rule Violation \[sn_st_mgmt_threshold_rule_violation\] |
| testMeasure.ruleViolation.name | Name of the threshold rule. Data type: String |
| testMeasure.ruleViolation.numberOfAllowedCrossing | Maximum crossings allowed within the tolerance period before consequences are applied. Data type: Number Maximum value: 40 |
| testMeasure.ruleViolation.thresholdRuleSeverity | Severity of the threshold rule. Valid values: * high * medium * low {#servicetestmgmt-PATCH-serviceTestid__ul_xd2_gxv_xbc} Data type: String |
| testMeasure.ruleViolation.tolerancePeriod | Specified time interval during which crossing occurrences are enabled without triggering any immediate consequences or actions. Date type: Object "tolerancePeriod": { "amount": Number, "units": "String" } |
| testMeasure.ruleViolation.tolerancePeriod.units | Units of the period. Valid values: * days * hours * minutes * seconds {#servicetestmgmt-PATCH-serviceTestid__ul_qbw_qds_dcc} Data type: String |
| testMeasure.unitOfMeasure | Unit of measurement for the conformance target values of the test measure. Data type: String |
| testMeasure.value | Value of the test measure. Data type: Object "value": { "id": "String", "name": "String", "valueType": "String", "value": "String } |
| testMeasure.value.id | ID of the test measure value. Data type: String |
| testMeasure.value.name | Name of the test measure value. Data type: String |
| testMeasure.value.value | Value of the test measure. Data type: String |
| testMeasure.value.valueType | Type of test measure value such as numeric, text, and so forth. Data type: String |
| testSpecification | Required. Test definition associated with this test. Data type: Object "testSpecification": { "href": "String", "id": "String" } |
| testSpecification.href | Hyperlink reference to the service test definition. Data type: String |
| testSpecification.id | Sys_id or external_id of the service test definition. Data type: String Table: In the sys_id or external_id field of the Service Test Definition \[sn_st_mgmt_test_definition\] table. |
| validFor | Date range the service test is valid for. Data type: Object "validFor": { "endDateTime ": "String", "startDateTime": "String" } |
| validFor.endDateTime | Validity end date of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| validFor.startDateTime | Validity start date of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
[Table 28. Request body parameters (XML or JSON)]

### Headers

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#servicetestmgmt-PATCH-serviceTestid__entry__120}{#servicetestmgmt-PATCH-serviceTestid__accept-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Supported types: application/json or application/xml. Default: application/json |
[Table 29. Request headers]

{#servicetestmgmt-PATCH-serviceTestid__entry__124}

| Header | Description |
|-|-|
| None |   |
[Table 30. Response headers]

### Status codes

The following status codes apply to this HTTP action. For a
list of possible status codes used in the REST API, see [REST API HTTP response
codes](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#servicetestmgmt-PATCH-serviceTestid__entry__128}{#servicetestmgmt-PATCH-serviceTestid__entry-200-status-code}{#servicetestmgmt-PATCH-serviceTestid__entry-400-status-code}{#servicetestmgmt-PATCH-serviceTestid__entry-404-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 400 | Bad Request. A bad request type or malformed request was detected. |
| 404 | Not found. The requested item wasn't found. |
[Table 31. Status codes]

### Response body parameters (JSON or XML)

{#servicetestmgmt-PATCH-serviceTestid__entry__136}

| Name | Description |
|-|-|
| characteristic | List that describes the characteristics of the associated service test. Data type: Array of Objects "characteristic": [ { "id": "String", "name": "String", "value": "String", "valueType": "String" } ] |
| characteristic.id | Sys_id or external_id of characteristics. If external_id is present for that record, the response returns the external_id otherwise it returns the sys_id. Data type: String Table: Characteristics \[sn_prd_pm_characteristic\] |
| characteristic.name | Name of the characteristic. Data type: String |
| characteristic.value | Characteristic options associated with the service test. Characteristics vary based on the customer instance. Data type: String |
| characteristic.valueType | Type of characteristic value. * choice * date * date/time * duration * email * label * single line test * yes/no Data type: String |
| description | Description of the service test. Data type: String |
| id | Sys_id or external_id of the service test definition. Data type: String Table: Service Test \[sn_st_mgmt_test\] |
| name | Name of the service test. Data type: String |
| relatedService | Test definition associated for this test. Data type: Object "relatedService": { "href": "string", "id": "String", "name": "String" } |
| relatedService.id | Sys_id or external_id of the product inventory. Data type: String Table: Product Inventory \[sn_prd_invt_product_inventory\] |
| relatedService.name | Name of the product inventory. Data type: String |
| testMeasure | Measure of a specific aspect of a product, service, or resource test, such as lost packets or connectivity status. Data type: Array of Objects "testMeasureDefinition": [ { "accuracy": "String", "captureDateTime": "String", "captureMethod": "String", "id": "String", "metricDescription": "String", "metricName": "String", "ruleViolation": [Array] "unitOfMeasure": "String", "value": {Object} } ] |
| testMeasure.accuracy | Float decimal value representing the test measure accuracy captured for the associated metrics. Data type: Number Maximum value: 40 |
| testMeasure.captureDateTime | The date and time that the metric was captured. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| testMeasure.captureMethod | Method used to capture the metric. Valid values: * automatic: Automatically capture the metric. * manual: Manually capture the metric. * none: Don't capture the metric. {#servicetestmgmt-PATCH-serviceTestid__ul_zrs_txv_xbc} Data type: String |
| testMeasure.id | Sys_id or external_id of the test measure. Data type: String Table: Test Measures \[sn_st_mgmt_test_measure\] |
| testMeasure.metricDescription | Brief description of the metric. Data type: String |
| testMeasure.metricName | Name of a metric in the test measure. Data type: String |
| testMeasure.ruleViolation | Object for defining a rule in the threshold rule definition, along with consequences if the rule is violated. Data type: Array of Objects "RuleViolation": [ { "appliedConsequence": [Array], "conformanceComparatorExact": Boolean, "conformanceComparatorLower": "String", "conformanceComparatorUpper": "String", "conformanceTargetExact": "String", "conformanceTargetLower": "String", "conformanceTargetUpper": "String", "description": "String", "id": "String", "name": "String", "numberOfAllowedCrossing": Number, "thresholdRuleSeverity": "String", "tolerancePeriod": {Object} } ] |
| testMeasure.ruleViolation.appliedConsequence | Action (prescribed action or notification) to take when a threshold rule is violated. Data type: Array of Objects "appliedConsequence": [ { "appliedAction": "String", "description": "String", "id": "String", "name": "String", "repeatAction": Boolean } ] |
| testMeasure.ruleViolation.appliedConsequence.appliedAction | Action to take when a threshold rule is violated. For example, sending a warning or generating a report. Applied actions can vary between instances. Data type: String |
| testMeasure.ruleViolation.appliedConsequence.appliedAction.repeatAction | Flag that indicates whether to repeat the applied action or not. Valid values: * true: Repeats the action. * false: Doesn't repeat the action. {#servicetestmgmt-PATCH-serviceTestid__ul_kss_txv_xbc} Data type: Boolean Default: false |
| testMeasure.ruleViolation.appliedConsequence.description | Description of the applied consequence. Data type: String |
| testMeasure.ruleViolation.appliedConsequence.id | Sys_id or external_id of the applied consequence. Data type: String |
| testMeasure.ruleViolation.appliedConsequence.name | Name of the applied consequence. Data type: String |
| testMeasure.ruleViolation.conformanceComparatorExact | Flag that indicates whether a value is identical to the value of conformanceTargetExact. Valid values: * true: The value is identical. * false: The value isn't identical. {#servicetestmgmt-PATCH-serviceTestid__ul_uss_txv_xbc} Data type: Boolean Default: false |
| testMeasure.ruleViolation.conformanceComparatorLower | An operator that checks if a value falls below the threshold. Valid values: * greater than * is {#servicetestmgmt-PATCH-serviceTestid__ul_fts_txv_xbc} Data type: String |
| testMeasure.ruleViolation.conformanceComparatorUpper | An operator that checks if a value exceeds the threshold. Valid values: * is * lesser than {#servicetestmgmt-PATCH-serviceTestid__ul_mts_txv_xbc} Data type: String |
| testMeasure.ruleViolation.conformanceTargetExact | Required if conformanceComparatorExact is set to true. If the conformanceComparatorExact value is set to true, its value matches the value defined in conformanceTargetExact. Data type: Number |
| testMeasure.ruleViolation.conformanceTargetLower | Lower threshold value for comparing the test measure results. Determines if the threshold is crossed or no longer crossed. Data type: Number |
| testMeasure.ruleViolation.conformanceTargetUpper | Upper threshold value for comparing the test measure results. Determines if the threshold is crossed or no longer crossed. Data type: Number |
| testMeasure.ruleViolation.description | Description of the threshold rule violation. Data type: String |
| testMeasure.ruleViolation.id | Sys_id or external_id of the threshold rule violation. Data type: String Table: Threshold Rule Violation \[sn_st_mgmt_threshold_rule_violation\] |
| testMeasure.ruleViolation.numberOfAllowedCrossing | Maximum crossings allowed within the tolerance period before consequences are applied. Data type: Number Maximum: 40 |
| testMeasure.ruleViolation.thresholdRuleSeverity | Severity of the threshold rule. Valid values: * high * low * medium {#servicetestmgmt-PATCH-serviceTestid__ul_tts_txv_xbc} Data type: String |
| testMeasure.ruleViolation.tolerancePeriod | Duration or time interval in which allowed crossings can occur before a consequence is initiated. Date type: Object "tolerancePeriod": { "amount": Number, "units": "String" } |
| testMeasure.ruleViolation.tolerancePeriod.amount | Amount of the period in number. Data type: Number |
| testMeasure.ruleViolation.tolerancePeriod.units | Units of the period. Valid values: * days * hours * minutes * seconds {#servicetestmgmt-PATCH-serviceTestid__ul_my3_qds_dcc} Data type: String |
| testMeasure.unitOfMeasure | Measurable value of time used to calculate the performance of a service in days, minutes, and seconds. Data type: String |
| testMeasure.value | Value of metric in the test. Data type: Object "value": { "id": "String", "name": "String", "valueType": "String", "value": "String" } |
| testMeasure.value.id | ID of the metric value in the test. Data type: String |
| testMeasure.value.name | Name of the metric value in the test. Data type: String |
| testMeasure.value.value | Value of metric in the test. Data type: String |
| testMeasure.value.valueType | Type of test measure value such as numeric, text, and so forth. Data type: String |
| testSpecification | Test definition associated for this test. Data type: Object "testSpecification": { "href": "String", "id": "String" } |
| testSpecification.href | Hyperlink reference to the service test definition. Data type: String |
| testSpecification.id | Sys_id or external_id of the service test definition. Data type: String Table: Service Test Definition \[sn_st_mgmt_test_definition\] |
| validFor | Date range that the service test is valid for. Data type: Object "validFor": { "endDateTime": "String", "startDateTime": "String" } |
| validFor.endDateTime | End date and timestamp of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| validFor.startDateTime | Start date and timestamp of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
[ ]

### cURL request

The following example updates the given service test entity according to details provided in the request body.

    curl "http://instance.servicenow.com/api/sn_sprb_mgmt/servicetestmanagement/serviceTest/2b406ec043b202104fefe4511fb8f211" \ 
    --request PATCH \
    --header "Accept:application/json" \
    --user 'username':'password'
    --data {
      "description": "Service test description",
      "endDateTime": "2025-01-31 15:05:43",
      "mode": "proactive",
      "name": "Speed Test TR0001002",
      "startDateTime": "2024-06-05 09:07:10",
      "validFor": {
        "startDateTime": "",
        "endDateTime": ""
      },
      "relatedService": {
        "id": "fa6d13f45b5620102dff5e92dc81c77f",
        "name": "Internet_VPLS_PI0000011"
      },
      "testSpecification": {
        "href": "/api/sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification/76a3b160432a02104fefe4511fb8f2ad",
        "id": "76a3b160432a02104fefe4511fb8f2ad"
      },
      "characteristic": [
        {
          "id": "e7ef960443f202104fefe4511fb8f224",
          "name": "AccessRequired",
          "valueType": "yes_no",
          "value": "No"
        }
      ],
      "testMeasure": [
        {
          "id": "61d1382e3be28210d140068aa4e45a2e",
          "accuracy": "0.0001",
          "captureDateTime": "",
          "captureMethod": "automatic",
          "metricDescription": "",
          "metricName": "Flow speed",
          "unitOfMeasure": "A second",
          "value": "3000",
          "ruleViolation": [
            {
              "id": "61d1382e3be28210d140068aa4e45a2f",
              "description": "This speed is greater than the target",
              "name": "tooMuchTraffic",
              "numberOfAllowedCrossing": "0",
              "thresholdRuleSeverity": "high",
              "tolerancePeriod": "",
              "conformanceTargetLower": "2500",
              "conformanceComparatorLower": "greater than",
              "appliedConsequence": [
                {
                  "id": "65d1382e3be28210d140068aa4e45a31",
                  "appliedAction": "sendWarning",
                  "description": "send a warning to the system",
                  "name": "sendWarning",
                  "repeatAction": "0"
                }
              ]
            }
          ]
        }
      ]
    }

The response shows a successful update by returning the modified information in the given test service.

    {
      "description": "Service test description",
      "endDateTime": "2025-01-31 15:05:43",
      "mode": "proactive",
      "name": "Speed Test TR0001002",
      "startDateTime": "2024-06-05 09:07:10",
      "validFor": {
        "startDateTime": "",
        "endDateTime": ""
      },
      "relatedService": {
        "id": "fa6d13f45b5620102dff5e92dc81c77f",
        "name": "Internet_VPLS_PI0000011"
      },
      "testSpecification": {
        "href": "/api/sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification/76a3b160432a02104fefe4511fb8f2ad",
        "id": "76a3b160432a02104fefe4511fb8f2ad"
      },
      "characteristic": [
        {
          "id": "e7ef960443f202104fefe4511fb8f224",
          "name": "AccessRequired",
          "valueType": "yes_no",
          "value": "yes"
        }
      ],
      "testMeasure": [
        {
          "id": "61d1382e3be28210d140068aa4e45a2e",
          "accuracy": "0.0001",
          "captureDateTime": "",
          "captureMethod": "automatic",
          "metricDescription": "",
          "metricName": "Flow speed",
          "unitOfMeasure": "A second",
          "value": "3000",
          "ruleViolation": [
            {
              "id": "61d1382e3be28210d140068aa4e45a2f",
              "description": "This speed is greater than the target",
              "name": "tooMuchTraffic",
              "numberOfAllowedCrossing": "0",
              "thresholdRuleSeverity": "high",
              "tolerancePeriod": "",
              "conformanceTargetLower": "2500",
              "conformanceComparatorLower": "greater than",
              "appliedConsequence": [
                {
                  "id": "65d1382e3be28210d140068aa4e45a31",
                  "appliedAction": "sendWarning",
                  "description": "send a warning to the system",
                  "name": "sendWarning",
                  "repeatAction": "0"
                }
              ]
            }
          ]
        }
      ]
    }

## Service Test Management Open API - PATCH /sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification/{id} {#ariaid-title7}

Allows partial updates of a service test definition entity.

### URL format

Default URL: /api/sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification/{id}

### Supported request parameters

{#servicetestmgmt-PATCH-servTestSp-id__entry__2}

| Name | Description |
|-|-|
| id | Sys_id or external_id of the service test definition to retrieve. Data type: String Table: Service Test Definition \[sn_st_mgmt_test_definition\] |
[Table 32. Path parameters]

{#servicetestmgmt-PATCH-servTestSp-id__entry__6}

| Name | Description |
|-|-|
| None |   |
[Table 33. Query parameters]

{#servicetestmgmt-PATCH-servTestSp-id__entry__10}

| Name | Description |
|-|-|
| description | Description of the service test definition. Data type: String |
| name | Required. Name of the service test definition. Data type: String |
| relatedServiceSpecification | Required. Service specifications of the test definition. Data type: Array of Objects "relatedServiceSpecification": [ { "id": "String", "name": "String" } ] |
| relatedServiceSpecification.id | Sys_id or external_id of the service specification. Data type: String Table: In the sys_id or external_id field of the Specification \[sn_prd_pm_specification\] table. |
| relatedServiceSpecification.name | Name of the service specification. Data type: String |
| serviceTestSpecRelationship | Related service test definition. Data type: Array of Objects "serviceTestSpecRelationship": [ { "id": "String", "name": "String", "relationshipType": "String" } ] |
| serviceTestSpecRelationship.id | Sys_id or external_id of the related service test definition. Data type: String Table: Test Definition \[sn_st_mgmt_test_definition\] |
| serviceTestSpecRelationship.name | Name of the related test definition. Data type: String |
| serviceTestSpecRelationship.relationshipType | Type of relationship. Accepted values: * dependency * exclusivity * substitution {#servicetestmgmt-PATCH-servTestSp-id__ul_hpg_xtr_dcc} Data type: String |
| specCharacteristic | Characteristics of the test definition. Data type: Array of Objects "specCharacteristic": [ { "characteristicValueSpecification": [Array], "description": "String", "name": "String", "validFor": {Object}, "valueType": "String" } ] |
| specCharacteristic.characteristicValueSpecification | Possible values of the characteristic. Data type: Array of Objects "characteristicValueSpecification": [ { "value": "String" } ] |
| specCharacteristic.characteristicValueSpecification.value | Value of the characteristic. Data type: String |
| specCharacteristic.description | Description of the characteristic. Data type: String |
| specCharacteristic.name | Name of the characteristic. Data type: String |
| specCharacteristic.validFor | Date range that the characteristic is valid for. Data type: Object "validFor": { "endDateTime": "String", "startDateTime": "String" } |
| specCharacteristic.validFor.endDateTime | End date of the characteristic. Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. Data type: String |
| specCharacteristic.validFor.startDateTime | Start date of the characteristic. Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. Data type: String |
| specCharacteristic.valueType | Type of characteristic value. * choice * date * date/time * duration * email * label * single line test * yes/no {#servicetestmgmt-PATCH-servTestSp-id__ul_i3m_twr_dcc} Data type: String |
| testMeasureDefinition | Test measure definitions for this service test definition. For more information, see [Define test measure definitions for a service test](https://www.servicenow.com/docs/access?context=define-test-measure-spm&version=yokohama&pubname=yokohama-proactive-service-exp-workflows&ft:locale=en-US). Data type: Array of objects "testMeasureDefinition": [ { "captureFrequency": "String", "captureMethod": "String", "capturePeriod": {Object}, "id": "String", "metricDescription": "String", "metricName": "String", "name": "String", "unitOfMeasure": "String", "thresholdRule": [Array], "validFor": {Object}, "valueType": "String" } ] |
| testMeasureDefinition.captureFrequency | The frequency at which to capture the metric. Valid values: * daily * monthly * none * once * weekly {#servicetestmgmt-PATCH-servTestSp-id__ul_lsw_jxv_xbc} Data type: String |
| testMeasureDefinition.captureMethod | Method used to capture the metric. Valid values: * automatic: Automatically capture the metric. * manual: Manually capture the metric. * none: Doesn't capture the metric. {#servicetestmgmt-PATCH-servTestSp-id__ul_gsw_jxv_xbc} Data type: String |
| testMeasureDefinition.capturePeriod | Period or duration of the metric capture. Data type: Object "capturePeriod": { "amount": Number, "units": "String" } |
| testMeasureDefinition.capturePeriod.amount | Number of capture periods. Data type: Number |
| testMeasureDefinition.capturePeriod.units | Units of the period. Valid values: * days * hours * minutes * seconds {#servicetestmgmt-PATCH-servTestSp-id__ul_rn1_3ds_dcc} Data type: String |
| testMeasureDefinition.id | Sys_id or external_id of the test measure definitions. Data type: String Table: Test Measure definition table \[sn_st_mgmt_test_measure_definition\] |
| testMeasureDefinition.metricDescription | Brief description of the metric. Data type: String |
| testMeasureDefinition.metricName | User-defined name of a metric in the test measure. Data type: String |
| testMeasureDefinition.name | Name of the test measure definition. Data type: String |
| testMeasureDefinition.thresholdRule | Rule that defines conditions to achieve before applying consequences when a threshold is crossed (or not crossed)​ in the test measure definition. For more information, see [Define threshold rules for a test measure definition](https://www.servicenow.com/docs/access?context=define-threshold-rules&version=yokohama&pubname=yokohama-proactive-service-exp-workflows&ft:locale=en-US). Data type: Array of Objects { "thresholdRule": { "consequence": [Array], "conformanceComparatorExact": Boolean, "conformanceComparatorLower": "String", "conformanceComparatorUpper": "String", "conformanceTargetExact": "String", "conformanceTargetLower": "String", "conformanceTargetUpper": "String", "consequence": [Array], "description": "String", "id": "String", "name": "String", "numberOfAllowedCrossing": Number, "thresholdRuleSeverity": "String", "tolerancePeriod": {Object} } } |
| testMeasureDefinition.thresholdRule.conformanceComparatorExact | Flag that indicates whether a value is identical to the value set for testMeasureDefinition.thresholdRule.conformanceTargetExact. If set to true, testMeasureDefinition.thresholdRule.conformanceTargetExact is required. Valid values: * true: The value is identical to the value of conformanceTargetExact. * false: The value isn't identical conformanceTargetExact. {#servicetestmgmt-PATCH-servTestSp-id__ul_bsw_jxv_xbc} Data type: Boolean Default: false |
| testMeasureDefinition.thresholdRule.conformanceComparatorLower | Operator that checks if a value falls below the threshold. Valid values: * greater than * greater than or is {#servicetestmgmt-PATCH-servTestSp-id__ul_zrw_jxv_xbc} Data type: String |
| testMeasureDefinition.thresholdRule.conformanceComparatorUpper | Operator that checks if a value exceeds the threshold. Valid values: * less than * less than or is {#servicetestmgmt-PATCH-servTestSp-id__ul_wrw_jxv_xbc} Data type: String |
| testMeasureDefinition.thresholdRule.conformanceTargetExact | Required if conformanceComparatorExact is set to true. If the conformanceComparatorExact value is set to true, its value matches the value defined in conformanceTargetExact. Data type: Number |
| testMeasureDefinition.thresholdRule.conformanceTargetLower | Lower threshold value for comparing the test measure results. Data type: Number |
| testMeasureDefinition.thresholdRule.conformanceTargetUpper | Upper threshold value for comparing the test measure results. Data type: Number |
| testMeasureDefinition.thresholdRule.consequence | Action (prescribed action or notification) to take when a threshold rule is crossed. For more information, see [Define measure consequences for the threshold rules](https://www.servicenow.com/docs/access?context=define-threshold-consequences-spm&version=yokohama&pubname=yokohama-proactive-service-exp-workflows&ft:locale=en-US). Data type: Array of objects "consequence": [ { "description": "String", "id": "String", "name": "String", "prescribeAction": "String", "repeatAction": Boolean, "validFor": { "endDateTime": "String", "startDateTime": "String" } ] |
| testMeasureDefinition.thresholdRule.consequence.description | Description of the consequence. Data type: String |
| testMeasureDefinition.thresholdRule.consequence.id | Sys_id or external_id of the measure consequence. Data type: String |
| testMeasureDefinition.thresholdRule.consequence.name | Name of the consequence. Data type: String |
| testMeasureDefinition.thresholdRule.consequence.prescribeAction | User-defined action to take for threshold violations. Actions vary between instances. Data type: String |
| testMeasureDefinition.thresholdRule.consequence.repeatAction | Flag that indicates whether to repeat the applied consequence. Valid values: * true: Repeats the action. * false: Doesn't repeat the action. {#servicetestmgmt-PATCH-servTestSp-id__ul_srw_jxv_xbc} Data type: Boolean Default: false |
| testMeasureDefinition.thresholdRule.consequence.validFor | Date range that the consequence is valid for. Data type: Object "validFor": { "startDateTime": "String", "endDateTime ": "String" } |
| testMeasureDefinition.thresholdRule.consequence.validFor.endDateTime | Validity end date of the consequence. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| testMeasureDefinition.thresholdRule.consequence.validFor.startDateTime | Validity start date of the consequence. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| testMeasureDefinition.thresholdRule.description | Description of the threshold rule. Data type: String |
| testMeasureDefinition.thresholdRule.id | Sys_id or external_id of the threshold rules. Data type: String Table: In the sys_id or external_id field of the Threshold Rules \[sn_st_mgmt_threshold_rule\] table. |
| testMeasureDefinition.thresholdRule.name | Name of the threshold rule. Data type: String |
| testMeasureDefinition.thresholdRule.numberOfAllowedCrossing | Maximum crossings allowed within the tolerance period before consequences are applied. Data type: Number Maximum value: 40 |
| testMeasureDefinition.thresholdRule.thresholdRuleSeverity | Severity level of the threshold rule. Valid values: * high * medium * low {#servicetestmgmt-PATCH-servTestSp-id__ul_orw_jxv_xbc} Data type: String |
| testMeasureDefinition.unitOfMeasure | Measurable value of time used to calculate the performance of a service in days, minutes, and seconds. Data type: String |
| testMeasureDefinition.validFor | Date range that the test measure definition is valid for. Data type: String "validFor": { "endDateTime": "String", "startDateTime": "String" } |
| testMeasureDefinition.validFor.endDateTime | Validity end date of the test measure definition. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| testMeasureDefinition.validFor.startDateTime | Validity start date of the test measure definition. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
[Table 34. Request body parameters (XML or JSON)]

### Headers

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#servicetestmgmt-PATCH-servTestSp-id__entry__118}{#servicetestmgmt-PATCH-servTestSp-id__accept-RESTAPI}{#servicetestmgmt-PATCH-servTestSp-id__content_type-JSON-only-entry-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Supported types: application/json or application/xml. Default: application/json |
| Content-Type | Data format of the request body. Only supports application/json. |
[Table 35. Request headers]

{#servicetestmgmt-PATCH-servTestSp-id__entry__124}

| Header | Description |
|-|-|
| Content-Type | Data format of the response body. Only supports application/json. |
[Table 36. Response headers]

### Status codes

The following status codes apply to this HTTP action. For a
list of possible status codes used in the REST API, see [REST API HTTP response
codes](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#servicetestmgmt-PATCH-servTestSp-id__entry__128}{#servicetestmgmt-PATCH-servTestSp-id__entry-200-status-code}{#servicetestmgmt-PATCH-servTestSp-id__entry-400-status-code}{#servicetestmgmt-PATCH-servTestSp-id__entry-404-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 400 | Bad Request. A bad request type or malformed request was detected. |
| 404 | Not found. The requested item wasn't found. |
[Table 37. Status codes]

### Response body parameters (JSON or XML) {#servicetestmgmt-PATCH-servTestSp-id__section_h1m_wz4_qbc}

{#servicetestmgmt-PATCH-servTestSp-id__table_i1m_wz4_qbc__entry__2}

| Name | Description |
|-|-|
| description | Description of the service test definition. Data type: String |
| id | Sys_id or external_id of the service test definition. Data type: String Table: Service Test \[sn_st_mgmt_test\] |
| name | Name of the service test definition. Data type: String |
| relatedServiceSpecification | Service specifications for the test definitions. Data type: Array of Objects "relatedServiceSpecification": [ { "id": "String", "name": "String" } ] |
| relatedServiceSpecification.id | Sys_id or external_id of the service specification. Data type: String Table: In the sys_id or external_id field of the Specification \[sn_prd_pm_specification\] table. |
| relatedServiceSpecification.name | Name of the service specification. Data type: String |
| serviceTestSpecRelationship | Related service test definition. Data type: Array of Objects "serviceTestSpecRelationship": [ { "id": "String", "name": "String", "relationshipType": "String" } ] |
| serviceTestSpecRelationship.id | Sys_id or external_id of the related service test definition. Data type: String Table: Test Definition \[sn_st_mgmt_test_definition\] |
| serviceTestSpecRelationship.name | Name of the related test definition. Data type: String |
| serviceTestSpecRelationship.relationshipType | Type of relationship. Accepted values: * dependency * exclusivity * substitution {#servicetestmgmt-PATCH-servTestSp-id__d4582e2407} Data type: String |
| specCharacteristic | Test definition characteristics. Data type: Array of Objects "specCharacteristic": [ { "characteristicValueSpecification": [Array], "description": "String", "name": "String", "validFor": {Object}, "valueType": "String" } ] |
| specCharacteristic.characteristicValueSpecification | Possible values of the characteristic. Data type: Array of Objects "characteristicValueSpecification": [ { "value": "String" } ] |
| specCharacteristic.characteristicValueSpecification.value | Value of the characteristic. Data type: String |
| specCharacteristic.description | Description of the characteristic. Data type: String |
| specCharacteristic.name | Name of the characteristic. Data type: String |
| specCharacteristic.validFor | Date range the characteristic is valid for. Data type: Object "validFor": { "endDateTime": "String", "startDateTime": "String" } |
| specCharacteristic.validFor.endDateTime | End date of the characteristic. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| specCharacteristic.validFor.startDateTime | Start date of the characteristic. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| specCharacteristic.valueType | Type of characteristic value. * choice * date * date/time * duration * email * label * single line test * yes/no {#servicetestmgmt-PATCH-servTestSp-id__ul_uwb_5wr_dcc} Data type: String |
| testMeasureDefinition | Test measure definitions for this service test definition. For more information, see [Define test measure definitions for a service test](https://www.servicenow.com/docs/access?context=define-test-measure-spm&version=yokohama&pubname=yokohama-proactive-service-exp-workflows&ft:locale=en-US). Data type: Array of Objects "testMeasureDefinition": [ { "captureFrequency": "String", "captureMethod": "String", "capturePeriod": {Object}, "id": "String", "metricDescription": "String", "metricName": "String", "name": "String", "unitOfMeasure": "String", "thresholdRule": [Array], "validFor": {Object}, "valueType": "String" } ] |
| testMeasureDefinition.captureFrequency | Frequency at which to capture the metric. Valid values: * daily * monthly * none * once * weekly {#servicetestmgmt-PATCH-servTestSp-id__ul_od2_sxv_xbc} Data type: String |
| testMeasureDefinition.captureMethod | Method used to capture the metric. Valid values: * automatic: Automatically capture the metric. * manual: Manually capture the metric. * none: Don't capture the metric. {#servicetestmgmt-PATCH-servTestSp-id__ul_rd2_sxv_xbc} Data type: String |
| testMeasureDefinition.capturePeriod | Duration or period of the capture. Data type: Object "capturePeriod": { "amount": Number, "units": "String" } |
| testMeasureDefinition.capturePeriod.amount | Number of capture periods. Data type: Number |
| testMeasureDefinition.capturePeriod.units | Units of the period. Accepted values: * days * hours * minutes * seconds {#servicetestmgmt-PATCH-servTestSp-id__ul_lfv_dds_dcc} Data type: String |
| testMeasureDefinition.id | Sys_id or external_id of the Test Measure definitions. Data type: String Table: Test Measure definition \[sn_st_mgmt_test_measure_definition\] |
| testMeasureDefinition.metricDescription | Brief description of the metric. Data type: String |
| testMeasureDefinition.metricName | User-defined name of a metric in the test measure. Data type: String |
| testMeasureDefinition.name | Name of the test measure definition. Data type: String |
| testMeasureDefinition.thresholdRule | Rule that defines the condition (raise or clear) to achieve to apply consequences when a threshold is crossed or ceased to be crossed​ for a particular test measure definition. Data type: Array of Objects { "thresholdRule": { "conformanceComparatorExact": Boolean, "conformanceComparatorLower": "String", "conformanceComparatorUpper": "String", "conformanceTargetExact": "String", "conformanceTargetLower": "String", "conformanceTargetUpper": "String", "consequence": [Array], "description": "String", "id": "String", "name": "String", "numberOfAllowedCrossing": Number, "thresholdRuleSeverity": "String", "tolerancePeriod": Object } } |
| testMeasureDefinition.thresholdRule.conformanceComparatorExact | Flag that indicates whether a value is identical to the value of conformanceTargetExact. Valid values: * true: The value is identical to the value of conformanceTargetExact. * false: The value isn't identical conformanceTargetExact. {#servicetestmgmt-PATCH-servTestSp-id__ul_gyl_vqr_dcc} Data type: Boolean Default: false |
| testMeasureDefinition.thresholdRule.conformanceComparatorLower | Operator that checks if a value falls below the threshold. Valid values: * greater than * is {#servicetestmgmt-PATCH-servTestSp-id__ul_b22_sxv_xbc} Data type: String |
| testMeasureDefinition.thresholdRule.conformanceComparatorUpper | Operator that checks if a value exceeds the threshold. Valid values: * lesser than * is {#servicetestmgmt-PATCH-servTestSp-id__ul_e22_sxv_xbc} Data type: String |
| testMeasureDefinition.thresholdRule.conformanceTargetExact | Required if conformanceComparatorExact is set to true. If the conformanceComparatorExact value is set to true, its value matches the value defined in conformanceTargetExact. Data type: Number |
| testMeasureDefinition.thresholdRule.conformanceTargetLower | Lower threshold value for comparing the test measure results. Data type: Number |
| testMeasureDefinition.thresholdRule.conformanceTargetUpper | Upper threshold value for comparing the test measure results. Data type: Number |
| testMeasureDefinition.thresholdRule.consequence | Action (prescribed action or notification) to take when a threshold rule is crossed. Data type: Array of Objects "consequence": [ { "description": "String", "id": "String", "name": "String", "prescribeAction": "String", "repeatAction": Boolean, "validFor": { "endDateTime": "String", "startDateTime": "String" } ] |
| testMeasureDefinition.thresholdRule.consequence.description | Description of the consequence. Data type: String |
| testMeasureDefinition.thresholdRule.consequence.id | Sys_id or external_id of the measure consequence. Data type: String |
| testMeasureDefinition.thresholdRule.consequence.name | Name of the consequence. Data type: String |
| testMeasureDefinition.thresholdRule.consequence.prescribeAction | User-defined action to take for threshold violations. Actions vary between instances. Data type: String |
| testMeasureDefinition.thresholdRule.consequence.repeatAction | Flag that indicates whether to repeat the applied action or not. Valid values: * true: Repeats the action. * false: Doesn't repeat the action. {#servicetestmgmt-PATCH-servTestSp-id__ul_rjm_pxy_rbc} Data type: Boolean Default: false |
| testMeasureDefinition.thresholdRule.consequence.validFor | Date range that the consequence is valid for. Data type: Object "validFor": { "startDateTime": "String", "endDateTime ": "String" } |
| testMeasureDefinition.thresholdRule.consequence.validFor.endDateTime | Validity end date of the consequence. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| testMeasureDefinition.thresholdRule.consequence.validFor.startDateTime | Validity start date of the consequence. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| testMeasureDefinition.thresholdRule.description | Description of the threshold rule. Data type: String |
| testMeasureDefinition.thresholdRule.id | Sys_id or external_id of the threshold rules. Data type: String Table: Threshold Rules \[sn_st_mgmt_threshold_rule\] |
| testMeasureDefinition.thresholdRule.name | Name of the threshold rule. Data type: String |
| testMeasureDefinition.thresholdRule.numberOfAllowedCrossing | Maximum crossings allowed within the tolerance period before consequences are applied. Data type: Number Maximum value: 40 |
| testMeasureDefinition.thresholdRule.thresholdRuleSeverity | Severity of the threshold rule. Valid values: * high * low * medium {#servicetestmgmt-PATCH-servTestSp-id__ul_j22_sxv_xbc} Data type: String |
| testMeasureDefinition.unitOfMeasure | Measurable value of time used to calculate the performance of a service in days, minutes, and seconds. Data type: String |
| testMeasureDefinition.validFor | Date range the test measure definition is valid for. Data type: Object "validFor": { "endDateTime": "String", "startDateTime": "String" } |
| testMeasureDefinition.validFor.endDateTime | Validity end date of the test measure definition. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| testMeasureDefinition.validFor.startDateTime | Validity start date of the test measure definition. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
[ ]

{#servicetestmgmt-PATCH-servTestSp-id__table_i1m_wz4_qbc}  

### cURL request

The following example partially updates the given service test definition ID according to modifications provided in the request body.

    curl "http://instance.servicenow.com/api/sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification/89d2b920432a02104fefe4511fb8f22e " 
    --request PATCH
    --header "Accept:application/json" 
    --user 'username':'password'
    --data {
      "description": "Upstream and Downstream speed ",
      "name": "This is my new Speed Test",
      "testMeasureDefinition": [
        {
          "id": "1a04f560432a02104fefe4511fb8f2ad",
          "captureFrequency": "once",
          "captureMethod": "automatic",
          "metricDescription": "This is the downstream speed in a service",
          "metricName": "Downstream Speed",
          "name": "Downstream Speed",
          "unitOfMeasure": "a second",
          "valueType": "",
          "capturePeriod": "30 Minutes",
          "validFor": {
            "startDateTime": "2024-05-30 08:49:26",
            "endDateTime": "2024-05-31 08:49:29"
          },
          "thresholdRule": [
            {
              "id": "a754f960432a02104fefe4511fb8f2d0",
              "description": "This speed is greater than the target upper",
              "name": "InternetSpeedValue",
              "numberOfAllowedCrossing": "0",
              "thresholdRuleSeverity": "high",
              "tolerancePeriod": "15 Minutes",
              "conformanceTargetLower": "75",
              "conformanceComparatorLower": "greater than",
              "consequence": [
                {
                  "id": "15a4bd60432a02104fefe4511fb8f2b8",
                  "prescribeAction": "null",
                  "description": "generate a waring report",
                  "name": "degradedQualityOfService",
                  "repeatAction": "0",
                  "validFor": {
                    "startDateTime": "2024-05-30 08:51:29",
                    "endDateTime": "2024-08-06 08:51:31"
                  }
                },
                {
                  "id": "e6847d60432a02104fefe4511fb8f2c3",
                  "prescribeAction": "null",
                  "description": "send a warning to the system",
                  "name": "packetdrop",
                  "repeatAction": "0",
                  "validFor": {
                    "startDateTime": "2024-05-30 08:50:53",
                    "endDateTime": "2024-08-06 08:50:55"
                  }
                }
              ]
            },
            {
              "id": "cb55b5a0432a02104fefe4511fb8f201",
              "description": "",
              "name": "InternetSpeedValue",
              "numberOfAllowedCrossing": "0",
              "thresholdRuleSeverity": "medium",
              "tolerancePeriod": "",
              "conformanceTargetUpper": "120",
              "conformanceComparatorUpper": "less than",
              "consequence": []
            }
          ]
        },
        {
          "id": "8f987524432a02104fefe4511fb8f2f0",
          "captureFrequency": "once",
          "captureMethod": "automatic",
          "metricDescription": "This is the upstream speed in the service",
          "metricName": "Upstream Speed",
          "name": "Upstream Speed",
          "unitOfMeasure": "a second",
          "valueType": "",
          "capturePeriod": "",
          "validFor": {
            "startDateTime": "",
            "endDateTime": ""
          },
          "thresholdRule": []
        }
      ],
      "specCharacteristic": [
        {
          "name": "restart",
          "description": "restart",
          "valueType": "yes_no",
          "validFor": {
            "startDatetime": "2024-05-30 08:45:49"
          }
        }
      ],
      "serviceTestSpecRelationship": [
        {
          "id": "76a3b160432a02104fefe4511fb8f2ad",
          "name": "OAM Test",
          "relationshipType": ""
        }
      ],
      "relatedServiceSpecification": [
        {
          "id": "aeddcd1fb7d69910ff00f203ae11a990",
          "name": "Home Internet"
        }
      ]
    }

The response body returns the updated portion of the service test specification:

    {
      "description": "Upstream and Downstream speed ",
      "name": "This is my new Speed Test",
      "testMeasureDefinition": [
        {
          "id": "1a04f560432a02104fefe4511fb8f2ad",
          "captureFrequency": "once",
          "captureMethod": "automatic",
          "metricDescription": "This is the downstream speed in a service",
          "metricName": "Downstream Speed",
          "name": "Downstream Speed",
          "unitOfMeasure": "a second",
          "valueType": "",
          "capturePeriod": "30 Minutes",
          "validFor": {
            "startDateTime": "2024-05-30 08:49:26",
            "endDateTime": "2024-05-31 08:49:29"
          },
          "thresholdRule": [
            {
              "id": "a754f960432a02104fefe4511fb8f2d0",
              "description": "This speed is greater than the target upper",
              "name": "InternetSpeedValue",
              "numberOfAllowedCrossing": "0",
              "thresholdRuleSeverity": "high",
              "tolerancePeriod": "15 Minutes",
              "conformanceTargetLower": "75",
              "conformanceComparatorLower": "greater than",
              "consequence": [
                {
                  "id": "15a4bd60432a02104fefe4511fb8f2b8",
                  "prescribeAction": "null",
                  "description": "generate a waring report",
                  "name": "degradedQualityOfService",
                  "repeatAction": "0",
                  "validFor": {
                    "startDateTime": "2024-05-30 08:51:29",
                    "endDateTime": "2024-08-06 08:51:31"
                  }
                },
                {
                  "id": "e6847d60432a02104fefe4511fb8f2c3",
                  "prescribeAction": "null",
                  "description": "send a warning to the system",
                  "name": "packetdrop",
                  "repeatAction": "0",
                  "validFor": {
                    "startDateTime": "2024-05-30 08:50:53",
                    "endDateTime": "2024-08-06 08:50:55"
                  }
                }
              ]
            },
            {
              "id": "cb55b5a0432a02104fefe4511fb8f201",
              "description": "",
              "name": "InternetSpeedValue",
              "numberOfAllowedCrossing": "0",
              "thresholdRuleSeverity": "medium",
              "tolerancePeriod": "",
              "conformanceTargetUpper": "120",
              "conformanceComparatorUpper": "less than",
              "consequence": []
            }
          ]
        },
        {
          "id": "8f987524432a02104fefe4511fb8f2f0",
          "captureFrequency": "once",
          "captureMethod": "automatic",
          "metricDescription": "This is the upstream speed in the service",
          "metricName": "Upstream Speed",
          "name": "Upstream Speed",
          "unitOfMeasure": "a second",
          "valueType": "",
          "capturePeriod": "",
          "validFor": {
            "startDateTime": "",
            "endDateTime": ""
          },
          "thresholdRule": []
        }
      ],
      "specCharacteristic": [
        {
          "name": "restart",
          "description": "restart",
          "valueType": "yes_no",
          "validFor": {
            "startDatetime": "2024-05-30 08:45:49"
          }
        }
      ],
      "serviceTestSpecRelationship": [
        {
          "id": "76a3b160432a02104fefe4511fb8f2ad",
          "name": "OAM Test",
          "relationshipType": ""
        }
      ],
      "relatedServiceSpecification": [
        {
          "id": "aeddcd1fb7d69910ff00f203ae11a990",
          "name": "Home Internet"
        }
      ]
    }

## Service Test Management Open API - POST /sn_sprb_mgmt/servicetestmanagement/serviceTest {#ariaid-title8}

Creates a service test.

### URL format

Default URL: /api/sn_sprb_mgmt/servicetestmanagement/serviceTest

### Supported request parameters

{#servicetestmgmt-POST-serviceTest__entry__2}

| Name | Description |
|-|-|
| None |   |
[Table 38. Path parameters]

{#servicetestmgmt-POST-serviceTest__entry__6}

| Name | Description |
|-|-|
| None |   |
[Table 39. Query parameters]

{#servicetestmgmt-POST-serviceTest__id_q31_zd1_qbc__entry__2}{#servicetestmgmt-POST-serviceTest__serviceTest-request-characteristic}{#servicetestmgmt-POST-serviceTest__serviceTest-request-characteristic.id}{#servicetestmgmt-POST-serviceTest__serviceTest-request-characteristic.name}{#servicetestmgmt-POST-serviceTest__serviceTest-request-characteristic.value}{#servicetestmgmt-POST-serviceTest__serviceTest-request-characteristic.valueType}{#servicetestmgmt-POST-serviceTest__serviceTest-request-description}{#servicetestmgmt-POST-serviceTest__serviceTest-request-endDateTime}{#servicetestmgmt-POST-serviceTest__serviceTest-request-id}{#servicetestmgmt-POST-serviceTest__serviceTest-request-mode}{#servicetestmgmt-POST-serviceTest__serviceTest-request-name}{#servicetestmgmt-POST-serviceTest__serviceTest-request-relatedService}{#servicetestmgmt-POST-serviceTest__serviceTest-request-relatedService.href}{#servicetestmgmt-POST-serviceTest__serviceTest-request-relatedService.id}{#servicetestmgmt-POST-serviceTest__serviceTest-request-relatedService.name}{#servicetestmgmt-POST-serviceTest__serviceTest-request-startDateTime}{#servicetestmgmt-POST-serviceTest__serviceTest-request-state}{#servicetestmgmt-POST-serviceTest__serviceTest-request-testMeasure}{#servicetestmgmt-POST-serviceTest__serviceTest-request-testMeasure.accuracy}{#servicetestmgmt-POST-serviceTest__serviceTest-request-testMeasure.captureDateTime}{#servicetestmgmt-POST-serviceTest__serviceTest-request-testMeasure.id}{#servicetestmgmt-POST-serviceTest__serviceTest-request-testMeasure.captureMethod}{#servicetestmgmt-POST-serviceTest__serviceTest-request-testMeasure.metricDescription}{#servicetestmgmt-POST-serviceTest__serviceTest-request-testMeasure.metricName}{#servicetestmgmt-POST-serviceTest__serviceTest-request-testMeasure.ruleViolation}{#servicetestmgmt-POST-serviceTest__serviceTest-request-testMeasure.ruleViolation.appliedConsequence}{#servicetestmgmt-POST-serviceTest__serviceTest-request-testMeasure.ruleViolation.appliedConsequence.appliedAction}{#servicetestmgmt-POST-serviceTest__serviceTest-request-testMeasure.ruleViolation.appliedConsequence.description}{#servicetestmgmt-POST-serviceTest__serviceTest-request-testMeasure.ruleViolation.appliedConsequence.id}{#servicetestmgmt-POST-serviceTest__serviceTest-request-testMeasure.ruleViolation.appliedConsequence.name}{#servicetestmgmt-POST-serviceTest__serviceTest-request-testMeasure.ruleViolation.appliedConsequence.repeatAction}{#servicetestmgmt-POST-serviceTest__serviceTest-request-testMeasure.ruleViolation.conformanceComporatorExact}{#servicetestmgmt-POST-serviceTest__serviceTest-request-testMeasure.ruleViolation.conformanceComporatorLower}{#servicetestmgmt-POST-serviceTest__serviceTest-request-testMeasure.ruleViolation.conformanceComporatorUpper}{#servicetestmgmt-POST-serviceTest__serviceTest-request-testMeasure.ruleViolation.conformanceTargetExact}{#servicetestmgmt-POST-serviceTest__serviceTest-request-testMeasure.ruleViolation.conformanceTargetLower}{#servicetestmgmt-POST-serviceTest__serviceTest-request-testMeasure.ruleViolation.conformanceTargetUpper}{#servicetestmgmt-POST-serviceTest__serviceTest-request-testMeasure.ruleViolation.description}{#servicetestmgmt-POST-serviceTest__serviceTest-request-test.Measure.ruleViolation.id}{#servicetestmgmt-POST-serviceTest__serviceTest-request-testMeasure.ruleViolation.name}{#servicetestmgmt-POST-serviceTest__serviceTest-request-testMeasure.ruleViolation.numberOfAllowedCrossing}{#servicetestmgmt-POST-serviceTest__serviceTest-request-estMeasure.ruleViolation.thresholdRuleSeverity}{#servicetestmgmt-POST-serviceTest__serviceTest-request-testMeasure.ruleViolation.tolerancePeriod}{#servicetestmgmt-POST-serviceTest__serviceTest-request-testMeasure.ruleViolation.amount}{#servicetestmgmt-POST-serviceTest__serviceTest-request-testMeasure.ruleViolation.tolerancePeriod.units}{#servicetestmgmt-POST-serviceTest__serviceTest-request-testMeasure.unitOfMeasure}{#servicetestmgmt-POST-serviceTest__serviceTest-request-testMeasure.value}{#servicetestmgmt-POST-serviceTest__serviceTest-request-testMeasure.value.id}{#servicetestmgmt-POST-serviceTest__serviceTest-request-testMeasure.value.name}{#servicetestmgmt-POST-serviceTest__serviceTest-request-testMeasure.value.value}{#servicetestmgmt-POST-serviceTest__serviceTest-request-testMeasure.value.valueType}{#servicetestmgmt-POST-serviceTest__serviceTest-request-testSpecification}{#servicetestmgmt-POST-serviceTest__serviceTest-request-testSpecification.href}{#servicetestmgmt-POST-serviceTest__serviceTest-request-testSpecification.id}{#servicetestmgmt-POST-serviceTest__serviceTest-request-validFor}{#servicetestmgmt-POST-serviceTest__serviceTest-request-validFor.endDateTime}{#servicetestmgmt-POST-serviceTest__serviceTest-request-validFor.startDateTime}

| Name | Description |
|-|-|
| characteristic | List that describes the characteristics of the associated service test. For more information about test definition characteristics, see Data type: Array of Objects "characteristic": [ { "id": "String", "name": "String", "value": "String", "valueType": "String" } ] |
| characteristic.id | Sys_id or external_id of characteristics. If external_id is present for that record, the response returns the external_id otherwise it returns the sys_id. Data type: String Table: Characteristics \[sn_prd_pm_characteristic\] |
| characteristic.name | Name of the characteristic. Data type: String |
| characteristic.value | Characteristic options associated with the service test. Characteristics vary based on the customer instance. Data type: String |
| characteristic.valueType | Type of characteristic value. * choice * date * date/time * duration * email * label * single line test * yes/no {#servicetestmgmt-POST-serviceTest__ul_zfr_twr_dcc} Data type: String |
| description | Description of the service test. Data type: String |
| endDateTime | End date and time of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| id | Sys_id or external_id of the service test. This ID creates a service test and is used as the external_id. Data type: String Table: Service Test \[sn_st_mgmt_test\] |
| mode | Mode that the service test is running in. Valid values: * ONDEMAND: Triggers the service test manually. * PROACTIVE: Triggers the service test automatically. {#servicetestmgmt-POST-serviceTest__ul_ybc_mqn_xbc} Data type: String Default: ONDEMAND |
| name | Required. Name of the service test. Data type: String |
| relatedService | Required. Test definition associated with the service test. Data type: Object "relatedService": { "href": "String", "id": "String", "name": "String" } |
| relatedService.href | Hyperlink reference to the related service. Data type: String |
| relatedService.id | Sys_id or external_id of the product inventory. Data type: String Table: In the sys_id or external_id field of the product Inventory \[sn_prd_invt_product_inventory\] table. |
| relatedService.name | Name of the product inventory item. Data type: String |
| startDateTime | Start date and time of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| state | State the service test is in. Valid values: * acknowledged * canceled * completed * failed * inProgress * pending * rejected {#servicetestmgmt-POST-serviceTest__ul_gym_mqn_xbc} Data type: String |
| testMeasure | Measure of a specific aspect of a product, service, or resource test, such as lost packets or connectivity status. Data type: Array of Objects "testMeasure": [ { "accuracy": "String", "captureDateTime": "String", "captureMethod": "String", "id": "String", "metricDescription": "String", "metricName": "String", "ruleViolation": [Array], "unitOfMeasure": "String", "value": {Object} } ] |
| testMeasure.accuracy | Float decimal value representing the test measure accuracy captured for the associated metrics. Data type: Number Maximum value: 40 |
| testMeasure.captureDateTime | The date and time that the metric was captured. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| testMeasure.id | Sys_id or external_id of the Test Measures. Data type: String Table: In the sys_id or external_id fields of the Test Measures table \[sn_st_mgmt_test_measure\] table. |
| testMeasure.Measure.captureMethod | Method used to capture the metric. Valid values: * automatic: Automatically capture the metric. * manual: Manually capture the metric. * none: Don't capture the metric. {#servicetestmgmt-POST-serviceTest__ul_ed2_gxv_xbc} Data type: String |
| testMeasure.metricDescription | Brief description of the metric. Data type: String |
| testMeasure.metricName | Name of the test measure metric. Data type: String |
| testMeasure.ruleViolation | An object for defining a rule in the threshold rule definition, along with consequences if the rule is violated. Data type: Array of Objects "ruleViolation"[ { appliedConsequence: [Array], conformanceTargetUpper: Number, conformanceComparatorUpper: "String", description: "String", id: "String", name: "String", numberOfAllowedCrossing: Number, thresholdRuleSeverity: "String", tolerancePeriod: "String" } ] |
| testMeasure.ruleViolation.appliedConsequence | Action (prescribed action or notification) to take when a threshold rule is crossed. Data type: Array of Objects "appliedConsequence": [ { "appliedAction": "String", "description": "String", "id": "String", "name": "String", "repeatAction": Boolean } ] |
| testMeasure.ruleViolation.appliedConsequence.appliedAction | Action to take when a threshold rule is violated. For example, sending a warning or generating a report. Applied actions can vary between instances. Data type: String |
| testMeasure.ruleViolation.appliedConsequence.description | Description of the applied consequence. Data type: String |
| testMeasure.ruleViolation.appliedConsequence.id | Sys_id or external_id of the applied consequence. Data type: String |
| testMeasure.ruleViolation.appliedConsequence.name | Name of the applied consequence. Data type: String |
| testMeasure.ruleViolation.appliedConsequence.repeatAction | Flag that indicates whether to repeat the consequence when a second violation occurs. Valid values: * true: Repeat the action. * false: Don't repeat the action. {#servicetestmgmt-POST-serviceTest__ul_ld2_gxv_xbc} Data type: Boolean Default: false |
| testMeasure.ruleViolation.conformanceComporatorExact | Flag that indicates whether a value is identical. Valid values: * true: The value is identical. * false: The value isn't identical. {#servicetestmgmt-POST-serviceTest__ul_od2_gxv_xbc} Data type: Boolean Default: false |
| testMeasure.ruleViolation.conformanceComporatorLower | Operator for checking if a value falls below the threshold. Valid values: * greater than * greater than or is {#servicetestmgmt-POST-serviceTest__ul_sd2_gxv_xbc} Data type: String |
| testMeasure.ruleViolation.conformanceComporatorUpper | Operator for checking if a value is above the threshold. Valid values: * less than * less than or is {#servicetestmgmt-POST-serviceTest__ul_vd2_gxv_xbc} Data type: String |
| testMeasure.ruleViolation.conformanceTargetExact | Required if conformanceComparatorExact is set to true. If the conformanceComparatorExact value is set to true, its value matches the value defined in conformanceTargetExact. Data type: Number |
| testMeasure.ruleViolation.conformanceTargetLower | Lower threshold value for comparing the test measure results. Determines if the threshold is crossed or no longer crossed. Data type: Number |
| testMeasure.ruleViolation.conformanceTargetUpper | Upper threshold value for comparing the test measure results. Determines if the threshold is crossed or no longer crossed. Data type: Number |
| testMeasure.ruleViolation.description | Description of the threshold rule. Data type: String |
| testMeasure.ruleViolation.id | Sys_id or external_id of the threshold rule violation. Data type: String Table: Threshold Rule Violation \[sn_st_mgmt_threshold_rule_violation\] |
| testMeasure.ruleViolation.name | Name of the threshold rule. Data type: String |
| testMeasure.ruleViolation.numberOfAllowedCrossing | Maximum crossings allowed within the tolerance period before consequences are applied. Data type: Number Maximum value: 40 |
| testMeasure.ruleViolation.thresholdRuleSeverity | Severity of the threshold rule. Valid values: * high * medium * low {#servicetestmgmt-POST-serviceTest__ul_xd2_gxv_xbc} Data type: String |
| testMeasure.ruleViolation.tolerancePeriod | Specified time interval during which crossing occurrences are enabled without triggering any immediate consequences or actions. Date type: Object "tolerancePeriod": { "amount": Number, "units": "String" } |
| testMeasure.ruleViolation.tolerancePeriod.amount | Number of periods before applying the consequence. Data type: Number |
| testMeasure.ruleViolation.tolerancePeriod.units | Units of the period. Valid values: * days * hours * minutes * seconds {#servicetestmgmt-POST-serviceTest__ul_qbw_qds_dcc} Data type: String |
| testMeasure.unitOfMeasure | Unit of measurement for the conformance target values of the test measure. Data type: String |
| testMeasure.value | Value of the test measure. Data type: Object "value": { "id": "String", "name": "String", "valueType": "String", "value": "String } |
| testMeasure.value.id | ID of the test measure value. Data type: String |
| testMeasure.value.name | Name of the test measure value. Data type: String |
| testMeasure.value.value | Value of the test measure. Data type: String |
| testMeasure.value.valueType | Type of test measure value such as numeric, text, and so forth. Data type: String |
| testSpecification | Required. Test definition associated with this test. Data type: Object "testSpecification": { "href": "String", "id": "String" } |
| testSpecification.href | Hyperlink reference to the service test definition. Data type: String |
| testSpecification.id | Sys_id or external_id of the service test definition. Data type: String Table: In the sys_id or external_id field of the Service Test Definition \[sn_st_mgmt_test_definition\] table. |
| validFor | Date range the service test is valid for. Data type: Object "validFor": { "endDateTime ": "String", "startDateTime": "String" } |
| validFor.endDateTime | Validity end date of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| validFor.startDateTime | Validity start date of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
[Table 40. Request body parameters (XML or JSON)]

{#servicetestmgmt-POST-serviceTest__id_q31_zd1_qbc}

### Headers

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#servicetestmgmt-POST-serviceTest__entry__124}{#servicetestmgmt-POST-serviceTest__accept-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Supported types: application/json or application/xml. Default: application/json |
[Table 41. Request headers]

{#servicetestmgmt-POST-serviceTest__entry__128}

| Header | Description |
|-|-|
| None |   |
[Table 42. Response headers]

### Status codes

The following status codes apply to this HTTP action. For a
list of possible status codes used in the REST API, see [REST API HTTP response
codes](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#servicetestmgmt-POST-serviceTest__entry__132}{#servicetestmgmt-POST-serviceTest__entry-200-status-code}{#servicetestmgmt-POST-serviceTest__entry-400-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 400 | Bad Request. A bad request type or malformed request was detected. |
[Table 43. Status codes]

### Response body parameters (JSON or XML)

{#servicetestmgmt-POST-serviceTest__table_qzk_r2p_qbc__entry__2}

| Name | Description |
|-|-|
| characteristic | List that describes the characteristics of the associated service test. Data type: Array of Objects "characteristic": [ { "id": "String", "name": "String", "value": "String", "valueType": "String" } ] |
| characteristic.id | Sys_id or external_id of characteristics. If external_id is present for that record, the response returns the external_id otherwise it returns the sys_id. Data type: String Table: Characteristics \[sn_prd_pm_characteristic\] |
| characteristic.name | Name of the characteristic. Data type: String |
| characteristic.value | Characteristic options associated with the service test. Characteristics vary based on the customer instance. Data type: String |
| characteristic.valueType | Type of characteristic value. * choice * date * date/time * duration * email * label * single line test * yes/no Data type: String |
| description | Description of the service test. Data type: String |
| endDateTime | End date and time of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| id | Sys_id or external_id of the service test definition. Data type: String Table: Service Test \[sn_st_mgmt_test\] |
| mode | Mode that the service test is running in. Valid values: * ONDEMAND: Triggers the service test manually. * PROACTIVE: Triggers the service test automatically. {#servicetestmgmt-POST-serviceTest__ul_itl_ksn_xbc} Data type: String Default: ONDEMAND |
| name | Name of the service test. Data type: String |
| relatedService | Test definition associated for this test. Data type: Object "relatedService": { "href": "string", "id": "String", "name": "String" } |
| relatedService.id | Sys_id or external_id of the product inventory. Data type: String Table: Product Inventory \[sn_prd_invt_product_inventory\] |
| relatedService.name | Name of the product inventory. Data type: String |
| startDateTime | Start date and time of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| state | State of the service test. Valid values: * acknowledged * canceled * completed * failed * inProgress * pending * rejected {#servicetestmgmt-POST-serviceTest__ul_prs_txv_xbc} Data type: String |
| testMeasure | Measure of a specific aspect of a product, service, or resource test, such as lost packets or connectivity status. Data type: Array of Objects "testMeasureDefinition": [ { "accuracy": "String", "captureDateTime": "String", "captureMethod": "String", "id": "String", "metricDescription": "String", "metricName": "String", "ruleViolation": [Array] "unitOfMeasure": "String", "value": {Object} } ] |
| testMeasure.accuracy | Float decimal value representing the test measure accuracy captured for the associated metrics. Data type: Number Maximum value: 40 |
| testMeasure.captureDateTime | The date and time that the metric was captured. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| testMeasure.captureMethod | Method used to capture the metric. Valid values: * automatic: Automatically capture the metric. * manual: Manually capture the metric. * none: Don't capture the metric. {#servicetestmgmt-POST-serviceTest__ul_zrs_txv_xbc} Data type: String |
| testMeasure.id | Sys_id or external_id of the test measure. Data type: String Table: Test Measures \[sn_st_mgmt_test_measure\] |
| testMeasure.metricDescription | Brief description of the metric. Data type: String |
| testMeasure.metricName | Name of a metric in the test measure. Data type: String |
| testMeasure.ruleViolation | Object for defining a rule in the threshold rule definition, along with consequences if the rule is violated. Data type: Array of Objects "RuleViolation": [ { "appliedConsequence": [Array], "conformanceComparatorExact": Boolean, "conformanceComparatorLower": "String", "conformanceComparatorUpper": "String", "conformanceTargetExact": "String", "conformanceTargetLower": "String", "conformanceTargetUpper": "String", "description": "String", "id": "String", "name": "String", "numberOfAllowedCrossing": Number, "thresholdRuleSeverity": "String", "tolerancePeriod": {Object} } ] |
| testMeasure.ruleViolation.appliedConsequence | Action (prescribed action or notification) to take when a threshold rule is violated. Data type: Array of Objects "appliedConsequence": [ { "appliedAction": "String", "description": "String", "id": "String", "name": "String", "repeatAction": Boolean } ] |
| testMeasure.ruleViolation.appliedConsequence.appliedAction | Action to take when a threshold rule is violated. For example, sending a warning or generating a report. Applied actions can vary between instances. Data type: String |
| testMeasure.ruleViolation.appliedConsequence.appliedAction.repeatAction | Flag that indicates whether to repeat the applied action or not. Valid values: * true: Repeats the action. * false: Doesn't repeat the action. {#servicetestmgmt-POST-serviceTest__ul_kss_txv_xbc} Data type: Boolean Default: false |
| testMeasure.ruleViolation.appliedConsequence.description | Description of the applied consequence. Data type: String |
| testMeasure.ruleViolation.appliedConsequence.id | Sys_id or external_id of the applied consequence. Data type: String |
| testMeasure.ruleViolation.appliedConsequence.name | Name of the applied consequence. Data type: String |
| testMeasure.ruleViolation.conformanceComparatorExact | Flag that indicates whether a value is identical to the value of conformanceTargetExact. Valid values: * true: The value is identical. * false: The value isn't identical. {#servicetestmgmt-POST-serviceTest__ul_uss_txv_xbc} Data type: Boolean Default: false |
| testMeasure.ruleViolation.conformanceComparatorLower | An operator that checks if a value falls below the threshold. Valid values: * greater than * is {#servicetestmgmt-POST-serviceTest__ul_fts_txv_xbc} Data type: String |
| testMeasure.ruleViolation.conformanceComparatorUpper | An operator that checks if a value exceeds the threshold. Valid values: * is * lesser than {#servicetestmgmt-POST-serviceTest__ul_mts_txv_xbc} Data type: String |
| testMeasure.ruleViolation.conformanceTargetExact | Required if conformanceComparatorExact is set to true. If the conformanceComparatorExact value is set to true, its value matches the value defined in conformanceTargetExact. Data type: Number |
| testMeasure.ruleViolation.conformanceTargetLower | Lower threshold value for comparing the test measure results. Determines if the threshold is crossed or no longer crossed. Data type: Number |
| testMeasure.ruleViolation.conformanceTargetUpper | Upper threshold value for comparing the test measure results. Determines if the threshold is crossed or no longer crossed. Data type: Number |
| testMeasure.ruleViolation.description | Description of the threshold rule violation. Data type: String |
| testMeasure.ruleViolation.id | Sys_id or external_id of the threshold rule violation. Data type: String Table: Threshold Rule Violation \[sn_st_mgmt_threshold_rule_violation\] |
| testMeasure.ruleViolation.name | Name of the threshold rule violation. Date type: String |
| testMeasure.ruleViolation.numberOfAllowedCrossing | Maximum crossings allowed within the tolerance period before consequences are applied. Data type: Number Maximum: 40 |
| testMeasure.ruleViolation.thresholdRuleSeverity | Severity of the threshold rule. Valid values: * high * low * medium {#servicetestmgmt-POST-serviceTest__ul_tts_txv_xbc} Data type: String |
| testMeasure.ruleViolation.tolerancePeriod | Duration or time interval in which allowed crossings can occur before a consequence is initiated. Date type: Object "tolerancePeriod": { "amount": Number, "units": "String" } |
| testMeasure.ruleViolation.tolerancePeriod.amount | Amount of the period in number. Data type: Number |
| testMeasure.ruleViolation.tolerancePeriod.units | Units of the period. Valid values: * days * hours * minutes * seconds {#servicetestmgmt-POST-serviceTest__ul_my3_qds_dcc} Data type: String |
| testMeasure.unitOfMeasure | Measurable value of time used to calculate the performance of a service in days, minutes, and seconds. Data type: String |
| testMeasure.value | Value of metric in the test. Data type: Object "value": { "id": "String", "name": "String", "valueType": "String", "value": "String" } |
| testMeasure.value.id | ID of the metric value in the test. Data type: String |
| testMeasure.value.name | Name of the metric value in the test. Data type: String |
| testMeasure.value.name | Name of the metric value in the test. Data type: String |
| testMeasure.value.value | Value of metric in the test. Data type: String |
| testMeasure.value.valueType | Type of test measure value such as numeric, text, and so forth. Data type: String |
| testSpecification | Test definition associated for this test. Data type: Object "testSpecification": { "href": "String", "id": "String" } |
| testSpecification.href | Hyperlink reference to the service test definition. Data type: String |
| testSpecification.id | Sys_id or external_id of the service test definition. Data type: String Table: Service Test Definition \[sn_st_mgmt_test_definition\] |
| validFor | Date range that the service test is valid for. Data type: Object "validFor": { "endDateTime": "String", "startDateTime": "String" } |
| validFor.endDateTime | End date and timestamp of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| validFor.startDateTime | Start date and timestamp of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
[ ]

{#servicetestmgmt-POST-serviceTest__table_qzk_r2p_qbc}  

### cURL request {#servicetestmgmt-POST-serviceTest__example_x42_qf1_qbc}

The following example creates a new service test according to specific details provided in the request body.

    curl "https:/instance.servicenow.com/api/sn_sprb_mgmt/servicetestmanagement/serviceTest" \
    --request POST \
    --header "Accept:application/json" \
    --header "Content-Type:application/json" \
    --data {
      "description": "Service test",
      "endDateTime": "2025-01-31 15:05:43",
      "mode": "proactive",
      "name": "Speed Test TR0001002",
      "startDateTime": "2024-06-05 09:07:10",
      "validFor": {
        "startDateTime": "",
        "endDateTime": ""
      },
      "relatedService": {
        "id": "fa6d13f45b5620102dff5e92dc81c77f",
        "name": "Internet_VPLS_PI0000011"
      },
      "testSpecification": {
        "href": "/api/sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification/76a3b160432a02104fefe4511fb8f2ad",
        "id": "76a3b160432a02104fefe4511fb8f2ad"
      },
      "characteristic": [
        {
          "id": "e7ef960443f202104fefe4511fb8f224",
          "name": "AccessRequired",
          "valueType": "yes_no",
          "value": "Yes"
        }
      ],
      "testMeasure": [
        {
          "id": "61d1382e3be28210d140068aa4e45a2e",
          "accuracy": "0.0001",
          "captureDateTime": "",
          "captureMethod": "automatic",
          "metricDescription": "",
          "metricName": "Flow speed",
          "unitOfMeasure": "A second",
          "value": "3000",
          "ruleViolation": [
            {
              "id": "61d1382e3be28210d140068aa4e45a2f",
              "description": "This speed is greater than the target",
              "name": "tooMuchTraffic",
              "numberOfAllowedCrossing": "0",
              "thresholdRuleSeverity": "high",
              "tolerancePeriod": "",
              "conformanceTargetLower": "2500",
              "conformanceComparatorLower": "greater than",
              "appliedConsequence": [
                {
                  "id": "65d1382e3be28210d140068aa4e45a31",
                  "appliedAction": "sendWarning",
                  "description": "send a warning to the system",
                  "name": "sendWarning",
                  "repeatAction": "0"
                }
              ]
            }
          ]
        }
      ]
    }

The response returns confirmation details about the new test service and assigns it a unique ID, 2b406ec043b202104fefe4511fb8f211:

    {
      "description": "Service test",
      "endDateTime": "2025-01-31 15:05:43",
      "mode": "proactive",
      "name": "Speed Test TR0001002",
      "startDateTime": "2024-06-05 09:07:10",
      "validFor": {
        "startDateTime": "",
        "endDateTime": ""
      },
      "relatedService": {
        "id": "fa6d13f45b5620102dff5e92dc81c77f",
        "name": "Internet_VPLS_PI0000011"
      },
      "testSpecification": {
        "href": "/api/sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification/76a3b160432a02104fefe4511fb8f2ad",
        "id": "76a3b160432a02104fefe4511fb8f2ad"
      },
      "characteristic": [
        {
          "id": "e7ef960443f202104fefe4511fb8f224",
          "name": "AccessRequired",
          "valueType": "yes_no",
          "value": "Yes"
        }
      ],
      "testMeasure": [
        {
          "id": "61d1382e3be28210d140068aa4e45a2e",
          "accuracy": "0.0001",
          "captureDateTime": "",
          "captureMethod": "automatic",
          "metricDescription": "",
          "metricName": "Flow speed",
          "unitOfMeasure": "A second",
          "value": "3000",
          "ruleViolation": [
            {
              "id": "61d1382e3be28210d140068aa4e45a2f",
              "description": "This speed is greater than the target",
              "name": "tooMuchTraffic",
              "numberOfAllowedCrossing": "0",
              "thresholdRuleSeverity": "high",
              "tolerancePeriod": "",
              "conformanceTargetLower": "2500",
              "conformanceComparatorLower": "greater than",
              "appliedConsequence": [
                {
                  "id": "65d1382e3be28210d140068aa4e45a31",
                  "appliedAction": "sendWarning",
                  "description": "send a warning to the system",
                  "name": "sendWarning",
                  "repeatAction": "0"
                }
              ]
            }
          ]
        }
      ],
      "id": "2b406ec043b202104fefe4511fb8f211"
    }

## Service Test Management Open API - POST /sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification {#ariaid-title9}

Creates a new service test definition.

### URL format

Default URL: /api/sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification

### Supported request parameters

{#servicetestmgmt-POST-serviceTestSp__entry__2}

| Name | Description |
|-|-|
| None |   |
[Table 44. Path parameters]

{#servicetestmgmt-POST-serviceTestSp__entry__6}

| Name | Description |
|-|-|
| None |   |
[Table 45. Query parameters]

{#servicetestmgmt-POST-serviceTestSp__id_thr_xwn_qbc__entry__2}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-description-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-id-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-name-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-relatedServiceSpecification-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-relatedServiceSpecification.id-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-relatedServiceSpecification.name-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-specCharacteristics-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-specCharacteristics.characteristicValueSpecification-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-specCharacteristic.characteristicValueSpecification.value-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-specCharacteristic.characteristicValueSpecification.descr-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-specCharacteristic.characteristicValueSpecification.name-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-specCharacteristic.validFor-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-specCharacteristic.validFor.endDateTime-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-specCharacteristic.validFor.startDateTime-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-specCharacteristic.valueType-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-testMeasureDefinition-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-testMeasureDefinition.captureFrequency-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-testMeasureDefinition.captureMethod-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-testMeasureDefinition.capturePeriod-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-testMeasureDefinition.capturePeriod.amount-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-testMeasureDefinition.capturePeriod.units-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-testMeasureDefinition.id-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-testMeasureDefinition.metricDescription-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-testMeasureDefinition.metricName-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-testMeasureDefinition.name-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-testMeasureDefinition.thresholdRule-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-testMeasureDefinition.thresholdRule.ComporatorExact-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-testMeasureDefinition.thresholdRule.ComporatorLower-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-testMeasureDefinition.thresholdRule.ComporatorUpper-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-testMeasureDefinition.thresholdRule.TargetExact-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-testMeasureDefinition.thresholdRule.TargetLower-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-testMeasureDefinition.thresholdRule.TargetUpper-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-testMeasureDefinition.thresholdRule.consequence-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-testMeasureDefinition.thresholdRule.consequence.description-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-testMeasureDefinition.thresholdRule.consequence.id-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-testMeasureDefinition.thresholdRule.consequence.name-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-testMeasureDefinition.thresholdRule.consequence.prescribeAction-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-testMeasureDefinition.thresholdRule.consequence.repeatAction-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-testMeasureDefinition.thresholdRule.consequence.validFor-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-testMeasureDefinition.thresholdRule.consequence.validFor.endDateTime-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-testMeasureDefinition.thresholdRule.consequence.validFor.startDateTime-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-testMeasureDefinition.thresholdRule.description-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-testMeasureDefinition.thresholdRule.id-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-testMeasureDefinition.thresholdRule.name-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-testMeasureDefinition.thresholdRule.numberOfAllowedCrossing-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-testMeasureDefinition.thresholdRule.thresholdRuleSeverity-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-testMeasureDefinition.unitOfMeasure-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-testMeasureDefinition.validFor-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-testMeasureDefinition.validFor.endDateTime-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-testMeasureDefinition.validFor.startDateTime-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-validFor-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-validFor.endDateTime-param}{#servicetestmgmt-POST-serviceTestSp__testSpec-request-validFor.startDateTime-param}

| Name | Description |
|-|-|
| description | Description of the service test definition. Data type: String |
| id | Sys_id or external_id of the service test definition. Data type: String Table: Service Test Definition \[sn_st_mgmt_test_definition\] |
| name | Required. Name of the service test definition. Data type: String |
| relatedServiceSpecification | Required. Service specifications of the test definition. Data type: Array of Objects "relatedServiceSpecification": [ { "id": "String", "name": "String" } ] |
| relatedServiceSpecification.id | Sys_id or external_id of the service specification. Data type: String Table: In the sys_id or external_id field of the Specification \[sn_prd_pm_specification\] table. |
| relatedServiceSpecification.name | Name of the service specification. Data type: String |
| serviceTestSpecRelationship | Related service test definition. Data type: Array of objects "serviceTestSpecRelationship": [ { "id": "String", "name": "String", "relationshipType": "String" } ] |
| serviceTestSpecRelationship.id | Sys_id or external_id of the related service test definition. Data type: String Table: In the sys_id or external_id field of the Test Definition \[sn_st_mgmt_test_definition\] table. |
| serviceTestSpecRelationship.name | Name of the related test definition. Data type: String |
| serviceTestSpecRelationship.relationshipType | Type of relationship. Valid values: * dependency * exclusivity * substitution Data type: String |
| specCharacteristic | Characteristics of the test definition. Data type: Array of Objects "specCharacteristic": [ { "characteristicValueSpecification": [Array], "description": "String", "name": "String", "validFor": {Object}, "valueType": "String" } ] |
| specCharacteristic.characteristicValueSpecification | Possible values of the characteristic. Data type: Array of Objects "characteristicValueSpecification": [ { "value": "String" } ] |
| specCharacteristic.characteristicValueSpecification.value | Value of the characteristic. Data type: String |
| specCharacteristic.description | Description of the characteristic. Data type: String |
| specCharacteristic.name | Name of the characteristic. Data type: String |
| specCharacteristic.validFor | Date range that the characteristic is valid for. Data type: Object "validFor": { "endDateTime": "String", "startDateTime": "String" } |
| specCharacteristic.validFor.endDateTime | End date of the characteristic. Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. Data type: String |
| specCharacteristic.validFor.startDateTime | Start date of the characteristic. Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. Data type: String |
| specCharacteristic.valueType | Type of characteristic value. * choice * date * date/time * duration * email * label * single line test * yes/no {#servicetestmgmt-POST-serviceTestSp__ul_i3m_twr_dcc} Data type: String |
| testMeasureDefinition | Test measure definitions for this service test definition. For more information, see [Define test measure definitions for a service test](https://www.servicenow.com/docs/access?context=define-test-measure-spm&version=yokohama&pubname=yokohama-proactive-service-exp-workflows&ft:locale=en-US). Data type: Array of objects "testMeasureDefinition": [ { "captureFrequency": "String", "captureMethod": "String", "capturePeriod": {Object}, "id": "String", "metricDescription": "String", "metricName": "String", "name": "String", "unitOfMeasure": "String", "thresholdRule": [Array], "validFor": {Object}, "valueType": "String" } ] |
| testMeasureDefinition.captureFrequency | The frequency at which to capture the metric. Valid values: * daily * monthly * none * once * weekly {#servicetestmgmt-POST-serviceTestSp__ul_lsw_jxv_xbc} Data type: String |
| testMeasureDefinition.captureMethod | Method used to capture the metric. Valid values: * automatic: Automatically capture the metric. * manual: Manually capture the metric. * none: Doesn't capture the metric. {#servicetestmgmt-POST-serviceTestSp__ul_gsw_jxv_xbc} Data type: String |
| testMeasureDefinition.capturePeriod | Period or duration of the metric capture. Data type: Object "capturePeriod": { "amount": Number, "units": "String" } |
| testMeasureDefinition.capturePeriod.amount | Number of capture periods. Data type: Number |
| testMeasureDefinition.capturePeriod.units | Units of the period. Valid values: * days * hours * minutes * seconds {#servicetestmgmt-POST-serviceTestSp__ul_rn1_3ds_dcc} Data type: String |
| testMeasureDefinition.id | Sys_id or external_id of the test measure definitions. Data type: String Table: Test Measure definition table \[sn_st_mgmt_test_measure_definition\] |
| testMeasureDefinition.metricDescription | Brief description of the metric. Data type: String |
| testMeasureDefinition.metricName | User-defined name of a metric in the test measure. Data type: String |
| testMeasureDefinition.name | Name of the test measure definition. Data type: String |
| testMeasureDefinition.thresholdRule | Rule that defines conditions to achieve before applying consequences when a threshold is crossed (or not crossed)​ in the test measure definition. For more information, see [Define threshold rules for a test measure definition](https://www.servicenow.com/docs/access?context=define-threshold-rules&version=yokohama&pubname=yokohama-proactive-service-exp-workflows&ft:locale=en-US). Data type: Array of Objects { "thresholdRule": { "consequence": [Array], "conformanceComparatorExact": Boolean, "conformanceComparatorLower": "String", "conformanceComparatorUpper": "String", "conformanceTargetExact": "String", "conformanceTargetLower": "String", "conformanceTargetUpper": "String", "consequence": [Array], "description": "String", "id": "String", "name": "String", "numberOfAllowedCrossing": Number, "thresholdRuleSeverity": "String", "tolerancePeriod": {Object} } } |
| testMeasureDefinition.thresholdRule.conformanceComparatorExact | Flag that indicates whether a value is identical to the value set for testMeasureDefinition.thresholdRule.conformanceTargetExact. If set to true, testMeasureDefinition.thresholdRule.conformanceTargetExact is required. Valid values: * true: The value is identical to the value of conformanceTargetExact. * false: The value isn't identical conformanceTargetExact. {#servicetestmgmt-POST-serviceTestSp__ul_bsw_jxv_xbc} Data type: Boolean Default: false |
| testMeasureDefinition.thresholdRule.conformanceComparatorLower | Operator that checks if a value falls below the threshold. Valid values: * greater than * greater than or is {#servicetestmgmt-POST-serviceTestSp__ul_zrw_jxv_xbc} Data type: String |
| testMeasureDefinition.thresholdRule.conformanceComparatorUpper | Operator that checks if a value exceeds the threshold. Valid values: * less than * less than or is {#servicetestmgmt-POST-serviceTestSp__ul_wrw_jxv_xbc} Data type: String |
| testMeasureDefinition.thresholdRule.conformanceTargetExact | Required if conformanceComparatorExact is set to true. If the conformanceComparatorExact value is set to true, its value matches the value defined in conformanceTargetExact. Data type: Number |
| testMeasureDefinition.thresholdRule.conformanceTargetLower | Lower threshold value for comparing the test measure results. Data type: Number |
| testMeasureDefinition.thresholdRule.conformanceTargetUpper | Upper threshold value for comparing the test measure results. Data type: Number |
| testMeasureDefinition.thresholdRule.consequence | Action (prescribed action or notification) to take when a threshold rule is crossed. For more information, see [Define measure consequences for the threshold rules](https://www.servicenow.com/docs/access?context=define-threshold-consequences-spm&version=yokohama&pubname=yokohama-proactive-service-exp-workflows&ft:locale=en-US). Data type: Array of objects "consequence": [ { "description": "String", "id": "String", "name": "String", "prescribeAction": "String", "repeatAction": Boolean, "validFor": { "endDateTime": "String", "startDateTime": "String" } ] |
| testMeasureDefinition.thresholdRule.consequence.description | Description of the consequence. Data type: String |
| testMeasureDefinition.thresholdRule.consequence.id | Sys_id or external_id of the measure consequence. Data type: String |
| testMeasureDefinition.thresholdRule.consequence.name | Name of the consequence. Data type: String |
| testMeasureDefinition.thresholdRule.consequence.prescribeAction | User-defined action to take for threshold violations. Actions vary between instances. Data type: String |
| testMeasureDefinition.thresholdRule.consequence.repeatAction | Flag that indicates whether to repeat the applied consequence. Valid values: * true: Repeats the action. * false: Doesn't repeat the action. {#servicetestmgmt-POST-serviceTestSp__ul_srw_jxv_xbc} Data type: Boolean Default: false |
| testMeasureDefinition.thresholdRule.consequence.validFor | Date range that the consequence is valid for. Data type: Object "validFor": { "startDateTime": "String", "endDateTime ": "String" } |
| testMeasureDefinition.thresholdRule.consequence.validFor.endDateTime | Validity end date of the consequence. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| testMeasureDefinition.thresholdRule.consequence.validFor.startDateTime | Validity start date of the consequence. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| testMeasureDefinition.thresholdRule.description | Description of the threshold rule. Data type: String |
| testMeasureDefinition.thresholdRule.id | Sys_id or external_id of the threshold rules. Data type: String Table: In the sys_id or external_id field of the Threshold Rules \[sn_st_mgmt_threshold_rule\] table. |
| testMeasureDefinition.thresholdRule.name | Name of the threshold rule. Data type: String |
| testMeasureDefinition.thresholdRule.numberOfAllowedCrossing | Maximum crossings allowed within the tolerance period before consequences are applied. Data type: Number Maximum value: 40 |
| testMeasureDefinition.thresholdRule.thresholdRuleSeverity | Severity level of the threshold rule. Valid values: * high * medium * low {#servicetestmgmt-POST-serviceTestSp__ul_orw_jxv_xbc} Data type: String |
| testMeasureDefinition.unitOfMeasure | Measurable value of time used to calculate the performance of a service in days, minutes, and seconds. Data type: String |
| testMeasureDefinition.validFor | Date range that the test measure definition is valid for. Data type: String "validFor": { "endDateTime": "String", "startDateTime": "String" } |
| testMeasureDefinition.validFor.endDateTime | Validity end date of the test measure definition. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| testMeasureDefinition.validFor.startDateTime | Validity start date of the test measure definition. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| validFor | Date range that the test definition is valid for. Data type: Object "validFor": { "endDateTime": "String", "startDateTime": "String" } |
| validFor.endDateTime | Date and time of the test definition on which the state of it is retired. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| validFor.startDateTime | Date and time of the test definition on which the state of it is published. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
[Table 46. Request body parameters (XML or JSON)]

{#servicetestmgmt-POST-serviceTestSp__id_thr_xwn_qbc}

### Headers

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#servicetestmgmt-POST-serviceTestSp__entry__126}{#servicetestmgmt-POST-serviceTestSp__accept-JSON-only-entry-RESTAPI}{#servicetestmgmt-POST-serviceTestSp__content_type-JSON-only-entry-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Only supports application/json. |
| Content-Type | Data format of the request body. Only supports application/json. |
[Table 47. Request headers]

{#servicetestmgmt-POST-serviceTestSp__entry__132}

| Header | Description |
|-|-|
| Content-Type | Data format of the response body. Only supports application/json. |
[Table 48. Response headers]

### Status codes

The following status codes apply to this HTTP action. For a
list of possible status codes used in the REST API, see [REST API HTTP response
codes](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#servicetestmgmt-POST-serviceTestSp__entry__136}{#servicetestmgmt-POST-serviceTestSp__entry-200-status-code}{#servicetestmgmt-POST-serviceTestSp__entry-400-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 400 | Bad Request. A bad request type or malformed request was detected. |
[Table 49. Status codes]

### Response body parameters (JSON or XML)

{#servicetestmgmt-POST-serviceTestSp__table_qqg_3s4_qbc__entry__2}

| Name | Description |
|-|-|
| description | Description of the service test definition. Data type: String |
| id | Sys_id or external_id of the service test definition. Data type: String Table: Service Test \[sn_st_mgmt_test\] |
| name | Name of the service test definition. Data type: String |
| relatedServiceSpecification | Service specifications for the test definitions. Data type: Array of Objects "relatedServiceSpecification": [ { "id": "String", "name": "String" } ] |
| relatedServiceSpecification.id | Sys_id or external_id of the service specification. Data type: String Table: In the sys_id or external_id field of the Specification \[sn_prd_pm_specification\] table. |
| relatedServiceSpecification.name | Name of the service specification. Data type: String |
| serviceTestSpecRelationship | Related service test definition. Data type: Array of Objects "serviceTestSpecRelationship": [ { "id": "String", "name": "String", "relationshipType": "String" } ] |
| serviceTestSpecRelationship.id | Sys_id or external_id of the related service test definition. Data type: String Table: Test Definition \[sn_st_mgmt_test_definition\] |
| serviceTestSpecRelationship.name | Name of the related test definition. Data type: String |
| serviceTestSpecRelationship.relationshipType | Type of relationship. Accepted values: * dependency * exclusivity * substitution {#servicetestmgmt-POST-serviceTestSp__ul_hpg_xtr_dcc} Data type: String |
| specCharacteristic | Test definition characteristics. Data type: Array of Objects "specCharacteristic": [ { "characteristicValueSpecification": [Array], "description": "String", "name": "String", "validFor": {Object}, "valueType": "String" } ] |
| specCharacteristic.characteristicValueSpecification | Possible values of the characteristic. Data type: Array of Objects "characteristicValueSpecification": [ { "value": "String" } ] |
| specCharacteristic.characteristicValueSpecification.value | Value of the characteristic. Data type: String |
| specCharacteristic.description | Description of the characteristic. Data type: String |
| specCharacteristic.name | Name of the characteristic. Data type: String |
| specCharacteristic.validFor | Date range the characteristic is valid for. Data type: Object "validFor": { "endDateTime": "String", "startDateTime": "String" } |
| specCharacteristic.validFor.endDateTime | End date of the characteristic. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| specCharacteristic.validFor.startDateTime | Start date of the characteristic. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| specCharacteristic.valueType | Type of characteristic value. * choice * date * date/time * duration * email * label * single line test * yes/no {#servicetestmgmt-POST-serviceTestSp__ul_uwb_5wr_dcc} Data type: String |
| testMeasureDefinition | Test measure definitions for this service test definition. For more information, see [Define test measure definitions for a service test](https://www.servicenow.com/docs/access?context=define-test-measure-spm&version=yokohama&pubname=yokohama-proactive-service-exp-workflows&ft:locale=en-US). Data type: Array of Objects "testMeasureDefinition": [ { "captureFrequency": "String", "captureMethod": "String", "capturePeriod": {Object}, "id": "String", "metricDescription": "String", "metricName": "String", "name": "String", "unitOfMeasure": "String", "thresholdRule": [Array], "validFor": {Object}, "valueType": "String" } ] |
| testMeasureDefinition.captureFrequency | Frequency at which to capture the metric. Valid values: * daily * monthly * none * once * weekly {#servicetestmgmt-POST-serviceTestSp__ul_od2_sxv_xbc} Data type: String |
| testMeasureDefinition.captureMethod | Method used to capture the metric. Valid values: * automatic: Automatically capture the metric. * manual: Manually capture the metric. * none: Don't capture the metric. {#servicetestmgmt-POST-serviceTestSp__ul_rd2_sxv_xbc} Data type: String |
| testMeasureDefinition.capturePeriod | Duration or period of the capture. Data type: Object "capturePeriod": { "amount": Number, "units": "String" } |
| testMeasureDefinition.capturePeriod.amount | Number of capture periods. Data type: Number |
| testMeasureDefinition.capturePeriod.units | Units of the period. Accepted values: * days * hours * minutes * seconds {#servicetestmgmt-POST-serviceTestSp__ul_lfv_dds_dcc} Data type: String |
| testMeasureDefinition.id | Sys_id or external_id of the Test Measure definitions. Data type: String Table: Test Measure definition \[sn_st_mgmt_test_measure_definition\] |
| testMeasureDefinition.metricDescription | Brief description of the metric. Data type: String |
| testMeasureDefinition.metricName | User-defined name of a metric in the test measure. Data type: String |
| testMeasureDefinition.name | Name of the test measure definition. Data type: String |
| testMeasureDefinition.thresholdRule | Rule that defines the condition (raise or clear) to achieve to apply consequences when a threshold is crossed or ceased to be crossed​ for a particular test measure definition. Data type: Array of Objects { "thresholdRule": { "conformanceComparatorExact": Boolean, "conformanceComparatorLower": "String", "conformanceComparatorUpper": "String", "conformanceTargetExact": "String", "conformanceTargetLower": "String", "conformanceTargetUpper": "String", "consequence": [Array], "description": "String", "id": "String", "name": "String", "numberOfAllowedCrossing": Number, "thresholdRuleSeverity": "String", "tolerancePeriod": Object } } |
| testMeasureDefinition.thresholdRule.conformanceComparatorExact | Flag that indicates whether a value is identical to the value of conformanceTargetExact. Valid values: * true: The value is identical to the value of conformanceTargetExact. * false: The value isn't identical conformanceTargetExact. {#servicetestmgmt-POST-serviceTestSp__ul_gyl_vqr_dcc} Data type: Boolean Default: false |
| testMeasureDefinition.thresholdRule.conformanceComparatorLower | Operator that checks if a value falls below the threshold. Valid values: * greater than * is {#servicetestmgmt-POST-serviceTestSp__ul_b22_sxv_xbc} Data type: String |
| testMeasureDefinition.thresholdRule.conformanceComparatorUpper | Operator that checks if a value exceeds the threshold. Valid values: * lesser than * is {#servicetestmgmt-POST-serviceTestSp__ul_e22_sxv_xbc} Data type: String |
| testMeasureDefinition.thresholdRule.conformanceTargetExact | Required if conformanceComparatorExact is set to true. If the conformanceComparatorExact value is set to true, its value matches the value defined in conformanceTargetExact. Data type: Number |
| testMeasureDefinition.thresholdRule.conformanceTargetLower | Lower threshold value for comparing the test measure results. Data type: Number |
| testMeasureDefinition.thresholdRule.conformanceTargetUpper | Upper threshold value for comparing the test measure results. Data type: Number |
| testMeasureDefinition.thresholdRule.consequence | Action (prescribed action or notification) to take when a threshold rule is crossed. Data type: Array of Objects "consequence": [ { "description": "String", "id": "String", "name": "String", "prescribeAction": "String", "repeatAction": Boolean, "validFor": { "endDateTime": "String", "startDateTime": "String" } ] |
| testMeasureDefinition.thresholdRule.consequence.description | Description of the consequence. Data type: String |
| testMeasureDefinition.thresholdRule.consequence.id | Sys_id or external_id of the measure consequence. Data type: String |
| testMeasureDefinition.thresholdRule.consequence.name | Name of the consequence. Data type: String |
| testMeasureDefinition.thresholdRule.consequence.prescribeAction | User-defined action to take for threshold violations. Actions vary between instances. Data type: String |
| testMeasureDefinition.thresholdRule.consequence.repeatAction | Flag that indicates whether to repeat the applied action or not. Valid values: * true: Repeats the action. * false: Doesn't repeat the action. {#servicetestmgmt-POST-serviceTestSp__ul_rjm_pxy_rbc} Data type: Boolean Default: false |
| testMeasureDefinition.thresholdRule.consequence.validFor | Date range that the consequence is valid for. Data type: Object "validFor": { "startDateTime": "String", "endDateTime ": "String" } |
| testMeasureDefinition.thresholdRule.consequence.validFor.endDateTime | Validity end date of the consequence. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| testMeasureDefinition.thresholdRule.consequence.validFor.startDateTime | Validity start date of the consequence. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| testMeasureDefinition.thresholdRule.description | Description of the threshold rule. Data type: String |
| testMeasureDefinition.thresholdRule.id | Sys_id or external_id of the threshold rules. Data type: String Table: Threshold Rules \[sn_st_mgmt_threshold_rule\] |
| testMeasureDefinition.thresholdRule.name | Name of the threshold rule. Data type: String |
| testMeasureDefinition.thresholdRule.numberOfAllowedCrossing | Maximum crossings allowed within the tolerance period before consequences are applied. Data type: Number Maximum value: 40 |
| testMeasureDefinition.thresholdRule.thresholdRuleSeverity | Severity of the threshold rule. Valid values: * high * low * medium {#servicetestmgmt-POST-serviceTestSp__ul_j22_sxv_xbc} Data type: String |
| testMeasureDefinition.unitOfMeasure | Measurable value of time used to calculate the performance of a service in days, minutes, and seconds. Data type: String |
| testMeasureDefinition.validFor | Date range the test measure definition is valid for. Data type: Object "validFor": { "endDateTime": "String", "startDateTime": "String" } |
| testMeasureDefinition.validFor.endDateTime | Validity end date of the test measure definition. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| testMeasureDefinition.validFor.startDateTime | Validity start date of the test measure definition. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| validFor | Date range the service test is valid for. Data type: Object "validFor": { "endDateTime ": "String", "startDateTime": "String" } |
| validFor.endDateTime | End date and time of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
| validFor.startDateTime | Start date and time of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. |
[ ]

{#servicetestmgmt-POST-serviceTestSp__table_qqg_3s4_qbc}  

### cURL request

The following example creates a new service test definition.

    curl "https:/instance.servicenow.com/api/sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification" \
    --request POST \
    --header "Accept:application/json" \
    --header "Content-Type:application/json" \
    --user 'username':'password'
    -- data {
      "description": "Upstream and Downstream speed ",
      "name": "Speed Test",
      "validFor": {
        "startDateTime": "2024-05-31",
        "endDateTime": "2024-06-27"
      },
      "testMeasureDefinition": [
        {
          "id": "1a04f560432a02104fefe4511fb8f2ad",
          "captureFrequency": "once",
          "captureMethod": "automatic",
          "metricDescription": "This is the downstream speed in a service",
          "metricName": "Downstream Speed",
          "name": "Downstream Speed",
          "unitOfMeasure": "a second",
          "valueType": "",
          "capturePeriod": "30 Minutes",
          "validFor": {
            "startDateTime": "2024-05-30 08:49:26",
            "endDateTime": "2024-05-31 08:49:29"
          },
          "thresholdRule": [
            {
              "id": "a754f960432a02104fefe4511fb8f2d0",
              "description": "This speed is greater than the target upper",
              "name": "InternetSpeedValue",
              "numberOfAllowedCrossing": "0",
              "thresholdRuleSeverity": "high",
              "tolerancePeriod": "15 Minutes",
              "conformanceTargetLower": "75",
              "conformanceComparatorLower": "greater than",
              "consequence": [
                {
                  "id": "15a4bd60432a02104fefe4511fb8f2b8",
                  "prescribeAction": "null",
                  "description": "generate a waring report",
                  "name": "degradedQualityOfService",
                  "repeatAction": "0",
                  "validFor": {
                    "startDateTime": "2024-05-30 08:51:29",
                    "endDateTime": "2024-08-06 08:51:31"
                  }
                },
                {
                  "id": "e6847d60432a02104fefe4511fb8f2c3",
                  "prescribeAction": "null",
                  "description": "send a warning to the system",
                  "name": "packetdrop",
                  "repeatAction": "0",
                  "validFor": {
                    "startDateTime": "2024-05-30 08:50:53",
                    "endDateTime": "2024-08-06 08:50:55"
                  }
                }
              ]
            },
            {
              "id": "cb55b5a0432a02104fefe4511fb8f201",
              "description": "",
              "name": "InternetSpeedValue",
              "numberOfAllowedCrossing": "0",
              "thresholdRuleSeverity": "medium",
              "tolerancePeriod": "",
              "conformanceTargetUpper": "120",
              "conformanceComparatorUpper": "less than",
              "consequence": []
            }
          ]
        },
        {
          "id": "8f987524432a02104fefe4511fb8f2f0",
          "captureFrequency": "once",
          "captureMethod": "automatic",
          "metricDescription": "This is the upstream speed in the service",
          "metricName": "Upstream Speed",
          "name": "Upstream Speed",
          "unitOfMeasure": "a second",
          "valueType": "",
          "capturePeriod": "",
          "validFor": {
            "startDateTime": "",
            "endDateTime": ""
          },
          "thresholdRule": []
        }
      ],
      "specCharacteristic": [
        {
          "name": "restart",
          "description": "restart",
          "valueType": "yes_no",
          "validFor": {
            "startDatetime": "2024-05-30 08:45:49"
          },
          "characteristicValueSpecification": [
            {
              "value": "No",
            },
            {
              "value": "Yes",
            }
          ]
        }
      ],
      "serviceTestSpecRelationship": [
        {
          "id": "76a3b160432a02104fefe4511fb8f2ad",
          "name": "OAM Test",
          "relationshipType": ""
        }
      ],
      "relatedServiceSpecification": [
        {
          "id": "aeddcd1fb7d69910ff00f203ae11a990",
          "name": "Home Internet"
        }
      ]
    }

Response body.

    {
      "description": "Upstream and Downstream speed ",  
      "name": "Speed Test",
      "validFor": {
        "startDateTime": "2024-05-31",
        "endDateTime": "2024-06-27"
      },
      "testMeasureDefinition": [
        {
          "id": "1a04f560432a02104fefe4511fb8f2ad",
          "captureFrequency": "once",
          "captureMethod": "automatic",
          "metricDescription": "This is the downstream speed in a service",
          "metricName": "Downstream Speed",
          "name": "Downstream Speed",
          "unitOfMeasure": "a second",
          "valueType": "",
          "capturePeriod": "30 Minutes",
          "validFor": {
            "startDateTime": "2024-05-30 08:49:26",
            "endDateTime": "2024-05-31 08:49:29"
          },
          "thresholdRule": [
            {
              "id": "a754f960432a02104fefe4511fb8f2d0",
              "description": "This speed is greater than the target upper",
              "name": "InternetSpeedValue",
              "numberOfAllowedCrossing": "0",
              "thresholdRuleSeverity": "high",
              "tolerancePeriod": "15 Minutes",
              "conformanceTargetLower": "75",
              "conformanceComparatorLower": "greater than",
              "consequence": [
                {
                  "id": "15a4bd60432a02104fefe4511fb8f2b8",
                  "prescribeAction": "null",
                  "description": "generate a waring report",
                  "name": "degradedQualityOfService",
                  "repeatAction": "0",
                  "validFor": {
                    "startDateTime": "2024-05-30 08:51:29",
                    "endDateTime": "2024-08-06 08:51:31"
                  }
                },
                {
                  "id": "e6847d60432a02104fefe4511fb8f2c3",
                  "prescribeAction": "null",
                  "description": "send a warning to the system",
                  "name": "packetdrop",
                  "repeatAction": "0",
                  "validFor": {
                    "startDateTime": "2024-05-30 08:50:53",
                    "endDateTime": "2024-08-06 08:50:55"
                  }
                }
              ]
            },
            {
              "id": "cb55b5a0432a02104fefe4511fb8f201",
              "description": "",
              "name": "InternetSpeedValue",
              "numberOfAllowedCrossing": "0",
              "thresholdRuleSeverity": "medium",
              "tolerancePeriod": "",
              "conformanceTargetUpper": "120",
              "conformanceComparatorUpper": "less than",
              "consequence": []
            }
          ]
        },
        {
          "id": "8f987524432a02104fefe4511fb8f2f0",
          "captureFrequency": "once",
          "captureMethod": "automatic",
          "metricDescription": "This is the upstream speed in the service",
          "metricName": "Upstream Speed",
          "name": "Upstream Speed",
          "unitOfMeasure": "a second",
          "valueType": "",
          "capturePeriod": "",
          "validFor": {
            "startDateTime": "",
            "endDateTime": ""
          },
          "thresholdRule": []
        }
      ],
      "specCharacteristic": [
        {
          "name": "restart",
          "description": "restart",
          "valueType": "yes_no",
          "validFor": {
            "startDatetime": "2024-05-30 08:45:49"
          },
          "characteristicValueSpecification": [
            {
              "value": "No",
              "validFor": {
                "startDateTime": "",
                "endDateTime": ""
              }
            },
            {
              "value": "Yes",
              "validFor": {
                "startDateTime": "",
                "endDateTime": ""
              }
            }
          ]
        }
      ],
      "serviceTestSpecRelationship": [
        {
          "id": "76a3b160432a02104fefe4511fb8f2ad",
          "name": "OAM Test",
          "relationshipType": ""
        }
      ],
      "relatedServiceSpecification": [
        {
          "id": "aeddcd1fb7d69910ff00f203ae11a990",
          "name": "Home Internet"
        }
      ]
      "id": "89d2b920432a02104fefe4511fb8f22e"
    }


