How to Disable Outgoing Emails via REST API in Jira
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
This article provides steps on how to disable outgoing email functionality for the entire Jira instance using the REST API.
Environment
Jira Data Center 8.x and later
Solution
To disable outgoing emails via REST API, follow these steps:
Use the following cURL command:
1
curl -D- -u <USERNAME>:<PASSWORD> -X PUT -H "Content-Type: application/json" --data-raw '{"enabled": "false"}' --location https://<JIRA_BASE_URL>/rest/jira-mail-plugin/1.0/outgoingMail/config
For Windows system, the below PowerShell command can be used:
1 2 3 4 5
$headers = @{ "Authorization" = "Basic " + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("USERNAME:PASSWORD")) "Content-Type" = "application/json" } Invoke-WebRequest -Uri "https://JIRA.EXAMPLE.COM/rest/jira-mail-plugin/1.0/outgoingMail/config" -Method Put -Headers $headers -Body '{"enabled": "false"}' -UseBasicParsing
Replace the following placeholders with actual values:
<USERNAME>: Username of a Jira System Administrator
<PASSWORD>: Password of a Jira System Administrator
Or use an API token for authentication which is recommended and more secure.
<JIRA_BASE_URL>: Your Jira base URL
Was this helpful?