Proxmox API
July 13, 2024
Whether you are working in the cloud or on-prem, APIs and their usage has become standard practice in the IT world in recent years, with more and more services providing them and IT professionals becoming accustomed to their usage.
Proxmox is no different - it provides a well documented API, which can be used to drive the functionality in the Proxmox web interface.
How to Access the API
There are two approaches to using the API - you can either create an API token, or use your username and password.
To create an API token, go to Datacenter and into “Permissions”. Click on “API Tokens” and “Add” to create a new token.
Select the relevant username, and enter a unique token ID.
The Token ID and secret will be generated, which you can then use for scripting / integration purposes on each API call.
Set the token as the Authorization header on each REST call - see the token authentication video below.
Alternatively, you can use your username and password to connect to the /api2/json/access/ticket endpoint on your cluster.
The ticket value can be added as a cookie ( and CSRFPreventionToken can be added as a header) to use with further API calls.
API Usage can be seen in the following videos - API quick start with PowerShell and Postman:
Python and Postman:
API Tokens:
Example scripts can be found here:
Useful links: