Skip to main content
Version: main

Attachment API overview

The Attachment API lets you manage files attached to records in ServiceNow. You can use it to list metadata for multiple attachments, retrieve metadata for a specific attachment, or delete an attachment.

Additionally, it provides specialized endpoints for handling the raw file content (binary data) through the File operations sub-module.

Commonly used for:

  • Retrieving a list of attachments associated with a specific record or table.
  • Downloading file content for processing.
  • Uploading documents, images, or logs to existing ServiceNow records.
  • Cleaning up old or redundant attachments.

Basic usage

To interact with attachments, you use the Attachment method from the now namespace.

// Access the attachment API
attachmentAPI := client.Now().Attachment()

// Fetch metadata for all attachments (optionally filtered)
result, err := attachmentAPI.Get(context.Background(), nil)
if err != nil {
log.Fatal(err)
}

Available operations

Was this page helpful?