Problem with using API Delete VM

zpopovski

New Member
Feb 1, 2023
6
0
1
Hi,

I am trying to delete a VM using API DELETE /nodes/{node-name}/qemu/{vm-id} with AUTHORIZATION Token in the header but i am receiving all the time null as response instead of task UPID and the VM is not deleted. Did i miss something?

Thanks
 
Hi, this sounds like the user/token you are using doesn't have the permission to delete the VM. You can check the HTTP response headers for more information. If you use curl, you can use the -i option:
Code:
$ curl -i 'https://.../api2/json/nodes/.../qemu/103' -X DELETE ...
HTTP/1.1 403 Permission check failed (/vms/103, VM.Allocate)
Cache-Control: max-age=0
...
And you can show the user/token permissions using pveum: https://pve.proxmox.com/pve-docs/chapter-pveum.html#_limited_api_token_for_monitoring