{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":552,"path":"api-reference/rest-apis/shared_libraries-api.md","title":"CdmSharedLibraryApi","bundle":null,"doc_type":null,"release":"australia","body":"\n# CdmSharedLibraryApi\n\nThe CdmSharedLibraryApi provides endpoints that enable you to create and manage shared libraries and shared components. It also has endpoints that enable you to upload and export the configuration data of a shared component.\n\nThis API requires the Configuration Data Management \\(CDM\\) plugin to be activated for these APIs to be available in the instance. In addition, you must have one of the following roles to access this API:\n\n-   CDM Editor Role\n-   CDM Admin Role\n\nFor additional information on shared libraries and shared components, see [Sharing components among applications — Component libraries](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/it-service-management/cdm-component-libraries.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## CdmSharedLibraryApi - DELETE /sn\\_cdm/shared\\_libraries\n\nDeletes the shared library with the specified name.\n\nThe CDM Admin role is required to access this endpoint.\n\n### URL format\n\nVersioned URL: `/api/sn_cdm/{api_version}/shared_libraries`\n\nDefault URL: `/api/sn_cdm/shared_libraries`\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>|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\nname\n\n</td><td>\n\nRequired. Name of the shared library to delete.Data type: String\n\nTable: CDM Application \\[sn\\_cdm\\_application\\]\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=\"cdm_apps-sl_req_headers-accept-entry\">\n\nData format of the response body. Supported types:\n\n-   **application/json**\n-   **application/xml**\n-   **text/xml**\n\nDefault: **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|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 code example shows how delete the shared library \"javalib\".\n\n```\ncurl \"http://instance.servicenow.com/sn_cdm/shared_libraries?name='javalib'\\ \n--request DELETE\\ \n--header \"Accept:application/json\" \\ \n--user 'username':'password'\n```\n\nResponse:\n\n```\n\"\"\n```\n\n## CdmSharedLibraryApi - DELETE /sn\\_cdm/shared\\_libraries/components\n\nDeletes the specified shared component from the specified library.\n\nThe CDM Editor role is required to access this endpoint.\n\n**Note:** You can only delete a component if it is not currently being used. Also, you cannot delete a component if the associated shared library is not active.\n\n### URL format\n\nVersioned URL: `/api/sn_cdm/{api_version}/shared_libraries/components`\n\nDefault URL: `/api/sn_cdm/shared_libraries/components`\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\nchangesetNumber\n\n</td><td>\n\nRequired. Number of the changeset associated with the component.Data type: String\n\nTable: CDM Changeset \\[sn\\_cdm\\_changeset\\]\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nRequired. Name of the shared component to delete.Data type: String\n\nTable: CDM Shared Component \\[sn\\_cdm\\_shared\\_component\\]\n\n</td></tr><tr><td>\n\nsharedLibraryName\n\n</td><td>\n\nRequired. Name of the shared library where the component to delete is located.Data type: String\n\nTable: CDM Application \\[sn\\_cdm\\_application\\]\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<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=\"cdm_apps-sl_req_headers-accept-entry\">\n\nData format of the response body. Supported types:\n\n-   **application/json**\n-   **application/xml**\n-   **text/xml**\n\nDefault: **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<table><thead><tr><th>\n\nStatus code\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\n200\n\n</td><td id=\"entry-200-status-code\">\n\nSuccessful. The request was successfully processed.\n\n</td></tr><tr><td>\n\n400\n\n</td><td>\n\nBad Request. Possible issues:\n\n-   Shared library does not exist.\n-   Shared library is not active.\n-   Shared component is in use. Cannot delete it.\n-   User is restricted from deleting the shared component.\n\n</td></tr><tr><td>\n\n500\n\n</td><td id=\"entry-500-status-code\">\n\nInternal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.\n\n</td></tr></tbody>\n</table>### 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\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 code example shows how to delete the component \"TestComponent\" under the \"javalib\" shared library.\n\n```\ncurl \"http://instance.servicenow.com/sn_cdm/shared_libraries/components?sharedLibraryName='javalib&changesetNumber='chset-8'&name='TestComponent'\\ \n--request DELETE\\ \n--header \"Accept:application/json\" \\ \n--user 'username':'password' \n```\n\nResponse:\n\n```\n\"\"\n```\n\n## CdmSharedLibraryApi - GET /sn\\_cdm/shared\\_libraries/upload-status/\\{upload-id\\}\n\nReturns the current status of the specified shared library upload request.\n\n### URL format\n\nVersioned URL: `/api/sn_cdm/{api_version}/shared_libraries/upload-status/{upload-id}`\n\nDefault URL: `/api/sn_cdm/shared_libraries/upload-status/{upload-id}`\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\nupload-id\n\n</td><td>\n\nSys\\_id of the upload request whose status to return. This value is returned by various CdmSharedLibrary upload request endpoints.Data type: String\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<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=\"cdm_apps-sl_req_headers-accept-entry\">\n\nData format of the response body. Supported types:\n\n-   **application/json**\n-   **application/xml**\n-   **text/xml**\n\nDefault: **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|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\nerrors\n\n</td><td>\n\nDescription of the error\\(s\\) encountered during upload.Data type: String\n\n</td></tr><tr><td>\n\noutput\n\n</td><td>\n\nDescription of the uploaded data or if an error occurred during the upload, an error message describing the error that was encountered.Data type: Array of String\n\n ```\n\"output\": {\n  \"auto_validate\": \"String\",\n  \"cdm_application\": \"String\",\n  \"committed_at\": \"String\",\n  \"committed_by\": \"String\",\n  \"description\": \"String\",\n  \"last_conflict_detection_time\": \"String\",\n  \"number\": \"String\",\n  \"publish_option\": \"String\",\n  \"sharedLibraryName\": \"String\",\n  \"snapshot_description\": \"String\",\n  \"snapshot_name\": \"String\",\n  \"state\": \"String\",\n  \"sys_created_by\": \"String\",\n  \"sys_id\": \"String\",\n  \"title\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\noutput.auto\\_validate\n\n</td><td>\n\nIndicates whether to invoke validation after the commit.Data type: String\n\n</td></tr><tr><td>\n\noutput.cdm\\_application\n\n</td><td>\n\nName of application under which the upload was performed.Data type: String\n\n</td></tr><tr><td>\n\noutput.committed\\_at\n\n</td><td>\n\nDate and time that the uploaded content was committed.Data type: String\n\n</td></tr><tr><td>\n\noutput.committed\\_by\n\n</td><td>\n\nSys\\_id of the record of the entity that performed the commit.Data type: String\n\n</td></tr><tr><td>\n\noutput.description\n\n</td><td>\n\nNot currently used.Data type: String\n\n</td></tr><tr><td>\n\noutput.last\\_conflict\\_detection\\_time\n\n</td><td>\n\nDate and time conflict detection invocation.Data type: String\n\n</td></tr><tr><td>\n\noutput.number\n\n</td><td>\n\nUnique changeset identification value, such as Chset-124.Data type: String\n\n</td></tr><tr><td>\n\noutput.publish\\_option\n\n</td><td>\n\nValue of the publish option passed in the associated upload call. For additional information on publishing snapshots, see [Publish or unpublish a snapshot](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/it-service-management/cdm-snapshot-publish.md).\n\n Data type: String\n\n</td></tr><tr><td>\n\noutput.sharedLibraryName\n\n</td><td>\n\nName of the shared library as passed in the original upload call.Data type: String\n\n</td></tr><tr><td>\n\noutput.snapshot\\_description\n\n</td><td>\n\nDescription of the associated snapshot.Data type: String\n\n</td></tr><tr><td>\n\noutput.snapshot\\_name\n\n</td><td>\n\nName of the associated snapshot.Data type: String\n\n</td></tr><tr><td>\n\noutput.state\n\n</td><td>\n\nState of the upload.Possible values:\n\n-   COMPLETED: Upload has completed.\n-   EXPIREDERROR: Error while processing the upload request. The job ran for more than 15 minutes and was terminated by the system.\n-   IN\\_PROGRESS: Upload is in process.\n-   NEW: Processing has not yet started.\n-   READY: Request has been queued.\n\n Data type: String\n\n</td></tr><tr><td>\n\noutput.sys\\_created\\_by\n\n</td><td>\n\nSys\\_id of the entity that created the record.Data type: String\n\n</td></tr><tr><td>\n\noutput.sys\\_id\n\n</td><td>\n\nSys\\_id of the record containing the changeset.Data type: String\n\n</td></tr><tr><td>\n\noutput.title\n\n</td><td>\n\nTitle of the changeset created as part of the upload.Data type: String\n\n</td></tr><tr><td>\n\nprocessing\\_state\n\n</td><td>\n\nCurrent processing state of the upload request.Possible values: PROCESSED\n\n Data type: String\n\n</td></tr><tr><td>\n\nstate\n\n</td><td>\n\nCurrent state of the upload request.Possible values:\n\n-   completed\n-   error\n\n</td></tr><tr><td>\n\ntype\n\n</td><td>\n\nType of upload request.Possible values: upload\\_and\\_commit\n\n Data type: String\n\n</td></tr><tr><td>\n\nupload\\_id\n\n</td><td>\n\nSys\\_id of the record containing the uploaded configuration payload. Data type: String\n\n</td></tr></tbody>\n</table>### cURL request\n\nThis code example shows how to request the status for the upload-id 0d91d9891b2b19109524cae0604bcbe6.\n\n```\ncurl \"http://instance.servicenow.com/api/sn_cdm/shared_libraries/upload-status/0d91d9891b2b19109524cae0604bcbe6\" \\\n--request GET \\\n--header \"Accept:application/json\" \\\n--user 'username':'password'\n```\n\nResponse:\n\n```\n// Successful response\n{\n  \"result\": {\n    \"type\": \"upload_and_commit\",\n    \"state\": \"completed\",\n    \"output\": {\n      \"sys_id\": \"0002ea107768a1109ac0cf0bbb5a9963\",\n      \"number\": \"Chset-457\",\n      \"title\": \"admin8802ea107768a1109ac0cf0bbb5a9962\",\n      \"description\": null,\n      \"committed_at\": \"\",\n      \"committed_by\": null,\n      \"sys_created_by\": \"admin\",\n      \"state\": \"open\",\n      \"publish_option\": \"publish_none\",\n      \"auto_validate\": false,\n      \"snapshot_name\": null,\n      \"snapshot_description\": null,\n      \"cdm_application\": \"OracleG-Library-15\",\n      \"last_conflict_detection_time\": null\n    },\n    \"processing_state\": \"PROCESSED\",\n    \"upload_id\": \"00b226547768a1109ac0cf0bbb5a99f2\"\n  }\n}\n\n// Error response\n{\n  \"result\": {\n    \"type\": \"upload_and_commit\",\n    \"state\": \"error\",\n    \"output\": \"Error: Application with sys_id 87fb1ecb1be3111050fc21b0604bcb95 is in State Deleted. No data can be modified on deleted applications\",\n    \"processing_state\": \"PROCESSED\",\n    \"upload_id\": \"fcdfaf7f1b88211050fc21b0604bcb79\"\n  }\n}\n```\n\n## CdmSharedLibraryApi - POST /sn\\_cdm/shared\\_libraries\n\nCreates a new shared library with the specified name.\n\nThe CDM Admin role is required to access this endpoint.\n\n### URL format\n\nVersioned URL: `/api/sn_cdm/{api_version}/shared_libraries`\n\nDefault URL: `/api/sn_cdm/shared_libraries`\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\ndescription\n\n</td><td>\n\nDescription of the shared library. Data type: String\n\n Default: Empty\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nRequired. Name of the shared library to create. This name must be unique across all CDM applications and libraries.Data type: String\n\n</td></tr><tr><td>\n\nreturnFields\n\n</td><td>\n\nComma separated list of fields to return as part of the response.Data type: String\n\nDefault: All non-system fields are returned.\n\nTable: CDM Application \\[sn\\_cdm\\_application\\]\n\n</td></tr><tr><td>\n\nuserGroupIds\n\n</td><td id=\"appName-userGroupIds-entry\">\n\nComma-separated list of sys\\_ids of the user groups that can edit the associated shared library. All users with the proper roles can view the shared library.Data type: String\n\nDefault: All users with the CDM Editor role can edit data within the shared library.\n\nTable: Group \\[sys\\_user\\_group\\]\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<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=\"cdm_apps-sl_req_headers-accept-entry\">\n\nData format of the response body. Supported types:\n\n-   **application/json**\n-   **application/xml**\n-   **text/xml**\n\nDefault: **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|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\n&lt;fields&gt;\n\n</td><td>\n\nRequested fields.Data type: Variable\n\nTable: CDM Application \\[sn\\_cdm\\_application\\]\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\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 code example shows how to call this endpoint to create the shared library Java11Lib with all user groups able to access the library.\n\n```\ncurl \"http://instance.servicenow.com/api/sn_cdm/shared_libraries?name=Java11Lib&description=The%20new%20java%20library\" \\ \n--request POST \\ \n--header \"Accept:application/json\" \\ \n--user 'userName':'password\n```\n\nResponse:\n\n```\n{\n  \"result\": {\n    \"sdlc_component\": null,\n    \"cdi_count\": \"0\",\n    \"available\": false,\n    \"description\": \"Description of LibraryA\",\n    \"managed_by_group\": null,\n    \"sys_updated_on\": \"2023-01-18 11:34:43\",\n    \"type\": \"shared_library\",\n    \"node\": {\n      \"value\": \"d852b15877a4a1109ac0cf0bbb5a99aa\",\n      \"link\": \"http://instance.servicenow.com/api/now/table/sn_cdm_node/d852b15877a4a1109ac0cf0bbb5a99aa\"\n    },\n    \"sys_id\": \"185235dc77a4a1109ac0cf0bbb5a994e\",\n    \"sys_updated_by\": \"admin\",\n    \"node_main\": {\n      \"value\": \"1852b15877a4a1109ac0cf0bbb5a99aa\",\n      \"link\": \"http://instance.servicenow.com/api/now/table/sn_cdm_node_main/1852b15877a4a1109ac0cf0bbb5a99aa\"\n    },\n    \"sys_created_on\": \"2023-01-18 11:34:43\",\n    \"cdi_usage\": \"0\",\n    \"name\": \"LibraryA\",\n    \"last_committed_changeset\": {\n      \"value\": \"9052b15877a4a1109ac0cf0bbb5a99aa\",\n      \"link\": \"http://instance.servicenow.com/api/now/table/sn_cdm_changeset/9052b15877a4a1109ac0cf0bbb5a99aa\"\n    },\n    \"state\": \"active\",\n    \"sys_created_by\": \"admin\"\n  }\n}\n```\n\n## CdmSharedLibraryApi - POST /sn\\_cdm/shared\\_libraries/components\n\nCreates the specified shared component under the specified library.\n\nThe CDM Editor role is required to access this endpoint.\n\n### URL format\n\nVersioned URL: `/api/sn_cdm/{api_version}/shared_libraries/components`\n\nDefault URL: `/api/sn_cdm/shared_libraries/components`\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\nchangesetNumber\n\n</td><td id=\"changesetNumber-changeset-entry\">\n\nRequired. Unique identifier of the associated changeset, such as \"Chset-10\".\n\nData type: String\n\nTable: CDM Changeset \\[sn\\_cdm\\_changeset\\]\n\n</td></tr><tr><td>\n\ndescription\n\n</td><td>\n\nDescription of the shared component. Data type: String\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nRequired. Name of the shared component to create in the shared library. This name must be unique.Data type: String\n\n</td></tr><tr><td>\n\nreturnFields\n\n</td><td>\n\nComma separated list of fields in the CDM Node \\[sn\\_cdm\\_node\\] table to return as part of the response.Data type: String\n\nDefault: All non-internal fields are returned.\n\n</td></tr><tr><td>\n\nsharedLibraryName\n\n</td><td>\n\nRequired. Name of the shared library under which to create the component. This library must already exist and be in the active state.Data type: String\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<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=\"cdm_apps-sl_req_headers-accept-entry\">\n\nData format of the response body. Supported types:\n\n-   **application/json**\n-   **application/xml**\n-   **text/xml**\n\nDefault: **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|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\n&lt;requested fields&gt;\n\n</td><td>\n\nRequested fields.Data type: Various\n\nTable: CDM Node \\[sn\\_cdm\\_node\\]\n\n</td></tr><tr><td>\n\nerror\n\n</td><td id=\"cdm_apps-error-entry\">\n\nOnly returned if an error occurred during processing.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 id=\"cdm_apps-error_detail-entry\">\n\nDetails about the error that occurred.Data type: String\n\n</td></tr><tr><td>\n\nerror.message\n\n</td><td id=\"cdm_apps-error_message-entry\">\n\nMessage that provides an overview of the error.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 code example stores the component named \"SharedComponent\" under the shared library \"javalib\".\n\n```\ncurl \"http://instance.servicenow.com/sn_cdm/shared_libraries/components/?sharedLibraryName=javalib&changeSetNumber='Chset-9'&name='SharedComponent'\\  \n--request POST\\  \n--header \"Accept:application/json\" \\  \n--user 'username':'password'\n```\n\nResponse:\n\n```\n{\n  \"result\": {\n    \"changeset_id\": {\n      \"value\": \"ca7e6a501b202110636e0fe0604bcb71\",\n      \"link\": \"https://instance.servicenow.com/api/now/table/sn_cdm_changeset/ca7e6a501b202110636e0fe0604bcb71\"\n    },\n    \"node_path\": \"!2!3!:\",\n    \"description\": null,\n    \"sys_updated_on\": \"2023-01-18 16:04:52\",\n    \"type\": \"sn_cdm_node_shared_component\",\n    \"sys_class_name\": \"sn_cdm_node\",\n    \"sys_id\": \"6d2072901b602110636e0fe0604bcbec\",\n    \"sys_updated_by\": \"admin\",\n    \"previous_version\": null,\n    \"sys_created_on\": \"2023-01-18 16:04:52\",\n    \"value\": null,\n    \"effective_from\": null,\n    \"linked_to\": null,\n    \"sys_created_by\": \"admin\",\n    \"restricted_to\": null,\n    \"linked_to_version\": null,\n    \"level\": \"2\",\n    \"conflict_type\": null,\n    \"main_id\": \"19\",\n    \"effective_to\": null,\n    \"secure_value\": null,\n    \"node_classifier\": \"/shared_library/shared_components\",\n    \"main_id_encoded\": \":\",\n    \"name\": \"testSharedComponent\",\n    \"position\": null,\n    \"reason_for_conflict\": null,\n    \"system_folder\": false,\n    \"status\": \"new\",\n    \"conflict\": false\n  }\n}\n```\n\n## CdmSharedLibraryApi - POST /sn\\_cdm/shared\\_libraries/uploads/components\n\nEnables you to create and manage shared libraries and shared components. This endpoint creates a shared component node in the CDM Node \\[sn\\_cdm\\_node\\] table and a shared component record in the CDM Shared Component \\[sn\\_cdm\\_shared\\_component\\] table.\n\nThe CDM Editor role is required to access this endpoint.\n\n**Note:** By default, the maximum content upload size is 2MB. You can modify this default by updating the sn\\_cdm.max\\_allowed\\_upload\\_file\\_size property.\n\n**Note:** This upload method can't be used to modify nodes. Use the alternative [CdmSharedLibraryApi - POST /sn\\_cdm/shared\\_libraries/uploads/components/file](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/shared_libraries-api.md) method to modify nodes.\n\n### URL format\n\nVersioned URL: `/api/sn_cdm/{api_version}/shared_libraries/uploads/components`\n\nDefault URL: `/api/sn_cdm/shared_libraries/uploads/components`\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\nautoCommit\n\n</td><td>\n\nFlag that indicates whether the changeset identified in the **changesetNumber** parameter is committed to the data model after upload.Valid values:\n\n-   true: Changeset is committed after upload.\n-   false: Changeset isn't committed after upload.\n\nData type: Boolean\n\nDefault: false\n\n</td></tr><tr><td>\n\nautoDelete\n\n</td><td>\n\nFlag that indicates whether the existing nodes, that aren’t part of the upload content, are deleted after the processing is complete.Valid values:\n\n-   true: Automatically delete existing nodes.\n-   false: Don't automatically delete existing nodes.\n\nData type: Boolean\n\nDefault: false\n\n</td></tr><tr><td>\n\nchangesetNumber\n\n</td><td>\n\nRequired. String that uniquely identifies the changeset associated with the application, such as Chset-102. This changeset must be in the \"Open\" state.Data type: String\n\nTable: CDM Changeset \\[sn\\_cdm\\_changeset\\]\n\n</td></tr><tr><td>\n\ndataFormat\n\n</td><td>\n\nRequired. Format of the configuration data.Valid values:\n\n-   csv\n-   ini\n-   json\n-   properties\n-   raw\n-   xml\n-   yaml\n\nData type: String\n\n</td></tr><tr><td>\n\ndeleteRedundantOverrides\n\n</td><td>\n\nFlag that indicates whether to create an override where redundant values are present.Valid values:\n\n-   true: If redundant values are present, an override isn’t created.\n-   false: If redundant values are present, proceeds with an override.\n\nDefault: true\n\n</td></tr><tr><td>\n\nidentifierKeys\n\n</td><td>\n\nList of names that indicate which key in an array child to use to identify the same node.For example, if you’re uploading:\n\n```\n[\n  {\"name\" : \"Allan, \"city\" : \"Paris\"}, \n  {\"name\" : \"Karen, \"city\" : \"Sydney\"}\n]\n```\n\nin the following existing model:\n\n```\n[\n  {\"name\" : \"Karen, \"city\" : \"Manila\"},\n  {\"name\" : \"Allan, \"city\" : \"Brussels\"}\n]\n```\n\nand you set **identifierKeys** to `name`, it produces the following output:\n\n```\n[\n  {\"name\" : \"Karen, \"city\" : \"Sydney\"},\n  {\"name\" : \"Allan, \"city\" : \"Paris\"}\n]\n```\n\nOtherwise, it produces the following output:\n\n```\n[\n  {\"name\" : \"Karen, \"city\" : \"Manila\"},\n  {\"name\" : \"Allan, \"city\" : \"Brussels\"},\n  {\"name\" : \"Allan, \"city\" : \"Paris\"},\n  {\"name\" : \"Karen, \"city\" : \"Sydney\"}\n]\n```\n\nData type: Array of Strings\n\n</td></tr><tr><td>\n\nignoreAttributes\n\n</td><td>\n\nFlag that indicates whether the given data format supports attributes \\(currently only XML\\).Valid values:\n\n-   true: If the given data format supports attributes, any attributes in the input data are skipped during the upload.\n-   false: If the given data format supports attributes, any attributes in the input data are included in the upload.\n\nData type: Boolean\n\nDefault: false\n\n</td></tr><tr><td>\n\nnamePath\n\n</td><td>\n\nPath of the targeted node under which the configuration data should be uploaded. This path is relative to the components, collection, or deployable folder \\(depending on the endpoint being called\\).You can pass the name path in any of the following formats. For example, to define the name path for the node `testApp/deployables/Development1/cdi1`:\n\n-   Backslash format: `testApp/deployables/Development1/cdi1`\n\n**Note:** If your node name contains a backslash \\(\"/\"\\), you can’t use this format.\n\n-   Backend name path with replacement characters: `testApp�deployables�​Development1​�​cdi1`\n-   Array: `['testApp','deployables','Development1','cdi1']`\n\n**Note:** If the specified component doesn't exist at the specified path, the system automatically creates the component at the specified path and then uploads the data.\n\nData type: String\n\n</td></tr><tr><td>\n\npublishOption\n\n</td><td>\n\nPublish option for the associated configured snapshots.\n\nValid values:\n\n-   publish\\_new\\_and\\_unpublish\\_old: Publish the new snapshot created after the commit and unpublish the existing snapshot.\n-   publish\\_none: Don't publish any snapshots.\n\nFor additional information on publishing snapshots, see [Publish or unpublish a snapshot](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/it-service-management/cdm-snapshot-publish.md).\n\nData type: String\n\nDefault: publish\\_none\n\n</td></tr><tr><td>\n\nsharedLibraryName\n\n</td><td>\n\nRequired. Name of the shared library to create or manage.Data type: String\n\nTable: CDM Application \\[sn\\_cdm\\_application\\]\n\n</td></tr></tbody>\n</table>|Name|Description|\n|----|-----------|\n|Variable upload data|Configuration data to upload. This can be any data in the format defined by the **dataFormat** parameter of the query parameters.|\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 id=\"id_fyp_pmb_fwb\" 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-JSON-only-entry-RESTAPI\">\n\nData format of the response body. Only supports **application/json**.\n\n</td></tr><tr><td>\n\nContent-Type\n\n</td><td>\n\nData format of the request body. Supported types: **text/plain** and **application/x-www-form-urlencoded**.Default: **text/plain**\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<table><thead><tr><th>\n\nStatus code\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\n200\n\n</td><td id=\"entry-200-status-code\">\n\nSuccessful. The request was successfully processed.\n\n</td></tr><tr><td>\n\n400\n\n</td><td>\n\nBad Request. The upload request has been rejected.Possible issues:\n\n-   Size of the configuration payload is greater that the allowed maximum - 2MB by default.\n-   Required parameters are missing from the call.\n\n</td></tr><tr><td>\n\n500\n\n</td><td id=\"entry-500-status-code\">\n\nInternal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.\n\n</td></tr></tbody>\n</table>### 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\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\nupload\\_id\n\n</td><td>\n\nSys\\_id of the upload request. Use this ID to call the endpoint to obtain the status of the upload.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 upload the shared library called Demo\\_App1631126164773 with the configuration data being plain text.\n\n```\ncurl \"http://instance.servicenow.com/api/sn_cdm/sharedlibrary/component/upload?namePath=%2FSettings%2FdbSettings&dataFormat=json&appName=Demo_App1631126164773&changesetNumber=Chset-8&autoCommit=false&publishOption=publish_none&autoDelete=true\" \\ \n--request POST \\  \n--header \"Accept:application/json\" \\  \n--header \"Content-Type:text/plain\" \\  \n--data \"{  \n  \\\"dbIPAddress\\\": \\\"10.10.10.110\\\",  \n\\\"dbPort\\\": \\\"8080\\\",  \n\\\"dbConnectionString\\\": \\\"admin:admin server1.xyz.com:8080 dbName_payments\\\",  \n\\\"dbConnectionStringBackup\\\": \\\"admin:admin server2.xyz.com dbName_payments_backup\\ \"}\" \\  \n--user 'username':'password' \n```\n\nThe following return results show both a successful and an error response to this request.\n\n```\n// Successful response \n{  \n\"result\": {  \n    \"upload_id\": \"ec1f71f45322301096edddeeff7b12b3\"  \n  }  \n}\n \n// Error response \n\n{  \n\"error\": {  \n   \"message\": \"Size of uploaded data:6853632.0(bytes) is greater than max allowed upload limit of 2097152.0(bytes)\",  \n   \"detail\": \"\"  \n},  \n\"status\": \"failure\" \n} \n```\n\n## CdmSharedLibraryApi - POST /sn\\_cdm/shared\\_libraries/uploads/components/file\n\nUploads files as part of the Configuration Data Model \\(CDM\\) under the components folder in a shared library.\n\n### URL format\n\nVersioned URL: `/api/sn_cdm/{api_version}shared_libraries/uploads/components/file`\n\nDefault URL: `/api/sn_cdm/shared_libraries/uploads/components/file`\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=\"table_hxt_rmm_2yb\"><thead><tr><th>\n\n \n\n</th><th>\n\n \n\n</th></tr></thead><tbody><tr><td>\n\nautoCommit\n\n</td><td>\n\nFlag that indicates whether the changeset identified in the **changesetNumber** parameter is committed to the data model after upload.Valid values:\n\n-   true: Changeset is committed after upload.\n-   false: Changeset isn't committed after upload.\n\nData type: Boolean\n\nDefault: false\n\n</td></tr><tr><td>\n\nautoValidate\n\n</td><td>\n\nFlag that indicates whether the snapshots created when committed are validated.Valid values:\n\n-   true: Validate the snapshots.\n-   false: Don't validate the snapshots.\n\n**Note:** This option is only available if the **autoCommit** parameter is `true`.\n\nData type: Boolean\n\nDefault: false\n\n</td></tr><tr><td>\n\nchangesetNumber\n\n</td><td>\n\nString that uniquely identifies the [changeset](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/it-service-management/cdm-changesets-version-control.md) associated with the application, such as Chset-102. This changeset must be in the \"Open\" state.Data type: String\n\nDefault: Creates a changeset to use. The changeset details are returned as part of the [CdmApplicationsApi - GET /sn\\_cdm/applications/upload-status/\\{upload\\_id\\}](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/applications-api.md) results.\n\nTable: CDM Changeset \\[sn\\_cdm\\_changeset\\]\n\n</td></tr><tr><td>\n\nfileName\n\n</td><td>\n\nName of the file to upload. This name can differ from than the actual file name and contain the file extension. For example, .txt/.scv/.jar. The fileName value is applied when downloading the file.Data type: String\n\n</td></tr><tr><td>\n\nfileNodeName\n\n</td><td>\n\nName of the file node. This file name is used in the configuration data when exporting it. This name doesn’t require a file extension nor does it affect the download.Data type: String\n\n</td></tr><tr><td>\n\nnamePath\n\n</td><td>\n\nPath of the targeted node under which the configuration data should be uploaded. This path is relative to the components, collection, or deployable folder \\(depending on the endpoint being called\\).You can pass the name path in any of the following formats. For example, to define the name path for the node `testApp/deployables/Development1/cdi1`:\n\n-   Backslash format: `testApp/deployables/Development1/cdi1`\n\n**Note:** If your node name contains a backslash \\(\"/\"\\), you can’t use this format.\n\n-   Backend name path with replacement characters: `testApp�deployables�​Development1​�​cdi1`\n-   Array: `['testApp','deployables','Development1','cdi1']`\n\n**Note:** If the specified component doesn't exist at the specified path, the system automatically creates the component at the specified path and then uploads the data.\n\nData type: String\n\n</td></tr><tr><td>\n\nsharedLibraryName\n\n</td><td>\n\nRequired. Name of the shared library where the component to delete is located.Data type: String\n\nTable: CDM Application \\[sn\\_cdm\\_application\\]\n\n</td></tr></tbody>\n</table><table id=\"table_j22_fgm_2yb\" 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\nVariable upload data\n\n</td><td>\n\nConfiguration data to upload. By default, file size uploads are limited to 5 MB. For information about how to adjust your upload file sizes and type, see this [Now Support article](https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0718101).Data type: String/stream\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\nContent Type of the file to be uploaded. Examples: application/zip, text/plain, 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<table id=\"id_cdq_fft_byb\"><thead><tr><th>\n\nStatus code\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\n200\n\n</td><td id=\"entry-200-status-code\">\n\nSuccessful. The request was successfully processed.\n\n</td></tr><tr><td>\n\n400\n\n</td><td>\n\nBad request.Upload request has been rejected.\n\nPossible issues:\n\n-   Size of configuration payload is greater that the allowed maximum - 2 MB by default.\n-   Required parameters are missing from the call.\n\n</td></tr><tr><td>\n\n500\n\n</td><td id=\"entry-500-status-code\">\n\nInternal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.\n\n</td></tr></tbody>\n</table>### Response body parameters \\(JSON or XML\\)\n\n<table id=\"id_af3_kft_byb\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr id=\"cdm_apps-stat-error\"><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 id=\"cdm_apps-stat-error_detail-row\"><td>\n\nerror.detail\n\n</td><td>\n\nAdditional information about the error.Data type: String\n\n</td></tr><tr id=\"cdm_apps-stat-error_messaage-row\"><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 id=\"cdm_apps-stat-error_status-row\"><td>\n\nstatus\n\n</td><td>\n\nError status of the request.Possible values: failure\n\nData type: String\n\n</td></tr><tr id=\"cdm_apps-upload_id-row\"><td>\n\nupload\\_id\n\n</td><td>\n\nSys\\_id of the upload request. Use this ID to call the [CdmApplicationsApi - GET /sn\\_cdm/applications/upload-status/\\{upload\\_id\\}](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/applications-api.md) endpoint to obtain the status of the upload.Data type: String\n\n</td></tr></tbody>\n</table>### cURL request\n\nThe following call demonstrates how to upload a plain text file to the components folder in the Shared Library.\n\n```\ncurl \"http://instance.servicenow.com/api/sn_cdm/shared_libraries/uploads/components/file?autoValidate=true&sharedLibraryName=sharedLibA &namePath=testComponent%2FfilesFolder&fileName=testFileNodeName.txt&publishOption=publish_valid&changesetNumber=Chset-108&autoCommit=true&fileNodeName=testFile.txt\" \\ \n--request POST \\ \n--header \"Accept:application/json\" \\ \n--header \"Content-Type:text/plain\" \\ \n--data \"This is sample content that will be uploaded to a plain text file.\"\\ \n--user 'username':'password' \n```\n\nThe following return results show both a successful and an error response to this request.\n\n```\n// Successful completion of the upload request\n{ \n  \"result\": { \n    \"upload_id\": \"ec1f71f45322301096edddeeff7b12b3\" \n  } \n} \n\n// Error response. Payload is too large.\n{ \n  \"error\": { \n    \"message\": \"Could not find active application with name: ‘testApp’ of type application\", \n    \"detail\": \"\" \n  },\n  \"status\": \"failure\"\n}\n```\n\n## CdmSharedLibraryApi - PUT /sn\\_cdm/shared\\_libraries\n\nUpdates the shared library information. Use this endpoint to update the name, description, state of a shared library, and the user groups that can access the library.\n\nThe CDM Admin role is required to access this endpoint.\n\n### URL format\n\nVersioned URL: `/api/sn_cdm/{api_version}/shared_libraries`\n\nDefault URL: `/api/sn_cdm/shared_libraries`\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\nname\n\n</td><td>\n\nRequired. Name of the shared library to update.Data type: String\n\nTable: CDM Application \\[sn\\_cdm\\_application\\]\n\n</td></tr><tr><td>\n\nnewAvailableState\n\n</td><td>\n\nFlag that indicates the state of the shared library.Valid values:\n\n-   true: The shared library is active.\n-   false: The shared library is inactive. No users are allowed to access this library.\n\nDefault: true\n\n</td></tr><tr><td>\n\nnewDescription\n\n</td><td>\n\nUpdated description of the shared library. Data type: String\n\n</td></tr><tr><td>\n\nnewName\n\n</td><td>\n\nNew name of the shared library.Data type: String\n\n</td></tr><tr><td>\n\nnewUserGroupIds\n\n</td><td>\n\nComma separated list of sys\\_ids of the user groups that can access the associated shared library.Data type: String\n\nTable: Group \\[sys\\_user\\_group\\]\n\n</td></tr><tr><td>\n\nreturnFields\n\n</td><td>\n\nComma separated list of fields in the CDM Application \\[sn\\_cdm\\_application\\] table to return as part of the response.Data type: String\n\nDefault: All non-system fields are returned.\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<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=\"cdm_apps-sl_req_headers-accept-entry\">\n\nData format of the response body. Supported types:\n\n-   **application/json**\n-   **application/xml**\n-   **text/xml**\n\nDefault: **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|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\n&lt;fields&gt;\n\n</td><td>\n\nRequested fields.Data type: Variable\n\nTable: CDM Application \\[sn\\_cdm\\_application\\]\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\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 code example shows how to call this endpoint for the shared library Java11Lib and update the library name and description.\n\n```\ncurl \"http://instance.servicenow.com/sn_cdm/shared_libraries?name=' javalib'&newName=’NewLibraryName’&newDescription=’new%20description%20of%20library’\\ \n--request PUT\\ \n--header \"Accept:application/json\" \\ \n--user 'username':'password'  \n```\n\nResponse:\n\n```\n{\n  \"result\": {\n    \"sdlc_component\": null,\n    \"cdi_count\": \"0\",\n    \"available\": true,\n    \"description\": \"Set new description\",\n    \"managed_by_group\": null,\n    \"sys_updated_on\": \"2023-01-18 11:51:14\",\n    \"type\": \"shared_library\",\n    \"node\": {\n      \"value\": \"021635dc77a4a1109ac0cf0bbb5a9952\",\n      \"link\": \"http://192.168.0.129:8080/api/now/table/sn_cdm_node/021635dc77a4a1109ac0cf0bbb5a9952\"\n    },\n    \"sys_id\": \"185235dc77a4a1109ac0cf0bbb5a994e\",\n    \"sys_updated_by\": \"admin\",\n    \"node_main\": {\n      \"value\": \"1852b15877a4a1109ac0cf0bbb5a99aa\",\n      \"link\": \"http://192.168.0.129:8080/api/now/table/sn_cdm_node_main/1852b15877a4a1109ac0cf0bbb5a99aa\"\n    },\n    \"sys_created_on\": \"2023-01-18 11:34:43\",\n    \"cdi_usage\": \"0\",\n    \"name\": \"LibraryA\",\n    \"last_committed_changeset\": {\n      \"value\": \"4a1635dc77a4a1109ac0cf0bbb5a9951\",\n      \"link\": \"http://192.168.0.129:8080/api/now/table/sn_cdm_changeset/4a1635dc77a4a1109ac0cf0bbb5a9951\"\n    },\n    \"state\": \"active\",\n    \"sys_created_by\": \"admin\"\n  }\n}\n```\n\n## CdmSharedLibraryApi - PUT /sn\\_cdm/shared\\_libraries/components\n\nUpdates the name and description of the specified shared component.\n\nThe CDM Editor role is required to access this endpoint.\n\n**Note:** Renaming is only allowed if a component has never been used, as when the component's snapshot has never been imported. The renaming scenario is primarily for the purpose of fixing typos when creating new components.\n\n### URL format\n\nVersioned URL: `/api/sn_cdm/{api_version}/shared_libraries/components`\n\nDefault URL: `/api/sn_cdm/shared_libraries/components`\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\nchangesetNumber\n\n</td><td>\n\nRequired. Name of the associated changeset.Data type: String\n\nTable:CDM Changeset \\[sn\\_cdm\\_changeset\\]\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nRequired. Name of the shared component to update.Data type: String\n\nTable: CDM Shared Component \\[sn\\_cdm\\_shared\\_component\\]\n\n</td></tr><tr><td>\n\nnewName\n\n</td><td>\n\nRequired. Updated name of the shared component.Data type: String\n\n</td></tr><tr><td>\n\nnewDescription\n\n</td><td>\n\nUpdated description of the shared component. Data type: String\n\nDefault: Empty\n\n</td></tr><tr><td>\n\nreturnFields\n\n</td><td>\n\nComma separated list of fields in the CDM Shared Component \\[sn\\_cdm\\_shared\\_component\\] table to return as part of the response.Data type: String\n\nDefault: All non-system fields are returned.\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<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=\"cdm_apps-sl_req_headers-accept-entry\">\n\nData format of the response body. Supported types:\n\n-   **application/json**\n-   **application/xml**\n-   **text/xml**\n\nDefault: **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|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\n&lt;fields&gt;\n\n</td><td>\n\nRequested fields from the CDM Shared Component \\[sn\\_cdm\\_shared\\_component\\] table.Data type: Variable\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\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 code sample shows how to update the description of the component SharedComponentTest.\n\n```\ncurl \"http://instance.servicenow.com/sn_cdm/shared_libraries/components/?sharedLibraryName=javalib&changeSetNumber='chset-9'&name='SharedComponentTest'&newDescription='The shared component description'\\  \n--request POST\\  \n--header \"Accept:application/json\" \\  \n--user 'username':'password\n```\n\nResponse:\n\n```\n{\n  \"result\": {\n    \"changeset_id\": {\n      \"value\": \"5c33311077e4a1109ac0cf0bbb5a9902\",\n      \"link\": \"http://instance.servicenow.com/api/now/table/sn_cdm_changeset/5c33311077e4a1109ac0cf0bbb5a9902\"\n    },\n    \"node_path\": \"!(1!(2!(3\",\n    \"description\": \"Changing the description only\",\n    \"sys_updated_on\": \"2023-01-18 12:09:05\",\n    \"type\": \"sn_cdm_node_shared_component\",\n    \"sys_class_name\": \"sn_cdm_node\",\n    \"sys_id\": \"9953f99077a4a1109ac0cf0bbb5a99ec\",\n    \"sys_updated_by\": \"admin\",\n    \"previous_version\": null,\n    \"sys_created_on\": \"2023-01-18 11:39:09\",\n    \"value\": null,\n    \"effective_from\": null,\n    \"linked_to\": null,\n    \"sys_created_by\": \"admin\",\n    \"restricted_to\": null,\n    \"linked_to_version\": null,\n    \"level\": \"2\",\n    \"conflict_type\": null,\n    \"main_id\": \"183\",\n    \"effective_to\": null,\n    \"secure_value\": null,\n    \"node_classifier\": \"/shared_library/shared_components\",\n    \"main_id_encoded\": \"(3\",\n    \"name\": \"sharedComponentName\",\n    \"position\": null,\n    \"reason_for_conflict\": null,\n    \"system_folder\": false,\n    \"status\": \"new\",\n    \"conflict\": false\n  }\n}\n```\n\n"}}