> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://en.megaport.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://en.megaport.ferndocs.com/_mcp/server.

# Change Notification Settings

PUT https://api.megaport.com/v3/notificationPreferences
Content-Type: application/json

Updates the current email notification settings for the logged-in user.

The changes are defined in the Body of the request. The request format is the same as the response received when listing the notifications using the **List Notification Settings** endpoint.

These parameters are required to update email notification subscription settings:

- `subscriptionKey` - (String) The key value of the email event. Run the **List Notification Settings** endpoint to get the full list available for the user. For example, BILLING_START_ADMIN.
    
- `subscribed` - (Boolean) Set the `subscribed` value to either `true` or `false`, depending on whether you want to subscribe to the email notification group. This will default to `false` if the subscribed value is not supplied.
    

**Note**: The 200 OK response always returns all notifications for the user even if you only send one update.

Reference: https://en.megaport.ferndocs.com/api-reference/email-notifications/change-notification-settings

## Servers

- `https://api.megaport.com` (Production environment, default)
- `https://api-staging.megaport.com` (Staging environment (test only, reset every 24 hours))

## Request

### Body (application/json)

This endpoint expects an object.

- `emails` (list of V3NotificationPreferencesPutRequestBodyContentApplicationJsonSchemaEmailsItems, optional)

## Response

### 200

Change Notification Settings - Subscribe to Two Notifications / Change Notification Settings - Subscribe to All Notifications to all / Change Notification Settings - Subscribe to All Notifications to all / Change Notification Settings - Subscribe to Two Notifications

- `data` (V3NotificationPreferencesPutResponsesContentApplicationJsonSchemaData, optional)
- `message` (string, optional)
- `terms` (string, optional)

## Errors

### 400 Bad Request Error

Change Notification Settings - Incorrect Subscription Key / Change Notification Settings - Incorrect Subscription Key

- `message` (string, optional)
- `terms` (string, optional)

## Types

### V3NotificationPreferencesPutRequestBodyContentApplicationJsonSchemaEmailsItems

- `subscribed` (boolean, optional)
- `subscriptionKey` (string, optional)

### V3NotificationPreferencesPutResponsesContentApplicationJsonSchemaData

- `emails` (list of V3NotificationPreferencesPutResponsesContentApplicationJsonSchemaDataEmailsItems, optional)
- `receivesChildNotifications` (boolean, optional)

### V3NotificationPreferencesPutResponsesContentApplicationJsonSchemaDataEmailsItems

- `description` (string, optional)
- `messageGroupName` (string, optional)
- `subscribed` (boolean, optional)
- `subscriptionKey` (string, optional)

## Examples

### Change Notification Settings - Subscribe to All Notifications to all

**Response**

