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

# Update

POST https://api.mercoa.com/entity/{entityId}/user/{userId}/notification-policy/{notificationType}
Content-Type: application/json

Update notification policy associated with this entity user

Reference: https://docs.mercoa.com/embedded-ap-ar/api-reference/entity/user/notification-policy/update

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `entityId` (string, required) — Entity ID or Entity ForeignID
- `userId` (string, required) — User ID or User ForeignID
- `notificationType` (enum, required)
  - Allowed values: `INVOICE_APPROVAL_NEEDED`, `INVOICE_APPROVED`, `INVOICE_REJECTED`, `INVOICE_SCHEDULED`, `INVOICE_PENDING`, `INVOICE_PAID`, `INVOICE_CANCELED`, `INVOICE_CREATED`, `INVOICE_EMAILED`, `INVOICE_FAILED`, `COUNTERPARTY_ONBOARDING_COMPLETED`

### Body (application/json)

This endpoint expects an object.

- `disabled` (boolean, optional) — Set to true if the selected notification type should be disabled for this user
- `digest` (boolean, optional) — Set to true if the selected notification type should be sent as a digest. Default is false.
- `immediate` (boolean, optional) — Set to true if the selected notification type should be sent immediately. Default is true.

## Response

### 200

- `disabled` (boolean, required) — True if the selected notification type is disabled for this user
- `digest` (boolean, required) — True if the selected notification type is sent as a digest.
- `immediate` (boolean, required) — True if the selected notification type is sent immediately.
- `type` (enum, required)
  - Allowed values: `INVOICE_APPROVAL_NEEDED`, `INVOICE_APPROVED`, `INVOICE_REJECTED`, `INVOICE_SCHEDULED`, `INVOICE_PENDING`, `INVOICE_PAID`, `INVOICE_CANCELED`, `INVOICE_CREATED`, `INVOICE_EMAILED`, `INVOICE_FAILED`, `COUNTERPARTY_ONBOARDING_COMPLETED`

## Errors

### 400 Bad Request

- `errorName` ("BadRequest", required)
- `content` (string, required)

### 401 Unauthorized

- `errorName` ("Unauthorized", required)
- `content` (string, required)

### 403 Forbidden

- `errorName` ("Forbidden", required)
- `content` (string, required)

### 404 Not Found

- `errorName` ("NotFound", required)
- `content` (string, required)

### 409 Conflict

- `errorName` ("Conflict", required)
- `content` (string, required)

### 500 Internal Server Error

- `errorName` ("InternalServerError", required)
- `content` (string, required)

### 501 Unimplemented

- `errorName` ("Unimplemented", required)
- `content` (string, required)

## Examples

### DISABLED

**Request**

```json
{
  "disabled": true
}
```

**Response**

```json
{
  "disabled": true,
  "digest": false,
  "immediate": true,
  "type": "INVOICE_APPROVED"
}
```

**SDK Code**

```python DISABLED
import requests

url = "https://api.mercoa.com/entity/ent_8545a84e-a45f-41bf-bdf1-33b42a55812c/user/user_e24fc81c-c5ee-47e8-af42-4fe29d895506/notification-policy/INVOICE_APPROVED"

payload = { "disabled": True }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```typescript DISABLED
import { MercoaClient } from "@mercoa/javascript";

const client = new MercoaClient({ token: "YOUR_TOKEN" });
await client.entity.user.notificationPolicy.update("ent_8545a84e-a45f-41bf-bdf1-33b42a55812c", "user_e24fc81c-c5ee-47e8-af42-4fe29d895506", "INVOICE_APPROVED", {
    disabled: true
});

```

```go DISABLED
package main

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

