Update workspace proxy
PATCH
CoderSessionTokenheader
Coder-Session-Token<token>workspaceproxy*stringProxy ID or name
Format
uuidUpdate workspace proxy request
application/json- body
display_name*stringicon*stringid*stringFormat
uuidname*stringregenerate_token?booleanOK
application/json- response
created_at?stringFormat
date-timedeleted?booleanderp_enabled?booleanderp_only?booleandisplay_name?stringhealthy?booleanicon_url?stringid?stringFormat
uuidname?stringpath_app_url?stringPathAppURL is the URL to the base path for path apps. Optional unless wildcard_hostname is set. E.g. https://us.example.com
status?Status is the latest status check of the proxy. This will be empty for deleted proxies. This value can be used to determine if a workspace proxy is healthy and ready to use.
updated_at?stringFormat
date-timeversion?stringwildcard_hostname?stringWildcardHostname is the wildcard hostname for subdomain apps. E.g. *.us.example.com E.g. *--suffix.au.example.com Optional. Does not need to be on the same domain as PathAppURL.
The samples read CODER_URL and CODER_SESSION_TOKEN: set up your environment.
curl -X PATCH \ "$CODER_URL/api/v2/workspaceproxies/{workspaceproxy}" \ -H "Coder-Session-Token: $CODER_SESSION_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "display_name": "string", "icon": "string", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string"}'const { CODER_URL, CODER_SESSION_TOKEN } = process.env;const url = `${CODER_URL}/api/v2/workspaceproxies/{workspaceproxy}`;const response = await fetch(url, { method: "PATCH", headers: { "Coder-Session-Token": CODER_SESSION_TOKEN, "Content-Type": "application/json", }, body: JSON.stringify({ display_name: "string", icon: "string", id: "497f6eca-6276-4993-bfeb-53cbbbba6f08", name: "string", }),});console.log(response.status, await response.text());import osimport requestsurl = os.environ["CODER_URL"] + "/api/v2/workspaceproxies/{workspaceproxy}"token = os.environ["CODER_SESSION_TOKEN"]response = requests.patch( url, headers={ "Coder-Session-Token": token, }, json={ "display_name": "string", "icon": "string", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", },)print(response.status_code, response.text)package mainimport ( "fmt" "io" "net/http" "os" "strings")func main() { body := strings.NewReader(`{ "display_name": "string", "icon": "string", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string"}`) url := os.Getenv("CODER_URL") + "/api/v2/workspaceproxies/{workspaceproxy}" token := os.Getenv("CODER_SESSION_TOKEN") req, err := http.NewRequest(http.MethodPatch, url, body) if err != nil { panic(err) } req.Header.Set("Coder-Session-Token", token) req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() out, err := io.ReadAll(resp.Body) if err != nil { panic(err) } fmt.Println(resp.Status, string(out))}Example Response200
{ "created_at": "2019-08-24T14:15:22Z", "deleted": true, "derp_enabled": true, "derp_only": true, "display_name": "string", "healthy": true, "icon_url": "string", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "path_app_url": "string", "status": { "checked_at": "2019-08-24T14:15:22Z", "report": { "errors": [ "string" ], "warnings": [ "string" ] }, "status": "ok" }, "updated_at": "2019-08-24T14:15:22Z", "version": "string", "wildcard_hostname": "string"}