```json
{
  "data": {
    "emails": [
      {
        "description": "When the administrator starts billing a service",
        "messageGroupName": "Financial",
        "subscribed": true,
        "subscriptionKey": "BILLING_START_ADMIN"
      },
      {
        "description": "When a service goes live and we start billing on it",
        "messageGroupName": "Financial",
        "subscribed": true,
        "subscriptionKey": "BILLING_START_LIVE"
      },
      {
        "description": "When a user successfully modifies the term of a service",
        "messageGroupName": "Financial",
        "subscribed": false,
        "subscriptionKey": "BILLING_SERVICE_RETERMED"
      },
      {
        "description": "When a credit card is used to pay and it is successful",
        "messageGroupName": "Financial",
        "subscribed": true,
        "subscriptionKey": "CARD_GOOD_PAYMENT"
      },
      {
        "description": "When a credit card is used to pay and it fails for temporal issues",
        "messageGroupName": "Financial",
        "subscribed": true,
        "subscriptionKey": "CARD_TEMP_BAD_PAYMENT"
      },
      {
        "description": "When a credit card is used to pay and it fails for permanent issues",
        "messageGroupName": "Financial",
        "subscribed": true,
        "subscriptionKey": "CARD_PERM_BAD_PAYMENT"
      },
      {
        "description": "When a credit card has been successfully registered",
        "messageGroupName": "Financial",
        "subscribed": true,
        "subscriptionKey": "CARD_REGISTER"
      },
      {
        "description": "When a credit card registration attempt has failed",
        "messageGroupName": "Financial",
        "subscribed": true,
        "subscriptionKey": "CARD_REGISTER_FAILED"
      },
      {
        "description": "When a company gets activated",
        "messageGroupName": "Company",
        "subscribed": true,
        "subscriptionKey": "COMPANY_ACTIVATED"
      },
      {
        "description": "When a company market is created",
        "messageGroupName": "Company",
        "subscribed": true,
        "subscriptionKey": "COMPANY_SUPPLY_NEW"
      },
      {
        "description": "When the billing email account is edited in a market",
        "messageGroupName": "Company",
        "subscribed": true,
        "subscriptionKey": "COMPANY_SUPPLY_EMAIL_CHANGED"
      },
      {
        "description": "When the customer rejects the new email account as billing contact email",
        "messageGroupName": "Company",
        "subscribed": true,
        "subscriptionKey": "COMPANY_SUPPLY_EMAIL_REJECTED"
      },
      {
        "description": "When a new invoice is prepared for the billing market/customer",
        "messageGroupName": "Financial",
        "subscribed": true,
        "subscriptionKey": "INVOICE_NOTIFY_CMD"
      },
      {
        "description": "When an IX service contained in an order is processed",
        "messageGroupName": "Ordering",
        "subscribed": true,
        "subscriptionKey": "ORDER_IX"
      },
      {
        "description": "When a port contained in an order is processed",
        "messageGroupName": "Ordering",
        "subscribed": true,
        "subscriptionKey": "ORDER_MEGAPORT"
      },
      {
        "description": "When a VXC service contained in an order is approved",
        "messageGroupName": "Ordering",
        "subscribed": true,
        "subscriptionKey": "ORDER_VXC_APPROVED"
      },
      {
        "description": "When a VXC order needs approval from one end",
        "messageGroupName": "Ordering",
        "subscribed": true,
        "subscriptionKey": "ORDER_VXC_PENDING"
      },
      {
        "description": "When a VXC order needs approval from one end and it's been waiting for more than 1 week",
        "messageGroupName": "Ordering",
        "subscribed": true,
        "subscriptionKey": "ORDER_VXC_PENDING_PLUS_7"
      },
      {
        "description": "When a VXC order waiting for approval is rejected",
        "messageGroupName": "Ordering",
        "subscribed": true,
        "subscriptionKey": "ORDER_VXC_REJECTED"
      },
      {
        "description": "When a first order created to a company and market supplier",
        "messageGroupName": "Financial",
        "subscribed": true,
        "subscriptionKey": "COMPANY_SUPPLY_FIRST_ORDER"
      },
      {
        "description": "Reminder sent of any/all due/outstanding invoices",
        "messageGroupName": "Financial",
        "subscribed": true,
        "subscriptionKey": "PAYMENT_REMIND_CMD"
      },
      {
        "description": "When a service is configured",
        "messageGroupName": "Services",
        "subscribed": true,
        "subscriptionKey": "SERVICE_LIFECYCLE_CONFIGURED"
      },
      {
        "description": "When a service has been decommissioned",
        "messageGroupName": "Services",
        "subscribed": true,
        "subscriptionKey": "SERVICE_LIFECYCLE_DECOMMISSIONED"
      },
      {
        "description": "Service follow up email + 1 week",
        "messageGroupName": "Services",
        "subscribed": true,
        "subscriptionKey": "SERVICE_LIFECYCLE_LIVE_PLUS_7_DAYS"
      },
      {
        "description": "When a service goes down (1 mail per hour if service is flapping)",
        "messageGroupName": "Service Status",
        "subscribed": true,
        "subscriptionKey": "SERVICE_STATUS_DOWN"
      },
      {
        "description": "When a service goes up (1 mail per hour if service is flapping)",
        "messageGroupName": "Service Status",
        "subscribed": true,
        "subscriptionKey": "SERVICE_STATUS_UP"
      },
      {
        "description": "When a speed change is made that requires approval",
        "messageGroupName": "Services",
        "subscribed": true,
        "subscriptionKey": "SERVICE_SPEED"
      },
      {
        "description": "When planned works are scheduled",
        "messageGroupName": "Services",
        "subscribed": true,
        "subscriptionKey": "SERVICE_MAINTENANCE"
      },
      {
        "description": "Service Outage Notification",
        "messageGroupName": "Services",
        "subscribed": true,
        "subscriptionKey": "SERVICE_OUTAGE"
      },
      {
        "description": "When an order request is pending approval",
        "messageGroupName": "Ordering",
        "subscribed": true,
        "subscriptionKey": "ORDER_REQUEST_PENDING"
      },
      {
        "description": "When an order request is approved",
        "messageGroupName": "Ordering",
        "subscribed": true,
        "subscriptionKey": "ORDER_REQUEST_APPROVED"
      },
      {
        "description": "When an order request is rejected",
        "messageGroupName": "Ordering",
        "subscribed": true,
        "subscriptionKey": "ORDER_REQUEST_REJECTED"
      },
      {
        "description": "When an order request fails to process",
        "messageGroupName": "Ordering",
        "subscribed": true,
        "subscriptionKey": "ORDER_REQUEST_FAILED"
      },
      {
        "description": "When a BGP session goes down in a service (1 mail per hour if the service is flapping)",
        "messageGroupName": "Service Status",
        "subscribed": true,
        "subscriptionKey": "SERVICE_EVENT_BGP_DOWN"
      },
      {
        "description": "When a BGP session goes up in a service (1 mail per hour if the service is flapping)",
        "messageGroupName": "Service Status",
        "subscribed": true,
        "subscriptionKey": "SERVICE_EVENT_BGP_UP"
      }
    ],
    "receivesChildNotifications": false
  },
  "message": "Your messaging destination has been saved",
  "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy"
}
```

**SDK Code**

```python Change Notification Settings - Subscribe to All Notifications to all
import requests

url = "https://api.megaport.com/v3/notificationPreferences"

response = requests.put(url)

print(response.json())
```

```javascript Change Notification Settings - Subscribe to All Notifications to all
const url = 'https://api.megaport.com/v3/notificationPreferences';
const options = {method: 'PUT'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Change Notification Settings - Subscribe to All Notifications to all
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.megaport.com/v3/notificationPreferences"

	req, _ := http.NewRequest("PUT", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Change Notification Settings - Subscribe to All Notifications to all
require 'uri'
require 'net/http'

url = URI("https://api.megaport.com/v3/notificationPreferences")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)

response = http.request(request)
puts response.read_body
```

```java Change Notification Settings - Subscribe to All Notifications to all
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.megaport.com/v3/notificationPreferences")
  .asString();
```

```php Change Notification Settings - Subscribe to All Notifications to all
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.megaport.com/v3/notificationPreferences');

echo $response->getBody();
```

```csharp Change Notification Settings - Subscribe to All Notifications to all
using RestSharp;

var client = new RestClient("https://api.megaport.com/v3/notificationPreferences");
var request = new RestRequest(Method.PUT);
IRestResponse response = client.Execute(request);
```

```swift Change Notification Settings - Subscribe to All Notifications to all
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.megaport.com/v3/notificationPreferences")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Change Notification Settings - Subscribe to Two Notifications

**Response**

```json
{
  "data": {
    "emails": [
      {
        "description": "When the administrator starts billing a service",
        "messageGroupName": "Financial",
        "subscribed": true,
        "subscriptionKey": "BILLING_START_ADMIN"
      },
      {
        "description": "When a service goes live and we start billing on it",
        "messageGroupName": "Financial",
        "subscribed": true,
        "subscriptionKey": "BILLING_START_LIVE"
      },
      {
        "description": "When a user successfully modifies the term of a service",
        "messageGroupName": "Financial",
        "subscribed": false,
        "subscriptionKey": "BILLING_SERVICE_RETERMED"
      },
      {
        "description": "When a credit card is used to pay and it is successful",
        "messageGroupName": "Financial",
        "subscribed": true,
        "subscriptionKey": "CARD_GOOD_PAYMENT"
      },
      {
        "description": "When a credit card is used to pay and it fails for temporal issues",
        "messageGroupName": "Financial",
        "subscribed": true,
        "subscriptionKey": "CARD_TEMP_BAD_PAYMENT"
      },
      {
        "description": "When a credit card is used to pay and it fails for permanent issues",
        "messageGroupName": "Financial",
        "subscribed": true,
        "subscriptionKey": "CARD_PERM_BAD_PAYMENT"
      },
      {
        "description": "When a credit card has been successfully registered",
        "messageGroupName": "Financial",
        "subscribed": true,
        "subscriptionKey": "CARD_REGISTER"
      },
      {
        "description": "When a credit card registration attempt has failed",
        "messageGroupName": "Financial",
        "subscribed": true,
        "subscriptionKey": "CARD_REGISTER_FAILED"
      },
      {
        "description": "When a company gets activated",
        "messageGroupName": "Company",
        "subscribed": true,
        "subscriptionKey": "COMPANY_ACTIVATED"
      },
      {
        "description": "When a company market is created",
        "messageGroupName": "Company",
        "subscribed": false,
        "subscriptionKey": "COMPANY_SUPPLY_NEW"
      },
      {
        "description": "When the billing email account is edited in a market",
        "messageGroupName": "Company",
        "subscribed": false,
        "subscriptionKey": "COMPANY_SUPPLY_EMAIL_CHANGED"
      },
      {
        "description": "When the customer rejects the new email account as billing contact email",
        "messageGroupName": "Company",
        "subscribed": false,
        "subscriptionKey": "COMPANY_SUPPLY_EMAIL_REJECTED"
      },
      {
        "description": "When a new invoice is prepared for the billing market/customer",
        "messageGroupName": "Financial",
        "subscribed": true,
        "subscriptionKey": "INVOICE_NOTIFY_CMD"
      },
      {
        "description": "When an IX service contained in an order is processed",
        "messageGroupName": "Ordering",
        "subscribed": true,
        "subscriptionKey": "ORDER_IX"
      },
      {
        "description": "When a port contained in an order is processed",
        "messageGroupName": "Ordering",
        "subscribed": true,
        "subscriptionKey": "ORDER_MEGAPORT"
      },
      {
        "description": "When a VXC service contained in an order is approved",
        "messageGroupName": "Ordering",
        "subscribed": true,
        "subscriptionKey": "ORDER_VXC_APPROVED"
      },
      {
        "description": "When a VXC order needs approval from one end",
        "messageGroupName": "Ordering",
        "subscribed": true,
        "subscriptionKey": "ORDER_VXC_PENDING"
      },
      {
        "description": "When a VXC order needs approval from one end and it's been waiting for more than 1 week",
        "messageGroupName": "Ordering",
        "subscribed": true,
        "subscriptionKey": "ORDER_VXC_PENDING_PLUS_7"
      },
      {
        "description": "When a VXC order waiting for approval is rejected",
        "messageGroupName": "Ordering",
        "subscribed": true,
        "subscriptionKey": "ORDER_VXC_REJECTED"
      },
      {
        "description": "When a first order created to a company and market supplier",
        "messageGroupName": "Financial",
        "subscribed": true,
        "subscriptionKey": "COMPANY_SUPPLY_FIRST_ORDER"
      },
      {
        "description": "Reminder sent of any/all due/outstanding invoices",
        "messageGroupName": "Financial",
        "subscribed": true,
        "subscriptionKey": "PAYMENT_REMIND_CMD"
      },
      {
        "description": "When a service is configured",
        "messageGroupName": "Services",
        "subscribed": false,
        "subscriptionKey": "SERVICE_LIFECYCLE_CONFIGURED"
      },
      {
        "description": "When a service has been decommissioned",
        "messageGroupName": "Services",
        "subscribed": false,
        "subscriptionKey": "SERVICE_LIFECYCLE_DECOMMISSIONED"
      },
      {
        "description": "Service follow up email + 1 week",
        "messageGroupName": "Services",
        "subscribed": true,
        "subscriptionKey": "SERVICE_LIFECYCLE_LIVE_PLUS_7_DAYS"
      },
      {
        "description": "When a service goes down (1 mail per hour if service is flapping)",
        "messageGroupName": "Service Status",
        "subscribed": false,
        "subscriptionKey": "SERVICE_STATUS_DOWN"
      },
      {
        "description": "When a service goes up (1 mail per hour if service is flapping)",
        "messageGroupName": "Service Status",
        "subscribed": false,
        "subscriptionKey": "SERVICE_STATUS_UP"
      },
      {
        "description": "When a speed change is made that requires approval",
        "messageGroupName": "Services",
        "subscribed": false,
        "subscriptionKey": "SERVICE_SPEED"
      },
      {
        "description": "When planned works are scheduled",
        "messageGroupName": "Services",
        "subscribed": false,
        "subscriptionKey": "SERVICE_MAINTENANCE"
      },
      {
        "description": "Service Outage Notification",
        "messageGroupName": "Services",
        "subscribed": false,
        "subscriptionKey": "SERVICE_OUTAGE"
      },
      {
        "description": "When an order request is pending approval",
        "messageGroupName": "Ordering",
        "subscribed": true,
        "subscriptionKey": "ORDER_REQUEST_PENDING"
      },
      {
        "description": "When an order request is approved",
        "messageGroupName": "Ordering",
        "subscribed": true,
        "subscriptionKey": "ORDER_REQUEST_APPROVED"
      },
      {
        "description": "When an order request is rejected",
        "messageGroupName": "Ordering",
        "subscribed": true,
        "subscriptionKey": "ORDER_REQUEST_REJECTED"
      },
      {
        "description": "When an order request fails to process",
        "messageGroupName": "Ordering",
        "subscribed": true,
        "subscriptionKey": "ORDER_REQUEST_FAILED"
      },
      {
        "description": "When a BGP session goes down in a service (1 mail per hour if the service is flapping)",
        "messageGroupName": "Service Status",
        "subscribed": false,
        "subscriptionKey": "SERVICE_EVENT_BGP_DOWN"
      },
      {
        "description": "When a BGP session goes up in a service (1 mail per hour if the service is flapping)",
        "messageGroupName": "Service Status",
        "subscribed": false,
        "subscriptionKey": "SERVICE_EVENT_BGP_UP"
      }
    ],
    "receivesChildNotifications": false
  },
  "message": "Your messaging destination has been saved",
  "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy"
}
```

**SDK Code**

```python Change Notification Settings - Subscribe to Two Notifications
import requests

