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
<#1359697987822944388>
Category
Help needed
Product
Coder (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
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.
@Yasbaltrine - Out of curiosity, to stop a workspace, you have the send a
CreateWorkspaceBuildRequest
, but with transition: stop
?@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

@Phorcys closed the thread.