---
agentTools:
  projectIndex: https://sourcepoint-public-api.readme.io/llms.txt
---

# postRejectAllUsnat

> 🚧 Deprecated
>
> This command is currently deprecated. To implement a command that opts an en end-user out of all privacy choices and vendors please see the [`postRejectAll`](https://sourcepoint-public-api.readme.io/reference/postrejectall-4)  command.

The `postRejectAllUsnat` command is an on-page opt-out mechanism that will opt out of all privacy choices and vendors for the U.S. Multi-State Privacy (GPP) vendor list associated with the property. By attaching the command to an `onclick` event of a page element, your organization can provide end-users with a one-click solution that allows them to easily revoke their opt in selections.

* [Command]()
* [Implement `postRejectAllUsnat`]()
* [Response]()

## Command

```javascript
__gpp('postRejectAllUsnat', function(data, success) {console.log("All privacy choices opted out:" + success)})
```

## Implement `postRejectAllUsnat`

In order to implement the `postRejectAllUsnat` command on your website property, you will need to:

1. Implement a button or link on your website property with an element ID. The suggested element ID is "postRejectAllUsnat".
2. Create a function that executes the `postRejectAllUsnat` command.
3. Use the `document.getElementbyId` method to return the button or link ID and call your function for an `onclick` event.

```html
<!--Create modal with a button--> 
<div id="myModal" class="modal"> 
  <div class="modal-content"> 
    <p>Opt out of all privacy choices and vendors.</p> 
    <button id="postRejectAllUsnat">Opt out all</button> 
  </div>
</div>
```
```javascript
<script>
//calls function when Opt-Out of All button is clicked
      document.getElementById("postRejectAllUsnat").onclick = function() {myFunction()};
  
  function myFunction() {
    console.log("postRejectAllUsnat called:");
    __gpp("postRejectAllUsnat", (consents, success) => {
      if (success) {
        console.log("postRejectAllUsnat request was successful: " + success)
        //checking U.S. National section for correct field settings
        __gpp('getSection', (data,success)=>{console.log("getSection request successfully executed: " + success);console.log(data)}, 'usnatv1');
      }
      else {
        // do something else
        console.log("gpp call was not successful!");
      }
    });
  }
</script>
```

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/f5ef8c3-Screenshot_2023-12-04_at_10.04.44_AM.png",
        "",
        ""
      ],
      "align": "center",
      "sizing": "650px"
    }
  ]
}
[/block]

## Response

In addition to any custom code you might implement when your function executes, a successful reject all action will return `true` for the `success` parameter.

> **Example**
>
> An end-user accessing our page from South Dakota has opted into all privacy choices and vendors on our U.S. Multi-State Privacy (National) vendor list. As such, the fields in the U.S. National Privacy Section which describe the end-users opt in status returns the following:
>
> * `SaleOptOut` : `2` (Did Not Opt Out)
>
> * `SharingOptOut` : `2` (Did Not Opt Out)
>
> * `SensitiveDataProcessing` : `{2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2}` (Opted In)

[block:image]{"images":[{"image":["https://files.readme.io/8c762e9-Screenshot_2023-12-04_at_10.19.23_AM.png","",""],"align":"center","sizing":"650px"}]}[/block]

> After clicking the button we configured to execute the `postRejectAllUsnat` command, our script returns `true` for the success parameter.

[block:image]{"images":[{"image":["https://files.readme.io/2eef036-Screenshot_2023-12-04_at_10.26.21_AM.png","",""],"align":"center","sizing":"650px"}]}[/block]

> Upon re-retrieving the U.S. National Privacy section, the fields which describe the end-users opt in status returns the following
>
> * `SaleOptOut` : `1` (Opted out)
>
> * `SharingOptOut` : `1` (Opted out)
>
> * `SensitiveDataProcessing` : `{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}` (Opted out)

[block:image]{"images":[{"image":["https://files.readme.io/db3029a-Screenshot_2023-12-04_at_10.26.40_AM.png","",""],"align":"center","sizing":"650px"}]}[/block]