Install the pfSense API service
The pfSense API is not installed by default. To use this API, you'll need to install it and generate an authentication key. The operations are very simple.
The pfSense API is not installed by default.
To use this API, you'll need to install it and generate an authentication key.
The operations are very simple.
- Open an SSH session or use the Unix console
- Select the option 8 to run the Shell.

- Run this command:
pkg -C /dev/null add https://github.com/jaredhendrickson13/pfsense-api/releases/latest/download/pfSense-2.7-pkg-API.pkg && /etc/rc.restart_webgui
Once executed, open the web administration console and go to “System” > “API”

- In the middle of the page, choose the option API Token in the Authentication mode field**.**

- Generate a new token
- Retrieve the Client-ID and the generated API key, which is temporarily displayed at the top of the web page.
