{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":553,"path":"api-reference/rest-apis/snapshot-api.md","title":"CdmSnapshotApi","bundle":null,"doc_type":null,"release":"australia","body":"\n# CdmSnapshotApi\n\nThe CdmSnapshotApi provides endpoints that enable you to publish, unpublish, and re-validate snapshots in Configuration Data Management \\(CDM\\).\n\nYou publish a snapshot so that it can be exported, enabling the Continuous Integration and Continuous Delivery \\(CICD\\) pipeline to access and use the associated configuration data. Exporters can only execute on published snapshots. When snapshots are no longer needed, you can unpublish them to reduce the confusion as to whether the snapshot is viable anymore.\n\nYou must have one of the following roles to access this API:\n\n-   Scripted REST CDM View ACL \\(sn\\_cdm.cdm.viewer\\)\n-   Scripted REST CDM Editor ACL \\(sn\\_cdm.cdm\\_editor\\)\n\nIn addition, the Configuration Data Management \\(CDM\\) plugin must be activated for this API to be available in an instance.\n\nFor additional information on snapshots, see [View snapshots](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/it-service-management/cdm-snapshots-view-list.md).\n\n**Parent Topic:**[REST API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/api-rest.md)\n\n## CdmSnapshotAPI - POST /sn\\_cdm/snapshots/\\{snapshot\\_id\\}/publish\n\nPublishes a specified unpublished snapshot.\n\nBefore a snapshot can be published, it must be validated. You can use the [CdmSnapshotAPI - POST /sn\\_cdm/snapshots/\\{snapshot\\_id\\}/validate](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/snapshot-api.md) endpoint to validate snapshots or have them automatically validated when you do a commit. A deployable must be connected to a service to publish its snapshots. Also, if the snapshot has already been published, the request will fail.\n\n### URL format\n\nVersioned URL: `/api/sn_cdm/{api_version}/snapshots/{snapshot_id}/publish`\n\nDefault URL: `/api/sn_cdm/snapshots/{snapshot_id}/publish`\n\n**Note:** Available versions are specified in the [REST API Explorer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_CustomWebServices.md).\n\n### Supported request parameters\n\n<table class=\"rest_api_path_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\napi\\_version\n\n</td><td id=\"version-entry-RESTAPI\">\n\nOptional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String\n\n</td></tr><tr><td>\n\nsnapshot\\_id\n\n</td><td>\n\nSys\\_id of the snapshot record to process.Data type: String\n\nTable: CDM Snapshot \\[sn\\_cdm\\_snapshot\\]\n\n</td></tr></tbody>\n</table>|Name|Description|\n|----|-----------|\n|None| |\n\n|Name|Description|\n|----|-----------|\n|None| |\n\n### Headers\n\nThe 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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Header|Description|\n|------|-----------|\n|Accept|Data format of the response body. Only supports **application/json**.|\n|Content-Type|Data format of the request body. Only supports **application/json**.|\n\n|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe 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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|400|Bad Request. A bad request type or malformed request was detected.|\n|500|Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.|\n\n### Response body parameters \\(JSON or XML\\)\n\n<table><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nerror\n\n</td><td>\n\nIf an error occurred during processing, the details about the error.Data type: Object\n\n```\n\"error\": {\n  \"detail\": \"String\",\n  \"message\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nerror.detail\n\n</td><td>\n\nAdditional information about the error.Data type: String\n\n</td></tr><tr><td>\n\nerror.message\n\n</td><td>\n\nError message that was generated while trying to process the request.Data type: String\n\n</td></tr><tr><td>\n\nstatus\n\n</td><td>\n\nError status of the request.Possible values: failure\n\nData type: String\n\n</td></tr></tbody>\n</table>### cURL request\n\nThe following example shows how to publish the snapshot with the sys\\_id of 3a168d9dc342301054c1582e1340dd68.\n\n```\ncurl \"http://instance.servicenow.com/api/sn_cdm/snapshots/3a168d9dc342301054c1582e1340dd68/publish\"\\ \n--request POST \\ \n--header \"Accept:application/json\" \\ \n--header \"Content-Type:application/json\" \\\n--user 'username':'password' \n```\n\nThe following shows both a success and failure response to the publish request.\n\n```\n// Example of a successful response\n{ \n  \"\" \n}\n\n// Example of an error response\n{\n  \"error\": {\n    \"message\": \"Error: Unexpected error occurred in publish request.Error:Snapshot not found\",\n    \"detail\": \"\"\n  },\n  \"status\": \"failure\"\n}\n```\n\n## CdmSnapshotAPI - POST /sn\\_cdm/snapshots/\\{snapshot\\_id\\}/unpublish\n\nUnpublishes a previously published snapshot.\n\n### URL format\n\nVersioned URL: `/api/sn_cdm/{api_version}/snapshots/{snapshot_id}/unpublish`\n\nDefault URL: `/api/sn_cdm/snapshots/{snapshot_id}/unpublish`\n\n**Note:** Available versions are specified in the [REST API Explorer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_CustomWebServices.md).\n\n### Supported request parameters\n\n<table class=\"rest_api_path_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\napi\\_version\n\n</td><td id=\"version-entry-RESTAPI\">\n\nOptional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String\n\n</td></tr><tr><td>\n\nsnapshot\\_id\n\n</td><td>\n\nSys\\_id of the snapshot record to process.Data type: String\n\nTable: CDM Snapshot \\[sn\\_cdm\\_snapshot\\]\n\n</td></tr></tbody>\n</table>|Name|Description|\n|----|-----------|\n|None| |\n\n|Name|Description|\n|----|-----------|\n|None| |\n\n### Headers\n\nThe 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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Header|Description|\n|------|-----------|\n|Accept|Data format of the response body. Only supports **application/json**.|\n|Content-Type|Data format of the request body. Only supports **application/json**.|\n\n|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe 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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|400|Bad Request. A bad request type or malformed request was detected.|\n|500|Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.|\n\n### Response body parameters \\(JSON or XML\\)\n\n<table><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nerror\n\n</td><td>\n\nIf an error occurred during processing, the details about the error.Data type: Object\n\n```\n\"error\": {\n  \"detail\": \"String\",\n  \"message\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nerror.detail\n\n</td><td>\n\nAdditional information about the error.Data type: String\n\n</td></tr><tr><td>\n\nerror.message\n\n</td><td>\n\nError message that was generated while trying to process the request.Data type: String\n\n</td></tr><tr><td>\n\nstatus\n\n</td><td>\n\nError status of the request.Possible values: failure\n\nData type: String\n\n</td></tr></tbody>\n</table>### cURL request\n\nThe following example shows how to unpublish the snapshot with the sys\\_id of 3a168d9dc342301054c1582e1340dd68.\n\n```\ncurl \"http://instance.servicenow.com/api/sn_cdm/snapshots/3a168d9dc342301054c1582e1340dd68/unpublish\"\\ \n--request POST \\ \n--header \"Accept:application/json\" \\ \n--header \"Content-Type:application/json\" \\\n--user 'username':'password' \n```\n\nThe following shows both a success and failure response to the unpublish request.\n\n```\n// Example of a successful response\n{ \n  \"\" \n}\n\n// Example of an error response\n{\n  \"error\": {\n    \"message\": \"Error: Unexpected error occurred in publish request.Error:Snapshot not found\",\n    \"detail\": \"\"\n  },\n  \"status\": \"failure\"\n}\n```\n\n## CdmSnapshotAPI - POST /sn\\_cdm/snapshots/\\{snapshot\\_id\\}/validate\n\nValidates a specified unpublished snapshot.\n\nThe validation is performed as an asynchronous process. Calling this endpoint only starts the validation process. The return results from this call only indicate whether the validation process started, not the results of the validation itself. To find out if the snapshot has validated, use the Table API to locate the snapshot and check its validation status.\n\n**Note:** You cannot validate a published snapshot.\n\n### URL format\n\nVersioned URL: `/api/sn_cdm/{api_version}/snapshots/{snapshot_id}/validate`\n\nDefault URL: `/api/sn_cdm/snapshots/{snapshot_id}/validate`\n\n**Note:** Available versions are specified in the [REST API Explorer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_CustomWebServices.md).\n\n### Supported request parameters\n\n<table class=\"rest_api_path_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\napi\\_version\n\n</td><td id=\"version-entry-RESTAPI\">\n\nOptional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String\n\n</td></tr><tr><td>\n\nsnapshot\\_id\n\n</td><td>\n\nSys\\_id of the snapshot record to process.Data type: String\n\nTable: CDM Snapshot \\[sn\\_cdm\\_snapshot\\]\n\n</td></tr></tbody>\n</table>|Name|Description|\n|----|-----------|\n|None| |\n\n|Name|Description|\n|----|-----------|\n|None| |\n\n### Headers\n\nThe 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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Header|Description|\n|------|-----------|\n|Accept|Data format of the response body. Only supports **application/json**.|\n|Content-Type|Data format of the request body. Only supports **application/json**.|\n\n|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe 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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|400|Bad Request. The specified snapshot is already published or cannot be located.|\n|500|Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.|\n\n### Response body parameters \\(JSON or XML\\)\n\n<table><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nerror\n\n</td><td>\n\nIf an error occurred during processing, the details about the error.Data type: Object\n\n```\n\"error\": {\n  \"detail\": \"String\",\n  \"message\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nerror.detail\n\n</td><td>\n\nAdditional information about the error.Data type: String\n\n</td></tr><tr><td>\n\nerror.message\n\n</td><td>\n\nError message that was generated while trying to process the request.Data type: String\n\n</td></tr><tr><td>\n\nstatus\n\n</td><td>\n\nError status of the request.Possible values: failure\n\nData type: String\n\n</td></tr></tbody>\n</table>### cURL request\n\nThe following example shows how to validate the snapshot with the sys\\_id of 3a168d9dc342301054c1582e1340dd68.\n\n```\ncurl \"http://instance.servicenow.com/api/sn_cdm/snapshots/3a168d9dc342301054c1582e1340dd68/validate\"\\ \n--request POST \\ \n--header \"Accept:application/json\" \\ \n--header \"Content-Type:application/json\" \\\n--user 'username':'password' \n```\n\nThe following shows both a success and failure response to the validate request.\n\n```\n// Example of a successful response\n{ \n  \"\" \n}\n\n// Example of an error response\n{\n  \"error\": {\n    \"message\": \"Invalid Snapshot id:test\",\n    \"detail\": \"\"\n  },\n  \"status\": \"failure\"\n}\n```\n\n## CdmSnapshotApi - PUT /sn\\_cdm/snapshots/publish\n\nPublishes a specified unpublished snapshot.\n\nBefore a snapshot can be published, it must be validated. You can use the [CdmSnapshotApi - PUT /sn\\_cdm/snapshots/validate](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/snapshot-api.md) endpoint to validate snapshots or have them automatically validated when you do a commit. A deployable must be connected to a service to publish its snapshots. Also, if the snapshot has already been published, the request will fail.\n\nThe caller of this endpoint must have the CDM Editor role.\n\n### URL format\n\nVersioned URL: `/api/sn_cdm/{api_version}/snapshots/publish`\n\nDefault URL: `/api/sn_cdm/snapshots/publish`\n\n**Note:** Available versions are specified in the [REST API Explorer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_CustomWebServices.md).\n\n### Supported request parameters\n\n<table class=\"rest_api_path_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\napi\\_version\n\n</td><td id=\"version-entry-RESTAPI\">\n\nOptional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String\n\n</td></tr></tbody>\n</table><table id=\"id_evn_23g_15b\" class=\"rest_api_query_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nappName\n\n</td><td>\n\nRequired. Name of the Configuration Data Management \\(CDM\\) application for which to create the snapshot.Data type: String\n\nTable: CDM Application \\[sn\\_cdm\\_application\\]\n\n</td></tr><tr><td>\n\ndeployableName\n\n</td><td>\n\nRequired. Name of the CDM deployable for which to create the snapshot.Data type: String\n\nTable: CDM Deployable \\[sn\\_cdm\\_deployable\\]\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nRequired. Name of the snapshot.Data type: String\n\nTable: CDM Snapshot \\[sn\\_cdm\\_snapshot\\]\n\n</td></tr><tr><td>\n\nreturnFields\n\n</td><td id=\"cdm_apps-returnFields-entry\">\n\nList of fields to return as part of the response. Pass the record column names such as sys\\_id, sys\\_updated\\_by, or state.Data type: Array\n\nDefault: All fields as determined by the endpoint\n\n</td></tr></tbody>\n</table>|Name|Description|\n|----|-----------|\n|None| |\n\n### Headers\n\nThe 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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Header|Description|\n|------|-----------|\n|Accept|Data format of the response body. Only supports **application/json**.|\n|Content-Type|Data format of the request body. Only supports **application/json**.|\n\n|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe 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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|400|Bad Request. A bad request type or malformed request was detected.|\n|500|Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.|\n\n### Response body parameters\n\n<table id=\"id_lrr_frg_15b\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\ncdm\\_application\\_id\n\n</td><td>\n\nDetails about the CDM application associated with the snapshot.Data type: Object\n\n```\n\"cdm_application_id\": {\n  \"link\": \"String\",\n  \"value\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\ncdm\\_application\\_id.link\n\n</td><td>\n\nCall to use to access the CDM application record using the REST Table API. Data type: String\n\n</td></tr><tr><td>\n\ncdm\\_application\\_id.value\n\n</td><td>\n\nSys\\_id of the associated CDM application record.Data type: String\n\nTable: CDM Application \\[sn\\_cdm\\_application\\]\n\n</td></tr><tr><td>\n\ncdm\\_deployable\\_id\n\n</td><td>\n\nDetails about the CDM deployable associated with the snapshot.Data type: Object\n\n```\n\"cdm_deployable_id\": {\n  \"link\": \"String\",\n  \"value\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\ncdm\\_deployable\\_id.link\n\n</td><td>\n\nCall syntax for querying this deployable record using the Table REST API.Data type: String\n\n</td></tr><tr><td>\n\ncdm\\_deployable\\_id.value\n\n</td><td>\n\nSys\\_id of the deployable record.Data type: String\n\nTable: CDM Deployable \\[sn\\_cdm\\_deployable\\]\n\n</td></tr><tr><td>\n\nchangeset\\_id\n\n</td><td>\n\nDetails about the changeset associated with the snapshot.Data type: Object\n\n```\n\"changeset_id\": {\n  \"link\": \"String\",\n  \"value\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nchangeset\\_id.link\n\n</td><td>\n\nCall syntax for querying this changeset record using the Table REST API.Data type: String\n\n</td></tr><tr><td>\n\nchangeset\\_id.value\n\n</td><td>\n\nUnique identifier of the changeset record.Data type: String\n\nTable: CDM Changeset \\[sn\\_cdm\\_changeset\\]\n\n</td></tr><tr><td>\n\ndescription\n\n</td><td>\n\nBrief description of the snapshot.Data type: String\n\n</td></tr><tr><td>\n\nerror\n\n</td><td>\n\nIf an error occurred during processing, the details about the error.Data type: Object\n\n```\n\"error\": {\n  \"detail\": \"String\",\n  \"message\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nerror.detail\n\n</td><td>\n\nAdditional information about the error.Data type: String\n\n</td></tr><tr><td>\n\nerror.message\n\n</td><td>\n\nError message that was generated while trying to process the request.Data type: String\n\n</td></tr><tr><td>\n\nlast\\_published\n\n</td><td>\n\nDate and time that the snapshot was last published.Data type: String\n\nFormat: yyyy-mm-dd hh:mm:ss\n\n</td></tr><tr><td>\n\nlast\\_validated\n\n</td><td>\n\nDate and time that the snapshot was last validated.Data type: String\n\nFormat: yyyy-mm-dd hh:mm:ss\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nName of the snapshot.Data type: String\n\n</td></tr><tr><td>\n\nnumber\n\n</td><td>\n\nUnique number that identifies the snapshot. This value provides a human-readable identifier for the mapping.Data type: String\n\n</td></tr><tr><td>\n\npublished\n\n</td><td>\n\nFlag that indicates whether the snapshot was published.Possible values:\n\n-   true: Snapshot was published.\n-   false: Snapshot wasn't published.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nsys\\_created\\_by\n\n</td><td>\n\nName of the user that created the snapshot.Data type: String\n\n</td></tr><tr><td>\n\nsys\\_created\\_on\n\n</td><td>\n\nDate and time when the snapshot was created.Data type: String\n\nFormat: yyyy-mm-dd hh:mm:ss\n\n</td></tr><tr><td>\n\nsys\\_id\n\n</td><td>\n\nSys\\_id of the snapshot.Data type: String\n\nTable: CDM Snapshot \\[sn\\_cdm\\_snapshot\\]\n\n</td></tr><tr><td>\n\nsys\\_updated\\_by\n\n</td><td>\n\nName of the user that updated the snapshot.Data type: String\n\n</td></tr><tr><td>\n\nsys\\_updated\\_on\n\n</td><td>\n\nDate and time when the snapshot was last updated.Data type: String\n\nFormat: yyyy-mm-dd hh:mm:ss\n\n</td></tr><tr><td>\n\nvalidation\n\n</td><td>\n\nCurrent validation state of the snapshot. Possible values:\n\n-   execution\\_error\n-   failed\n-   in\\_progress\n-   not\\_validated\n-   passed\n-   passed\\_with\\_exception\n-   requested\n\nData type: String\n\n</td></tr></tbody>\n</table>### cURL request\n\nThis code example shows how to publish a snapshot.\n\n```\ncurl \"http://instance.servicenow.com/api/sn_cdm/snapshots/publish?deployableName=Development_1&name=Development_1-v1.dpl&appName=testApp\" \\ \n--request PUT \\ \n--header \"Accept:application/json\" \\ \n--user 'username':'password'\n```\n\nReturn results:\n\n```\n \n{ \n  \"result\": { \n    \"changeset_id\": { \n      \"value\": \"d4b9446e53001110a1d3ddeeff7b126c\", \n      \"link\": \"http://instance.servicenow.com/api/now/table/sn_cdm_changeset/d4b9446e53001110a1d3ddeeff7b126c\" \n    }, \n    \"cdm_deployable_id\": { \n      \"value\": \"6dc517a953b70110a1d3ddeeff7b129b\", \n      \"link\": \"http://instance.servicenow.com/api/now/table/sn_cdm_deployable/6dc517a953b70110a1d3ddeeff7b129b\" \n    }, \n    \"description\": null, \n    \"cdm_application_id\": { \n      \"value\": \"62b517a953b70110a1d3ddeeff7b128c\", \n      \"link\": \"http://instance.servicenow.com/api/now/table/sn_cdm_application/62b517a953b70110a1d3ddeeff7b128c\" \n    }, \n    \"published\": true, \n    \"sys_updated_on\": \"2022-06-30 12:57:02\", \n    \"last_published\": \"2022-06-30 12:57:02\", \n    \"number\": \"SNAP0001002\", \n    \"sys_id\": \"9017fc2e53801110a1d3ddeeff7b12d7\", \n    \"sys_updated_by\": \"admin\", \n    \"sys_created_on\": \"2022-06-15 14:19:38\", \n    \"name\": \"Development_1-v2.dpl\", \n    \"last_validated\": \"2022-06-30 12:56:07\", \n    \"validation\": \"passed\", \n    \"sys_created_by\": \"admin\" \n  } \n}\n```\n\n## CdmSnapshotApi - PUT /sn\\_cdm/snapshots/unpublish\n\nUnpublishes a previously published snapshot.\n\n### URL format\n\nVersioned URL: `/api/sn_cdm/{api_version}/snapshots/unpublish`\n\nDefault URL: `/api/sn_cdm/snapshots/unpublish`\n\n**Note:** Available versions are specified in the [REST API Explorer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_CustomWebServices.md).\n\n### Supported request parameters\n\n<table class=\"rest_api_path_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\napi\\_version\n\n</td><td id=\"version-entry-RESTAPI\">\n\nOptional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String\n\n</td></tr></tbody>\n</table><table class=\"rest_api_query_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nappName\n\n</td><td>\n\nRequired. Name of the Configuration Data Management \\(CDM\\) application for which to create the snapshot.Data type: String\n\nTable: CDM Application \\[sn\\_cdm\\_application\\]\n\n</td></tr><tr><td>\n\ndeployableName\n\n</td><td>\n\nRequired. Name of the CDM deployable for which to create the snapshot.Data type: String\n\nTable: CDM Deployable \\[sn\\_cdm\\_deployable\\]\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nRequired. Name of the snapshot.Data type: String\n\nTable: CDM Snapshot \\[sn\\_cdm\\_snapshot\\]\n\n</td></tr><tr><td>\n\nreturnFields\n\n</td><td id=\"cdm_apps-returnFields-entry\">\n\nList of fields to return as part of the response. Pass the record column names such as sys\\_id, sys\\_updated\\_by, or state.Data type: Array\n\nDefault: All fields as determined by the endpoint\n\n</td></tr></tbody>\n</table>|Name|Description|\n|----|-----------|\n|None| |\n\n### Headers\n\nThe 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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Header|Description|\n|------|-----------|\n|Accept|Data format of the response body. Only supports **application/json**.|\n|Content-Type|Data format of the request body. Only supports **application/json**.|\n\n|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe 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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|400|Bad Request. A bad request type or malformed request was detected.|\n|500|Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.|\n\n### Response body parameters\n\n<table><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\ncdm\\_application\\_id\n\n</td><td>\n\nDetails about the CDM application associated with the snapshot.Data type: Object\n\n```\n\"cdm_application_id\": {\n  \"link\": \"String\",\n  \"value\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\ncdm\\_application\\_id.link\n\n</td><td>\n\nCall to use to access the CDM application record using the REST Table API. Data type: String\n\n</td></tr><tr><td>\n\ncdm\\_application\\_id.value\n\n</td><td>\n\nSys\\_id of the associated CDM application record.Data type: String\n\nTable: CDM Application \\[sn\\_cdm\\_application\\]\n\n</td></tr><tr><td>\n\ncdm\\_deployable\\_id\n\n</td><td>\n\nDetails about the CDM deployable associated with the snapshot.Data type: Object\n\n```\n\"cdm_deployable_id\": {\n  \"link\": \"String\",\n  \"value\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\ncdm\\_deployable\\_id.link\n\n</td><td>\n\nCall syntax for querying this deployable record using the Table REST API.Data type: String\n\n</td></tr><tr><td>\n\ncdm\\_deployable\\_id.value\n\n</td><td>\n\nSys\\_id of the deployable record.Data type: String\n\nTable: CDM Deployable \\[sn\\_cdm\\_deployable\\]\n\n</td></tr><tr><td>\n\nchangeset\\_id\n\n</td><td>\n\nDetails about the changeset associated with the snapshot.Data type: Object\n\n```\n\"changeset_id\": {\n  \"link\": \"String\",\n  \"value\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nchangeset\\_id.link\n\n</td><td>\n\nCall syntax for querying this changeset record using the Table REST API.Data type: String\n\n</td></tr><tr><td>\n\nchangeset\\_id.value\n\n</td><td>\n\nUnique identifier of the changeset record.Data type: String\n\nTable: CDM Changeset \\[sn\\_cdm\\_changeset\\]\n\n</td></tr><tr><td>\n\ndescription\n\n</td><td>\n\nBrief description of the snapshot.Data type: String\n\n</td></tr><tr><td>\n\nerror\n\n</td><td>\n\nIf an error occurred during processing, the details about the error.Data type: Object\n\n```\n\"error\": {\n  \"detail\": \"String\",\n  \"message\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nerror.detail\n\n</td><td>\n\nAdditional information about the error.Data type: String\n\n</td></tr><tr><td>\n\nerror.message\n\n</td><td>\n\nError message that was generated while trying to process the request.Data type: String\n\n</td></tr><tr><td>\n\nlast\\_published\n\n</td><td>\n\nDate and time that the snapshot was last published.Data type: String\n\nFormat: yyyy-mm-dd hh:mm:ss\n\n</td></tr><tr><td>\n\nlast\\_validated\n\n</td><td>\n\nDate and time that the snapshot was last validated.Data type: String\n\nFormat: yyyy-mm-dd hh:mm:ss\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nName of the snapshot.Data type: String\n\n</td></tr><tr><td>\n\nnumber\n\n</td><td>\n\nUnique number that identifies the snapshot. This value provides a human-readable identifier for the mapping.Data type: String\n\n</td></tr><tr><td>\n\npublished\n\n</td><td>\n\nFlag that indicates whether the snapshot was published.Possible values:\n\n-   true: Snapshot was published.\n-   false: Snapshot wasn't published.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nsys\\_created\\_by\n\n</td><td>\n\nName of the user that created the snapshot.Data type: String\n\n</td></tr><tr><td>\n\nsys\\_created\\_on\n\n</td><td>\n\nDate and time when the snapshot was created.Data type: String\n\nFormat: yyyy-mm-dd hh:mm:ss\n\n</td></tr><tr><td>\n\nsys\\_id\n\n</td><td>\n\nSys\\_id of the snapshot.Data type: String\n\nTable: CDM Snapshot \\[sn\\_cdm\\_snapshot\\]\n\n</td></tr><tr><td>\n\nsys\\_updated\\_by\n\n</td><td>\n\nName of the user that updated the snapshot.Data type: String\n\n</td></tr><tr><td>\n\nsys\\_updated\\_on\n\n</td><td>\n\nDate and time when the snapshot was last updated.Data type: String\n\nFormat: yyyy-mm-dd hh:mm:ss\n\n</td></tr><tr><td>\n\nvalidation\n\n</td><td>\n\nCurrent validation state of the snapshot. Possible values:\n\n-   execution\\_error\n-   failed\n-   in\\_progress\n-   not\\_validated\n-   passed\n-   passed\\_with\\_exception\n-   requested\n\nData type: String\n\n</td></tr></tbody>\n</table>### cURL request\n\nThis code example shows how to unpublish a snapshot.\n\n```\n\n```\n\nReturn results:\n\n```\n\n```\n\n## CdmSnapshotApi - PUT /sn\\_cdm/snapshots/validate\n\nValidates a specified unpublished snapshot against its mapped policies.\n\nThe validation is performed as an asynchronous process. Calling this endpoint only starts the validation process. The return results from this call only indicate whether the validation process started, not the results of the validation itself. To find out if the snapshot has validated, use the Table API to locate the snapshot and check its validation status.\n\n**Note:** You cannot validate a published snapshot.\n\nThe caller of this endpoint must have the CDM Editor role.\n\n### URL format\n\nVersioned URL: `/api/sn_cdm/{api_version}/snapshots/validate`\n\nDefault URL: `/api/sn_cdm/snapshots/validate`\n\n**Note:** Available versions are specified in the [REST API Explorer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_CustomWebServices.md).\n\n### Supported request parameters\n\n<table class=\"rest_api_path_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\napi\\_version\n\n</td><td id=\"version-entry-RESTAPI\">\n\nOptional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String\n\n</td></tr></tbody>\n</table><table id=\"id_x2b_qvg_15b\" class=\"rest_api_query_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nappName\n\n</td><td>\n\nRequired. Name of the Configuration Data Management \\(CDM\\) application for which to create the snapshot.Data type: String\n\nTable: CDM Application \\[sn\\_cdm\\_application\\]\n\n</td></tr><tr><td>\n\ndeployableName\n\n</td><td>\n\nRequired. Name of the CDM deployable for which to create the snapshot.Data type: String\n\nTable: CDM Deployable \\[sn\\_cdm\\_deployable\\]\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nRequired. Name of the snapshot.Data type: String\n\nTable: CDM Snapshot \\[sn\\_cdm\\_snapshot\\]\n\n</td></tr><tr><td>\n\nreturnFields\n\n</td><td id=\"cdm_apps-returnFields-entry\">\n\nList of fields to return as part of the response. Pass the record column names such as sys\\_id, sys\\_updated\\_by, or state.Data type: Array\n\nDefault: All fields as determined by the endpoint\n\n</td></tr></tbody>\n</table>|Name|Description|\n|----|-----------|\n|None| |\n\n### Headers\n\nThe 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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Header|Description|\n|------|-----------|\n|Accept|Data format of the response body. Only supports **application/json**.|\n|Content-Type|Data format of the request body. Only supports **application/json**.|\n\n|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe 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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|400|Bad Request. The specified snapshot is already published or cannot be located.|\n|500|Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.|\n\n### Response body parameters\n\n<table id=\"id_dsl_5vg_15b\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\ncdm\\_application\\_id\n\n</td><td>\n\nDetails about the CDM application associated with the snapshot.Data type: Object\n\n```\n\"cdm_application_id\": {\n  \"link\": \"String\",\n  \"value\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\ncdm\\_application\\_id.link\n\n</td><td>\n\nCall to use to access the CDM application record using the REST Table API. Data type: String\n\n</td></tr><tr><td>\n\ncdm\\_application\\_id.value\n\n</td><td>\n\nSys\\_id of the associated CDM application record.Data type: String\n\nTable: CDM Application \\[sn\\_cdm\\_application\\]\n\n</td></tr><tr><td>\n\ncdm\\_deployable\\_id\n\n</td><td>\n\nDetails about the CDM deployable associated with the snapshot.Data type: Object\n\n```\n\"cdm_deployable_id\": {\n  \"link\": \"String\",\n  \"value\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\ncdm\\_deployable\\_id.link\n\n</td><td>\n\nCall syntax for querying this deployable record using the Table REST API.Data type: String\n\n</td></tr><tr><td>\n\ncdm\\_deployable\\_id.value\n\n</td><td>\n\nSys\\_id of the deployable record.Data type: String\n\nTable: CDM Deployable \\[sn\\_cdm\\_deployable\\]\n\n</td></tr><tr><td>\n\nchangeset\\_id\n\n</td><td>\n\nDetails about the changeset associated with the snapshot.Data type: Object\n\n```\n\"changeset_id\": {\n  \"link\": \"String\",\n  \"value\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nchangeset\\_id.link\n\n</td><td>\n\nCall syntax for querying this changeset record using the Table REST API.Data type: String\n\n</td></tr><tr><td>\n\nchangeset\\_id.value\n\n</td><td>\n\nUnique identifier of the changeset record.Data type: String\n\nTable: CDM Changeset \\[sn\\_cdm\\_changeset\\]\n\n</td></tr><tr><td>\n\ndescription\n\n</td><td>\n\nBrief description of the snapshot.Data type: String\n\n</td></tr><tr><td>\n\nerror\n\n</td><td>\n\nIf an error occurred during processing, the details about the error.Data type: Object\n\n```\n\"error\": {\n  \"detail\": \"String\",\n  \"message\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nerror.detail\n\n</td><td>\n\nAdditional information about the error.Data type: String\n\n</td></tr><tr><td>\n\nerror.message\n\n</td><td>\n\nError message that was generated while trying to process the request.Data type: String\n\n</td></tr><tr><td>\n\nlast\\_published\n\n</td><td>\n\nDate and time that the snapshot was last published.Data type: String\n\nFormat: yyyy-mm-dd hh:mm:ss\n\n</td></tr><tr><td>\n\nlast\\_validated\n\n</td><td>\n\nDate and time that the snapshot was last validated.Data type: String\n\nFormat: yyyy-mm-dd hh:mm:ss\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nName of the snapshot.Data type: String\n\n</td></tr><tr><td>\n\nnumber\n\n</td><td>\n\nUnique number that identifies the snapshot. This value provides a human-readable identifier for the mapping.Data type: String\n\n</td></tr><tr><td>\n\npublished\n\n</td><td>\n\nFlag that indicates whether the snapshot was published.Possible values:\n\n-   true: Snapshot was published.\n-   false: Snapshot wasn't published.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nsys\\_created\\_by\n\n</td><td>\n\nName of the user that created the snapshot.Data type: String\n\n</td></tr><tr><td>\n\nsys\\_created\\_on\n\n</td><td>\n\nDate and time when the snapshot was created.Data type: String\n\nFormat: yyyy-mm-dd hh:mm:ss\n\n</td></tr><tr><td>\n\nsys\\_id\n\n</td><td>\n\nSys\\_id of the snapshot.Data type: String\n\nTable: CDM Snapshot \\[sn\\_cdm\\_snapshot\\]\n\n</td></tr><tr><td>\n\nsys\\_updated\\_by\n\n</td><td>\n\nName of the user that updated the snapshot.Data type: String\n\n</td></tr><tr><td>\n\nsys\\_updated\\_on\n\n</td><td>\n\nDate and time when the snapshot was last updated.Data type: String\n\nFormat: yyyy-mm-dd hh:mm:ss\n\n</td></tr><tr><td>\n\nvalidation\n\n</td><td>\n\nCurrent validation state of the snapshot. Possible values:\n\n-   execution\\_error\n-   failed\n-   in\\_progress\n-   not\\_validated\n-   passed\n-   passed\\_with\\_exception\n-   requested\n\nData type: String\n\n</td></tr></tbody>\n</table>### cURL request\n\nThis code example shows how to validate a snapshot.\n\n```\ncurl \"http://instance.servicenow.com/api/sn_cdm/snapshots/validate?name=Development_1-v2.dpl&deployableName=Development_1&appName=testApp\" \\ \n--request PUT \\ \n--header \"Accept:application/json\" \\ \n--user 'username':'password' \n```\n\nReturn results:\n\n```\n{ \n  \"result\": { \n    \"changeset_id\": { \n      \"value\": \"d4b9446e53001110a1d3ddeeff7b126c\", \n      \"link\": \"http://instance.servicenow.com/api/now/table/sn_cdm_changeset/d4b9446e53001110a1d3ddeeff7b126c\" \n    }, \n    \"cdm_deployable_id\": { \n      \"value\": \"6dc517a953b70110a1d3ddeeff7b129b\", \n      \"link\": \"http://instance.servicenow.com/api/now/table/sn_cdm_deployable/6dc517a953b70110a1d3ddeeff7b129b\" \n    }, \n    \"description\": null, \n    \"cdm_application_id\": { \n      \"value\": \"62b517a953b70110a1d3ddeeff7b128c\", \n      \"link\": \"http://instance.servicenow.com/api/now/table/sn_cdm_application/62b517a953b70110a1d3ddeeff7b128c\" \n    }, \n    \"published\": false, \n    \"sys_updated_on\": \"2022-06-30 12:57:02\", \n    \"last_published\": \"2022-06-30 12:57:02\", \n    \"number\": \"SNAP0001002\", \n    \"sys_id\": \"9017fc2e53801110a1d3ddeeff7b12d7\", \n    \"sys_updated_by\": \"admin\", \n    \"sys_created_on\": \"2022-06-15 14:19:38\", \n    \"name\": \"Development_1-v2.dpl\", \n    \"last_validated\": \"2022-06-30 12:56:07\", \n    \"validation\": \"passed\", \n    \"sys_created_by\": \"admin\" \n  } \n} \n```\n\n"}}