The best you can do is set the ‘hidden’ field to true in the attachment. This will prevent a notification from being sent. But there will still be an event (com.atlassian.confluence.event.events.content.attachment.HiddenAttachmentCreateEvent) that is published.