Skip to content

New-PveAccessUsersToken

Generate a new API token for a specific user. NOTE: returns API token value, which needs to be stored as it cannot be retrieved afterwards!

API: POST /access/users/{userid}/token/{tokenid}, Proxmox VE API viewer

New-PveAccessUsersToken
[-PveTicket <PveTicket>]
[-Comment <string>]
[-Expire <int>]
[-Privsep <bool>]
-Tokenid <string>
-Userid <string>
[<CommonParameters>]
Parameter Type Required Description
-PveTicket PveTicket No Ticket data connection.
-Comment string No
-Expire int No API token expiration date (seconds since epoch). ‘0’ means no expiration date.
-Privsep bool No Restrict API token privileges with separate ACLs (default), or give full privileges of corresponding user.
-Tokenid string Yes User-specific token identifier.
-Userid string Yes Full User ID, in the name@realm format.

Every parameter also binds by property name from the pipeline, so an object with node and vmid properties (the output of Get-PveGuest, for one) fills -Node and -Vmid. Without -PveTicket the cmdlet uses the last connection, see Connection.

A PveResponse: the data returned by Proxmox VE is in .Response.data, the outcome in .IsSuccessStatusCode. See Results and Errors.