Stop workspace from API?

Hi, documentation says it's possible, but I couldn't figure out which route / method I should use to achieve that? I'd also like to be able to start the workspace when it's stopped thanks
5 Replies
Codercord
Codercord2w ago
<#1359697987822944388>
Category
Help needed
Product
Coder (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
Yasbaltrine
YasbaltrineOP2w ago
I got it to work: I needed to use a workspace build https://coder.com/docs/reference/api/builds#create-workspace-build
Builds API Reference | Coder Docs
Manage workspace builds in Coder. Retrieve build logs, handle workspace transitions, and cancel or track build status through the Builds API.
From An unknown user
From An unknown user
Scott
Scott2w ago
@Yasbaltrine - Out of curiosity, to stop a workspace, you have the send a CreateWorkspaceBuildRequest, but with transition: stop?
Yasbaltrine
YasbaltrineOP2w ago
@Scott Idk if it's creating a CreateWorkspaceBuildRequest but this is the endpoint I use: api/v2/workspaces/{workspace}/builds with transition value to stop or start
No description
Codercord
Codercord2w ago
@Phorcys closed the thread.

Did you find this page helpful?