How to bulk export attachments from a ServiceNow instanceIssue <!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Learn how to bulk export attachments from a ServiceNow instance using the REST Attachment API. The base system does not include a feature to directly download all attachments, but you can use the REST Attachment API with scripting to perform a bulk download. Release<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } All supported releases Cause<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } How attachments are stored Attachments are stored in the Attachment [sys_attachment] and Attachment Document [sys_attachment_doc] tables. Records are linked by the following relationships: sys_attachment.table_sys_id = sys_id of the source recordsys_attachment_doc.sys_attachment = sys_id of the attachment record Resolution<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Retrieve attachment metadata Use the Attachment - GET /now/attachment REST Attachment API endpoint to retrieve the metadata for all Attachment [sys_attachment] records on the instance. For details on this endpoint, see the Attachment API product documentation. Example result: { "result": [ { "size_bytes": "106879", "file_name": "4.3_2_modify-label-names.png", "sys_mod_count": "2", "average_image_color": "#ffffff", "image_width": "800", "sys_updated_on": "2016-02-29 16:07:02", "sys_tags": "", "table_name": "sys_product_help", "sys_id": "003a3ef24ff1120031577d2ca310c74b", "image_height": "484", "sys_updated_by": "admin", "download_link": "https://INSTANCENAME.service-now.com/api/now/attachment/003a3ef24ff1120031577d2ca310c74b/file", "content_type": "image/png", "sys_created_on": "2016-02-29 16:07:02", "size_compressed": "105563", "compressed": "true", "state": "", "table_sys_id": "750129c94f12020031577d2ca310c7a4", "chunk_size_bytes": "", "hash": "", "sys_created_by": "admin" } ] } Extract download links Parse the JSON response to extract the download links. The following example uses the jq program in a bash shell (Linux, macOS, or Windows WSL) to process a JSON file with 10 results from the Attachment - GET /now/attachment endpoint: jq '.result[].download_link' jsonfile_10results"https://INSTANCENAME.service-now.com/api/now/attachment/003a3ef24ff1120031577d2ca310c74b/file""https://INSTANCENAME..service-now.com/api/now/attachment/009c53e0bf1101007a6d257b3f0739c0/file""https://INSTANCENAME..service-now.com/api/now/attachment/00e7525ddf710100a9e78b6c3df2639c/file""https://INSTANCENAME..service-now.com/api/now/attachment/011049ba5f130100a9ad2572f2b4775d/file""https://INSTANCENAME..service-now.com/api/now/attachment/011e08b5c311220071d07bfaa2d3ae2e/file""https://INSTANCENAME..service-now.com/api/now/attachment/01b07a11dfb10100a9e78b6c3df26342/file""https://INSTANCENAME..service-now.com/api/now/attachment/01e533a4bf1101007a6d257b3f0739a7/file""https://INSTANCENAME..service-now.com/api/now/attachment/023b3dc0d7613100a9ad1e173e24d460/file""https://INSTANCENAME..service-now.com/api/now/attachment/029382a947830100e43987e8dee49021/file""https://INSTANCENAME..service-now.com/api/now/attachment/02c7308f40a97200964f0edb17b6d9d0/file" Download the attachments Script the download of attachments. The following example uses curl in a bash shell: jq '.result[].download_link' jsonfile_10results > urls_to_download.txt xargs curl -v < urls_to_download.txt Important: ServiceNow Support does not provide assistance with custom scripting. The preceding examples are provided as a general guideline and can be accomplished in many ways, for example, using Python instead of a bash shell. Related Links<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } How to export bulk data from ServiceNow using REST API pagination Attachment API