# Admin Action Postbacks

NATS has to ability to post information to a script of your choice for admin actions. These postbacks can be enabled from the Configuration admin.&#x20;

For other postback examples, please see [Postbacks and Post URLs](https://docs.toomuchmedia.com/nats-admin/sites/further-reading/postbacks-and-post-urls).

## Configuration Admin

If you would like to enable these postbacks, go to the [Configuration Admin](https://docs.toomuchmedia.com/nats-admin/configuration) and select "Postback" from the Current Section drop-down menu. You will then see the following configurations under the "Admin Postback" sub-section

* ADMIN\_ACTION\_POSTBACK - Receive a postback whenever an admin page is viewed or used. To enable, put the URL of the script to post all admin actions.

## Postback Logging Script

The following example script allows you to log the contents of a postback

{% hint style="warning" %}
**Please Note:** Make sure that the log is NOT in a web-accessible folder.
{% endhint %}

```
<?php

	$file = '/path/to/nats4/logs/postback_logs.txt';
	// Open the file to get existing content
	$post = print_r($_REQUEST, TRUE);
	file_put_contents($file, $post, FILE_APPEND);
 
?>
```

## Admin Postback Format

Here is an exmaple log of the ADMIN\_ACTION\_POSTBACK when viewing the edit page of a site:

{% code overflow="wrap" %}

```
Array
(
    [query_string] => view=edit&site[id]=1&nats_sess=1068ac55f635337ed03ffca0883a1dd8
    [performed_action_loginid] => 2
    [performed_action_ip] => 10.10.10.31
    [performed_action_script] => /admin_sites.php
    [performed_action_time] => 1437762032
)
```

{% endcode %}
