{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":503,"path":"api-reference/rest-apis/data-classification-api.md","title":"Data Classification API","bundle":null,"doc_type":null,"release":"australia","body":"\n# Data Classification API\n\nThe Data Classification API provides endpoints to group data by type.\n\nWith the Data Classification API, you can:\n\n-   Assign data classifications to existing dictionary entries.\n-   Look up the data classifications for specific dictionary entries.\n-   Remove all data classifications associated with specific dictionary entries.\n-   Retrieve a list of all data classifications available in the current domain.\n\nThis API requires the Data Classification \\[com.glide.data\\_classification\\] plugin.\n\nFor more information, see [Data Classification](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-security/data-classification.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## Data Classification - GET /data\\_classification/getAllDataClasses\n\nReturns a list of all data classifications available in the current domain.\n\nRequires the admin, data\\_classification\\_admin, or data\\_classification\\_auditor role.\n\n### URL format\n\nDefault URL: `/api/now/data_classification/getAllDataClasses`\n\n### Supported request parameters\n\n|Name|Description|\n|----|-----------|\n|None| |\n\n|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<table class=\"rest_api_request_headers\"><thead><tr><th>\n\nHeader\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nAccept\n\n</td><td id=\"accept-entry-RESTAPI\">\n\nData format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json**\n\n</td></tr></tbody>\n</table>|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\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\nresult\n\n</td><td>\n\nResult of the request. Returns the sys\\_id and name for each available data classification. If there are no data classifications, it returns an empty array.Data classifications can be organized into parent-child relationships. If there are parent data classifications, they are identified in the result.\n\nData type: Array of Objects\n\n```\n\"result\": [\n  {\n    \"name\": \"String\",\n    \"parent\": {Object},\n    \"sys_id\": \"String\"\n  }\n]\n```\n\n</td></tr><tr><td>\n\nresult.name\n\n</td><td>\n\nName of the data classification.Data type: String\n\n</td></tr><tr><td>\n\nresult.parent\n\n</td><td>\n\nEntry for a parent data classification.Data type: Object\n\n```\n\"parent\": {\n  \"name\": \"String\",\n  \"sys_id\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nresult.parent.name\n\n</td><td>\n\nName of the parent data classification.Data type: String\n\n</td></tr><tr><td>\n\nresult.parent.sys\\_id\n\n</td><td>\n\nSys\\_id of the parent data classification record.Data type: String\n\nTable: Data Classification \\[data\\_classification\\]\n\n</td></tr><tr><td>\n\nresult.sys\\_id\n\n</td><td>\n\nSys\\_id of the data classification record.Data type: String\n\nTable: Data Classification \\[data\\_classification\\]\n\n</td></tr></tbody>\n</table>### cURL request\n\nRetrieves a list of all the available data classifications.\n\n```\ncurl \"https://instance.servicenow.com/api/now/data_classification/getAllDataClasses\" \\\n--request GET \\\n--header \"Accept:application/json\" \\\n--user 'username':'password'\n```\n\n```\n{\n  \"result\": [\n    {\n      \"parent\": {\n        \"sys_id\": \"a9670fc773fc1010ae8dd21efaf6a735\",\n        \"name\": \"Confidential\"\n      },\n      \"sys_id\": \"348107b951d71010f877f3f178e7dd0d\",\n      \"name\": \"Personally identifiable information\"\n    },\n    {\n      \"sys_id\": \"a9670fc773fc1010ae8dd21efaf6a735\",\n      \"name\": \"Confidential\"\n    },\n    {\n      \"sys_id\": \"59b7070b73fc1010ae8dd21efaf6a764\",\n      \"name\": \"Restricted\"\n    },\n    {\n      \"sys_id\": \"11d60fc773fc1010ae8dd21efaf6a744\",\n      \"name\": \"Internal\"\n    },\n    {\n      \"sys_id\": \"f5b4cf4773fc1010ae8dd21efaf6a766\",\n      \"name\": \"Public\"\n    }\n  ]\n}\n\n```\n\n## Data Classification - POST /data\\_classification/classify\n\nAssigns pre-defined or user-defined data classifications to existing dictionary entries.\n\nRequires the admin or data\\_classification\\_admin role.\n\n### URL format\n\nDefault URL: `/api/now/data_classification/classify`\n\n### Supported request parameters\n\n|Name|Description|\n|----|-----------|\n|None| |\n\n|Name|Description|\n|----|-----------|\n|None| |\n\n<table class=\"rest_api_request_body\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\ndictionary\\_entries\n\n</td><td>\n\nRequired. Sys\\_ids of the records you want to classify. Entered as a comma-separated list enclosed in a string.\n\nTable: Dictionary \\[sys\\_dictionary\\] table\n\nData type: String\n\n</td></tr><tr><td>\n\ndata\\_classes\n\n</td><td>\n\nRequired. Sys\\_ids of the data classifications you want to assign. Entered as a comma-separated list enclosed in a string.\n\nTable: Data Classification \\[data\\_classification\\]\n\nData type: String\n\n</td></tr></tbody>\n</table>### 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<table class=\"rest_api_request_headers\"><thead><tr><th>\n\nHeader\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nAccept\n\n</td><td id=\"accept-entry-RESTAPI\">\n\nData format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json**\n\n</td></tr><tr><td>\n\nContent-Type\n\n</td><td>\n\nData format of the request body. Supported types: **application/json** or **application/xml**. Default: **application/json**\n\n</td></tr></tbody>\n</table>|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|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\nresult\n\n</td><td>\n\nMessage describing the result of the operation. Data type: String\n\n</td></tr></tbody>\n</table>### cURL request\n\nAssigns a data classification to a dictionary entry.\n\n```\ncurl \"https://instance.servicenow.com/api/now/data_classification/classify\" \\\n--request POST \\\n--header \"Accept:application/json\" \\\n--header \"Content-Type:application/json\" \\\n--data \"{\n    \\\"dictionary_entries\\\": \\\"445de0a6dba30300efc57416bf9619b0\\\",\n    \\\"data_classes\\\": \\\"40edb1f51bbcec50b92a10a61a4bcb8a\\\"\n}\" \\\n--user 'username':'password'\n\n```\n\n```\n{\n  \"result\": \"Successfully stored the data classification configurations\"\n}\n\n```\n\n## Data Classification - POST /data\\_classification/clear\n\nRemoves all data classifications for the specified dictionary entries.\n\nRequires the admin or data\\_classification\\_admin role.\n\n### URL format\n\nDefault URL: `/api/now/data_classification/clear`\n\n### Supported request parameters\n\n|Name|Description|\n|----|-----------|\n|None| |\n\n|Name|Description|\n|----|-----------|\n|None| |\n\n<table class=\"rest_api_request_body\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\ndictionary\\_entries\n\n</td><td>\n\nRequired. Sys\\_ids of the records you want to remove classifications from. Entered as a comma-separated list enclosed in a string.\n\nTable: Dictionary \\[sys\\_dictionary\\]\n\nData type: String\n\n</td></tr></tbody>\n</table>### 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<table class=\"rest_api_request_headers\"><thead><tr><th>\n\nHeader\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nAccept\n\n</td><td id=\"accept-entry-RESTAPI\">\n\nData format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json**\n\n</td></tr><tr><td>\n\nContent-Type\n\n</td><td>\n\nData format of the request body. Supported types: **application/json** or **application/xml**. Default: **application/json**\n\n</td></tr></tbody>\n</table>|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|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\nresult\n\n</td><td>\n\nMessage describing the result of the operation. Data type: String\n\n</td></tr></tbody>\n</table>### cURL request\n\nClears the data classifications for a dictionary entry.\n\n```\ncurl \"https://instance.servicenow.com/api/now/data_classification/clear\" \\\n--request POST \\\n--header \"Accept:application/json\" \\\n--header \"Content-Type:application/json\" \\\n--data \"{\n    \\\"dictionary_entries\\\": \\\"445de0a6dba30300efc57416bf9619b0\\\"\n}\" \\\n--user 'username':'password'\n\n```\n\n```\n{\n  \"result\": \"Classifications removed for the specified dictionary entries\"\n}\n\n```\n\n## Data Classification - POST /data\\_classification/getClassification\n\nRetrieves all data classifications for the specified dictionary entries.\n\nRequires the admin, data\\_classification\\_admin, or data\\_classification\\_auditor role.\n\n### URL format\n\nDefault URL: `/api/now/data_classification/getClassification`\n\n### Supported request parameters\n\n|Name|Description|\n|----|-----------|\n|None| |\n\n|Name|Description|\n|----|-----------|\n|None| |\n\n<table class=\"rest_api_request_body\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\ndictionary\\_entries\n\n</td><td>\n\nRequired. Sys\\_ids of the records you want to retrieve classifications for. Entered as a comma-separated list enclosed in a string.\n\nTable: Dictionary \\[sys\\_dictionary\\]\n\nData type: String\n\n</td></tr></tbody>\n</table>### 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<table class=\"rest_api_request_headers\"><thead><tr><th>\n\nHeader\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nAccept\n\n</td><td id=\"accept-entry-RESTAPI\">\n\nData format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json**\n\n</td></tr><tr><td>\n\nContent-Type\n\n</td><td>\n\nData format of the request body. Supported types: **application/json** or **application/xml**. Default: **application/json**\n\n</td></tr></tbody>\n</table>|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|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\nresult\n\n</td><td>\n\nResult of the request. Returns a JSON object containing each dictionary entry's sys\\_id with an array of its associated data classifications. If there are no associated data classifications, it returns a message describing the result of the operation.Data classifications can be organized into parent-child relationships. If there are parent data classifications, they are identified in the result.\n\nData type: Object\n\n```\n\"result\": {\n  <sys_dictionary_sys_id>: [\n    {\n      \"name\": \"String\",\n      \"parent\": {Object},\n      \"sys_id\": \"String\"\n    }\n  ]\n}\n```\n\n</td></tr><tr><td>\n\nresult.name\n\n</td><td>\n\nName of the data classification.Data type: String\n\n</td></tr><tr><td>\n\nresult.parent\n\n</td><td>\n\nEntry for a parent data classification.Data type: Object\n\n```\n\"parent\": {\n  \"name\": \"String\",\n  \"sys_id\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nresult.parent.name\n\n</td><td>\n\nName of the parent data classification.Data type: String\n\n</td></tr><tr><td>\n\nresult.parent.sys\\_id\n\n</td><td>\n\nSys\\_id of the parent data classification record.Data type: String\n\nTable: Data Classification \\[data\\_classification\\]\n\n</td></tr><tr><td>\n\nresult.sys\\_id\n\n</td><td>\n\nSys\\_id of the data classification record.Data type: String\n\nTable: Data Classification \\[data\\_classification\\]\n\n</td></tr></tbody>\n</table>### cURL request\n\nGet the data classifications associated with a specific dictionary entry.\n\n```\ncurl \"https://instance.servicenow.com/api/now/data_classification/getClassification\" \\\n--request POST \\\n--header \"Accept:application/json\" \\\n--header \"Content-Type:application/json\" \\\n--data \"{\n    \\\"dictionary_entries\\\": \\\"445de0a6dba30300efc57416bf9619b0\\\"\n}\" \\\n--user 'username':'password'\n\n```\n\n```\n{\n  \"result\": {\n    \"445de0a6dba30300efc57416bf9619b0\": [\n      {\n        \"parent\": {\n          \"sys_id\": \"a9670fc773fc1010ae8dd21efaf6a735\",\n          \"name\": \"Confidential\"\n        },\n        \"sys_id\": \"348107b951d71010f877f3f178e7dd0d\",\n        \"name\": \"Personally identifiable information\"\n      }\n    ]\n  }\n}\n\n```\n\n"}}