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

# Audit Data Download

For on-premises installations, the system administrator is sometimes
given access to the admin UI that tracks the health of NLP API,
shows the logs, tasks and ongoing jobs if any.

The admin UI also provides the ability to download the audit log data
in the form of a GPG signed zip file that contains a SQL dump of the
audit data. This data might be contractually required to be submitted to
emtelligent in cases where NLP API is operating behind a firewall and
usage information can only be shared via the download of the audit data.

Apart from the admin UI web interface, the audit data can also be
downloaded from the command line using the shell script provided below:

```bash
#!/bin/bash

# Make sure you have httpie and jq installed on your system:
# sudo apt install httpie jq

set -euxo pipefail

USER_NAME="<name>"  # set as environment variable
PASSWORD="<password>"   # set as environment variable
IAM_URL="http<s>://<server>"
EMTELLIPRO_ADMIN_URL="http<s>://<server>"

echo "Getting auth token..."
auth_token=$(http POST $IAM_URL/iam/v2/login user_name=$USER_NAME password=$PASSWORD | jq --raw-output .auth_token)

echo "Downloading audit log..."
http --timeout 120 GET $EMTELLIPRO_ADMIN_URL/admin/download-audit-log --auth-type bearer --auth $auth_token --download
```

The IAM service and the NLP API admin UI might be installed as either
`http` or `https` so the above script asks you to check and use the
appropriate one.

Make sure you are running IAM v2 for the latest NLP API release.

You may want to increase the `timeout` parameter (which is in seconds)
in cases where there are network stability issues or the connection to
the NLP API server is slow.