func main() {

	url := "https://api.mercoa.com/entity/ent_8545a84e-a45f-41bf-bdf1-33b42a55812c/user/user_e24fc81c-c5ee-47e8-af42-4fe29d895506/notification-policy/INVOICE_APPROVED"

	payload := strings.NewReader("{\n  \"disabled\": true\n}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	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 DISABLED
require 'uri'
require 'net/http'

url = URI("https://api.mercoa.com/entity/ent_8545a84e-a45f-41bf-bdf1-33b42a55812c/user/user_e24fc81c-c5ee-47e8-af42-4fe29d895506/notification-policy/INVOICE_APPROVED")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"disabled\": true\n}"

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

```java DISABLED
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.mercoa.com/entity/ent_8545a84e-a45f-41bf-bdf1-33b42a55812c/user/user_e24fc81c-c5ee-47e8-af42-4fe29d895506/notification-policy/INVOICE_APPROVED")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"disabled\": true\n}")
  .asString();
```

```php DISABLED
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.mercoa.com/entity/ent_8545a84e-a45f-41bf-bdf1-33b42a55812c/user/user_e24fc81c-c5ee-47e8-af42-4fe29d895506/notification-policy/INVOICE_APPROVED', [
  'body' => '{
  "disabled": true
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp DISABLED
using RestSharp;

var client = new RestClient("https://api.mercoa.com/entity/ent_8545a84e-a45f-41bf-bdf1-33b42a55812c/user/user_e24fc81c-c5ee-47e8-af42-4fe29d895506/notification-policy/INVOICE_APPROVED");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"disabled\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift DISABLED
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["disabled": true] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.mercoa.com/entity/ent_8545a84e-a45f-41bf-bdf1-33b42a55812c/user/user_e24fc81c-c5ee-47e8-af42-4fe29d895506/notification-policy/INVOICE_APPROVED")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```

### DIGEST

**Request**

```json
{
  "digest": true
}
```

**Response**

```json
{
  "disabled": false,
  "digest": true,
  "immediate": false,
  "type": "INVOICE_APPROVAL_NEEDED"
}
```

**SDK Code**

```python DIGEST
import requests

url = "https://api.mercoa.com/entity/ent_8545a84e-a45f-41bf-bdf1-33b42a55812c/user/user_e24fc81c-c5ee-47e8-af42-4fe29d895506/notification-policy/INVOICE_APPROVAL_NEEDED"

payload = { "digest": True }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```typescript DIGEST
import { MercoaClient } from "@mercoa/javascript";

const client = new MercoaClient({ token: "YOUR_TOKEN" });
await client.entity.user.notificationPolicy.update("ent_8545a84e-a45f-41bf-bdf1-33b42a55812c", "user_e24fc81c-c5ee-47e8-af42-4fe29d895506", "INVOICE_APPROVAL_NEEDED", {
    digest: true
});

```

```go DIGEST
package main

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

func main() {

	url := "https://api.mercoa.com/entity/ent_8545a84e-a45f-41bf-bdf1-33b42a55812c/user/user_e24fc81c-c5ee-47e8-af42-4fe29d895506/notification-policy/INVOICE_APPROVAL_NEEDED"

	payload := strings.NewReader("{\n  \"digest\": true\n}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	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 DIGEST
require 'uri'
require 'net/http'

url = URI("https://api.mercoa.com/entity/ent_8545a84e-a45f-41bf-bdf1-33b42a55812c/user/user_e24fc81c-c5ee-47e8-af42-4fe29d895506/notification-policy/INVOICE_APPROVAL_NEEDED")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"digest\": true\n}"

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

```java DIGEST
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.mercoa.com/entity/ent_8545a84e-a45f-41bf-bdf1-33b42a55812c/user/user_e24fc81c-c5ee-47e8-af42-4fe29d895506/notification-policy/INVOICE_APPROVAL_NEEDED")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"digest\": true\n}")
  .asString();
```

```php DIGEST
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.mercoa.com/entity/ent_8545a84e-a45f-41bf-bdf1-33b42a55812c/user/user_e24fc81c-c5ee-47e8-af42-4fe29d895506/notification-policy/INVOICE_APPROVAL_NEEDED', [
  'body' => '{
  "digest": true
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp DIGEST
using RestSharp;

var client = new RestClient("https://api.mercoa.com/entity/ent_8545a84e-a45f-41bf-bdf1-33b42a55812c/user/user_e24fc81c-c5ee-47e8-af42-4fe29d895506/notification-policy/INVOICE_APPROVAL_NEEDED");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"digest\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift DIGEST
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["digest": true] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.mercoa.com/entity/ent_8545a84e-a45f-41bf-bdf1-33b42a55812c/user/user_e24fc81c-c5ee-47e8-af42-4fe29d895506/notification-policy/INVOICE_APPROVAL_NEEDED")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```

### IMMEDIATE

**Request**

```json
{
  "immediate": true
}
```

**Response**

```json
{
  "disabled": false,
  "digest": false,
  "immediate": true,
  "type": "INVOICE_PAID"
}
```

**SDK Code**

```python IMMEDIATE
import requests

url = "https://api.mercoa.com/entity/ent_8545a84e-a45f-41bf-bdf1-33b42a55812c/user/user_e24fc81c-c5ee-47e8-af42-4fe29d895506/notification-policy/INVOICE_PAID"

payload = { "immediate": True }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```typescript IMMEDIATE
import { MercoaClient } from "@mercoa/javascript";

const client = new MercoaClient({ token: "YOUR_TOKEN" });
await client.entity.user.notificationPolicy.update("ent_8545a84e-a45f-41bf-bdf1-33b42a55812c", "user_e24fc81c-c5ee-47e8-af42-4fe29d895506", "INVOICE_PAID", {
    immediate: true
});

```

```go IMMEDIATE
package main

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

func main() {

	url := "https://api.mercoa.com/entity/ent_8545a84e-a45f-41bf-bdf1-33b42a55812c/user/user_e24fc81c-c5ee-47e8-af42-4fe29d895506/notification-policy/INVOICE_PAID"

	payload := strings.NewReader("{\n  \"immediate\": true\n}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	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 IMMEDIATE
require 'uri'
require 'net/http'

url = URI("https://api.mercoa.com/entity/ent_8545a84e-a45f-41bf-bdf1-33b42a55812c/user/user_e24fc81c-c5ee-47e8-af42-4fe29d895506/notification-policy/INVOICE_PAID")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"immediate\": true\n}"

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

```java IMMEDIATE
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.mercoa.com/entity/ent_8545a84e-a45f-41bf-bdf1-33b42a55812c/user/user_e24fc81c-c5ee-47e8-af42-4fe29d895506/notification-policy/INVOICE_PAID")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"immediate\": true\n}")
  .asString();
```

```php IMMEDIATE
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.mercoa.com/entity/ent_8545a84e-a45f-41bf-bdf1-33b42a55812c/user/user_e24fc81c-c5ee-47e8-af42-4fe29d895506/notification-policy/INVOICE_PAID', [
  'body' => '{
  "immediate": true
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp IMMEDIATE
using RestSharp;

var client = new RestClient("https://api.mercoa.com/entity/ent_8545a84e-a45f-41bf-bdf1-33b42a55812c/user/user_e24fc81c-c5ee-47e8-af42-4fe29d895506/notification-policy/INVOICE_PAID");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"immediate\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift IMMEDIATE
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["immediate": true] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.mercoa.com/entity/ent_8545a84e-a45f-41bf-bdf1-33b42a55812c/user/user_e24fc81c-c5ee-47e8-af42-4fe29d895506/notification-policy/INVOICE_PAID")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```