We recommend automating Coder deployments through the CLI. Examples include updating templates via CI/CD pipelines.
Long-lived tokens can be generated to perform actions on behalf of your user account:
coder tokens create
You can use tokens with the CLI by setting the
--token CLI flag or the
export CODER_URL=https://coder.example.com export CODER_SESSION_TOKEN=***** coder workspaces ls
You can use tokens with the Coder's REST API using the
Coder-Session-Token HTTP header.
curl 'https://dev.coder.com/api/v2/workspaces' \ -H 'Coder-Session-Token: *****'
At this time, we do not publish an API reference. However, codersdk can be grepped to find the necessary routes and payloads.