Prevent notifications when using REST API
Asked by Rosario De Domenico:

I am using the Confluence REST API for our Server installation in VBA macros to update (change or add) attachments to Confluence pages and to edit the page content.

Everything works fine but currently I have many subsequent API calls to a given page each of which triggers a notification e-mail to all people watching the page.

Is there an option in the API that I can use to use the "save" instead of the "save and notify" option?

Alternatively, is there a way to combine multiple calls to a given page so that they are all done together?


Answers:
author: Stephen Sifers
body: Hello Rosario,

Using the Confluence API allows for easier integration and awesome amounts of automation. When you're editing multiple (hundreds of pages) at a time, and all those watches get notifications it can be painful to deal with. I have experienced the exact issue you are trying to avoid when bulk updating/automating.

There is a feature request to give you additional functionality to disable notifications of watchers. That Feature request can be found at [CONFSERVER-38804](https://jira.atlassian.com/browse/CONFSERVER-38804) for server and for cloud [CONFCLOUD-38804.](https://jira.atlassian.com/browse/CONFCLOUD-38804) If you are interested in seeing these feature become part of the product then we would suggest you vote and watch them to receive updates as they progress.

There is a way to disable notifications upon updating content. The work around is from the server feature request and it states the following:

### **Workaround** {#toc-hId-1653091356}

> [Comment from development](https://jira.atlassian.com/browse/CONFSERVER-38804?focusedCommentId=1555704&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-1555704):
>
> Suppressing notifications upon updating a content via REST is already supported. You currently have to supply a version with an incremented number in the request payload. Add the "minorEdit" field to the
>
> The version payload also supports minor edits and comments as follow

```
"version" : {
 ?"number" ???: incrementedFromPrevious,
 ?"minorEdit" : true,
 ?"message" ??: "some version comment to keep on the content history"
}
```

As stated above, without the work around, watchers of a space/page will be notified on creation/update of content.

I hope this clarifies the capabilities of the Confluence REST API along with a possible work around to your problem.

Regards,  
Stephen Sifers

comments: author: Rosario De Domenico
body: Is there a similar workaround also for adding or updating attachments?  

Forget the question this is already possible in the API call itself...


author: Pavel
body: +1

I started using "minorEdit" : true, no more page change messages. But a lot of messages about adding attachments. This is not good!


author: norbert
body: [@Rosario De Domenico](/t5/user/viewprofilepage/user-id/544490) How do you disable notification when uploading or deleting attachments? The minorEdit thing does not seem to apply there.

Thanks!


author: Rosario De Domenico
body: In the REST API call itself, you can use the option "-F minorEdit=true" which does the job.

It works for me.

Refer to: <https://docs.atlassian.com/atlassian-confluence/REST/6.6.0/#content/{id}/child/attachment-createAttachments>


author: norbert
body: I'll check, I'm using the python requests package though, not curl, so not sure how to pass that in there.

Thanks!


author: KOSHTI NIKHILESH
body: with the minorEdit =True option like below:-  
"version": {  
"number":41,  
"minorEdit" : "true",  
},

Watchers are still getting email about content changes. THough emails were sent after some delay :). It would be helpful if someone guide in this issue.


author: Robert Gottesman
body: This strange, on updates in Cloud, I seemed to have turned off notifications with "minorEdit" set to False.


author: Chris P.
body: (*Also posted on:*

*<https://community.atlassian.com/t5/Confluence-questions/Rest-API-how-to-disable-page-creation-update-notifications/qaq-p/1316180>*

)

Thanks guys \> did the same thing (remove watchers).

This was an issue for us when we were only updating attachments via API (vs content with a body).

Tried with both:

```
"minorEdit" : True
```

and

```
"minorEdit" : False?
```

included in API call data field, and it would still notify watchers via email.

Solution was to remove all watchers, update attachments, and the re-add the watchers back to affected pages.

Resources:

[Get watches for page](https://developer.atlassian.com/cloud/confluence/rest/api-group-content-watches/#api-api-content-id-notification-child-created-get)

[Remove watches for page](https://developer.atlassian.com/cloud/confluence/rest/api-group-content-watches/#api-api-user-watch-content-contentid-delete)

[Add content watcher](https://developer.atlassian.com/cloud/confluence/rest/api-group-content-watches/#api-api-user-watch-content-contentid-post)


author: KOSHTI NIKHILESH
body: With the minorEdit =True option like below:-  
"version": {  
"number":41,  
"minorEdit" : "true",  
},

Watchers are still getting email about content changes. THough emails were sent after some delay :). It would be helpful if someone guide in this issue.


author: Jake Stone
body: How do we prevent notifications when *creating* a new page?


Tags: atl-adm

confluence-server

rest-api

server