url = "https://api.megaport.com/v3/notificationPreferences"

response = requests.put(url)

print(response.json())
```

```javascript Change Notification Settings - Subscribe to Two Notifications
const url = 'https://api.megaport.com/v3/notificationPreferences';
const options = {method: 'PUT'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Change Notification Settings - Subscribe to Two Notifications
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.megaport.com/v3/notificationPreferences"

	req, _ := http.NewRequest("PUT", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Change Notification Settings - Subscribe to Two Notifications
require 'uri'
require 'net/http'

url = URI("https://api.megaport.com/v3/notificationPreferences")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)

response = http.request(request)
puts response.read_body
```

```java Change Notification Settings - Subscribe to Two Notifications
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.megaport.com/v3/notificationPreferences")
  .asString();
```

```php Change Notification Settings - Subscribe to Two Notifications
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.megaport.com/v3/notificationPreferences');

echo $response->getBody();
```

```csharp Change Notification Settings - Subscribe to Two Notifications
using RestSharp;

var client = new RestClient("https://api.megaport.com/v3/notificationPreferences");
var request = new RestRequest(Method.PUT);
IRestResponse response = client.Execute(request);
```

```swift Change Notification Settings - Subscribe to Two Notifications
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.megaport.com/v3/notificationPreferences")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Change Notification Settings

**Request**

```json
{
  "emails": [
    {
      "subscribed": true,
      "subscriptionKey": "COMPANY_ACTIVATED"
    },
    {
      "subscribed": false,
      "subscriptionKey": "COMPANY_SUPPLY_NEW"
    },
    {
      "subscribed": false,
      "subscriptionKey": "COMPANY_SUPPLY_EMAIL_CHANGED"
    },
    {
      "subscribed": false,
      "subscriptionKey": "COMPANY_SUPPLY_EMAIL_REJECTED"
    },
    {
      "subscribed": false,
      "subscriptionKey": "SERVICE_SPEED"
    },
    {
      "subscribed": false,
      "subscriptionKey": "SERVICE_MAINTENANCE"
    },
    {
      "subscribed": false,
      "subscriptionKey": "SERVICE_OUTAGE"
    },
    {
      "subscribed": false,
      "subscriptionKey": "SERVICE_LIFECYCLE_CONFIGURED"
    },
    {
      "subscribed": false,
      "subscriptionKey": "SERVICE_LIFECYCLE_DECOMMISSIONED"
    },
    {
      "subscribed": true,
      "subscriptionKey": "SERVICE_LIFECYCLE_LIVE_PLUS_7_DAYS"
    }
  ]
}
```

**Response**

```json
{
  "data": {
    "emails": [
      {
        "description": "When the administrator starts billing a service",
        "messageGroupName": "Financial",
        "subscribed": true,
        "subscriptionKey": "BILLING_START_ADMIN"
      },
      {
        "description": "When a service goes live and we start billing on it",
        "messageGroupName": "Financial",
        "subscribed": true,
        "subscriptionKey": "BILLING_START_LIVE"
      },
      {
        "description": "When a user successfully modifies the term of a service",
        "messageGroupName": "Financial",
        "subscribed": false,
        "subscriptionKey": "BILLING_SERVICE_RETERMED"
      },
      {
        "description": "When a credit card is used to pay and it is successful",
        "messageGroupName": "Financial",
        "subscribed": true,
        "subscriptionKey": "CARD_GOOD_PAYMENT"
      },
      {
        "description": "When a credit card is used to pay and it fails for temporal issues",
        "messageGroupName": "Financial",
        "subscribed": true,
        "subscriptionKey": "CARD_TEMP_BAD_PAYMENT"
      },
      {
        "description": "When a credit card is used to pay and it fails for permanent issues",
        "messageGroupName": "Financial",
        "subscribed": true,
        "subscriptionKey": "CARD_PERM_BAD_PAYMENT"
      },
      {
        "description": "When a credit card has been successfully registered",
        "messageGroupName": "Financial",
        "subscribed": true,
        "subscriptionKey": "CARD_REGISTER"
      },
      {
        "description": "When a credit card registration attempt has failed",
        "messageGroupName": "Financial",
        "subscribed": true,
        "subscriptionKey": "CARD_REGISTER_FAILED"
      },
      {
        "description": "When a company gets activated",
        "messageGroupName": "Company",
        "subscribed": true,
        "subscriptionKey": "COMPANY_ACTIVATED"
      },
      {
        "description": "When a company market is created",
        "messageGroupName": "Company",
        "subscribed": true,
        "subscriptionKey": "COMPANY_SUPPLY_NEW"
      },
      {
        "description": "When the billing email account is edited in a market",
        "messageGroupName": "Company",
        "subscribed": true,
        "subscriptionKey": "COMPANY_SUPPLY_EMAIL_CHANGED"
      },
      {
        "description": "When the customer rejects the new email account as billing contact email",
        "messageGroupName": "Company",
        "subscribed": true,
        "subscriptionKey": "COMPANY_SUPPLY_EMAIL_REJECTED"
      },
      {
        "description": "When a new invoice is prepared for the billing market/customer",
        "messageGroupName": "Financial",
        "subscribed": true,
        "subscriptionKey": "INVOICE_NOTIFY_CMD"
      },
      {
        "description": "When an IX service contained in an order is processed",
        "messageGroupName": "Ordering",
        "subscribed": true,
        "subscriptionKey": "ORDER_IX"
      },
      {
        "description": "When a port contained in an order is processed",
        "messageGroupName": "Ordering",
        "subscribed": true,
        "subscriptionKey": "ORDER_MEGAPORT"
      },
      {
        "description": "When a VXC service contained in an order is approved",
        "messageGroupName": "Ordering",
        "subscribed": true,
        "subscriptionKey": "ORDER_VXC_APPROVED"
      },
      {
        "description": "When a VXC order needs approval from one end",
        "messageGroupName": "Ordering",
        "subscribed": true,
        "subscriptionKey": "ORDER_VXC_PENDING"
      },
      {
        "description": "When a VXC order needs approval from one end and it's been waiting for more than 1 week",
        "messageGroupName": "Ordering",
        "subscribed": true,
        "subscriptionKey": "ORDER_VXC_PENDING_PLUS_7"
      },
      {
        "description": "When a VXC order waiting for approval is rejected",
        "messageGroupName": "Ordering",
        "subscribed": true,
        "subscriptionKey": "ORDER_VXC_REJECTED"
      },
      {
        "description": "When a first order created to a company and market supplier",
        "messageGroupName": "Financial",
        "subscribed": true,
        "subscriptionKey": "COMPANY_SUPPLY_FIRST_ORDER"
      },
      {
        "description": "Reminder sent of any/all due/outstanding invoices",
        "messageGroupName": "Financial",
        "subscribed": true,
        "subscriptionKey": "PAYMENT_REMIND_CMD"
      },
      {
        "description": "When a service is configured",
        "messageGroupName": "Services",
        "subscribed": true,
        "subscriptionKey": "SERVICE_LIFECYCLE_CONFIGURED"
      },
      {
        "description": "When a service has been decommissioned",
        "messageGroupName": "Services",
        "subscribed": true,
        "subscriptionKey": "SERVICE_LIFECYCLE_DECOMMISSIONED"
      },
      {
        "description": "Service follow up email + 1 week",
        "messageGroupName": "Services",
        "subscribed": true,
        "subscriptionKey": "SERVICE_LIFECYCLE_LIVE_PLUS_7_DAYS"
      },
      {
        "description": "When a service goes down (1 mail per hour if service is flapping)",
        "messageGroupName": "Service Status",
        "subscribed": true,
        "subscriptionKey": "SERVICE_STATUS_DOWN"
      },
      {
        "description": "When a service goes up (1 mail per hour if service is flapping)",
        "messageGroupName": "Service Status",
        "subscribed": true,
        "subscriptionKey": "SERVICE_STATUS_UP"
      },
      {
        "description": "When a speed change is made that requires approval",
        "messageGroupName": "Services",
        "subscribed": true,
        "subscriptionKey": "SERVICE_SPEED"
      },
      {
        "description": "When planned works are scheduled",
        "messageGroupName": "Services",
        "subscribed": true,
        "subscriptionKey": "SERVICE_MAINTENANCE"
      },
      {
        "description": "Service Outage Notification",
        "messageGroupName": "Services",
        "subscribed": true,
        "subscriptionKey": "SERVICE_OUTAGE"
      },
      {
        "description": "When an order request is pending approval",
        "messageGroupName": "Ordering",
        "subscribed": true,
        "subscriptionKey": "ORDER_REQUEST_PENDING"
      },
      {
        "description": "When an order request is approved",
        "messageGroupName": "Ordering",
        "subscribed": true,
        "subscriptionKey": "ORDER_REQUEST_APPROVED"
      },
      {
        "description": "When an order request is rejected",
        "messageGroupName": "Ordering",
        "subscribed": true,
        "subscriptionKey": "ORDER_REQUEST_REJECTED"
      },
      {
        "description": "When an order request fails to process",
        "messageGroupName": "Ordering",
        "subscribed": true,
        "subscriptionKey": "ORDER_REQUEST_FAILED"
      },
      {
        "description": "When a BGP session goes down in a service (1 mail per hour if the service is flapping)",
        "messageGroupName": "Service Status",
        "subscribed": true,
        "subscriptionKey": "SERVICE_EVENT_BGP_DOWN"
      },
      {
        "description": "When a BGP session goes up in a service (1 mail per hour if the service is flapping)",
        "messageGroupName": "Service Status",
        "subscribed": true,
        "subscriptionKey": "SERVICE_EVENT_BGP_UP"
      }
    ],
    "receivesChildNotifications": false
  },
  "message": "Your messaging destination has been saved",
  "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy"
}
```

**SDK Code**

```python Change Notification Settings
import requests

url = "https://api.megaport.com/v3/notificationPreferences"

payload = { "emails": [
        {
            "subscribed": True,
            "subscriptionKey": "COMPANY_ACTIVATED"
        },
        {
            "subscribed": False,
            "subscriptionKey": "COMPANY_SUPPLY_NEW"
        },
        {
            "subscribed": False,
            "subscriptionKey": "COMPANY_SUPPLY_EMAIL_CHANGED"
        },
        {
            "subscribed": False,
            "subscriptionKey": "COMPANY_SUPPLY_EMAIL_REJECTED"
        },
        {
            "subscribed": False,
            "subscriptionKey": "SERVICE_SPEED"
        },
        {
            "subscribed": False,
            "subscriptionKey": "SERVICE_MAINTENANCE"
        },
        {
            "subscribed": False,
            "subscriptionKey": "SERVICE_OUTAGE"
        },
        {
            "subscribed": False,
            "subscriptionKey": "SERVICE_LIFECYCLE_CONFIGURED"
        },
        {
            "subscribed": False,
            "subscriptionKey": "SERVICE_LIFECYCLE_DECOMMISSIONED"
        },
        {
            "subscribed": True,
            "subscriptionKey": "SERVICE_LIFECYCLE_LIVE_PLUS_7_DAYS"
        }
    ] }
headers = {"Content-Type": "application/json"}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript Change Notification Settings
const url = 'https://api.megaport.com/v3/notificationPreferences';
const options = {
  method: 'PUT',
  headers: {'Content-Type': 'application/json'},
  body: '{"emails":[{"subscribed":true,"subscriptionKey":"COMPANY_ACTIVATED"},{"subscribed":false,"subscriptionKey":"COMPANY_SUPPLY_NEW"},{"subscribed":false,"subscriptionKey":"COMPANY_SUPPLY_EMAIL_CHANGED"},{"subscribed":false,"subscriptionKey":"COMPANY_SUPPLY_EMAIL_REJECTED"},{"subscribed":false,"subscriptionKey":"SERVICE_SPEED"},{"subscribed":false,"subscriptionKey":"SERVICE_MAINTENANCE"},{"subscribed":false,"subscriptionKey":"SERVICE_OUTAGE"},{"subscribed":false,"subscriptionKey":"SERVICE_LIFECYCLE_CONFIGURED"},{"subscribed":false,"subscriptionKey":"SERVICE_LIFECYCLE_DECOMMISSIONED"},{"subscribed":true,"subscriptionKey":"SERVICE_LIFECYCLE_LIVE_PLUS_7_DAYS"}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Change Notification Settings
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.megaport.com/v3/notificationPreferences"

	payload := strings.NewReader("{\n  \"emails\": [\n    {\n      \"subscribed\": true,\n      \"subscriptionKey\": \"COMPANY_ACTIVATED\"\n    },\n    {\n      \"subscribed\": false,\n      \"subscriptionKey\": \"COMPANY_SUPPLY_NEW\"\n    },\n    {\n      \"subscribed\": false,\n      \"subscriptionKey\": \"COMPANY_SUPPLY_EMAIL_CHANGED\"\n    },\n    {\n      \"subscribed\": false,\n      \"subscriptionKey\": \"COMPANY_SUPPLY_EMAIL_REJECTED\"\n    },\n    {\n      \"subscribed\": false,\n      \"subscriptionKey\": \"SERVICE_SPEED\"\n    },\n    {\n      \"subscribed\": false,\n      \"subscriptionKey\": \"SERVICE_MAINTENANCE\"\n    },\n    {\n      \"subscribed\": false,\n      \"subscriptionKey\": \"SERVICE_OUTAGE\"\n    },\n    {\n      \"subscribed\": false,\n      \"subscriptionKey\": \"SERVICE_LIFECYCLE_CONFIGURED\"\n    },\n    {\n      \"subscribed\": false,\n      \"subscriptionKey\": \"SERVICE_LIFECYCLE_DECOMMISSIONED\"\n    },\n    {\n      \"subscribed\": true,\n      \"subscriptionKey\": \"SERVICE_LIFECYCLE_LIVE_PLUS_7_DAYS\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Change Notification Settings
require 'uri'
require 'net/http'

url = URI("https://api.megaport.com/v3/notificationPreferences")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"emails\": [\n    {\n      \"subscribed\": true,\n      \"subscriptionKey\": \"COMPANY_ACTIVATED\"\n    },\n    {\n      \"subscribed\": false,\n      \"subscriptionKey\": \"COMPANY_SUPPLY_NEW\"\n    },\n    {\n      \"subscribed\": false,\n      \"subscriptionKey\": \"COMPANY_SUPPLY_EMAIL_CHANGED\"\n    },\n    {\n      \"subscribed\": false,\n      \"subscriptionKey\": \"COMPANY_SUPPLY_EMAIL_REJECTED\"\n    },\n    {\n      \"subscribed\": false,\n      \"subscriptionKey\": \"SERVICE_SPEED\"\n    },\n    {\n      \"subscribed\": false,\n      \"subscriptionKey\": \"SERVICE_MAINTENANCE\"\n    },\n    {\n      \"subscribed\": false,\n      \"subscriptionKey\": \"SERVICE_OUTAGE\"\n    },\n    {\n      \"subscribed\": false,\n      \"subscriptionKey\": \"SERVICE_LIFECYCLE_CONFIGURED\"\n    },\n    {\n      \"subscribed\": false,\n      \"subscriptionKey\": \"SERVICE_LIFECYCLE_DECOMMISSIONED\"\n    },\n    {\n      \"subscribed\": true,\n      \"subscriptionKey\": \"SERVICE_LIFECYCLE_LIVE_PLUS_7_DAYS\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Change Notification Settings
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.megaport.com/v3/notificationPreferences")
  .header("Content-Type", "application/json")
  .body("{\n  \"emails\": [\n    {\n      \"subscribed\": true,\n      \"subscriptionKey\": \"COMPANY_ACTIVATED\"\n    },\n    {\n      \"subscribed\": false,\n      \"subscriptionKey\": \"COMPANY_SUPPLY_NEW\"\n    },\n    {\n      \"subscribed\": false,\n      \"subscriptionKey\": \"COMPANY_SUPPLY_EMAIL_CHANGED\"\n    },\n    {\n      \"subscribed\": false,\n      \"subscriptionKey\": \"COMPANY_SUPPLY_EMAIL_REJECTED\"\n    },\n    {\n      \"subscribed\": false,\n      \"subscriptionKey\": \"SERVICE_SPEED\"\n    },\n    {\n      \"subscribed\": false,\n      \"subscriptionKey\": \"SERVICE_MAINTENANCE\"\n    },\n    {\n      \"subscribed\": false,\n      \"subscriptionKey\": \"SERVICE_OUTAGE\"\n    },\n    {\n      \"subscribed\": false,\n      \"subscriptionKey\": \"SERVICE_LIFECYCLE_CONFIGURED\"\n    },\n    {\n      \"subscribed\": false,\n      \"subscriptionKey\": \"SERVICE_LIFECYCLE_DECOMMISSIONED\"\n    },\n    {\n      \"subscribed\": true,\n      \"subscriptionKey\": \"SERVICE_LIFECYCLE_LIVE_PLUS_7_DAYS\"\n    }\n  ]\n}")
  .asString();
```

```php Change Notification Settings
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.megaport.com/v3/notificationPreferences', [
  'body' => '{
  "emails": [
    {
      "subscribed": true,
      "subscriptionKey": "COMPANY_ACTIVATED"
    },
    {
      "subscribed": false,
      "subscriptionKey": "COMPANY_SUPPLY_NEW"
    },
    {
      "subscribed": false,
      "subscriptionKey": "COMPANY_SUPPLY_EMAIL_CHANGED"
    },
    {
      "subscribed": false,
      "subscriptionKey": "COMPANY_SUPPLY_EMAIL_REJECTED"
    },
    {
      "subscribed": false,
      "subscriptionKey": "SERVICE_SPEED"
    },
    {
      "subscribed": false,
      "subscriptionKey": "SERVICE_MAINTENANCE"
    },
    {
      "subscribed": false,
      "subscriptionKey": "SERVICE_OUTAGE"
    },
    {
      "subscribed": false,
      "subscriptionKey": "SERVICE_LIFECYCLE_CONFIGURED"
    },
    {
      "subscribed": false,
      "subscriptionKey": "SERVICE_LIFECYCLE_DECOMMISSIONED"
    },
    {
      "subscribed": true,
      "subscriptionKey": "SERVICE_LIFECYCLE_LIVE_PLUS_7_DAYS"
    }
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Change Notification Settings
using RestSharp;

var client = new RestClient("https://api.megaport.com/v3/notificationPreferences");
var request = new RestRequest(Method.PUT);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"emails\": [\n    {\n      \"subscribed\": true,\n      \"subscriptionKey\": \"COMPANY_ACTIVATED\"\n    },\n    {\n      \"subscribed\": false,\n      \"subscriptionKey\": \"COMPANY_SUPPLY_NEW\"\n    },\n    {\n      \"subscribed\": false,\n      \"subscriptionKey\": \"COMPANY_SUPPLY_EMAIL_CHANGED\"\n    },\n    {\n      \"subscribed\": false,\n      \"subscriptionKey\": \"COMPANY_SUPPLY_EMAIL_REJECTED\"\n    },\n    {\n      \"subscribed\": false,\n      \"subscriptionKey\": \"SERVICE_SPEED\"\n    },\n    {\n      \"subscribed\": false,\n      \"subscriptionKey\": \"SERVICE_MAINTENANCE\"\n    },\n    {\n      \"subscribed\": false,\n      \"subscriptionKey\": \"SERVICE_OUTAGE\"\n    },\n    {\n      \"subscribed\": false,\n      \"subscriptionKey\": \"SERVICE_LIFECYCLE_CONFIGURED\"\n    },\n    {\n      \"subscribed\": false,\n      \"subscriptionKey\": \"SERVICE_LIFECYCLE_DECOMMISSIONED\"\n    },\n    {\n      \"subscribed\": true,\n      \"subscriptionKey\": \"SERVICE_LIFECYCLE_LIVE_PLUS_7_DAYS\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Change Notification Settings
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = ["emails": [
    [
      "subscribed": true,
      "subscriptionKey": "COMPANY_ACTIVATED"
    ],
    [
      "subscribed": false,
      "subscriptionKey": "COMPANY_SUPPLY_NEW"
    ],
    [
      "subscribed": false,
      "subscriptionKey": "COMPANY_SUPPLY_EMAIL_CHANGED"
    ],
    [
      "subscribed": false,
      "subscriptionKey": "COMPANY_SUPPLY_EMAIL_REJECTED"
    ],
    [
      "subscribed": false,
      "subscriptionKey": "SERVICE_SPEED"
    ],
    [
      "subscribed": false,
      "subscriptionKey": "SERVICE_MAINTENANCE"
    ],
    [
      "subscribed": false,
      "subscriptionKey": "SERVICE_OUTAGE"
    ],
    [
      "subscribed": false,
      "subscriptionKey": "SERVICE_LIFECYCLE_CONFIGURED"
    ],
    [
      "subscribed": false,
      "subscriptionKey": "SERVICE_LIFECYCLE_DECOMMISSIONED"
    ],
    [
      "subscribed": true,
      "subscriptionKey": "SERVICE_LIFECYCLE_LIVE_PLUS_7_DAYS"
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.megaport.com/v3/notificationPreferences")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```