Coder.comC
Coder.com13mo ago
6 replies
ayush

Restart a workspace through the coder api

Is there a way to directly restart the coder workspce through the coder api , or i need to first stop the workspace then keep checking for the status of the workspace once its stopped in need to hit the start endpoint ??
Solution
Yes you can do that by making two API calls.
https://coder.com/docs/reference/api/builds#create-workspace-build
one with "transition": "stop" then when it completes do another with "transition": "start"
Was this page helpful?