diff --git a/coderd/aitasks.go b/coderd/aitasks.go index f0adb3b8ea..7518a98d33 100644 --- a/coderd/aitasks.go +++ b/coderd/aitasks.go @@ -44,7 +44,7 @@ import ( // @Param user path string true "Username, user ID, or 'me' for the authenticated user" // @Param request body codersdk.CreateTaskRequest true "Create task request" // @Success 201 {object} codersdk.Task -// @Router /tasks/{user} [post] +// @Router /api/v2/tasks/{user} [post] func (api *API) tasksCreate(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -401,7 +401,7 @@ func deriveTaskCurrentState( // @Tags Tasks // @Param q query string false "Search query for filtering tasks. Supports: owner:, organization:, status:" // @Success 200 {object} codersdk.TasksListResponse -// @Router /tasks [get] +// @Router /api/v2/tasks [get] func (api *API) tasksList(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() apiKey := httpmw.APIKey(r) @@ -511,7 +511,7 @@ func (api *API) convertTasks(ctx context.Context, requesterID uuid.UUID, dbTasks // @Param user path string true "Username, user ID, or 'me' for the authenticated user" // @Param task path string true "Task ID, or task name" // @Success 200 {object} codersdk.Task -// @Router /tasks/{user}/{task} [get] +// @Router /api/v2/tasks/{user}/{task} [get] func (api *API) taskGet(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() apiKey := httpmw.APIKey(r) @@ -585,7 +585,7 @@ func (api *API) taskGet(rw http.ResponseWriter, r *http.Request) { // @Param user path string true "Username, user ID, or 'me' for the authenticated user" // @Param task path string true "Task ID, or task name" // @Success 202 -// @Router /tasks/{user}/{task} [delete] +// @Router /api/v2/tasks/{user}/{task} [delete] func (api *API) taskDelete(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() apiKey := httpmw.APIKey(r) @@ -659,7 +659,7 @@ func (api *API) taskDelete(rw http.ResponseWriter, r *http.Request) { // @Param task path string true "Task ID, or task name" // @Param request body codersdk.UpdateTaskInputRequest true "Update task input request" // @Success 204 -// @Router /tasks/{user}/{task}/input [patch] +// @Router /api/v2/tasks/{user}/{task}/input [patch] func (api *API) taskUpdateInput(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -739,7 +739,7 @@ func (api *API) taskUpdateInput(rw http.ResponseWriter, r *http.Request) { // @Param task path string true "Task ID, or task name" // @Param request body codersdk.TaskSendRequest true "Task input request" // @Success 204 -// @Router /tasks/{user}/{task}/send [post] +// @Router /api/v2/tasks/{user}/{task}/send [post] func (api *API) taskSend(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() task := httpmw.TaskParam(r) @@ -831,7 +831,7 @@ func convertAgentAPIMessagesToLogEntries(messages []agentapisdk.Message) ([]code // @Param user path string true "Username, user ID, or 'me' for the authenticated user" // @Param task path string true "Task ID, or task name" // @Success 200 {object} codersdk.TaskLogsResponse -// @Router /tasks/{user}/{task}/logs [get] +// @Router /api/v2/tasks/{user}/{task}/logs [get] func (api *API) taskLogs(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() task := httpmw.TaskParam(r) @@ -1117,7 +1117,7 @@ type TaskLogSnapshotEnvelope struct { // @Param format query string true "Snapshot format" enums(agentapi) // @Param request body object true "Raw snapshot payload (structure depends on format parameter)" // @Success 204 -// @Router /workspaceagents/me/tasks/{task}/log-snapshot [post] +// @Router /api/v2/workspaceagents/me/tasks/{task}/log-snapshot [post] func (api *API) postWorkspaceAgentTaskLogSnapshot(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -1266,7 +1266,7 @@ func (api *API) postWorkspaceAgentTaskLogSnapshot(rw http.ResponseWriter, r *htt // @Param user path string true "Username, user ID, or 'me' for the authenticated user" // @Param task path string true "Task ID" format(uuid) // @Success 202 {object} codersdk.PauseTaskResponse -// @Router /tasks/{user}/{task}/pause [post] +// @Router /api/v2/tasks/{user}/{task}/pause [post] func (api *API) pauseTask(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -1343,7 +1343,7 @@ func (api *API) pauseTask(rw http.ResponseWriter, r *http.Request) { // @Param user path string true "Username, user ID, or 'me' for the authenticated user" // @Param task path string true "Task ID" format(uuid) // @Success 202 {object} codersdk.ResumeTaskResponse -// @Router /tasks/{user}/{task}/resume [post] +// @Router /api/v2/tasks/{user}/{task}/resume [post] func (api *API) resumeTask(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() diff --git a/coderd/apidoc/docs.go b/coderd/apidoc/docs.go index 460e05a902..db52e176e2 100644 --- a/coderd/apidoc/docs.go +++ b/coderd/apidoc/docs.go @@ -24,26 +24,6 @@ const docTemplate = `{ "host": "{{.Host}}", "basePath": "{{.BasePath}}", "paths": { - "/": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "General" - ], - "summary": "API root handler", - "operationId": "api-root-handler", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - } - } - }, "/.well-known/oauth-authorization-server": { "get": { "produces": [ @@ -84,1190 +64,7 @@ const docTemplate = `{ } } }, - "/aibridge/clients": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "AI Bridge" - ], - "summary": "List AI Bridge clients", - "operationId": "list-ai-bridge-clients", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/aibridge/interceptions": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "AI Bridge" - ], - "summary": "List AI Bridge interceptions", - "operationId": "list-ai-bridge-interceptions", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "Search query in the format ` + "`" + `key:value` + "`" + `. Available keys are: initiator, provider, model, started_after, started_before.", - "name": "q", - "in": "query" - }, - { - "type": "integer", - "description": "Page limit", - "name": "limit", - "in": "query" - }, - { - "type": "string", - "description": "Cursor pagination after ID (cannot be used with offset)", - "name": "after_id", - "in": "query" - }, - { - "type": "integer", - "description": "Offset pagination (cannot be used with after_id)", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.AIBridgeListInterceptionsResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/aibridge/models": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "AI Bridge" - ], - "summary": "List AI Bridge models", - "operationId": "list-ai-bridge-models", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/aibridge/sessions": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "AI Bridge" - ], - "summary": "List AI Bridge sessions", - "operationId": "list-ai-bridge-sessions", - "parameters": [ - { - "type": "string", - "description": "Search query in the format ` + "`" + `key:value` + "`" + `. Available keys are: initiator, provider, model, client, session_id, started_after, started_before.", - "name": "q", - "in": "query" - }, - { - "type": "integer", - "description": "Page limit", - "name": "limit", - "in": "query" - }, - { - "type": "string", - "description": "Cursor pagination after session ID (cannot be used with offset)", - "name": "after_session_id", - "in": "query" - }, - { - "type": "integer", - "description": "Offset pagination (cannot be used with after_session_id)", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.AIBridgeListSessionsResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/aibridge/sessions/{session_id}": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "AI Bridge" - ], - "summary": "Get AI Bridge session threads", - "operationId": "get-ai-bridge-session-threads", - "parameters": [ - { - "type": "string", - "description": "Session ID (client_session_id or interception UUID)", - "name": "session_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Thread pagination cursor (forward/older)", - "name": "after_id", - "in": "query" - }, - { - "type": "string", - "description": "Thread pagination cursor (backward/newer)", - "name": "before_id", - "in": "query" - }, - { - "type": "integer", - "description": "Number of threads per page (default 50)", - "name": "limit", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.AIBridgeSessionThreadsResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/appearance": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Get appearance", - "operationId": "get-appearance", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.AppearanceConfig" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "put": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Update appearance", - "operationId": "update-appearance", - "parameters": [ - { - "description": "Update appearance request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateAppearanceConfig" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.UpdateAppearanceConfig" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/applications/auth-redirect": { - "get": { - "tags": [ - "Applications" - ], - "summary": "Redirect to URI with encrypted API key", - "operationId": "redirect-to-uri-with-encrypted-api-key", - "parameters": [ - { - "type": "string", - "description": "Redirect destination", - "name": "redirect_uri", - "in": "query" - } - ], - "responses": { - "307": { - "description": "Temporary Redirect" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/applications/host": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Applications" - ], - "summary": "Get applications host", - "operationId": "get-applications-host", - "deprecated": true, - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.AppHostResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/applications/reconnecting-pty-signed-token": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Issue signed app token for reconnecting PTY", - "operationId": "issue-signed-app-token-for-reconnecting-pty", - "parameters": [ - { - "description": "Issue reconnecting PTY signed token request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.IssueReconnectingPTYSignedTokenRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.IssueReconnectingPTYSignedTokenResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/audit": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Audit" - ], - "summary": "Get audit logs", - "operationId": "get-audit-logs", - "parameters": [ - { - "type": "string", - "description": "Search query", - "name": "q", - "in": "query" - }, - { - "type": "integer", - "description": "Page limit", - "name": "limit", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "Page offset", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.AuditLogResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/audit/testgenerate": { - "post": { - "consumes": [ - "application/json" - ], - "tags": [ - "Audit" - ], - "summary": "Generate fake audit log", - "operationId": "generate-fake-audit-log", - "parameters": [ - { - "description": "Audit log request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.CreateTestAuditLogRequest" - } - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/auth/scopes": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Authorization" - ], - "summary": "List API key scopes", - "operationId": "list-api-key-scopes", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.ExternalAPIKeyScopes" - } - } - } - } - }, - "/authcheck": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Authorization" - ], - "summary": "Check authorization", - "operationId": "check-authorization", - "parameters": [ - { - "description": "Authorization request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.AuthorizationRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.AuthorizationResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/buildinfo": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "General" - ], - "summary": "Build info", - "operationId": "build-info", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.BuildInfoResponse" - } - } - } - } - }, - "/chats/insights/pull-requests": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Chats" - ], - "summary": "Get PR insights", - "operationId": "get-pr-insights", - "parameters": [ - { - "type": "string", - "description": "Start date (RFC3339)", - "name": "start_date", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "End date (RFC3339)", - "name": "end_date", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.PRInsightsResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/connectionlog": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Get connection logs", - "operationId": "get-connection-logs", - "parameters": [ - { - "type": "string", - "description": "Search query", - "name": "q", - "in": "query" - }, - { - "type": "integer", - "description": "Page limit", - "name": "limit", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "Page offset", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.ConnectionLogResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/csp/reports": { - "post": { - "consumes": [ - "application/json" - ], - "tags": [ - "General" - ], - "summary": "Report CSP violations", - "operationId": "report-csp-violations", - "parameters": [ - { - "description": "Violation report", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/coderd.cspViolation" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/debug/coordinator": { - "get": { - "produces": [ - "text/html" - ], - "tags": [ - "Debug" - ], - "summary": "Debug Info Wireguard Coordinator", - "operationId": "debug-info-wireguard-coordinator", - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/debug/derp/traffic": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Debug" - ], - "summary": "Debug DERP traffic", - "operationId": "debug-derp-traffic", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/derp.BytesSentRecv" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/debug/expvar": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Debug" - ], - "summary": "Debug expvar", - "operationId": "debug-expvar", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "object", - "additionalProperties": true - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/debug/health": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Debug" - ], - "summary": "Debug Info Deployment Health", - "operationId": "debug-info-deployment-health", - "parameters": [ - { - "type": "boolean", - "description": "Force a healthcheck to run", - "name": "force", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/healthsdk.HealthcheckReport" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/debug/health/settings": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Debug" - ], - "summary": "Get health settings", - "operationId": "get-health-settings", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/healthsdk.HealthSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "put": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Debug" - ], - "summary": "Update health settings", - "operationId": "update-health-settings", - "parameters": [ - { - "description": "Update health settings", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/healthsdk.UpdateHealthSettings" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/healthsdk.UpdateHealthSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/debug/metrics": { - "get": { - "tags": [ - "Debug" - ], - "summary": "Debug metrics", - "operationId": "debug-metrics", - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/debug/pprof": { - "get": { - "tags": [ - "Debug" - ], - "summary": "Debug pprof index", - "operationId": "debug-pprof-index", - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/debug/pprof/cmdline": { - "get": { - "tags": [ - "Debug" - ], - "summary": "Debug pprof cmdline", - "operationId": "debug-pprof-cmdline", - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/debug/pprof/profile": { - "get": { - "tags": [ - "Debug" - ], - "summary": "Debug pprof profile", - "operationId": "debug-pprof-profile", - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/debug/pprof/symbol": { - "get": { - "tags": [ - "Debug" - ], - "summary": "Debug pprof symbol", - "operationId": "debug-pprof-symbol", - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/debug/pprof/trace": { - "get": { - "tags": [ - "Debug" - ], - "summary": "Debug pprof trace", - "operationId": "debug-pprof-trace", - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/debug/profile": { - "post": { - "tags": [ - "Debug" - ], - "summary": "Collect debug profiles", - "operationId": "collect-debug-profiles", - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/debug/tailnet": { - "get": { - "produces": [ - "text/html" - ], - "tags": [ - "Debug" - ], - "summary": "Debug Info Tailnet", - "operationId": "debug-info-tailnet", - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/debug/ws": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Debug" - ], - "summary": "Debug Info Websocket Test", - "operationId": "debug-info-websocket-test", - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/debug/{user}/debug-link": { - "get": { - "tags": [ - "Agents" - ], - "summary": "Debug OIDC context for a user", - "operationId": "debug-oidc-context-for-a-user", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Success" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/deployment/config": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "General" - ], - "summary": "Get deployment config", - "operationId": "get-deployment-config", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.DeploymentConfig" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/deployment/ssh": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "General" - ], - "summary": "SSH Config", - "operationId": "ssh-config", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.SSHConfigResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/deployment/stats": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "General" - ], - "summary": "Get deployment stats", - "operationId": "get-deployment-stats", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.DeploymentStats" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/derp-map": { - "get": { - "tags": [ - "Agents" - ], - "summary": "Get DERP map updates", - "operationId": "get-derp-map-updates", - "responses": { - "101": { - "description": "Switching Protocols" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/entitlements": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Get entitlements", - "operationId": "get-entitlements", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Entitlements" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/experimental/chats/config/retention-days": { + "/api/experimental/chats/config/retention-days": { "get": { "produces": [ "application/json" @@ -1329,7 +126,51 @@ const docTemplate = `{ } } }, - "/experimental/watch-all-workspacebuilds": { + "/api/experimental/chats/insights/pull-requests": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Chats" + ], + "summary": "Get PR insights", + "operationId": "get-pr-insights", + "parameters": [ + { + "type": "string", + "description": "Start date (RFC3339)", + "name": "start_date", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "End date (RFC3339)", + "name": "end_date", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.PRInsightsResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/experimental/watch-all-workspacebuilds": { "get": { "produces": [ "application/json" @@ -1354,7 +195,1166 @@ const docTemplate = `{ } } }, - "/experiments": { + "/api/v2/": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "General" + ], + "summary": "API root handler", + "operationId": "api-root-handler", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + } + } + }, + "/api/v2/aibridge/clients": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "AI Bridge" + ], + "summary": "List AI Bridge clients", + "operationId": "list-ai-bridge-clients", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/aibridge/interceptions": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "AI Bridge" + ], + "summary": "List AI Bridge interceptions", + "operationId": "list-ai-bridge-interceptions", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "Search query in the format ` + "`" + `key:value` + "`" + `. Available keys are: initiator, provider, model, started_after, started_before.", + "name": "q", + "in": "query" + }, + { + "type": "integer", + "description": "Page limit", + "name": "limit", + "in": "query" + }, + { + "type": "string", + "description": "Cursor pagination after ID (cannot be used with offset)", + "name": "after_id", + "in": "query" + }, + { + "type": "integer", + "description": "Offset pagination (cannot be used with after_id)", + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.AIBridgeListInterceptionsResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/aibridge/models": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "AI Bridge" + ], + "summary": "List AI Bridge models", + "operationId": "list-ai-bridge-models", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/aibridge/sessions": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "AI Bridge" + ], + "summary": "List AI Bridge sessions", + "operationId": "list-ai-bridge-sessions", + "parameters": [ + { + "type": "string", + "description": "Search query in the format ` + "`" + `key:value` + "`" + `. Available keys are: initiator, provider, model, client, session_id, started_after, started_before.", + "name": "q", + "in": "query" + }, + { + "type": "integer", + "description": "Page limit", + "name": "limit", + "in": "query" + }, + { + "type": "string", + "description": "Cursor pagination after session ID (cannot be used with offset)", + "name": "after_session_id", + "in": "query" + }, + { + "type": "integer", + "description": "Offset pagination (cannot be used with after_session_id)", + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.AIBridgeListSessionsResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/aibridge/sessions/{session_id}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "AI Bridge" + ], + "summary": "Get AI Bridge session threads", + "operationId": "get-ai-bridge-session-threads", + "parameters": [ + { + "type": "string", + "description": "Session ID (client_session_id or interception UUID)", + "name": "session_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Thread pagination cursor (forward/older)", + "name": "after_id", + "in": "query" + }, + { + "type": "string", + "description": "Thread pagination cursor (backward/newer)", + "name": "before_id", + "in": "query" + }, + { + "type": "integer", + "description": "Number of threads per page (default 50)", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.AIBridgeSessionThreadsResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/appearance": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Get appearance", + "operationId": "get-appearance", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.AppearanceConfig" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "put": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Update appearance", + "operationId": "update-appearance", + "parameters": [ + { + "description": "Update appearance request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateAppearanceConfig" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.UpdateAppearanceConfig" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/applications/auth-redirect": { + "get": { + "tags": [ + "Applications" + ], + "summary": "Redirect to URI with encrypted API key", + "operationId": "redirect-to-uri-with-encrypted-api-key", + "parameters": [ + { + "type": "string", + "description": "Redirect destination", + "name": "redirect_uri", + "in": "query" + } + ], + "responses": { + "307": { + "description": "Temporary Redirect" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/applications/host": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Applications" + ], + "summary": "Get applications host", + "operationId": "get-applications-host", + "deprecated": true, + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.AppHostResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/applications/reconnecting-pty-signed-token": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Issue signed app token for reconnecting PTY", + "operationId": "issue-signed-app-token-for-reconnecting-pty", + "parameters": [ + { + "description": "Issue reconnecting PTY signed token request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.IssueReconnectingPTYSignedTokenRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.IssueReconnectingPTYSignedTokenResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/audit": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Audit" + ], + "summary": "Get audit logs", + "operationId": "get-audit-logs", + "parameters": [ + { + "type": "string", + "description": "Search query", + "name": "q", + "in": "query" + }, + { + "type": "integer", + "description": "Page limit", + "name": "limit", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "Page offset", + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.AuditLogResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/audit/testgenerate": { + "post": { + "consumes": [ + "application/json" + ], + "tags": [ + "Audit" + ], + "summary": "Generate fake audit log", + "operationId": "generate-fake-audit-log", + "parameters": [ + { + "description": "Audit log request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.CreateTestAuditLogRequest" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/auth/scopes": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Authorization" + ], + "summary": "List API key scopes", + "operationId": "list-api-key-scopes", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.ExternalAPIKeyScopes" + } + } + } + } + }, + "/api/v2/authcheck": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Authorization" + ], + "summary": "Check authorization", + "operationId": "check-authorization", + "parameters": [ + { + "description": "Authorization request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.AuthorizationRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.AuthorizationResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/buildinfo": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "General" + ], + "summary": "Build info", + "operationId": "build-info", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.BuildInfoResponse" + } + } + } + } + }, + "/api/v2/connectionlog": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Get connection logs", + "operationId": "get-connection-logs", + "parameters": [ + { + "type": "string", + "description": "Search query", + "name": "q", + "in": "query" + }, + { + "type": "integer", + "description": "Page limit", + "name": "limit", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "Page offset", + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.ConnectionLogResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/csp/reports": { + "post": { + "consumes": [ + "application/json" + ], + "tags": [ + "General" + ], + "summary": "Report CSP violations", + "operationId": "report-csp-violations", + "parameters": [ + { + "description": "Violation report", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/coderd.cspViolation" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/debug/coordinator": { + "get": { + "produces": [ + "text/html" + ], + "tags": [ + "Debug" + ], + "summary": "Debug Info Wireguard Coordinator", + "operationId": "debug-info-wireguard-coordinator", + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/debug/derp/traffic": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Debug" + ], + "summary": "Debug DERP traffic", + "operationId": "debug-derp-traffic", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/derp.BytesSentRecv" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/debug/expvar": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Debug" + ], + "summary": "Debug expvar", + "operationId": "debug-expvar", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object", + "additionalProperties": true + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/debug/health": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Debug" + ], + "summary": "Debug Info Deployment Health", + "operationId": "debug-info-deployment-health", + "parameters": [ + { + "type": "boolean", + "description": "Force a healthcheck to run", + "name": "force", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/healthsdk.HealthcheckReport" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/debug/health/settings": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Debug" + ], + "summary": "Get health settings", + "operationId": "get-health-settings", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/healthsdk.HealthSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "put": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Debug" + ], + "summary": "Update health settings", + "operationId": "update-health-settings", + "parameters": [ + { + "description": "Update health settings", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/healthsdk.UpdateHealthSettings" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/healthsdk.UpdateHealthSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/debug/metrics": { + "get": { + "tags": [ + "Debug" + ], + "summary": "Debug metrics", + "operationId": "debug-metrics", + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/debug/pprof": { + "get": { + "tags": [ + "Debug" + ], + "summary": "Debug pprof index", + "operationId": "debug-pprof-index", + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/debug/pprof/cmdline": { + "get": { + "tags": [ + "Debug" + ], + "summary": "Debug pprof cmdline", + "operationId": "debug-pprof-cmdline", + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/debug/pprof/profile": { + "get": { + "tags": [ + "Debug" + ], + "summary": "Debug pprof profile", + "operationId": "debug-pprof-profile", + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/debug/pprof/symbol": { + "get": { + "tags": [ + "Debug" + ], + "summary": "Debug pprof symbol", + "operationId": "debug-pprof-symbol", + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/debug/pprof/trace": { + "get": { + "tags": [ + "Debug" + ], + "summary": "Debug pprof trace", + "operationId": "debug-pprof-trace", + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/debug/profile": { + "post": { + "tags": [ + "Debug" + ], + "summary": "Collect debug profiles", + "operationId": "collect-debug-profiles", + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/debug/tailnet": { + "get": { + "produces": [ + "text/html" + ], + "tags": [ + "Debug" + ], + "summary": "Debug Info Tailnet", + "operationId": "debug-info-tailnet", + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/debug/ws": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Debug" + ], + "summary": "Debug Info Websocket Test", + "operationId": "debug-info-websocket-test", + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/debug/{user}/debug-link": { + "get": { + "tags": [ + "Agents" + ], + "summary": "Debug OIDC context for a user", + "operationId": "debug-oidc-context-for-a-user", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/deployment/config": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "General" + ], + "summary": "Get deployment config", + "operationId": "get-deployment-config", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.DeploymentConfig" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/deployment/ssh": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "General" + ], + "summary": "SSH Config", + "operationId": "ssh-config", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.SSHConfigResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/deployment/stats": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "General" + ], + "summary": "Get deployment stats", + "operationId": "get-deployment-stats", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.DeploymentStats" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/derp-map": { + "get": { + "tags": [ + "Agents" + ], + "summary": "Get DERP map updates", + "operationId": "get-derp-map-updates", + "responses": { + "101": { + "description": "Switching Protocols" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/entitlements": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Get entitlements", + "operationId": "get-entitlements", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Entitlements" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/experiments": { "get": { "produces": [ "application/json" @@ -1382,7 +1382,7 @@ const docTemplate = `{ ] } }, - "/experiments/available": { + "/api/v2/experiments/available": { "get": { "produces": [ "application/json" @@ -1410,7 +1410,7 @@ const docTemplate = `{ ] } }, - "/external-auth": { + "/api/v2/external-auth": { "get": { "produces": [ "application/json" @@ -1435,7 +1435,7 @@ const docTemplate = `{ ] } }, - "/external-auth/{externalauth}": { + "/api/v2/external-auth/{externalauth}": { "get": { "produces": [ "application/json" @@ -1503,7 +1503,7 @@ const docTemplate = `{ ] } }, - "/external-auth/{externalauth}/device": { + "/api/v2/external-auth/{externalauth}/device": { "get": { "produces": [ "application/json" @@ -1565,7 +1565,7 @@ const docTemplate = `{ ] } }, - "/files": { + "/api/v2/files": { "post": { "description": "Swagger notice: Swagger 2.0 doesn't support file upload with a ` + "`" + `content-type` + "`" + ` different than ` + "`" + `application/x-www-form-urlencoded` + "`" + `.", "consumes": [ @@ -1617,7 +1617,7 @@ const docTemplate = `{ ] } }, - "/files/{fileID}": { + "/api/v2/files/{fileID}": { "get": { "tags": [ "Files" @@ -1646,7 +1646,7 @@ const docTemplate = `{ ] } }, - "/groups": { + "/api/v2/groups": { "get": { "produces": [ "application/json" @@ -1697,7 +1697,7 @@ const docTemplate = `{ ] } }, - "/groups/{group}": { + "/api/v2/groups/{group}": { "get": { "produces": [ "application/json" @@ -1813,7 +1813,7 @@ const docTemplate = `{ ] } }, - "/groups/{group}/members": { + "/api/v2/groups/{group}/members": { "get": { "produces": [ "application/json" @@ -1872,7 +1872,7 @@ const docTemplate = `{ ] } }, - "/init-script/{os}/{arch}": { + "/api/v2/init-script/{os}/{arch}": { "get": { "produces": [ "text/plain" @@ -1905,7 +1905,7 @@ const docTemplate = `{ } } }, - "/insights/daus": { + "/api/v2/insights/daus": { "get": { "produces": [ "application/json" @@ -1939,7 +1939,7 @@ const docTemplate = `{ ] } }, - "/insights/templates": { + "/api/v2/insights/templates": { "get": { "produces": [ "application/json" @@ -2003,7 +2003,7 @@ const docTemplate = `{ ] } }, - "/insights/user-activity": { + "/api/v2/insights/user-activity": { "get": { "produces": [ "application/json" @@ -2056,7 +2056,7 @@ const docTemplate = `{ ] } }, - "/insights/user-latency": { + "/api/v2/insights/user-latency": { "get": { "produces": [ "application/json" @@ -2109,7 +2109,7 @@ const docTemplate = `{ ] } }, - "/insights/user-status-counts": { + "/api/v2/insights/user-status-counts": { "get": { "produces": [ "application/json" @@ -2148,7 +2148,7 @@ const docTemplate = `{ ] } }, - "/licenses": { + "/api/v2/licenses": { "get": { "produces": [ "application/json" @@ -2213,7 +2213,7 @@ const docTemplate = `{ ] } }, - "/licenses/refresh-entitlements": { + "/api/v2/licenses/refresh-entitlements": { "post": { "produces": [ "application/json" @@ -2238,7 +2238,7 @@ const docTemplate = `{ ] } }, - "/licenses/{id}": { + "/api/v2/licenses/{id}": { "delete": { "produces": [ "application/json" @@ -2270,7 +2270,7 @@ const docTemplate = `{ ] } }, - "/notifications/custom": { + "/api/v2/notifications/custom": { "post": { "consumes": [ "application/json" @@ -2324,7 +2324,7 @@ const docTemplate = `{ ] } }, - "/notifications/dispatch-methods": { + "/api/v2/notifications/dispatch-methods": { "get": { "produces": [ "application/json" @@ -2352,7 +2352,7 @@ const docTemplate = `{ ] } }, - "/notifications/inbox": { + "/api/v2/notifications/inbox": { "get": { "produces": [ "application/json" @@ -2404,7 +2404,7 @@ const docTemplate = `{ ] } }, - "/notifications/inbox/mark-all-as-read": { + "/api/v2/notifications/inbox/mark-all-as-read": { "put": { "tags": [ "Notifications" @@ -2423,7 +2423,7 @@ const docTemplate = `{ ] } }, - "/notifications/inbox/watch": { + "/api/v2/notifications/inbox/watch": { "get": { "produces": [ "application/json" @@ -2478,7 +2478,7 @@ const docTemplate = `{ ] } }, - "/notifications/inbox/{id}/read-status": { + "/api/v2/notifications/inbox/{id}/read-status": { "put": { "produces": [ "application/json" @@ -2512,7 +2512,7 @@ const docTemplate = `{ ] } }, - "/notifications/settings": { + "/api/v2/notifications/settings": { "get": { "produces": [ "application/json" @@ -2577,7 +2577,7 @@ const docTemplate = `{ ] } }, - "/notifications/templates/custom": { + "/api/v2/notifications/templates/custom": { "get": { "produces": [ "application/json" @@ -2611,7 +2611,7 @@ const docTemplate = `{ ] } }, - "/notifications/templates/system": { + "/api/v2/notifications/templates/system": { "get": { "produces": [ "application/json" @@ -2645,7 +2645,7 @@ const docTemplate = `{ ] } }, - "/notifications/templates/{notification_template}/method": { + "/api/v2/notifications/templates/{notification_template}/method": { "put": { "produces": [ "application/json" @@ -2679,7 +2679,7 @@ const docTemplate = `{ ] } }, - "/notifications/test": { + "/api/v2/notifications/test": { "post": { "tags": [ "Notifications" @@ -2698,7 +2698,7 @@ const docTemplate = `{ ] } }, - "/oauth2-provider/apps": { + "/api/v2/oauth2-provider/apps": { "get": { "produces": [ "application/json" @@ -2771,7 +2771,7 @@ const docTemplate = `{ ] } }, - "/oauth2-provider/apps/{app}": { + "/api/v2/oauth2-provider/apps/{app}": { "get": { "produces": [ "application/json" @@ -2875,7 +2875,7 @@ const docTemplate = `{ ] } }, - "/oauth2-provider/apps/{app}/secrets": { + "/api/v2/oauth2-provider/apps/{app}/secrets": { "get": { "produces": [ "application/json" @@ -2947,7 +2947,7 @@ const docTemplate = `{ ] } }, - "/oauth2-provider/apps/{app}/secrets/{secretID}": { + "/api/v2/oauth2-provider/apps/{app}/secrets/{secretID}": { "delete": { "tags": [ "Enterprise" @@ -2982,6 +2982,9245 @@ const docTemplate = `{ ] } }, + "/api/v2/organizations": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Organizations" + ], + "summary": "Get organizations", + "operationId": "get-organizations", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.Organization" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Organizations" + ], + "summary": "Create organization", + "operationId": "create-organization", + "parameters": [ + { + "description": "Create organization request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.CreateOrganizationRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/codersdk.Organization" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Organizations" + ], + "summary": "Get organization by ID", + "operationId": "get-organization-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Organization" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "Organizations" + ], + "summary": "Delete organization", + "operationId": "delete-organization", + "parameters": [ + { + "type": "string", + "description": "Organization ID or name", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Organizations" + ], + "summary": "Update organization", + "operationId": "update-organization", + "parameters": [ + { + "type": "string", + "description": "Organization ID or name", + "name": "organization", + "in": "path", + "required": true + }, + { + "description": "Patch organization request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateOrganizationRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Organization" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/groups": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Get groups by organization", + "operationId": "get-groups-by-organization", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.Group" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Create group for organization", + "operationId": "create-group-for-organization", + "parameters": [ + { + "description": "Create group request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.CreateGroupRequest" + } + }, + { + "type": "string", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/codersdk.Group" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/groups/{groupName}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Get group by organization and group name", + "operationId": "get-group-by-organization-and-group-name", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Group name", + "name": "groupName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Group" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/groups/{groupName}/members": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Get group members by organization and group name", + "operationId": "get-group-members-by-organization-and-group-name", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Group name", + "name": "groupName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Member search query", + "name": "q", + "in": "query" + }, + { + "type": "string", + "format": "uuid", + "description": "After ID", + "name": "after_id", + "in": "query" + }, + { + "type": "integer", + "description": "Page limit", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Page offset", + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.GroupMembersResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/members": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Members" + ], + "summary": "List organization members", + "operationId": "list-organization-members", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.OrganizationMemberWithUserData" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/members/roles": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Members" + ], + "summary": "Get member roles by organization", + "operationId": "get-member-roles-by-organization", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.AssignableRoles" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "put": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Members" + ], + "summary": "Update a custom organization role", + "operationId": "update-a-custom-organization-role", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "description": "Update role request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.CustomRoleRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.Role" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Members" + ], + "summary": "Insert a custom organization role", + "operationId": "insert-a-custom-organization-role", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "description": "Insert role request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.CustomRoleRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.Role" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/members/roles/{roleName}": { + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "Members" + ], + "summary": "Delete a custom organization role", + "operationId": "delete-a-custom-organization-role", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Role name", + "name": "roleName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.Role" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/members/{user}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Members" + ], + "summary": "Get organization member", + "operationId": "get-organization-member", + "parameters": [ + { + "type": "string", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.OrganizationMemberWithUserData" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "Members" + ], + "summary": "Add organization member", + "operationId": "add-organization-member", + "parameters": [ + { + "type": "string", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.OrganizationMember" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "delete": { + "tags": [ + "Members" + ], + "summary": "Remove organization member", + "operationId": "remove-organization-member", + "parameters": [ + { + "type": "string", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/members/{user}/roles": { + "put": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Members" + ], + "summary": "Assign role to organization member", + "operationId": "assign-role-to-organization-member", + "parameters": [ + { + "type": "string", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "description": "Update roles request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateRoles" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.OrganizationMember" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/members/{user}/workspace-quota": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Get workspace quota by user", + "operationId": "get-workspace-quota-by-user", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceQuota" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/members/{user}/workspaces": { + "post": { + "description": "Create a new workspace using a template. The request must\nspecify either the Template ID or the Template Version ID,\nnot both. If the Template ID is specified, the active version\nof the template will be used.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Workspaces" + ], + "summary": "Create user workspace by organization", + "operationId": "create-user-workspace-by-organization", + "deprecated": true, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Username, UUID, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "description": "Create workspace request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.CreateWorkspaceRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Workspace" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/members/{user}/workspaces/available-users": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Workspaces" + ], + "summary": "Get users available for workspace creation", + "operationId": "get-users-available-for-workspace-creation", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Search query", + "name": "q", + "in": "query" + }, + { + "type": "integer", + "description": "Limit results", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Offset for pagination", + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.MinimalUser" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/paginated-members": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Members" + ], + "summary": "Paginated organization members", + "operationId": "paginated-organization-members", + "parameters": [ + { + "type": "string", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Member search query", + "name": "q", + "in": "query" + }, + { + "type": "string", + "format": "uuid", + "description": "After ID", + "name": "after_id", + "in": "query" + }, + { + "type": "integer", + "description": "Page limit, if 0 returns all members", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Page offset", + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.PaginatedMembersResponse" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/provisionerdaemons": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Provisioning" + ], + "summary": "Get provisioner daemons", + "operationId": "get-provisioner-daemons", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Page limit", + "name": "limit", + "in": "query" + }, + { + "type": "array", + "format": "uuid", + "items": { + "type": "string" + }, + "collectionFormat": "csv", + "description": "Filter results by job IDs", + "name": "ids", + "in": "query" + }, + { + "enum": [ + "pending", + "running", + "succeeded", + "canceling", + "canceled", + "failed", + "unknown", + "pending", + "running", + "succeeded", + "canceling", + "canceled", + "failed" + ], + "type": "string", + "description": "Filter results by status", + "name": "status", + "in": "query" + }, + { + "type": "object", + "description": "Provisioner tags to filter by (JSON of the form {'tag1':'value1','tag2':'value2'})", + "name": "tags", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.ProvisionerDaemon" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/provisionerdaemons/serve": { + "get": { + "tags": [ + "Enterprise" + ], + "summary": "Serve provisioner daemon", + "operationId": "serve-provisioner-daemon", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "101": { + "description": "Switching Protocols" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/provisionerjobs": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Organizations" + ], + "summary": "Get provisioner jobs", + "operationId": "get-provisioner-jobs", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Page limit", + "name": "limit", + "in": "query" + }, + { + "type": "array", + "format": "uuid", + "items": { + "type": "string" + }, + "collectionFormat": "csv", + "description": "Filter results by job IDs", + "name": "ids", + "in": "query" + }, + { + "enum": [ + "pending", + "running", + "succeeded", + "canceling", + "canceled", + "failed", + "unknown", + "pending", + "running", + "succeeded", + "canceling", + "canceled", + "failed" + ], + "type": "string", + "description": "Filter results by status", + "name": "status", + "in": "query" + }, + { + "type": "object", + "description": "Provisioner tags to filter by (JSON of the form {'tag1':'value1','tag2':'value2'})", + "name": "tags", + "in": "query" + }, + { + "type": "string", + "format": "uuid", + "description": "Filter results by initiator", + "name": "initiator", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.ProvisionerJob" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/provisionerjobs/{job}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Organizations" + ], + "summary": "Get provisioner job", + "operationId": "get-provisioner-job", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "Job ID", + "name": "job", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.ProvisionerJob" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/provisionerkeys": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "List provisioner key", + "operationId": "list-provisioner-key", + "parameters": [ + { + "type": "string", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.ProvisionerKey" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Create provisioner key", + "operationId": "create-provisioner-key", + "parameters": [ + { + "type": "string", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/codersdk.CreateProvisionerKeyResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/provisionerkeys/daemons": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "List provisioner key daemons", + "operationId": "list-provisioner-key-daemons", + "parameters": [ + { + "type": "string", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.ProvisionerKeyDaemons" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/provisionerkeys/{provisionerkey}": { + "delete": { + "tags": [ + "Enterprise" + ], + "summary": "Delete provisioner key", + "operationId": "delete-provisioner-key", + "parameters": [ + { + "type": "string", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Provisioner key name", + "name": "provisionerkey", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/settings/idpsync/available-fields": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Get the available organization idp sync claim fields", + "operationId": "get-the-available-organization-idp-sync-claim-fields", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/settings/idpsync/field-values": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Get the organization idp sync claim field values", + "operationId": "get-the-organization-idp-sync-claim-field-values", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "string", + "description": "Claim Field", + "name": "claimField", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/settings/idpsync/groups": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Get group IdP Sync settings by organization", + "operationId": "get-group-idp-sync-settings-by-organization", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.GroupSyncSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Update group IdP Sync settings by organization", + "operationId": "update-group-idp-sync-settings-by-organization", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "description": "New settings", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.GroupSyncSettings" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.GroupSyncSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/settings/idpsync/groups/config": { + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Update group IdP Sync config", + "operationId": "update-group-idp-sync-config", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID or name", + "name": "organization", + "in": "path", + "required": true + }, + { + "description": "New config values", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.PatchGroupIDPSyncConfigRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.GroupSyncSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/settings/idpsync/groups/mapping": { + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Update group IdP Sync mapping", + "operationId": "update-group-idp-sync-mapping", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID or name", + "name": "organization", + "in": "path", + "required": true + }, + { + "description": "Description of the mappings to add and remove", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.PatchGroupIDPSyncMappingRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.GroupSyncSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/settings/idpsync/roles": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Get role IdP Sync settings by organization", + "operationId": "get-role-idp-sync-settings-by-organization", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.RoleSyncSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Update role IdP Sync settings by organization", + "operationId": "update-role-idp-sync-settings-by-organization", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "description": "New settings", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.RoleSyncSettings" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.RoleSyncSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/settings/idpsync/roles/config": { + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Update role IdP Sync config", + "operationId": "update-role-idp-sync-config", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID or name", + "name": "organization", + "in": "path", + "required": true + }, + { + "description": "New config values", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.PatchRoleIDPSyncConfigRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.RoleSyncSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/settings/idpsync/roles/mapping": { + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Update role IdP Sync mapping", + "operationId": "update-role-idp-sync-mapping", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID or name", + "name": "organization", + "in": "path", + "required": true + }, + { + "description": "Description of the mappings to add and remove", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.PatchRoleIDPSyncMappingRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.RoleSyncSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/settings/workspace-sharing": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Get workspace sharing settings for organization", + "operationId": "get-workspace-sharing-settings-for-organization", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceSharingSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Update workspace sharing settings for organization", + "operationId": "update-workspace-sharing-settings-for-organization", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "description": "Workspace sharing settings", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateWorkspaceSharingSettingsRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceSharingSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/templates": { + "get": { + "description": "Returns a list of templates for the specified organization.\nBy default, only non-deprecated templates are returned.\nTo include deprecated templates, specify ` + "`" + `deprecated:true` + "`" + ` in the search query.", + "produces": [ + "application/json" + ], + "tags": [ + "Templates" + ], + "summary": "Get templates by organization", + "operationId": "get-templates-by-organization", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.Template" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Templates" + ], + "summary": "Create template by organization", + "operationId": "create-template-by-organization", + "parameters": [ + { + "description": "Request body", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.CreateTemplateRequest" + } + }, + { + "type": "string", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Template" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/templates/examples": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Templates" + ], + "summary": "Get template examples by organization", + "operationId": "get-template-examples-by-organization", + "deprecated": true, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.TemplateExample" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/templates/{templatename}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Templates" + ], + "summary": "Get templates by organization and template name", + "operationId": "get-templates-by-organization-and-template-name", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Template name", + "name": "templatename", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Template" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/templates/{templatename}/versions/{templateversionname}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Templates" + ], + "summary": "Get template version by organization, template, and name", + "operationId": "get-template-version-by-organization-template-and-name", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Template name", + "name": "templatename", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Template version name", + "name": "templateversionname", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.TemplateVersion" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/templates/{templatename}/versions/{templateversionname}/previous": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Templates" + ], + "summary": "Get previous template version by organization, template, and name", + "operationId": "get-previous-template-version-by-organization-template-and-name", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Template name", + "name": "templatename", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Template version name", + "name": "templateversionname", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.TemplateVersion" + } + }, + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/templateversions": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Templates" + ], + "summary": "Create template version by organization", + "operationId": "create-template-version-by-organization", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "description": "Create template version request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.CreateTemplateVersionRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/codersdk.TemplateVersion" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/prebuilds/settings": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Prebuilds" + ], + "summary": "Get prebuilds settings", + "operationId": "get-prebuilds-settings", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.PrebuildsSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "put": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Prebuilds" + ], + "summary": "Update prebuilds settings", + "operationId": "update-prebuilds-settings", + "parameters": [ + { + "description": "Prebuilds settings request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.PrebuildsSettings" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.PrebuildsSettings" + } + }, + "304": { + "description": "Not Modified" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/provisionerkeys/{provisionerkey}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Fetch provisioner key details", + "operationId": "fetch-provisioner-key-details", + "parameters": [ + { + "type": "string", + "description": "Provisioner Key", + "name": "provisionerkey", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.ProvisionerKey" + } + } + }, + "security": [ + { + "CoderProvisionerKey": [] + } + ] + } + }, + "/api/v2/regions": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "WorkspaceProxies" + ], + "summary": "Get site-wide regions for workspace connections", + "operationId": "get-site-wide-regions-for-workspace-connections", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.RegionsResponse-codersdk_Region" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/replicas": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Get active replicas", + "operationId": "get-active-replicas", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.Replica" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/settings/idpsync/available-fields": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Get the available idp sync claim fields", + "operationId": "get-the-available-idp-sync-claim-fields", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/settings/idpsync/field-values": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Get the idp sync claim field values", + "operationId": "get-the-idp-sync-claim-field-values", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "string", + "description": "Claim Field", + "name": "claimField", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/settings/idpsync/organization": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Get organization IdP Sync settings", + "operationId": "get-organization-idp-sync-settings", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.OrganizationSyncSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Update organization IdP Sync settings", + "operationId": "update-organization-idp-sync-settings", + "parameters": [ + { + "description": "New settings", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.OrganizationSyncSettings" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.OrganizationSyncSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/settings/idpsync/organization/config": { + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Update organization IdP Sync config", + "operationId": "update-organization-idp-sync-config", + "parameters": [ + { + "description": "New config values", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.PatchOrganizationIDPSyncConfigRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.OrganizationSyncSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/settings/idpsync/organization/mapping": { + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Update organization IdP Sync mapping", + "operationId": "update-organization-idp-sync-mapping", + "parameters": [ + { + "description": "Description of the mappings to add and remove", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.PatchOrganizationIDPSyncMappingRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.OrganizationSyncSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/tailnet": { + "get": { + "tags": [ + "Agents" + ], + "summary": "User-scoped tailnet RPC connection", + "operationId": "user-scoped-tailnet-rpc-connection", + "responses": { + "101": { + "description": "Switching Protocols" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/tasks": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Tasks" + ], + "summary": "List AI tasks", + "operationId": "list-ai-tasks", + "parameters": [ + { + "type": "string", + "description": "Search query for filtering tasks. Supports: owner:\u003cusername/uuid/me\u003e, organization:\u003corg-name/uuid\u003e, status:\u003cstatus\u003e", + "name": "q", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.TasksListResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/tasks/{user}": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tasks" + ], + "summary": "Create a new AI task", + "operationId": "create-a-new-ai-task", + "parameters": [ + { + "type": "string", + "description": "Username, user ID, or 'me' for the authenticated user", + "name": "user", + "in": "path", + "required": true + }, + { + "description": "Create task request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.CreateTaskRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/codersdk.Task" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/tasks/{user}/{task}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Tasks" + ], + "summary": "Get AI task by ID or name", + "operationId": "get-ai-task-by-id-or-name", + "parameters": [ + { + "type": "string", + "description": "Username, user ID, or 'me' for the authenticated user", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Task ID, or task name", + "name": "task", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Task" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "delete": { + "tags": [ + "Tasks" + ], + "summary": "Delete AI task", + "operationId": "delete-ai-task", + "parameters": [ + { + "type": "string", + "description": "Username, user ID, or 'me' for the authenticated user", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Task ID, or task name", + "name": "task", + "in": "path", + "required": true + } + ], + "responses": { + "202": { + "description": "Accepted" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/tasks/{user}/{task}/input": { + "patch": { + "consumes": [ + "application/json" + ], + "tags": [ + "Tasks" + ], + "summary": "Update AI task input", + "operationId": "update-ai-task-input", + "parameters": [ + { + "type": "string", + "description": "Username, user ID, or 'me' for the authenticated user", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Task ID, or task name", + "name": "task", + "in": "path", + "required": true + }, + { + "description": "Update task input request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateTaskInputRequest" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/tasks/{user}/{task}/logs": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Tasks" + ], + "summary": "Get AI task logs", + "operationId": "get-ai-task-logs", + "parameters": [ + { + "type": "string", + "description": "Username, user ID, or 'me' for the authenticated user", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Task ID, or task name", + "name": "task", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.TaskLogsResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/tasks/{user}/{task}/pause": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "Tasks" + ], + "summary": "Pause task", + "operationId": "pause-task", + "parameters": [ + { + "type": "string", + "description": "Username, user ID, or 'me' for the authenticated user", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "Task ID", + "name": "task", + "in": "path", + "required": true + } + ], + "responses": { + "202": { + "description": "Accepted", + "schema": { + "$ref": "#/definitions/codersdk.PauseTaskResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/tasks/{user}/{task}/resume": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "Tasks" + ], + "summary": "Resume task", + "operationId": "resume-task", + "parameters": [ + { + "type": "string", + "description": "Username, user ID, or 'me' for the authenticated user", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "Task ID", + "name": "task", + "in": "path", + "required": true + } + ], + "responses": { + "202": { + "description": "Accepted", + "schema": { + "$ref": "#/definitions/codersdk.ResumeTaskResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/tasks/{user}/{task}/send": { + "post": { + "consumes": [ + "application/json" + ], + "tags": [ + "Tasks" + ], + "summary": "Send input to AI task", + "operationId": "send-input-to-ai-task", + "parameters": [ + { + "type": "string", + "description": "Username, user ID, or 'me' for the authenticated user", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Task ID, or task name", + "name": "task", + "in": "path", + "required": true + }, + { + "description": "Task input request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.TaskSendRequest" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templates": { + "get": { + "description": "Returns a list of templates.\nBy default, only non-deprecated templates are returned.\nTo include deprecated templates, specify ` + "`" + `deprecated:true` + "`" + ` in the search query.", + "produces": [ + "application/json" + ], + "tags": [ + "Templates" + ], + "summary": "Get all templates", + "operationId": "get-all-templates", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.Template" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templates/examples": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Templates" + ], + "summary": "Get template examples", + "operationId": "get-template-examples", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.TemplateExample" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templates/{template}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Templates" + ], + "summary": "Get template settings by ID", + "operationId": "get-template-settings-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template ID", + "name": "template", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Template" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "Templates" + ], + "summary": "Delete template by ID", + "operationId": "delete-template-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template ID", + "name": "template", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Templates" + ], + "summary": "Update template settings by ID", + "operationId": "update-template-settings-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template ID", + "name": "template", + "in": "path", + "required": true + }, + { + "description": "Patch template settings request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateTemplateMeta" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Template" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templates/{template}/acl": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Get template ACLs", + "operationId": "get-template-acls", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template ID", + "name": "template", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.TemplateACL" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Update template ACL", + "operationId": "update-template-acl", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template ID", + "name": "template", + "in": "path", + "required": true + }, + { + "description": "Update template ACL request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateTemplateACL" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templates/{template}/acl/available": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Get template available acl users/groups", + "operationId": "get-template-available-acl-usersgroups", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template ID", + "name": "template", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.ACLAvailable" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templates/{template}/daus": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Templates" + ], + "summary": "Get template DAUs by ID", + "operationId": "get-template-daus-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template ID", + "name": "template", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.DAUsResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templates/{template}/prebuilds/invalidate": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Invalidate presets for template", + "operationId": "invalidate-presets-for-template", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template ID", + "name": "template", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.InvalidatePresetsResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templates/{template}/versions": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Templates" + ], + "summary": "List template versions by template ID", + "operationId": "list-template-versions-by-template-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template ID", + "name": "template", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "After ID", + "name": "after_id", + "in": "query" + }, + { + "type": "boolean", + "description": "Include archived versions in the list", + "name": "include_archived", + "in": "query" + }, + { + "type": "integer", + "description": "Page limit", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Page offset", + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.TemplateVersion" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Templates" + ], + "summary": "Update active template version by template ID", + "operationId": "update-active-template-version-by-template-id", + "parameters": [ + { + "description": "Modified template version", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateActiveTemplateVersion" + } + }, + { + "type": "string", + "format": "uuid", + "description": "Template ID", + "name": "template", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templates/{template}/versions/archive": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Templates" + ], + "summary": "Archive template unused versions by template id", + "operationId": "archive-template-unused-versions-by-template-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template ID", + "name": "template", + "in": "path", + "required": true + }, + { + "description": "Archive request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.ArchiveTemplateVersionsRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templates/{template}/versions/{templateversionname}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Templates" + ], + "summary": "Get template version by template ID and name", + "operationId": "get-template-version-by-template-id-and-name", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template ID", + "name": "template", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Template version name", + "name": "templateversionname", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.TemplateVersion" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Templates" + ], + "summary": "Get template version by ID", + "operationId": "get-template-version-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.TemplateVersion" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Templates" + ], + "summary": "Patch template version by ID", + "operationId": "patch-template-version-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + }, + { + "description": "Patch template version request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.PatchTemplateVersionRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.TemplateVersion" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/archive": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "Templates" + ], + "summary": "Archive template version", + "operationId": "archive-template-version", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/cancel": { + "patch": { + "produces": [ + "application/json" + ], + "tags": [ + "Templates" + ], + "summary": "Cancel template version by ID", + "operationId": "cancel-template-version-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/dry-run": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Templates" + ], + "summary": "Create template version dry-run", + "operationId": "create-template-version-dry-run", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + }, + { + "description": "Dry-run request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.CreateTemplateVersionDryRunRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/codersdk.ProvisionerJob" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/dry-run/{jobID}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Templates" + ], + "summary": "Get template version dry-run by job ID", + "operationId": "get-template-version-dry-run-by-job-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "Job ID", + "name": "jobID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.ProvisionerJob" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/dry-run/{jobID}/cancel": { + "patch": { + "produces": [ + "application/json" + ], + "tags": [ + "Templates" + ], + "summary": "Cancel template version dry-run by job ID", + "operationId": "cancel-template-version-dry-run-by-job-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Job ID", + "name": "jobID", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/dry-run/{jobID}/logs": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Templates" + ], + "summary": "Get template version dry-run logs by job ID", + "operationId": "get-template-version-dry-run-logs-by-job-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "Job ID", + "name": "jobID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Before Unix timestamp", + "name": "before", + "in": "query" + }, + { + "type": "integer", + "description": "After Unix timestamp", + "name": "after", + "in": "query" + }, + { + "type": "boolean", + "description": "Follow log stream", + "name": "follow", + "in": "query" + }, + { + "enum": [ + "json", + "text" + ], + "type": "string", + "description": "Log output format. Accepted: 'json' (default), 'text' (plain text with RFC3339 timestamps and ANSI colors). Not supported with follow=true.", + "name": "format", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.ProvisionerJobLog" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/dry-run/{jobID}/matched-provisioners": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Templates" + ], + "summary": "Get template version dry-run matched provisioners", + "operationId": "get-template-version-dry-run-matched-provisioners", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "Job ID", + "name": "jobID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.MatchedProvisioners" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/dry-run/{jobID}/resources": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Templates" + ], + "summary": "Get template version dry-run resources by job ID", + "operationId": "get-template-version-dry-run-resources-by-job-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "Job ID", + "name": "jobID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.WorkspaceResource" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/dynamic-parameters": { + "get": { + "tags": [ + "Templates" + ], + "summary": "Open dynamic parameters WebSocket by template version", + "operationId": "open-dynamic-parameters-websocket-by-template-version", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + } + ], + "responses": { + "101": { + "description": "Switching Protocols" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/dynamic-parameters/evaluate": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Templates" + ], + "summary": "Evaluate dynamic parameters for template version", + "operationId": "evaluate-dynamic-parameters-for-template-version", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + }, + { + "description": "Initial parameter values", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.DynamicParametersRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.DynamicParametersResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/external-auth": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Templates" + ], + "summary": "Get external auth by template version", + "operationId": "get-external-auth-by-template-version", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.TemplateVersionExternalAuth" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/logs": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Templates" + ], + "summary": "Get logs by template version", + "operationId": "get-logs-by-template-version", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Before log id", + "name": "before", + "in": "query" + }, + { + "type": "integer", + "description": "After log id", + "name": "after", + "in": "query" + }, + { + "type": "boolean", + "description": "Follow log stream", + "name": "follow", + "in": "query" + }, + { + "enum": [ + "json", + "text" + ], + "type": "string", + "description": "Log output format. Accepted: 'json' (default), 'text' (plain text with RFC3339 timestamps and ANSI colors). Not supported with follow=true.", + "name": "format", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.ProvisionerJobLog" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/parameters": { + "get": { + "tags": [ + "Templates" + ], + "summary": "Removed: Get parameters by template version", + "operationId": "removed-get-parameters-by-template-version", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/presets": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Templates" + ], + "summary": "Get template version presets", + "operationId": "get-template-version-presets", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.Preset" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/resources": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Templates" + ], + "summary": "Get resources by template version", + "operationId": "get-resources-by-template-version", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.WorkspaceResource" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/rich-parameters": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Templates" + ], + "summary": "Get rich parameters by template version", + "operationId": "get-rich-parameters-by-template-version", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.TemplateVersionParameter" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/schema": { + "get": { + "tags": [ + "Templates" + ], + "summary": "Removed: Get schema by template version", + "operationId": "removed-get-schema-by-template-version", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/unarchive": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "Templates" + ], + "summary": "Unarchive template version", + "operationId": "unarchive-template-version", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/variables": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Templates" + ], + "summary": "Get template variables by template version", + "operationId": "get-template-variables-by-template-version", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.TemplateVersionVariable" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/updatecheck": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "General" + ], + "summary": "Update check", + "operationId": "update-check", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.UpdateCheckResponse" + } + } + } + } + }, + "/api/v2/users": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Get users", + "operationId": "get-users", + "parameters": [ + { + "type": "string", + "description": "Search query", + "name": "q", + "in": "query" + }, + { + "type": "string", + "format": "uuid", + "description": "After ID", + "name": "after_id", + "in": "query" + }, + { + "type": "integer", + "description": "Page limit", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Page offset", + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.GetUsersResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Create new user", + "operationId": "create-new-user", + "parameters": [ + { + "description": "Create user request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.CreateUserRequestWithOrgs" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/codersdk.User" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/authmethods": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Get authentication methods", + "operationId": "get-authentication-methods", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.AuthMethods" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/first": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Check initial user created", + "operationId": "check-initial-user-created", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Create initial user", + "operationId": "create-initial-user", + "parameters": [ + { + "description": "First user request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.CreateFirstUserRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/codersdk.CreateFirstUserResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/login": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Authorization" + ], + "summary": "Log in user", + "operationId": "log-in-user", + "parameters": [ + { + "description": "Login request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.LoginWithPasswordRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/codersdk.LoginWithPasswordResponse" + } + } + } + } + }, + "/api/v2/users/logout": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Log out user", + "operationId": "log-out-user", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/oauth2/github/callback": { + "get": { + "tags": [ + "Users" + ], + "summary": "OAuth 2.0 GitHub Callback", + "operationId": "oauth-20-github-callback", + "responses": { + "307": { + "description": "Temporary Redirect" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/oauth2/github/device": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Get Github device auth.", + "operationId": "get-github-device-auth", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.ExternalAuthDevice" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/oidc-claims": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Get OIDC claims for the authenticated user", + "operationId": "get-oidc-claims-for-the-authenticated-user", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.OIDCClaimsResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/oidc/callback": { + "get": { + "tags": [ + "Users" + ], + "summary": "OpenID Connect Callback", + "operationId": "openid-connect-callback", + "responses": { + "307": { + "description": "Temporary Redirect" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/otp/change-password": { + "post": { + "consumes": [ + "application/json" + ], + "tags": [ + "Authorization" + ], + "summary": "Change password with a one-time passcode", + "operationId": "change-password-with-a-one-time-passcode", + "parameters": [ + { + "description": "Change password request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.ChangePasswordWithOneTimePasscodeRequest" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/api/v2/users/otp/request": { + "post": { + "consumes": [ + "application/json" + ], + "tags": [ + "Authorization" + ], + "summary": "Request one-time passcode", + "operationId": "request-one-time-passcode", + "parameters": [ + { + "description": "One-time passcode request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.RequestOneTimePasscodeRequest" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/api/v2/users/roles": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Members" + ], + "summary": "Get site member roles", + "operationId": "get-site-member-roles", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.AssignableRoles" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/validate-password": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Authorization" + ], + "summary": "Validate user password", + "operationId": "validate-user-password", + "parameters": [ + { + "description": "Validate user password request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.ValidateUserPasswordRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.ValidateUserPasswordResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Get user by name", + "operationId": "get-user-by-name", + "parameters": [ + { + "type": "string", + "description": "User ID, username, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.User" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "delete": { + "tags": [ + "Users" + ], + "summary": "Delete user", + "operationId": "delete-user", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/appearance": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Get user appearance settings", + "operationId": "get-user-appearance-settings", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.UserAppearanceSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "put": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Update user appearance settings", + "operationId": "update-user-appearance-settings", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "description": "New appearance settings", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateUserAppearanceSettingsRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.UserAppearanceSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/autofill-parameters": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Get autofill build parameters for user", + "operationId": "get-autofill-build-parameters-for-user", + "parameters": [ + { + "type": "string", + "description": "User ID, username, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Template ID", + "name": "template_id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.UserParameter" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/convert-login": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Authorization" + ], + "summary": "Convert user from password to oauth authentication", + "operationId": "convert-user-from-password-to-oauth-authentication", + "parameters": [ + { + "description": "Convert request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.ConvertLoginRequest" + } + }, + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/codersdk.OAuthConversionResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/gitsshkey": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Get user Git SSH key", + "operationId": "get-user-git-ssh-key", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.GitSSHKey" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "put": { + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Regenerate user SSH key", + "operationId": "regenerate-user-ssh-key", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.GitSSHKey" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/keys": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Create new session key", + "operationId": "create-new-session-key", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/codersdk.GenerateAPIKeyResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/keys/tokens": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Get user tokens", + "operationId": "get-user-tokens", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "boolean", + "description": "Include expired tokens in the list", + "name": "include_expired", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.APIKey" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Create token API key", + "operationId": "create-token-api-key", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "description": "Create token request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.CreateTokenRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/codersdk.GenerateAPIKeyResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/keys/tokens/tokenconfig": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "General" + ], + "summary": "Get token config", + "operationId": "get-token-config", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.TokenConfig" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/keys/tokens/{keyname}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Get API key by token name", + "operationId": "get-api-key-by-token-name", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "string", + "description": "Key Name", + "name": "keyname", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.APIKey" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/keys/{keyid}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Get API key by ID", + "operationId": "get-api-key-by-id", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "string", + "description": "Key ID", + "name": "keyid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.APIKey" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "delete": { + "tags": [ + "Users" + ], + "summary": "Delete API key", + "operationId": "delete-api-key", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "string", + "description": "Key ID", + "name": "keyid", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/keys/{keyid}/expire": { + "put": { + "tags": [ + "Users" + ], + "summary": "Expire API key", + "operationId": "expire-api-key", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "string", + "description": "Key ID", + "name": "keyid", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/login-type": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Get user login type", + "operationId": "get-user-login-type", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.UserLoginType" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/notifications/preferences": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Notifications" + ], + "summary": "Get user notification preferences", + "operationId": "get-user-notification-preferences", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.NotificationPreference" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "put": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Notifications" + ], + "summary": "Update user notification preferences", + "operationId": "update-user-notification-preferences", + "parameters": [ + { + "description": "Preferences", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateUserNotificationPreferences" + } + }, + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.NotificationPreference" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/organizations": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Get organizations by user", + "operationId": "get-organizations-by-user", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.Organization" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/organizations/{organizationname}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Get organization by user and organization name", + "operationId": "get-organization-by-user-and-organization-name", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Organization name", + "name": "organizationname", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Organization" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/password": { + "put": { + "consumes": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Update user password", + "operationId": "update-user-password", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "description": "Update password request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateUserPasswordRequest" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/preferences": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Get user preference settings", + "operationId": "get-user-preference-settings", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.UserPreferenceSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "put": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Update user preference settings", + "operationId": "update-user-preference-settings", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "description": "New preference settings", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateUserPreferenceSettingsRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.UserPreferenceSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/profile": { + "put": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Update user profile", + "operationId": "update-user-profile", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "description": "Updated profile", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateUserProfileRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.User" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/quiet-hours": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Get user quiet hours schedule", + "operationId": "get-user-quiet-hours-schedule", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "User ID", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.UserQuietHoursScheduleResponse" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "put": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Update user quiet hours schedule", + "operationId": "update-user-quiet-hours-schedule", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "User ID", + "name": "user", + "in": "path", + "required": true + }, + { + "description": "Update schedule request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateUserQuietHoursScheduleRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.UserQuietHoursScheduleResponse" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/roles": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Get user roles", + "operationId": "get-user-roles", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.User" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "put": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Assign role to user", + "operationId": "assign-role-to-user", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "description": "Update roles request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateRoles" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.User" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/secrets": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Secrets" + ], + "summary": "List user secrets", + "operationId": "list-user-secrets", + "parameters": [ + { + "type": "string", + "description": "User ID, username, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.UserSecret" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Secrets" + ], + "summary": "Create a new user secret", + "operationId": "create-a-new-user-secret", + "parameters": [ + { + "type": "string", + "description": "User ID, username, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "description": "Create secret request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.CreateUserSecretRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/codersdk.UserSecret" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/secrets/{name}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Secrets" + ], + "summary": "Get a user secret by name", + "operationId": "get-a-user-secret-by-name", + "parameters": [ + { + "type": "string", + "description": "User ID, username, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Secret name", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.UserSecret" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "delete": { + "tags": [ + "Secrets" + ], + "summary": "Delete a user secret", + "operationId": "delete-a-user-secret", + "parameters": [ + { + "type": "string", + "description": "User ID, username, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Secret name", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Secrets" + ], + "summary": "Update a user secret", + "operationId": "update-a-user-secret", + "parameters": [ + { + "type": "string", + "description": "User ID, username, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Secret name", + "name": "name", + "in": "path", + "required": true + }, + { + "description": "Update secret request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateUserSecretRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.UserSecret" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/status/activate": { + "put": { + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Activate user account", + "operationId": "activate-user-account", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.User" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/status/suspend": { + "put": { + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Suspend user account", + "operationId": "suspend-user-account", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.User" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/webpush/subscription": { + "post": { + "consumes": [ + "application/json" + ], + "tags": [ + "Notifications" + ], + "summary": "Create user webpush subscription", + "operationId": "create-user-webpush-subscription", + "parameters": [ + { + "description": "Webpush subscription", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.WebpushSubscription" + } + }, + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + }, + "delete": { + "consumes": [ + "application/json" + ], + "tags": [ + "Notifications" + ], + "summary": "Delete user webpush subscription", + "operationId": "delete-user-webpush-subscription", + "parameters": [ + { + "description": "Webpush subscription", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.DeleteWebpushSubscription" + } + }, + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/users/{user}/webpush/test": { + "post": { + "tags": [ + "Notifications" + ], + "summary": "Send a test push notification", + "operationId": "send-a-test-push-notification", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/users/{user}/workspace/{workspacename}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Workspaces" + ], + "summary": "Get workspace metadata by user and workspace name", + "operationId": "get-workspace-metadata-by-user-and-workspace-name", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Workspace name", + "name": "workspacename", + "in": "path", + "required": true + }, + { + "type": "boolean", + "description": "Return data instead of HTTP 404 if the workspace is deleted", + "name": "include_deleted", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Workspace" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/workspace/{workspacename}/builds/{buildnumber}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Builds" + ], + "summary": "Get workspace build by user, workspace name, and build number", + "operationId": "get-workspace-build-by-user-workspace-name-and-build-number", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Workspace name", + "name": "workspacename", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "number", + "description": "Build number", + "name": "buildnumber", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceBuild" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/workspaces": { + "post": { + "description": "Create a new workspace using a template. The request must\nspecify either the Template ID or the Template Version ID,\nnot both. If the Template ID is specified, the active version\nof the template will be used.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Workspaces" + ], + "summary": "Create user workspace", + "operationId": "create-user-workspace", + "parameters": [ + { + "type": "string", + "description": "Username, UUID, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "description": "Create workspace request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.CreateWorkspaceRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Workspace" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspace-quota/{user}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Get workspace quota by user deprecated", + "operationId": "get-workspace-quota-by-user-deprecated", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceQuota" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/aws-instance-identity": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Agents" + ], + "summary": "Authenticate agent on AWS instance", + "operationId": "authenticate-agent-on-aws-instance", + "parameters": [ + { + "description": "Instance identity token. The optional agent_name field disambiguates when multiple agents share the same instance ID.", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/agentsdk.AWSInstanceIdentityToken" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/agentsdk.AuthenticateResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/azure-instance-identity": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Agents" + ], + "summary": "Authenticate agent on Azure instance", + "operationId": "authenticate-agent-on-azure-instance", + "parameters": [ + { + "description": "Instance identity token. The optional agent_name field disambiguates when multiple agents share the same instance ID.", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/agentsdk.AzureInstanceIdentityToken" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/agentsdk.AuthenticateResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/connection": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Agents" + ], + "summary": "Get connection info for workspace agent generic", + "operationId": "get-connection-info-for-workspace-agent-generic", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/workspacesdk.AgentConnectionInfo" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/workspaceagents/google-instance-identity": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Agents" + ], + "summary": "Authenticate agent on Google Cloud instance", + "operationId": "authenticate-agent-on-google-cloud-instance", + "parameters": [ + { + "description": "Instance identity token. The optional agent_name field disambiguates when multiple agents share the same instance ID.", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/agentsdk.GoogleInstanceIdentityToken" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/agentsdk.AuthenticateResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/me/app-status": { + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Agents" + ], + "summary": "Patch workspace agent app status", + "operationId": "patch-workspace-agent-app-status", + "deprecated": true, + "parameters": [ + { + "description": "app status", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/agentsdk.PatchAppStatus" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/me/external-auth": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Agents" + ], + "summary": "Get workspace agent external auth", + "operationId": "get-workspace-agent-external-auth", + "parameters": [ + { + "type": "string", + "description": "Match", + "name": "match", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "Provider ID", + "name": "id", + "in": "query", + "required": true + }, + { + "type": "boolean", + "description": "Wait for a new token to be issued", + "name": "listen", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/agentsdk.ExternalAuthResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/me/gitauth": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Agents" + ], + "summary": "Removed: Get workspace agent git auth", + "operationId": "removed-get-workspace-agent-git-auth", + "parameters": [ + { + "type": "string", + "description": "Match", + "name": "match", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "Provider ID", + "name": "id", + "in": "query", + "required": true + }, + { + "type": "boolean", + "description": "Wait for a new token to be issued", + "name": "listen", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/agentsdk.ExternalAuthResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/me/gitsshkey": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Agents" + ], + "summary": "Get workspace agent Git SSH key", + "operationId": "get-workspace-agent-git-ssh-key", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/agentsdk.GitSSHKey" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/me/log-source": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Agents" + ], + "summary": "Post workspace agent log source", + "operationId": "post-workspace-agent-log-source", + "parameters": [ + { + "description": "Log source request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/agentsdk.PostLogSourceRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceAgentLogSource" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/me/logs": { + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Agents" + ], + "summary": "Patch workspace agent logs", + "operationId": "patch-workspace-agent-logs", + "parameters": [ + { + "description": "logs", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/agentsdk.PatchLogs" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/me/reinit": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Agents" + ], + "summary": "Get workspace agent reinitialization", + "operationId": "get-workspace-agent-reinitialization", + "parameters": [ + { + "type": "boolean", + "description": "Opt in to durable reinit checks", + "name": "wait", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/agentsdk.ReinitializationEvent" + } + }, + "409": { + "description": "Conflict", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/me/rpc": { + "get": { + "tags": [ + "Agents" + ], + "summary": "Workspace agent RPC API", + "operationId": "workspace-agent-rpc-api", + "responses": { + "101": { + "description": "Switching Protocols" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/workspaceagents/me/tasks/{task}/log-snapshot": { + "post": { + "consumes": [ + "application/json" + ], + "tags": [ + "Tasks" + ], + "summary": "Upload task log snapshot", + "operationId": "upload-task-log-snapshot", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Task ID", + "name": "task", + "in": "path", + "required": true + }, + { + "enum": [ + "agentapi" + ], + "type": "string", + "description": "Snapshot format", + "name": "format", + "in": "query", + "required": true + }, + { + "description": "Raw snapshot payload (structure depends on format parameter)", + "name": "request", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/{workspaceagent}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Agents" + ], + "summary": "Get workspace agent by ID", + "operationId": "get-workspace-agent-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace agent ID", + "name": "workspaceagent", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceAgent" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/{workspaceagent}/connection": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Agents" + ], + "summary": "Get connection info for workspace agent", + "operationId": "get-connection-info-for-workspace-agent", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace agent ID", + "name": "workspaceagent", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/workspacesdk.AgentConnectionInfo" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/{workspaceagent}/containers": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Agents" + ], + "summary": "Get running containers for workspace agent", + "operationId": "get-running-containers-for-workspace-agent", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace agent ID", + "name": "workspaceagent", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "key=value", + "description": "Labels", + "name": "label", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceAgentListContainersResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/{workspaceagent}/containers/devcontainers/{devcontainer}": { + "delete": { + "tags": [ + "Agents" + ], + "summary": "Delete devcontainer for workspace agent", + "operationId": "delete-devcontainer-for-workspace-agent", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace agent ID", + "name": "workspaceagent", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Devcontainer ID", + "name": "devcontainer", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/{workspaceagent}/containers/devcontainers/{devcontainer}/recreate": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "Agents" + ], + "summary": "Recreate devcontainer for workspace agent", + "operationId": "recreate-devcontainer-for-workspace-agent", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace agent ID", + "name": "workspaceagent", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Devcontainer ID", + "name": "devcontainer", + "in": "path", + "required": true + } + ], + "responses": { + "202": { + "description": "Accepted", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/{workspaceagent}/containers/watch": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Agents" + ], + "summary": "Watch workspace agent for container updates.", + "operationId": "watch-workspace-agent-for-container-updates", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace agent ID", + "name": "workspaceagent", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceAgentListContainersResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/{workspaceagent}/coordinate": { + "get": { + "tags": [ + "Agents" + ], + "summary": "Coordinate workspace agent", + "operationId": "coordinate-workspace-agent", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace agent ID", + "name": "workspaceagent", + "in": "path", + "required": true + } + ], + "responses": { + "101": { + "description": "Switching Protocols" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/{workspaceagent}/listening-ports": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Agents" + ], + "summary": "Get listening ports for workspace agent", + "operationId": "get-listening-ports-for-workspace-agent", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace agent ID", + "name": "workspaceagent", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceAgentListeningPortsResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/{workspaceagent}/logs": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Agents" + ], + "summary": "Get logs by workspace agent", + "operationId": "get-logs-by-workspace-agent", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace agent ID", + "name": "workspaceagent", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Before log id", + "name": "before", + "in": "query" + }, + { + "type": "integer", + "description": "After log id", + "name": "after", + "in": "query" + }, + { + "type": "boolean", + "description": "Follow log stream", + "name": "follow", + "in": "query" + }, + { + "type": "boolean", + "description": "Disable compression for WebSocket connection", + "name": "no_compression", + "in": "query" + }, + { + "enum": [ + "json", + "text" + ], + "type": "string", + "description": "Log output format. Accepted: 'json' (default), 'text' (plain text with RFC3339 timestamps and ANSI colors). Not supported with follow=true.", + "name": "format", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.WorkspaceAgentLog" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/{workspaceagent}/pty": { + "get": { + "tags": [ + "Agents" + ], + "summary": "Open PTY to workspace agent", + "operationId": "open-pty-to-workspace-agent", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace agent ID", + "name": "workspaceagent", + "in": "path", + "required": true + } + ], + "responses": { + "101": { + "description": "Switching Protocols" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/{workspaceagent}/startup-logs": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Agents" + ], + "summary": "Removed: Get logs by workspace agent", + "operationId": "removed-get-logs-by-workspace-agent", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace agent ID", + "name": "workspaceagent", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Before log id", + "name": "before", + "in": "query" + }, + { + "type": "integer", + "description": "After log id", + "name": "after", + "in": "query" + }, + { + "type": "boolean", + "description": "Follow log stream", + "name": "follow", + "in": "query" + }, + { + "type": "boolean", + "description": "Disable compression for WebSocket connection", + "name": "no_compression", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.WorkspaceAgentLog" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/{workspaceagent}/watch-metadata": { + "get": { + "tags": [ + "Agents" + ], + "summary": "Watch for workspace agent metadata updates", + "operationId": "watch-for-workspace-agent-metadata-updates", + "deprecated": true, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace agent ID", + "name": "workspaceagent", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/workspaceagents/{workspaceagent}/watch-metadata-ws": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Agents" + ], + "summary": "Watch for workspace agent metadata updates via WebSockets", + "operationId": "watch-for-workspace-agent-metadata-updates-via-websockets", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace agent ID", + "name": "workspaceagent", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.ServerSentEvent" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/workspacebuilds/{workspacebuild}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Builds" + ], + "summary": "Get workspace build", + "operationId": "get-workspace-build", + "parameters": [ + { + "type": "string", + "description": "Workspace build ID", + "name": "workspacebuild", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceBuild" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspacebuilds/{workspacebuild}/cancel": { + "patch": { + "produces": [ + "application/json" + ], + "tags": [ + "Builds" + ], + "summary": "Cancel workspace build", + "operationId": "cancel-workspace-build", + "parameters": [ + { + "type": "string", + "description": "Workspace build ID", + "name": "workspacebuild", + "in": "path", + "required": true + }, + { + "enum": [ + "running", + "pending" + ], + "type": "string", + "description": "Expected status of the job. If expect_status is supplied, the request will be rejected with 412 Precondition Failed if the job doesn't match the state when performing the cancellation.", + "name": "expect_status", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspacebuilds/{workspacebuild}/logs": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Builds" + ], + "summary": "Get workspace build logs", + "operationId": "get-workspace-build-logs", + "parameters": [ + { + "type": "string", + "description": "Workspace build ID", + "name": "workspacebuild", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Before log id", + "name": "before", + "in": "query" + }, + { + "type": "integer", + "description": "After log id", + "name": "after", + "in": "query" + }, + { + "type": "boolean", + "description": "Follow log stream", + "name": "follow", + "in": "query" + }, + { + "enum": [ + "json", + "text" + ], + "type": "string", + "description": "Log output format. Accepted: 'json' (default), 'text' (plain text with RFC3339 timestamps and ANSI colors). Not supported with follow=true.", + "name": "format", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.ProvisionerJobLog" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspacebuilds/{workspacebuild}/parameters": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Builds" + ], + "summary": "Get build parameters for workspace build", + "operationId": "get-build-parameters-for-workspace-build", + "parameters": [ + { + "type": "string", + "description": "Workspace build ID", + "name": "workspacebuild", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.WorkspaceBuildParameter" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspacebuilds/{workspacebuild}/resources": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Builds" + ], + "summary": "Removed: Get workspace resources for workspace build", + "operationId": "removed-get-workspace-resources-for-workspace-build", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "Workspace build ID", + "name": "workspacebuild", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.WorkspaceResource" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspacebuilds/{workspacebuild}/state": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Builds" + ], + "summary": "Get provisioner state for workspace build", + "operationId": "get-provisioner-state-for-workspace-build", + "parameters": [ + { + "type": "string", + "description": "Workspace build ID", + "name": "workspacebuild", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceBuild" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "put": { + "consumes": [ + "application/json" + ], + "tags": [ + "Builds" + ], + "summary": "Update workspace build state", + "operationId": "update-workspace-build-state", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace build ID", + "name": "workspacebuild", + "in": "path", + "required": true + }, + { + "description": "Request body", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateWorkspaceBuildStateRequest" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspacebuilds/{workspacebuild}/timings": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Builds" + ], + "summary": "Get workspace build timings by ID", + "operationId": "get-workspace-build-timings-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace build ID", + "name": "workspacebuild", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceBuildTimings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceproxies": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Get workspace proxies", + "operationId": "get-workspace-proxies", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.RegionsResponse-codersdk_WorkspaceProxy" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Create workspace proxy", + "operationId": "create-workspace-proxy", + "parameters": [ + { + "description": "Create workspace proxy request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.CreateWorkspaceProxyRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceProxy" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceproxies/me/app-stats": { + "post": { + "consumes": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Report workspace app stats", + "operationId": "report-workspace-app-stats", + "parameters": [ + { + "description": "Report app stats request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/wsproxysdk.ReportAppStatsRequest" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/workspaceproxies/me/coordinate": { + "get": { + "tags": [ + "Enterprise" + ], + "summary": "Workspace Proxy Coordinate", + "operationId": "workspace-proxy-coordinate", + "responses": { + "101": { + "description": "Switching Protocols" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/workspaceproxies/me/crypto-keys": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Get workspace proxy crypto keys", + "operationId": "get-workspace-proxy-crypto-keys", + "parameters": [ + { + "type": "string", + "description": "Feature key", + "name": "feature", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/wsproxysdk.CryptoKeysResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/workspaceproxies/me/deregister": { + "post": { + "consumes": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Deregister workspace proxy", + "operationId": "deregister-workspace-proxy", + "parameters": [ + { + "description": "Deregister workspace proxy request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/wsproxysdk.DeregisterWorkspaceProxyRequest" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/workspaceproxies/me/issue-signed-app-token": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Issue signed workspace app token", + "operationId": "issue-signed-workspace-app-token", + "parameters": [ + { + "description": "Issue signed app token request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/workspaceapps.IssueTokenRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/wsproxysdk.IssueSignedAppTokenResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/workspaceproxies/me/register": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Register workspace proxy", + "operationId": "register-workspace-proxy", + "parameters": [ + { + "description": "Register workspace proxy request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/wsproxysdk.RegisterWorkspaceProxyRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/wsproxysdk.RegisterWorkspaceProxyResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/workspaceproxies/{workspaceproxy}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Get workspace proxy", + "operationId": "get-workspace-proxy", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Proxy ID or name", + "name": "workspaceproxy", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceProxy" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Delete workspace proxy", + "operationId": "delete-workspace-proxy", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Proxy ID or name", + "name": "workspaceproxy", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Update workspace proxy", + "operationId": "update-workspace-proxy", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Proxy ID or name", + "name": "workspaceproxy", + "in": "path", + "required": true + }, + { + "description": "Update workspace proxy request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.PatchWorkspaceProxy" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceProxy" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaces": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Workspaces" + ], + "summary": "List workspaces", + "operationId": "list-workspaces", + "parameters": [ + { + "type": "string", + "description": "Search query in the format ` + "`" + `key:value` + "`" + `. Available keys are: owner, template, name, status, has-agent, dormant, last_used_after, last_used_before, has-ai-task, has_external_agent, healthy.", + "name": "q", + "in": "query" + }, + { + "type": "integer", + "description": "Page limit", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Page offset", + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspacesResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaces/{workspace}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Workspaces" + ], + "summary": "Get workspace metadata by ID", + "operationId": "get-workspace-metadata-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + }, + { + "type": "boolean", + "description": "Return data instead of HTTP 404 if the workspace is deleted", + "name": "include_deleted", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Workspace" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "patch": { + "consumes": [ + "application/json" + ], + "tags": [ + "Workspaces" + ], + "summary": "Update workspace metadata by ID", + "operationId": "update-workspace-metadata-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + }, + { + "description": "Metadata update request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateWorkspaceRequest" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaces/{workspace}/acl": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Workspaces" + ], + "summary": "Get workspace ACLs", + "operationId": "get-workspace-acls", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceACL" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "delete": { + "tags": [ + "Workspaces" + ], + "summary": "Completely clears the workspace's user and group ACLs.", + "operationId": "completely-clears-the-workspaces-user-and-group-acls", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Workspaces" + ], + "summary": "Update workspace ACL", + "operationId": "update-workspace-acl", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + }, + { + "description": "Update workspace ACL request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateWorkspaceACL" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaces/{workspace}/autostart": { + "put": { + "consumes": [ + "application/json" + ], + "tags": [ + "Workspaces" + ], + "summary": "Update workspace autostart schedule by ID", + "operationId": "update-workspace-autostart-schedule-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + }, + { + "description": "Schedule update request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateWorkspaceAutostartRequest" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaces/{workspace}/autoupdates": { + "put": { + "consumes": [ + "application/json" + ], + "tags": [ + "Workspaces" + ], + "summary": "Update workspace automatic updates by ID", + "operationId": "update-workspace-automatic-updates-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + }, + { + "description": "Automatic updates request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateWorkspaceAutomaticUpdatesRequest" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaces/{workspace}/builds": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Builds" + ], + "summary": "Get workspace builds by workspace ID", + "operationId": "get-workspace-builds-by-workspace-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "After ID", + "name": "after_id", + "in": "query" + }, + { + "type": "integer", + "description": "Page limit", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Page offset", + "name": "offset", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "description": "Since timestamp", + "name": "since", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.WorkspaceBuild" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Builds" + ], + "summary": "Create workspace build", + "operationId": "create-workspace-build", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + }, + { + "description": "Create workspace build request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.CreateWorkspaceBuildRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceBuild" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaces/{workspace}/dormant": { + "put": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Workspaces" + ], + "summary": "Update workspace dormancy status by id.", + "operationId": "update-workspace-dormancy-status-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + }, + { + "description": "Make a workspace dormant or active", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateWorkspaceDormancy" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Workspace" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaces/{workspace}/extend": { + "put": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Workspaces" + ], + "summary": "Extend workspace deadline by ID", + "operationId": "extend-workspace-deadline-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + }, + { + "description": "Extend deadline update request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.PutExtendWorkspaceRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaces/{workspace}/external-agent/{agent}/credentials": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Get workspace external agent credentials", + "operationId": "get-workspace-external-agent-credentials", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Agent name", + "name": "agent", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.ExternalAgentCredentials" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaces/{workspace}/favorite": { + "put": { + "tags": [ + "Workspaces" + ], + "summary": "Favorite workspace by ID.", + "operationId": "favorite-workspace-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "delete": { + "tags": [ + "Workspaces" + ], + "summary": "Unfavorite workspace by ID.", + "operationId": "unfavorite-workspace-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaces/{workspace}/port-share": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "PortSharing" + ], + "summary": "Get workspace agent port shares", + "operationId": "get-workspace-agent-port-shares", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceAgentPortShares" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "PortSharing" + ], + "summary": "Upsert workspace agent port share", + "operationId": "upsert-workspace-agent-port-share", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + }, + { + "description": "Upsert port sharing level request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpsertWorkspaceAgentPortShareRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceAgentPortShare" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "delete": { + "consumes": [ + "application/json" + ], + "tags": [ + "PortSharing" + ], + "summary": "Delete workspace agent port share", + "operationId": "delete-workspace-agent-port-share", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + }, + { + "description": "Delete port sharing level request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.DeleteWorkspaceAgentPortShareRequest" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaces/{workspace}/resolve-autostart": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Workspaces" + ], + "summary": "Resolve workspace autostart by id.", + "operationId": "resolve-workspace-autostart-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.ResolveAutostartResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaces/{workspace}/timings": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Workspaces" + ], + "summary": "Get workspace timings by ID", + "operationId": "get-workspace-timings-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceBuildTimings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaces/{workspace}/ttl": { + "put": { + "consumes": [ + "application/json" + ], + "tags": [ + "Workspaces" + ], + "summary": "Update workspace TTL by ID", + "operationId": "update-workspace-ttl-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + }, + { + "description": "Workspace TTL update request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateWorkspaceTTLRequest" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaces/{workspace}/usage": { + "post": { + "consumes": [ + "application/json" + ], + "tags": [ + "Workspaces" + ], + "summary": "Post Workspace Usage by ID", + "operationId": "post-workspace-usage-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + }, + { + "description": "Post workspace usage request", + "name": "request", + "in": "body", + "schema": { + "$ref": "#/definitions/codersdk.PostWorkspaceUsageRequest" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaces/{workspace}/watch": { + "get": { + "produces": [ + "text/event-stream" + ], + "tags": [ + "Workspaces" + ], + "summary": "Watch workspace by ID", + "operationId": "watch-workspace-by-id", + "deprecated": true, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaces/{workspace}/watch-ws": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Workspaces" + ], + "summary": "Watch workspace by ID via WebSockets", + "operationId": "watch-workspace-by-id-via-websockets", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.ServerSentEvent" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, "/oauth2/authorize": { "get": { "tags": [ @@ -3347,2339 +12586,6 @@ const docTemplate = `{ ] } }, - "/organizations": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Organizations" - ], - "summary": "Get organizations", - "operationId": "get-organizations", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.Organization" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Organizations" - ], - "summary": "Create organization", - "operationId": "create-organization", - "parameters": [ - { - "description": "Create organization request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.CreateOrganizationRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/codersdk.Organization" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Organizations" - ], - "summary": "Get organization by ID", - "operationId": "get-organization-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Organization" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "delete": { - "produces": [ - "application/json" - ], - "tags": [ - "Organizations" - ], - "summary": "Delete organization", - "operationId": "delete-organization", - "parameters": [ - { - "type": "string", - "description": "Organization ID or name", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "patch": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Organizations" - ], - "summary": "Update organization", - "operationId": "update-organization", - "parameters": [ - { - "type": "string", - "description": "Organization ID or name", - "name": "organization", - "in": "path", - "required": true - }, - { - "description": "Patch organization request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateOrganizationRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Organization" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/groups": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Get groups by organization", - "operationId": "get-groups-by-organization", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.Group" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Create group for organization", - "operationId": "create-group-for-organization", - "parameters": [ - { - "description": "Create group request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.CreateGroupRequest" - } - }, - { - "type": "string", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/codersdk.Group" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/groups/{groupName}": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Get group by organization and group name", - "operationId": "get-group-by-organization-and-group-name", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Group name", - "name": "groupName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Group" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/groups/{groupName}/members": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Get group members by organization and group name", - "operationId": "get-group-members-by-organization-and-group-name", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Group name", - "name": "groupName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Member search query", - "name": "q", - "in": "query" - }, - { - "type": "string", - "format": "uuid", - "description": "After ID", - "name": "after_id", - "in": "query" - }, - { - "type": "integer", - "description": "Page limit", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page offset", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.GroupMembersResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/members": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Members" - ], - "summary": "List organization members", - "operationId": "list-organization-members", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.OrganizationMemberWithUserData" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/members/roles": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Members" - ], - "summary": "Get member roles by organization", - "operationId": "get-member-roles-by-organization", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.AssignableRoles" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "put": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Members" - ], - "summary": "Update a custom organization role", - "operationId": "update-a-custom-organization-role", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "description": "Update role request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.CustomRoleRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.Role" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Members" - ], - "summary": "Insert a custom organization role", - "operationId": "insert-a-custom-organization-role", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "description": "Insert role request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.CustomRoleRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.Role" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/members/roles/{roleName}": { - "delete": { - "produces": [ - "application/json" - ], - "tags": [ - "Members" - ], - "summary": "Delete a custom organization role", - "operationId": "delete-a-custom-organization-role", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Role name", - "name": "roleName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.Role" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/members/{user}": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Members" - ], - "summary": "Get organization member", - "operationId": "get-organization-member", - "parameters": [ - { - "type": "string", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.OrganizationMemberWithUserData" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "post": { - "produces": [ - "application/json" - ], - "tags": [ - "Members" - ], - "summary": "Add organization member", - "operationId": "add-organization-member", - "parameters": [ - { - "type": "string", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.OrganizationMember" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "delete": { - "tags": [ - "Members" - ], - "summary": "Remove organization member", - "operationId": "remove-organization-member", - "parameters": [ - { - "type": "string", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/members/{user}/roles": { - "put": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Members" - ], - "summary": "Assign role to organization member", - "operationId": "assign-role-to-organization-member", - "parameters": [ - { - "type": "string", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "description": "Update roles request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateRoles" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.OrganizationMember" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/members/{user}/workspace-quota": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Get workspace quota by user", - "operationId": "get-workspace-quota-by-user", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceQuota" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/members/{user}/workspaces": { - "post": { - "description": "Create a new workspace using a template. The request must\nspecify either the Template ID or the Template Version ID,\nnot both. If the Template ID is specified, the active version\nof the template will be used.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Workspaces" - ], - "summary": "Create user workspace by organization", - "operationId": "create-user-workspace-by-organization", - "deprecated": true, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Username, UUID, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "description": "Create workspace request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.CreateWorkspaceRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Workspace" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/members/{user}/workspaces/available-users": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Workspaces" - ], - "summary": "Get users available for workspace creation", - "operationId": "get-users-available-for-workspace-creation", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Search query", - "name": "q", - "in": "query" - }, - { - "type": "integer", - "description": "Limit results", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Offset for pagination", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.MinimalUser" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/paginated-members": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Members" - ], - "summary": "Paginated organization members", - "operationId": "paginated-organization-members", - "parameters": [ - { - "type": "string", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Member search query", - "name": "q", - "in": "query" - }, - { - "type": "string", - "format": "uuid", - "description": "After ID", - "name": "after_id", - "in": "query" - }, - { - "type": "integer", - "description": "Page limit, if 0 returns all members", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page offset", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.PaginatedMembersResponse" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/provisionerdaemons": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Provisioning" - ], - "summary": "Get provisioner daemons", - "operationId": "get-provisioner-daemons", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Page limit", - "name": "limit", - "in": "query" - }, - { - "type": "array", - "format": "uuid", - "items": { - "type": "string" - }, - "collectionFormat": "csv", - "description": "Filter results by job IDs", - "name": "ids", - "in": "query" - }, - { - "enum": [ - "pending", - "running", - "succeeded", - "canceling", - "canceled", - "failed", - "unknown", - "pending", - "running", - "succeeded", - "canceling", - "canceled", - "failed" - ], - "type": "string", - "description": "Filter results by status", - "name": "status", - "in": "query" - }, - { - "type": "object", - "description": "Provisioner tags to filter by (JSON of the form {'tag1':'value1','tag2':'value2'})", - "name": "tags", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.ProvisionerDaemon" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/provisionerdaemons/serve": { - "get": { - "tags": [ - "Enterprise" - ], - "summary": "Serve provisioner daemon", - "operationId": "serve-provisioner-daemon", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "101": { - "description": "Switching Protocols" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/provisionerjobs": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Organizations" - ], - "summary": "Get provisioner jobs", - "operationId": "get-provisioner-jobs", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Page limit", - "name": "limit", - "in": "query" - }, - { - "type": "array", - "format": "uuid", - "items": { - "type": "string" - }, - "collectionFormat": "csv", - "description": "Filter results by job IDs", - "name": "ids", - "in": "query" - }, - { - "enum": [ - "pending", - "running", - "succeeded", - "canceling", - "canceled", - "failed", - "unknown", - "pending", - "running", - "succeeded", - "canceling", - "canceled", - "failed" - ], - "type": "string", - "description": "Filter results by status", - "name": "status", - "in": "query" - }, - { - "type": "object", - "description": "Provisioner tags to filter by (JSON of the form {'tag1':'value1','tag2':'value2'})", - "name": "tags", - "in": "query" - }, - { - "type": "string", - "format": "uuid", - "description": "Filter results by initiator", - "name": "initiator", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.ProvisionerJob" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/provisionerjobs/{job}": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Organizations" - ], - "summary": "Get provisioner job", - "operationId": "get-provisioner-job", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "Job ID", - "name": "job", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.ProvisionerJob" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/provisionerkeys": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "List provisioner key", - "operationId": "list-provisioner-key", - "parameters": [ - { - "type": "string", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.ProvisionerKey" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "post": { - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Create provisioner key", - "operationId": "create-provisioner-key", - "parameters": [ - { - "type": "string", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/codersdk.CreateProvisionerKeyResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/provisionerkeys/daemons": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "List provisioner key daemons", - "operationId": "list-provisioner-key-daemons", - "parameters": [ - { - "type": "string", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.ProvisionerKeyDaemons" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/provisionerkeys/{provisionerkey}": { - "delete": { - "tags": [ - "Enterprise" - ], - "summary": "Delete provisioner key", - "operationId": "delete-provisioner-key", - "parameters": [ - { - "type": "string", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Provisioner key name", - "name": "provisionerkey", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/settings/idpsync/available-fields": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Get the available organization idp sync claim fields", - "operationId": "get-the-available-organization-idp-sync-claim-fields", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/settings/idpsync/field-values": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Get the organization idp sync claim field values", - "operationId": "get-the-organization-idp-sync-claim-field-values", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "string", - "description": "Claim Field", - "name": "claimField", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/settings/idpsync/groups": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Get group IdP Sync settings by organization", - "operationId": "get-group-idp-sync-settings-by-organization", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.GroupSyncSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "patch": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Update group IdP Sync settings by organization", - "operationId": "update-group-idp-sync-settings-by-organization", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "description": "New settings", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.GroupSyncSettings" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.GroupSyncSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/settings/idpsync/groups/config": { - "patch": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Update group IdP Sync config", - "operationId": "update-group-idp-sync-config", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID or name", - "name": "organization", - "in": "path", - "required": true - }, - { - "description": "New config values", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.PatchGroupIDPSyncConfigRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.GroupSyncSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/settings/idpsync/groups/mapping": { - "patch": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Update group IdP Sync mapping", - "operationId": "update-group-idp-sync-mapping", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID or name", - "name": "organization", - "in": "path", - "required": true - }, - { - "description": "Description of the mappings to add and remove", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.PatchGroupIDPSyncMappingRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.GroupSyncSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/settings/idpsync/roles": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Get role IdP Sync settings by organization", - "operationId": "get-role-idp-sync-settings-by-organization", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.RoleSyncSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "patch": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Update role IdP Sync settings by organization", - "operationId": "update-role-idp-sync-settings-by-organization", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "description": "New settings", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.RoleSyncSettings" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.RoleSyncSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/settings/idpsync/roles/config": { - "patch": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Update role IdP Sync config", - "operationId": "update-role-idp-sync-config", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID or name", - "name": "organization", - "in": "path", - "required": true - }, - { - "description": "New config values", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.PatchRoleIDPSyncConfigRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.RoleSyncSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/settings/idpsync/roles/mapping": { - "patch": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Update role IdP Sync mapping", - "operationId": "update-role-idp-sync-mapping", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID or name", - "name": "organization", - "in": "path", - "required": true - }, - { - "description": "Description of the mappings to add and remove", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.PatchRoleIDPSyncMappingRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.RoleSyncSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/settings/workspace-sharing": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Get workspace sharing settings for organization", - "operationId": "get-workspace-sharing-settings-for-organization", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceSharingSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "patch": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Update workspace sharing settings for organization", - "operationId": "update-workspace-sharing-settings-for-organization", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "description": "Workspace sharing settings", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateWorkspaceSharingSettingsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceSharingSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/templates": { - "get": { - "description": "Returns a list of templates for the specified organization.\nBy default, only non-deprecated templates are returned.\nTo include deprecated templates, specify ` + "`" + `deprecated:true` + "`" + ` in the search query.", - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "Get templates by organization", - "operationId": "get-templates-by-organization", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.Template" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "Create template by organization", - "operationId": "create-template-by-organization", - "parameters": [ - { - "description": "Request body", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.CreateTemplateRequest" - } - }, - { - "type": "string", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Template" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/templates/examples": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "Get template examples by organization", - "operationId": "get-template-examples-by-organization", - "deprecated": true, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.TemplateExample" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/templates/{templatename}": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "Get templates by organization and template name", - "operationId": "get-templates-by-organization-and-template-name", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Template name", - "name": "templatename", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Template" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/templates/{templatename}/versions/{templateversionname}": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "Get template version by organization, template, and name", - "operationId": "get-template-version-by-organization-template-and-name", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Template name", - "name": "templatename", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Template version name", - "name": "templateversionname", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.TemplateVersion" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/templates/{templatename}/versions/{templateversionname}/previous": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "Get previous template version by organization, template, and name", - "operationId": "get-previous-template-version-by-organization-template-and-name", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Template name", - "name": "templatename", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Template version name", - "name": "templateversionname", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.TemplateVersion" - } - }, - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/templateversions": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "Create template version by organization", - "operationId": "create-template-version-by-organization", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "description": "Create template version request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.CreateTemplateVersionRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/codersdk.TemplateVersion" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/prebuilds/settings": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Prebuilds" - ], - "summary": "Get prebuilds settings", - "operationId": "get-prebuilds-settings", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.PrebuildsSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "put": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Prebuilds" - ], - "summary": "Update prebuilds settings", - "operationId": "update-prebuilds-settings", - "parameters": [ - { - "description": "Prebuilds settings request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.PrebuildsSettings" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.PrebuildsSettings" - } - }, - "304": { - "description": "Not Modified" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/provisionerkeys/{provisionerkey}": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Fetch provisioner key details", - "operationId": "fetch-provisioner-key-details", - "parameters": [ - { - "type": "string", - "description": "Provisioner Key", - "name": "provisionerkey", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.ProvisionerKey" - } - } - }, - "security": [ - { - "CoderProvisionerKey": [] - } - ] - } - }, - "/regions": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "WorkspaceProxies" - ], - "summary": "Get site-wide regions for workspace connections", - "operationId": "get-site-wide-regions-for-workspace-connections", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.RegionsResponse-codersdk_Region" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/replicas": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Get active replicas", - "operationId": "get-active-replicas", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.Replica" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, "/scim/v2/ServiceProviderConfig": { "get": { "produces": [ @@ -5868,6912 +12774,6 @@ const docTemplate = `{ } ] } - }, - "/settings/idpsync/available-fields": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Get the available idp sync claim fields", - "operationId": "get-the-available-idp-sync-claim-fields", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/settings/idpsync/field-values": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Get the idp sync claim field values", - "operationId": "get-the-idp-sync-claim-field-values", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "string", - "description": "Claim Field", - "name": "claimField", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/settings/idpsync/organization": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Get organization IdP Sync settings", - "operationId": "get-organization-idp-sync-settings", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.OrganizationSyncSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "patch": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Update organization IdP Sync settings", - "operationId": "update-organization-idp-sync-settings", - "parameters": [ - { - "description": "New settings", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.OrganizationSyncSettings" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.OrganizationSyncSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/settings/idpsync/organization/config": { - "patch": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Update organization IdP Sync config", - "operationId": "update-organization-idp-sync-config", - "parameters": [ - { - "description": "New config values", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.PatchOrganizationIDPSyncConfigRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.OrganizationSyncSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/settings/idpsync/organization/mapping": { - "patch": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Update organization IdP Sync mapping", - "operationId": "update-organization-idp-sync-mapping", - "parameters": [ - { - "description": "Description of the mappings to add and remove", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.PatchOrganizationIDPSyncMappingRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.OrganizationSyncSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/tailnet": { - "get": { - "tags": [ - "Agents" - ], - "summary": "User-scoped tailnet RPC connection", - "operationId": "user-scoped-tailnet-rpc-connection", - "responses": { - "101": { - "description": "Switching Protocols" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/tasks": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Tasks" - ], - "summary": "List AI tasks", - "operationId": "list-ai-tasks", - "parameters": [ - { - "type": "string", - "description": "Search query for filtering tasks. Supports: owner:\u003cusername/uuid/me\u003e, organization:\u003corg-name/uuid\u003e, status:\u003cstatus\u003e", - "name": "q", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.TasksListResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/tasks/{user}": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tasks" - ], - "summary": "Create a new AI task", - "operationId": "create-a-new-ai-task", - "parameters": [ - { - "type": "string", - "description": "Username, user ID, or 'me' for the authenticated user", - "name": "user", - "in": "path", - "required": true - }, - { - "description": "Create task request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.CreateTaskRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/codersdk.Task" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/tasks/{user}/{task}": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Tasks" - ], - "summary": "Get AI task by ID or name", - "operationId": "get-ai-task-by-id-or-name", - "parameters": [ - { - "type": "string", - "description": "Username, user ID, or 'me' for the authenticated user", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Task ID, or task name", - "name": "task", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Task" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "delete": { - "tags": [ - "Tasks" - ], - "summary": "Delete AI task", - "operationId": "delete-ai-task", - "parameters": [ - { - "type": "string", - "description": "Username, user ID, or 'me' for the authenticated user", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Task ID, or task name", - "name": "task", - "in": "path", - "required": true - } - ], - "responses": { - "202": { - "description": "Accepted" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/tasks/{user}/{task}/input": { - "patch": { - "consumes": [ - "application/json" - ], - "tags": [ - "Tasks" - ], - "summary": "Update AI task input", - "operationId": "update-ai-task-input", - "parameters": [ - { - "type": "string", - "description": "Username, user ID, or 'me' for the authenticated user", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Task ID, or task name", - "name": "task", - "in": "path", - "required": true - }, - { - "description": "Update task input request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateTaskInputRequest" - } - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/tasks/{user}/{task}/logs": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Tasks" - ], - "summary": "Get AI task logs", - "operationId": "get-ai-task-logs", - "parameters": [ - { - "type": "string", - "description": "Username, user ID, or 'me' for the authenticated user", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Task ID, or task name", - "name": "task", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.TaskLogsResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/tasks/{user}/{task}/pause": { - "post": { - "produces": [ - "application/json" - ], - "tags": [ - "Tasks" - ], - "summary": "Pause task", - "operationId": "pause-task", - "parameters": [ - { - "type": "string", - "description": "Username, user ID, or 'me' for the authenticated user", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "Task ID", - "name": "task", - "in": "path", - "required": true - } - ], - "responses": { - "202": { - "description": "Accepted", - "schema": { - "$ref": "#/definitions/codersdk.PauseTaskResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/tasks/{user}/{task}/resume": { - "post": { - "produces": [ - "application/json" - ], - "tags": [ - "Tasks" - ], - "summary": "Resume task", - "operationId": "resume-task", - "parameters": [ - { - "type": "string", - "description": "Username, user ID, or 'me' for the authenticated user", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "Task ID", - "name": "task", - "in": "path", - "required": true - } - ], - "responses": { - "202": { - "description": "Accepted", - "schema": { - "$ref": "#/definitions/codersdk.ResumeTaskResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/tasks/{user}/{task}/send": { - "post": { - "consumes": [ - "application/json" - ], - "tags": [ - "Tasks" - ], - "summary": "Send input to AI task", - "operationId": "send-input-to-ai-task", - "parameters": [ - { - "type": "string", - "description": "Username, user ID, or 'me' for the authenticated user", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Task ID, or task name", - "name": "task", - "in": "path", - "required": true - }, - { - "description": "Task input request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.TaskSendRequest" - } - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templates": { - "get": { - "description": "Returns a list of templates.\nBy default, only non-deprecated templates are returned.\nTo include deprecated templates, specify ` + "`" + `deprecated:true` + "`" + ` in the search query.", - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "Get all templates", - "operationId": "get-all-templates", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.Template" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templates/examples": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "Get template examples", - "operationId": "get-template-examples", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.TemplateExample" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templates/{template}": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "Get template settings by ID", - "operationId": "get-template-settings-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template ID", - "name": "template", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Template" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "delete": { - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "Delete template by ID", - "operationId": "delete-template-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template ID", - "name": "template", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "patch": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "Update template settings by ID", - "operationId": "update-template-settings-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template ID", - "name": "template", - "in": "path", - "required": true - }, - { - "description": "Patch template settings request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateTemplateMeta" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Template" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templates/{template}/acl": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Get template ACLs", - "operationId": "get-template-acls", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template ID", - "name": "template", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.TemplateACL" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "patch": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Update template ACL", - "operationId": "update-template-acl", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template ID", - "name": "template", - "in": "path", - "required": true - }, - { - "description": "Update template ACL request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateTemplateACL" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templates/{template}/acl/available": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Get template available acl users/groups", - "operationId": "get-template-available-acl-usersgroups", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template ID", - "name": "template", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.ACLAvailable" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templates/{template}/daus": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "Get template DAUs by ID", - "operationId": "get-template-daus-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template ID", - "name": "template", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.DAUsResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templates/{template}/prebuilds/invalidate": { - "post": { - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Invalidate presets for template", - "operationId": "invalidate-presets-for-template", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template ID", - "name": "template", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.InvalidatePresetsResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templates/{template}/versions": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "List template versions by template ID", - "operationId": "list-template-versions-by-template-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template ID", - "name": "template", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "After ID", - "name": "after_id", - "in": "query" - }, - { - "type": "boolean", - "description": "Include archived versions in the list", - "name": "include_archived", - "in": "query" - }, - { - "type": "integer", - "description": "Page limit", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page offset", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.TemplateVersion" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "patch": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "Update active template version by template ID", - "operationId": "update-active-template-version-by-template-id", - "parameters": [ - { - "description": "Modified template version", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateActiveTemplateVersion" - } - }, - { - "type": "string", - "format": "uuid", - "description": "Template ID", - "name": "template", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templates/{template}/versions/archive": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "Archive template unused versions by template id", - "operationId": "archive-template-unused-versions-by-template-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template ID", - "name": "template", - "in": "path", - "required": true - }, - { - "description": "Archive request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.ArchiveTemplateVersionsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templates/{template}/versions/{templateversionname}": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "Get template version by template ID and name", - "operationId": "get-template-version-by-template-id-and-name", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template ID", - "name": "template", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Template version name", - "name": "templateversionname", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.TemplateVersion" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "Get template version by ID", - "operationId": "get-template-version-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.TemplateVersion" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "patch": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "Patch template version by ID", - "operationId": "patch-template-version-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - }, - { - "description": "Patch template version request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.PatchTemplateVersionRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.TemplateVersion" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/archive": { - "post": { - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "Archive template version", - "operationId": "archive-template-version", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/cancel": { - "patch": { - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "Cancel template version by ID", - "operationId": "cancel-template-version-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/dry-run": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "Create template version dry-run", - "operationId": "create-template-version-dry-run", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - }, - { - "description": "Dry-run request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.CreateTemplateVersionDryRunRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/codersdk.ProvisionerJob" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/dry-run/{jobID}": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "Get template version dry-run by job ID", - "operationId": "get-template-version-dry-run-by-job-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "Job ID", - "name": "jobID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.ProvisionerJob" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/dry-run/{jobID}/cancel": { - "patch": { - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "Cancel template version dry-run by job ID", - "operationId": "cancel-template-version-dry-run-by-job-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Job ID", - "name": "jobID", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/dry-run/{jobID}/logs": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "Get template version dry-run logs by job ID", - "operationId": "get-template-version-dry-run-logs-by-job-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "Job ID", - "name": "jobID", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Before Unix timestamp", - "name": "before", - "in": "query" - }, - { - "type": "integer", - "description": "After Unix timestamp", - "name": "after", - "in": "query" - }, - { - "type": "boolean", - "description": "Follow log stream", - "name": "follow", - "in": "query" - }, - { - "enum": [ - "json", - "text" - ], - "type": "string", - "description": "Log output format. Accepted: 'json' (default), 'text' (plain text with RFC3339 timestamps and ANSI colors). Not supported with follow=true.", - "name": "format", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.ProvisionerJobLog" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/dry-run/{jobID}/matched-provisioners": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "Get template version dry-run matched provisioners", - "operationId": "get-template-version-dry-run-matched-provisioners", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "Job ID", - "name": "jobID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.MatchedProvisioners" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/dry-run/{jobID}/resources": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "Get template version dry-run resources by job ID", - "operationId": "get-template-version-dry-run-resources-by-job-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "Job ID", - "name": "jobID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.WorkspaceResource" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/dynamic-parameters": { - "get": { - "tags": [ - "Templates" - ], - "summary": "Open dynamic parameters WebSocket by template version", - "operationId": "open-dynamic-parameters-websocket-by-template-version", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - } - ], - "responses": { - "101": { - "description": "Switching Protocols" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/dynamic-parameters/evaluate": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "Evaluate dynamic parameters for template version", - "operationId": "evaluate-dynamic-parameters-for-template-version", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - }, - { - "description": "Initial parameter values", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.DynamicParametersRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.DynamicParametersResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/external-auth": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "Get external auth by template version", - "operationId": "get-external-auth-by-template-version", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.TemplateVersionExternalAuth" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/logs": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "Get logs by template version", - "operationId": "get-logs-by-template-version", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Before log id", - "name": "before", - "in": "query" - }, - { - "type": "integer", - "description": "After log id", - "name": "after", - "in": "query" - }, - { - "type": "boolean", - "description": "Follow log stream", - "name": "follow", - "in": "query" - }, - { - "enum": [ - "json", - "text" - ], - "type": "string", - "description": "Log output format. Accepted: 'json' (default), 'text' (plain text with RFC3339 timestamps and ANSI colors). Not supported with follow=true.", - "name": "format", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.ProvisionerJobLog" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/parameters": { - "get": { - "tags": [ - "Templates" - ], - "summary": "Removed: Get parameters by template version", - "operationId": "removed-get-parameters-by-template-version", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/presets": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "Get template version presets", - "operationId": "get-template-version-presets", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.Preset" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/resources": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "Get resources by template version", - "operationId": "get-resources-by-template-version", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.WorkspaceResource" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/rich-parameters": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "Get rich parameters by template version", - "operationId": "get-rich-parameters-by-template-version", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.TemplateVersionParameter" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/schema": { - "get": { - "tags": [ - "Templates" - ], - "summary": "Removed: Get schema by template version", - "operationId": "removed-get-schema-by-template-version", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/unarchive": { - "post": { - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "Unarchive template version", - "operationId": "unarchive-template-version", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/variables": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "Get template variables by template version", - "operationId": "get-template-variables-by-template-version", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.TemplateVersionVariable" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/updatecheck": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "General" - ], - "summary": "Update check", - "operationId": "update-check", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.UpdateCheckResponse" - } - } - } - } - }, - "/users": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "Get users", - "operationId": "get-users", - "parameters": [ - { - "type": "string", - "description": "Search query", - "name": "q", - "in": "query" - }, - { - "type": "string", - "format": "uuid", - "description": "After ID", - "name": "after_id", - "in": "query" - }, - { - "type": "integer", - "description": "Page limit", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page offset", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.GetUsersResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "Create new user", - "operationId": "create-new-user", - "parameters": [ - { - "description": "Create user request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.CreateUserRequestWithOrgs" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/codersdk.User" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/authmethods": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "Get authentication methods", - "operationId": "get-authentication-methods", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.AuthMethods" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/first": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "Check initial user created", - "operationId": "check-initial-user-created", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "Create initial user", - "operationId": "create-initial-user", - "parameters": [ - { - "description": "First user request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.CreateFirstUserRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/codersdk.CreateFirstUserResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/login": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Authorization" - ], - "summary": "Log in user", - "operationId": "log-in-user", - "parameters": [ - { - "description": "Login request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.LoginWithPasswordRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/codersdk.LoginWithPasswordResponse" - } - } - } - } - }, - "/users/logout": { - "post": { - "produces": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "Log out user", - "operationId": "log-out-user", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/oauth2/github/callback": { - "get": { - "tags": [ - "Users" - ], - "summary": "OAuth 2.0 GitHub Callback", - "operationId": "oauth-20-github-callback", - "responses": { - "307": { - "description": "Temporary Redirect" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/oauth2/github/device": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "Get Github device auth.", - "operationId": "get-github-device-auth", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.ExternalAuthDevice" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/oidc-claims": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "Get OIDC claims for the authenticated user", - "operationId": "get-oidc-claims-for-the-authenticated-user", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.OIDCClaimsResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/oidc/callback": { - "get": { - "tags": [ - "Users" - ], - "summary": "OpenID Connect Callback", - "operationId": "openid-connect-callback", - "responses": { - "307": { - "description": "Temporary Redirect" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/otp/change-password": { - "post": { - "consumes": [ - "application/json" - ], - "tags": [ - "Authorization" - ], - "summary": "Change password with a one-time passcode", - "operationId": "change-password-with-a-one-time-passcode", - "parameters": [ - { - "description": "Change password request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.ChangePasswordWithOneTimePasscodeRequest" - } - } - ], - "responses": { - "204": { - "description": "No Content" - } - } - } - }, - "/users/otp/request": { - "post": { - "consumes": [ - "application/json" - ], - "tags": [ - "Authorization" - ], - "summary": "Request one-time passcode", - "operationId": "request-one-time-passcode", - "parameters": [ - { - "description": "One-time passcode request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.RequestOneTimePasscodeRequest" - } - } - ], - "responses": { - "204": { - "description": "No Content" - } - } - } - }, - "/users/roles": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Members" - ], - "summary": "Get site member roles", - "operationId": "get-site-member-roles", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.AssignableRoles" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/validate-password": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Authorization" - ], - "summary": "Validate user password", - "operationId": "validate-user-password", - "parameters": [ - { - "description": "Validate user password request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.ValidateUserPasswordRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.ValidateUserPasswordResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "Get user by name", - "operationId": "get-user-by-name", - "parameters": [ - { - "type": "string", - "description": "User ID, username, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.User" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "delete": { - "tags": [ - "Users" - ], - "summary": "Delete user", - "operationId": "delete-user", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/appearance": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "Get user appearance settings", - "operationId": "get-user-appearance-settings", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.UserAppearanceSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "put": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "Update user appearance settings", - "operationId": "update-user-appearance-settings", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "description": "New appearance settings", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateUserAppearanceSettingsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.UserAppearanceSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/autofill-parameters": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "Get autofill build parameters for user", - "operationId": "get-autofill-build-parameters-for-user", - "parameters": [ - { - "type": "string", - "description": "User ID, username, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Template ID", - "name": "template_id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.UserParameter" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/convert-login": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Authorization" - ], - "summary": "Convert user from password to oauth authentication", - "operationId": "convert-user-from-password-to-oauth-authentication", - "parameters": [ - { - "description": "Convert request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.ConvertLoginRequest" - } - }, - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/codersdk.OAuthConversionResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/gitsshkey": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "Get user Git SSH key", - "operationId": "get-user-git-ssh-key", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.GitSSHKey" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "put": { - "produces": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "Regenerate user SSH key", - "operationId": "regenerate-user-ssh-key", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.GitSSHKey" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/keys": { - "post": { - "produces": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "Create new session key", - "operationId": "create-new-session-key", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/codersdk.GenerateAPIKeyResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/keys/tokens": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "Get user tokens", - "operationId": "get-user-tokens", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "Include expired tokens in the list", - "name": "include_expired", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.APIKey" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "Create token API key", - "operationId": "create-token-api-key", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "description": "Create token request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.CreateTokenRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/codersdk.GenerateAPIKeyResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/keys/tokens/tokenconfig": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "General" - ], - "summary": "Get token config", - "operationId": "get-token-config", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.TokenConfig" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/keys/tokens/{keyname}": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "Get API key by token name", - "operationId": "get-api-key-by-token-name", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "string", - "description": "Key Name", - "name": "keyname", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.APIKey" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/keys/{keyid}": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "Get API key by ID", - "operationId": "get-api-key-by-id", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "string", - "description": "Key ID", - "name": "keyid", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.APIKey" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "delete": { - "tags": [ - "Users" - ], - "summary": "Delete API key", - "operationId": "delete-api-key", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "string", - "description": "Key ID", - "name": "keyid", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/keys/{keyid}/expire": { - "put": { - "tags": [ - "Users" - ], - "summary": "Expire API key", - "operationId": "expire-api-key", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "string", - "description": "Key ID", - "name": "keyid", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/login-type": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "Get user login type", - "operationId": "get-user-login-type", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.UserLoginType" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/notifications/preferences": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Notifications" - ], - "summary": "Get user notification preferences", - "operationId": "get-user-notification-preferences", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.NotificationPreference" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "put": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Notifications" - ], - "summary": "Update user notification preferences", - "operationId": "update-user-notification-preferences", - "parameters": [ - { - "description": "Preferences", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateUserNotificationPreferences" - } - }, - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.NotificationPreference" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/organizations": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "Get organizations by user", - "operationId": "get-organizations-by-user", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.Organization" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/organizations/{organizationname}": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "Get organization by user and organization name", - "operationId": "get-organization-by-user-and-organization-name", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Organization name", - "name": "organizationname", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Organization" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/password": { - "put": { - "consumes": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "Update user password", - "operationId": "update-user-password", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "description": "Update password request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateUserPasswordRequest" - } - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/preferences": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "Get user preference settings", - "operationId": "get-user-preference-settings", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.UserPreferenceSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "put": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "Update user preference settings", - "operationId": "update-user-preference-settings", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "description": "New preference settings", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateUserPreferenceSettingsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.UserPreferenceSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/profile": { - "put": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "Update user profile", - "operationId": "update-user-profile", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "description": "Updated profile", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateUserProfileRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.User" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/quiet-hours": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Get user quiet hours schedule", - "operationId": "get-user-quiet-hours-schedule", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "User ID", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.UserQuietHoursScheduleResponse" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "put": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Update user quiet hours schedule", - "operationId": "update-user-quiet-hours-schedule", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "User ID", - "name": "user", - "in": "path", - "required": true - }, - { - "description": "Update schedule request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateUserQuietHoursScheduleRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.UserQuietHoursScheduleResponse" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/roles": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "Get user roles", - "operationId": "get-user-roles", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.User" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "put": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "Assign role to user", - "operationId": "assign-role-to-user", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "description": "Update roles request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateRoles" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.User" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/secrets": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Secrets" - ], - "summary": "List user secrets", - "operationId": "list-user-secrets", - "parameters": [ - { - "type": "string", - "description": "User ID, username, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.UserSecret" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Secrets" - ], - "summary": "Create a new user secret", - "operationId": "create-a-new-user-secret", - "parameters": [ - { - "type": "string", - "description": "User ID, username, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "description": "Create secret request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.CreateUserSecretRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/codersdk.UserSecret" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/secrets/{name}": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Secrets" - ], - "summary": "Get a user secret by name", - "operationId": "get-a-user-secret-by-name", - "parameters": [ - { - "type": "string", - "description": "User ID, username, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Secret name", - "name": "name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.UserSecret" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "delete": { - "tags": [ - "Secrets" - ], - "summary": "Delete a user secret", - "operationId": "delete-a-user-secret", - "parameters": [ - { - "type": "string", - "description": "User ID, username, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Secret name", - "name": "name", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "patch": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Secrets" - ], - "summary": "Update a user secret", - "operationId": "update-a-user-secret", - "parameters": [ - { - "type": "string", - "description": "User ID, username, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Secret name", - "name": "name", - "in": "path", - "required": true - }, - { - "description": "Update secret request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateUserSecretRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.UserSecret" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/status/activate": { - "put": { - "produces": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "Activate user account", - "operationId": "activate-user-account", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.User" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/status/suspend": { - "put": { - "produces": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "Suspend user account", - "operationId": "suspend-user-account", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.User" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/webpush/subscription": { - "post": { - "consumes": [ - "application/json" - ], - "tags": [ - "Notifications" - ], - "summary": "Create user webpush subscription", - "operationId": "create-user-webpush-subscription", - "parameters": [ - { - "description": "Webpush subscription", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.WebpushSubscription" - } - }, - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - }, - "delete": { - "consumes": [ - "application/json" - ], - "tags": [ - "Notifications" - ], - "summary": "Delete user webpush subscription", - "operationId": "delete-user-webpush-subscription", - "parameters": [ - { - "description": "Webpush subscription", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.DeleteWebpushSubscription" - } - }, - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/users/{user}/webpush/test": { - "post": { - "tags": [ - "Notifications" - ], - "summary": "Send a test push notification", - "operationId": "send-a-test-push-notification", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/users/{user}/workspace/{workspacename}": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Workspaces" - ], - "summary": "Get workspace metadata by user and workspace name", - "operationId": "get-workspace-metadata-by-user-and-workspace-name", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Workspace name", - "name": "workspacename", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "Return data instead of HTTP 404 if the workspace is deleted", - "name": "include_deleted", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Workspace" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/workspace/{workspacename}/builds/{buildnumber}": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Builds" - ], - "summary": "Get workspace build by user, workspace name, and build number", - "operationId": "get-workspace-build-by-user-workspace-name-and-build-number", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Workspace name", - "name": "workspacename", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "number", - "description": "Build number", - "name": "buildnumber", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceBuild" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/workspaces": { - "post": { - "description": "Create a new workspace using a template. The request must\nspecify either the Template ID or the Template Version ID,\nnot both. If the Template ID is specified, the active version\nof the template will be used.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Workspaces" - ], - "summary": "Create user workspace", - "operationId": "create-user-workspace", - "parameters": [ - { - "type": "string", - "description": "Username, UUID, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "description": "Create workspace request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.CreateWorkspaceRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Workspace" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspace-quota/{user}": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Get workspace quota by user deprecated", - "operationId": "get-workspace-quota-by-user-deprecated", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceQuota" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/aws-instance-identity": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Agents" - ], - "summary": "Authenticate agent on AWS instance", - "operationId": "authenticate-agent-on-aws-instance", - "parameters": [ - { - "description": "Instance identity token. The optional agent_name field disambiguates when multiple agents share the same instance ID.", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/agentsdk.AWSInstanceIdentityToken" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/agentsdk.AuthenticateResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/azure-instance-identity": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Agents" - ], - "summary": "Authenticate agent on Azure instance", - "operationId": "authenticate-agent-on-azure-instance", - "parameters": [ - { - "description": "Instance identity token. The optional agent_name field disambiguates when multiple agents share the same instance ID.", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/agentsdk.AzureInstanceIdentityToken" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/agentsdk.AuthenticateResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/connection": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Agents" - ], - "summary": "Get connection info for workspace agent generic", - "operationId": "get-connection-info-for-workspace-agent-generic", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/workspacesdk.AgentConnectionInfo" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/workspaceagents/google-instance-identity": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Agents" - ], - "summary": "Authenticate agent on Google Cloud instance", - "operationId": "authenticate-agent-on-google-cloud-instance", - "parameters": [ - { - "description": "Instance identity token. The optional agent_name field disambiguates when multiple agents share the same instance ID.", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/agentsdk.GoogleInstanceIdentityToken" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/agentsdk.AuthenticateResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/me/app-status": { - "patch": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Agents" - ], - "summary": "Patch workspace agent app status", - "operationId": "patch-workspace-agent-app-status", - "deprecated": true, - "parameters": [ - { - "description": "app status", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/agentsdk.PatchAppStatus" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/me/external-auth": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Agents" - ], - "summary": "Get workspace agent external auth", - "operationId": "get-workspace-agent-external-auth", - "parameters": [ - { - "type": "string", - "description": "Match", - "name": "match", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "Provider ID", - "name": "id", - "in": "query", - "required": true - }, - { - "type": "boolean", - "description": "Wait for a new token to be issued", - "name": "listen", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/agentsdk.ExternalAuthResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/me/gitauth": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Agents" - ], - "summary": "Removed: Get workspace agent git auth", - "operationId": "removed-get-workspace-agent-git-auth", - "parameters": [ - { - "type": "string", - "description": "Match", - "name": "match", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "Provider ID", - "name": "id", - "in": "query", - "required": true - }, - { - "type": "boolean", - "description": "Wait for a new token to be issued", - "name": "listen", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/agentsdk.ExternalAuthResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/me/gitsshkey": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Agents" - ], - "summary": "Get workspace agent Git SSH key", - "operationId": "get-workspace-agent-git-ssh-key", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/agentsdk.GitSSHKey" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/me/log-source": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Agents" - ], - "summary": "Post workspace agent log source", - "operationId": "post-workspace-agent-log-source", - "parameters": [ - { - "description": "Log source request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/agentsdk.PostLogSourceRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceAgentLogSource" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/me/logs": { - "patch": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Agents" - ], - "summary": "Patch workspace agent logs", - "operationId": "patch-workspace-agent-logs", - "parameters": [ - { - "description": "logs", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/agentsdk.PatchLogs" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/me/reinit": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Agents" - ], - "summary": "Get workspace agent reinitialization", - "operationId": "get-workspace-agent-reinitialization", - "parameters": [ - { - "type": "boolean", - "description": "Opt in to durable reinit checks", - "name": "wait", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/agentsdk.ReinitializationEvent" - } - }, - "409": { - "description": "Conflict", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/me/rpc": { - "get": { - "tags": [ - "Agents" - ], - "summary": "Workspace agent RPC API", - "operationId": "workspace-agent-rpc-api", - "responses": { - "101": { - "description": "Switching Protocols" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/workspaceagents/me/tasks/{task}/log-snapshot": { - "post": { - "consumes": [ - "application/json" - ], - "tags": [ - "Tasks" - ], - "summary": "Upload task log snapshot", - "operationId": "upload-task-log-snapshot", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Task ID", - "name": "task", - "in": "path", - "required": true - }, - { - "enum": [ - "agentapi" - ], - "type": "string", - "description": "Snapshot format", - "name": "format", - "in": "query", - "required": true - }, - { - "description": "Raw snapshot payload (structure depends on format parameter)", - "name": "request", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/{workspaceagent}": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Agents" - ], - "summary": "Get workspace agent by ID", - "operationId": "get-workspace-agent-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace agent ID", - "name": "workspaceagent", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceAgent" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/{workspaceagent}/connection": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Agents" - ], - "summary": "Get connection info for workspace agent", - "operationId": "get-connection-info-for-workspace-agent", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace agent ID", - "name": "workspaceagent", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/workspacesdk.AgentConnectionInfo" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/{workspaceagent}/containers": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Agents" - ], - "summary": "Get running containers for workspace agent", - "operationId": "get-running-containers-for-workspace-agent", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace agent ID", - "name": "workspaceagent", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "key=value", - "description": "Labels", - "name": "label", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceAgentListContainersResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/{workspaceagent}/containers/devcontainers/{devcontainer}": { - "delete": { - "tags": [ - "Agents" - ], - "summary": "Delete devcontainer for workspace agent", - "operationId": "delete-devcontainer-for-workspace-agent", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace agent ID", - "name": "workspaceagent", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Devcontainer ID", - "name": "devcontainer", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/{workspaceagent}/containers/devcontainers/{devcontainer}/recreate": { - "post": { - "produces": [ - "application/json" - ], - "tags": [ - "Agents" - ], - "summary": "Recreate devcontainer for workspace agent", - "operationId": "recreate-devcontainer-for-workspace-agent", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace agent ID", - "name": "workspaceagent", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Devcontainer ID", - "name": "devcontainer", - "in": "path", - "required": true - } - ], - "responses": { - "202": { - "description": "Accepted", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/{workspaceagent}/containers/watch": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Agents" - ], - "summary": "Watch workspace agent for container updates.", - "operationId": "watch-workspace-agent-for-container-updates", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace agent ID", - "name": "workspaceagent", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceAgentListContainersResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/{workspaceagent}/coordinate": { - "get": { - "tags": [ - "Agents" - ], - "summary": "Coordinate workspace agent", - "operationId": "coordinate-workspace-agent", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace agent ID", - "name": "workspaceagent", - "in": "path", - "required": true - } - ], - "responses": { - "101": { - "description": "Switching Protocols" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/{workspaceagent}/listening-ports": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Agents" - ], - "summary": "Get listening ports for workspace agent", - "operationId": "get-listening-ports-for-workspace-agent", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace agent ID", - "name": "workspaceagent", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceAgentListeningPortsResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/{workspaceagent}/logs": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Agents" - ], - "summary": "Get logs by workspace agent", - "operationId": "get-logs-by-workspace-agent", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace agent ID", - "name": "workspaceagent", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Before log id", - "name": "before", - "in": "query" - }, - { - "type": "integer", - "description": "After log id", - "name": "after", - "in": "query" - }, - { - "type": "boolean", - "description": "Follow log stream", - "name": "follow", - "in": "query" - }, - { - "type": "boolean", - "description": "Disable compression for WebSocket connection", - "name": "no_compression", - "in": "query" - }, - { - "enum": [ - "json", - "text" - ], - "type": "string", - "description": "Log output format. Accepted: 'json' (default), 'text' (plain text with RFC3339 timestamps and ANSI colors). Not supported with follow=true.", - "name": "format", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.WorkspaceAgentLog" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/{workspaceagent}/pty": { - "get": { - "tags": [ - "Agents" - ], - "summary": "Open PTY to workspace agent", - "operationId": "open-pty-to-workspace-agent", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace agent ID", - "name": "workspaceagent", - "in": "path", - "required": true - } - ], - "responses": { - "101": { - "description": "Switching Protocols" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/{workspaceagent}/startup-logs": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Agents" - ], - "summary": "Removed: Get logs by workspace agent", - "operationId": "removed-get-logs-by-workspace-agent", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace agent ID", - "name": "workspaceagent", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Before log id", - "name": "before", - "in": "query" - }, - { - "type": "integer", - "description": "After log id", - "name": "after", - "in": "query" - }, - { - "type": "boolean", - "description": "Follow log stream", - "name": "follow", - "in": "query" - }, - { - "type": "boolean", - "description": "Disable compression for WebSocket connection", - "name": "no_compression", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.WorkspaceAgentLog" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/{workspaceagent}/watch-metadata": { - "get": { - "tags": [ - "Agents" - ], - "summary": "Watch for workspace agent metadata updates", - "operationId": "watch-for-workspace-agent-metadata-updates", - "deprecated": true, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace agent ID", - "name": "workspaceagent", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Success" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/workspaceagents/{workspaceagent}/watch-metadata-ws": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Agents" - ], - "summary": "Watch for workspace agent metadata updates via WebSockets", - "operationId": "watch-for-workspace-agent-metadata-updates-via-websockets", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace agent ID", - "name": "workspaceagent", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.ServerSentEvent" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/workspacebuilds/{workspacebuild}": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Builds" - ], - "summary": "Get workspace build", - "operationId": "get-workspace-build", - "parameters": [ - { - "type": "string", - "description": "Workspace build ID", - "name": "workspacebuild", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceBuild" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspacebuilds/{workspacebuild}/cancel": { - "patch": { - "produces": [ - "application/json" - ], - "tags": [ - "Builds" - ], - "summary": "Cancel workspace build", - "operationId": "cancel-workspace-build", - "parameters": [ - { - "type": "string", - "description": "Workspace build ID", - "name": "workspacebuild", - "in": "path", - "required": true - }, - { - "enum": [ - "running", - "pending" - ], - "type": "string", - "description": "Expected status of the job. If expect_status is supplied, the request will be rejected with 412 Precondition Failed if the job doesn't match the state when performing the cancellation.", - "name": "expect_status", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspacebuilds/{workspacebuild}/logs": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Builds" - ], - "summary": "Get workspace build logs", - "operationId": "get-workspace-build-logs", - "parameters": [ - { - "type": "string", - "description": "Workspace build ID", - "name": "workspacebuild", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Before log id", - "name": "before", - "in": "query" - }, - { - "type": "integer", - "description": "After log id", - "name": "after", - "in": "query" - }, - { - "type": "boolean", - "description": "Follow log stream", - "name": "follow", - "in": "query" - }, - { - "enum": [ - "json", - "text" - ], - "type": "string", - "description": "Log output format. Accepted: 'json' (default), 'text' (plain text with RFC3339 timestamps and ANSI colors). Not supported with follow=true.", - "name": "format", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.ProvisionerJobLog" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspacebuilds/{workspacebuild}/parameters": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Builds" - ], - "summary": "Get build parameters for workspace build", - "operationId": "get-build-parameters-for-workspace-build", - "parameters": [ - { - "type": "string", - "description": "Workspace build ID", - "name": "workspacebuild", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.WorkspaceBuildParameter" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspacebuilds/{workspacebuild}/resources": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Builds" - ], - "summary": "Removed: Get workspace resources for workspace build", - "operationId": "removed-get-workspace-resources-for-workspace-build", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "Workspace build ID", - "name": "workspacebuild", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.WorkspaceResource" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspacebuilds/{workspacebuild}/state": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Builds" - ], - "summary": "Get provisioner state for workspace build", - "operationId": "get-provisioner-state-for-workspace-build", - "parameters": [ - { - "type": "string", - "description": "Workspace build ID", - "name": "workspacebuild", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceBuild" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "put": { - "consumes": [ - "application/json" - ], - "tags": [ - "Builds" - ], - "summary": "Update workspace build state", - "operationId": "update-workspace-build-state", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace build ID", - "name": "workspacebuild", - "in": "path", - "required": true - }, - { - "description": "Request body", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateWorkspaceBuildStateRequest" - } - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspacebuilds/{workspacebuild}/timings": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Builds" - ], - "summary": "Get workspace build timings by ID", - "operationId": "get-workspace-build-timings-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace build ID", - "name": "workspacebuild", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceBuildTimings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceproxies": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Get workspace proxies", - "operationId": "get-workspace-proxies", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.RegionsResponse-codersdk_WorkspaceProxy" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Create workspace proxy", - "operationId": "create-workspace-proxy", - "parameters": [ - { - "description": "Create workspace proxy request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.CreateWorkspaceProxyRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceProxy" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceproxies/me/app-stats": { - "post": { - "consumes": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Report workspace app stats", - "operationId": "report-workspace-app-stats", - "parameters": [ - { - "description": "Report app stats request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/wsproxysdk.ReportAppStatsRequest" - } - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/workspaceproxies/me/coordinate": { - "get": { - "tags": [ - "Enterprise" - ], - "summary": "Workspace Proxy Coordinate", - "operationId": "workspace-proxy-coordinate", - "responses": { - "101": { - "description": "Switching Protocols" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/workspaceproxies/me/crypto-keys": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Get workspace proxy crypto keys", - "operationId": "get-workspace-proxy-crypto-keys", - "parameters": [ - { - "type": "string", - "description": "Feature key", - "name": "feature", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/wsproxysdk.CryptoKeysResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/workspaceproxies/me/deregister": { - "post": { - "consumes": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Deregister workspace proxy", - "operationId": "deregister-workspace-proxy", - "parameters": [ - { - "description": "Deregister workspace proxy request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/wsproxysdk.DeregisterWorkspaceProxyRequest" - } - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/workspaceproxies/me/issue-signed-app-token": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Issue signed workspace app token", - "operationId": "issue-signed-workspace-app-token", - "parameters": [ - { - "description": "Issue signed app token request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/workspaceapps.IssueTokenRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/wsproxysdk.IssueSignedAppTokenResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/workspaceproxies/me/register": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Register workspace proxy", - "operationId": "register-workspace-proxy", - "parameters": [ - { - "description": "Register workspace proxy request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/wsproxysdk.RegisterWorkspaceProxyRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/wsproxysdk.RegisterWorkspaceProxyResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/workspaceproxies/{workspaceproxy}": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Get workspace proxy", - "operationId": "get-workspace-proxy", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Proxy ID or name", - "name": "workspaceproxy", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceProxy" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "delete": { - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Delete workspace proxy", - "operationId": "delete-workspace-proxy", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Proxy ID or name", - "name": "workspaceproxy", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "patch": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Update workspace proxy", - "operationId": "update-workspace-proxy", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Proxy ID or name", - "name": "workspaceproxy", - "in": "path", - "required": true - }, - { - "description": "Update workspace proxy request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.PatchWorkspaceProxy" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceProxy" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaces": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Workspaces" - ], - "summary": "List workspaces", - "operationId": "list-workspaces", - "parameters": [ - { - "type": "string", - "description": "Search query in the format ` + "`" + `key:value` + "`" + `. Available keys are: owner, template, name, status, has-agent, dormant, last_used_after, last_used_before, has-ai-task, has_external_agent, healthy.", - "name": "q", - "in": "query" - }, - { - "type": "integer", - "description": "Page limit", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page offset", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspacesResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaces/{workspace}": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Workspaces" - ], - "summary": "Get workspace metadata by ID", - "operationId": "get-workspace-metadata-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "Return data instead of HTTP 404 if the workspace is deleted", - "name": "include_deleted", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Workspace" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "patch": { - "consumes": [ - "application/json" - ], - "tags": [ - "Workspaces" - ], - "summary": "Update workspace metadata by ID", - "operationId": "update-workspace-metadata-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - }, - { - "description": "Metadata update request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateWorkspaceRequest" - } - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaces/{workspace}/acl": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Workspaces" - ], - "summary": "Get workspace ACLs", - "operationId": "get-workspace-acls", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceACL" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "delete": { - "tags": [ - "Workspaces" - ], - "summary": "Completely clears the workspace's user and group ACLs.", - "operationId": "completely-clears-the-workspaces-user-and-group-acls", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "patch": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Workspaces" - ], - "summary": "Update workspace ACL", - "operationId": "update-workspace-acl", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - }, - { - "description": "Update workspace ACL request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateWorkspaceACL" - } - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaces/{workspace}/autostart": { - "put": { - "consumes": [ - "application/json" - ], - "tags": [ - "Workspaces" - ], - "summary": "Update workspace autostart schedule by ID", - "operationId": "update-workspace-autostart-schedule-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - }, - { - "description": "Schedule update request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateWorkspaceAutostartRequest" - } - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaces/{workspace}/autoupdates": { - "put": { - "consumes": [ - "application/json" - ], - "tags": [ - "Workspaces" - ], - "summary": "Update workspace automatic updates by ID", - "operationId": "update-workspace-automatic-updates-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - }, - { - "description": "Automatic updates request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateWorkspaceAutomaticUpdatesRequest" - } - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaces/{workspace}/builds": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Builds" - ], - "summary": "Get workspace builds by workspace ID", - "operationId": "get-workspace-builds-by-workspace-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "After ID", - "name": "after_id", - "in": "query" - }, - { - "type": "integer", - "description": "Page limit", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page offset", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "format": "date-time", - "description": "Since timestamp", - "name": "since", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.WorkspaceBuild" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Builds" - ], - "summary": "Create workspace build", - "operationId": "create-workspace-build", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - }, - { - "description": "Create workspace build request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.CreateWorkspaceBuildRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceBuild" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaces/{workspace}/dormant": { - "put": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Workspaces" - ], - "summary": "Update workspace dormancy status by id.", - "operationId": "update-workspace-dormancy-status-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - }, - { - "description": "Make a workspace dormant or active", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateWorkspaceDormancy" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Workspace" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaces/{workspace}/extend": { - "put": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Workspaces" - ], - "summary": "Extend workspace deadline by ID", - "operationId": "extend-workspace-deadline-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - }, - { - "description": "Extend deadline update request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.PutExtendWorkspaceRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaces/{workspace}/external-agent/{agent}/credentials": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Enterprise" - ], - "summary": "Get workspace external agent credentials", - "operationId": "get-workspace-external-agent-credentials", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Agent name", - "name": "agent", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.ExternalAgentCredentials" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaces/{workspace}/favorite": { - "put": { - "tags": [ - "Workspaces" - ], - "summary": "Favorite workspace by ID.", - "operationId": "favorite-workspace-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "delete": { - "tags": [ - "Workspaces" - ], - "summary": "Unfavorite workspace by ID.", - "operationId": "unfavorite-workspace-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaces/{workspace}/port-share": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "PortSharing" - ], - "summary": "Get workspace agent port shares", - "operationId": "get-workspace-agent-port-shares", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceAgentPortShares" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "PortSharing" - ], - "summary": "Upsert workspace agent port share", - "operationId": "upsert-workspace-agent-port-share", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - }, - { - "description": "Upsert port sharing level request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpsertWorkspaceAgentPortShareRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceAgentPortShare" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "delete": { - "consumes": [ - "application/json" - ], - "tags": [ - "PortSharing" - ], - "summary": "Delete workspace agent port share", - "operationId": "delete-workspace-agent-port-share", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - }, - { - "description": "Delete port sharing level request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.DeleteWorkspaceAgentPortShareRequest" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaces/{workspace}/resolve-autostart": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Workspaces" - ], - "summary": "Resolve workspace autostart by id.", - "operationId": "resolve-workspace-autostart-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.ResolveAutostartResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaces/{workspace}/timings": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Workspaces" - ], - "summary": "Get workspace timings by ID", - "operationId": "get-workspace-timings-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceBuildTimings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaces/{workspace}/ttl": { - "put": { - "consumes": [ - "application/json" - ], - "tags": [ - "Workspaces" - ], - "summary": "Update workspace TTL by ID", - "operationId": "update-workspace-ttl-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - }, - { - "description": "Workspace TTL update request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateWorkspaceTTLRequest" - } - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaces/{workspace}/usage": { - "post": { - "consumes": [ - "application/json" - ], - "tags": [ - "Workspaces" - ], - "summary": "Post Workspace Usage by ID", - "operationId": "post-workspace-usage-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - }, - { - "description": "Post workspace usage request", - "name": "request", - "in": "body", - "schema": { - "$ref": "#/definitions/codersdk.PostWorkspaceUsageRequest" - } - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaces/{workspace}/watch": { - "get": { - "produces": [ - "text/event-stream" - ], - "tags": [ - "Workspaces" - ], - "summary": "Watch workspace by ID", - "operationId": "watch-workspace-by-id", - "deprecated": true, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaces/{workspace}/watch-ws": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Workspaces" - ], - "summary": "Watch workspace by ID via WebSockets", - "operationId": "watch-workspace-by-id-via-websockets", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.ServerSentEvent" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } } }, "definitions": { @@ -25030,7 +25030,7 @@ const docTemplate = `{ var SwaggerInfo = &swag.Spec{ Version: "2.0", Host: "", - BasePath: "/api/v2", + BasePath: "/", Schemes: []string{}, Title: "Coder API", Description: "Coderd is the service created by running coder server. It is a thin API that connects workspaces, provisioners and users. coderd stores its state in Postgres and is the only service that communicates with Postgres.", diff --git a/coderd/apidoc/swagger.json b/coderd/apidoc/swagger.json index 616fb9b35a..f34aa8e898 100644 --- a/coderd/apidoc/swagger.json +++ b/coderd/apidoc/swagger.json @@ -15,24 +15,8 @@ }, "version": "2.0" }, - "basePath": "/api/v2", + "basePath": "/", "paths": { - "/": { - "get": { - "produces": ["application/json"], - "tags": ["General"], - "summary": "API root handler", - "operationId": "api-root-handler", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - } - } - }, "/.well-known/oauth-authorization-server": { "get": { "produces": ["application/json"], @@ -65,1046 +49,7 @@ } } }, - "/aibridge/clients": { - "get": { - "produces": ["application/json"], - "tags": ["AI Bridge"], - "summary": "List AI Bridge clients", - "operationId": "list-ai-bridge-clients", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/aibridge/interceptions": { - "get": { - "produces": ["application/json"], - "tags": ["AI Bridge"], - "summary": "List AI Bridge interceptions", - "operationId": "list-ai-bridge-interceptions", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "Search query in the format `key:value`. Available keys are: initiator, provider, model, started_after, started_before.", - "name": "q", - "in": "query" - }, - { - "type": "integer", - "description": "Page limit", - "name": "limit", - "in": "query" - }, - { - "type": "string", - "description": "Cursor pagination after ID (cannot be used with offset)", - "name": "after_id", - "in": "query" - }, - { - "type": "integer", - "description": "Offset pagination (cannot be used with after_id)", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.AIBridgeListInterceptionsResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/aibridge/models": { - "get": { - "produces": ["application/json"], - "tags": ["AI Bridge"], - "summary": "List AI Bridge models", - "operationId": "list-ai-bridge-models", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/aibridge/sessions": { - "get": { - "produces": ["application/json"], - "tags": ["AI Bridge"], - "summary": "List AI Bridge sessions", - "operationId": "list-ai-bridge-sessions", - "parameters": [ - { - "type": "string", - "description": "Search query in the format `key:value`. Available keys are: initiator, provider, model, client, session_id, started_after, started_before.", - "name": "q", - "in": "query" - }, - { - "type": "integer", - "description": "Page limit", - "name": "limit", - "in": "query" - }, - { - "type": "string", - "description": "Cursor pagination after session ID (cannot be used with offset)", - "name": "after_session_id", - "in": "query" - }, - { - "type": "integer", - "description": "Offset pagination (cannot be used with after_session_id)", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.AIBridgeListSessionsResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/aibridge/sessions/{session_id}": { - "get": { - "produces": ["application/json"], - "tags": ["AI Bridge"], - "summary": "Get AI Bridge session threads", - "operationId": "get-ai-bridge-session-threads", - "parameters": [ - { - "type": "string", - "description": "Session ID (client_session_id or interception UUID)", - "name": "session_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Thread pagination cursor (forward/older)", - "name": "after_id", - "in": "query" - }, - { - "type": "string", - "description": "Thread pagination cursor (backward/newer)", - "name": "before_id", - "in": "query" - }, - { - "type": "integer", - "description": "Number of threads per page (default 50)", - "name": "limit", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.AIBridgeSessionThreadsResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/appearance": { - "get": { - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Get appearance", - "operationId": "get-appearance", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.AppearanceConfig" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "put": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Update appearance", - "operationId": "update-appearance", - "parameters": [ - { - "description": "Update appearance request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateAppearanceConfig" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.UpdateAppearanceConfig" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/applications/auth-redirect": { - "get": { - "tags": ["Applications"], - "summary": "Redirect to URI with encrypted API key", - "operationId": "redirect-to-uri-with-encrypted-api-key", - "parameters": [ - { - "type": "string", - "description": "Redirect destination", - "name": "redirect_uri", - "in": "query" - } - ], - "responses": { - "307": { - "description": "Temporary Redirect" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/applications/host": { - "get": { - "produces": ["application/json"], - "tags": ["Applications"], - "summary": "Get applications host", - "operationId": "get-applications-host", - "deprecated": true, - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.AppHostResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/applications/reconnecting-pty-signed-token": { - "post": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Issue signed app token for reconnecting PTY", - "operationId": "issue-signed-app-token-for-reconnecting-pty", - "parameters": [ - { - "description": "Issue reconnecting PTY signed token request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.IssueReconnectingPTYSignedTokenRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.IssueReconnectingPTYSignedTokenResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/audit": { - "get": { - "produces": ["application/json"], - "tags": ["Audit"], - "summary": "Get audit logs", - "operationId": "get-audit-logs", - "parameters": [ - { - "type": "string", - "description": "Search query", - "name": "q", - "in": "query" - }, - { - "type": "integer", - "description": "Page limit", - "name": "limit", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "Page offset", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.AuditLogResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/audit/testgenerate": { - "post": { - "consumes": ["application/json"], - "tags": ["Audit"], - "summary": "Generate fake audit log", - "operationId": "generate-fake-audit-log", - "parameters": [ - { - "description": "Audit log request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.CreateTestAuditLogRequest" - } - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/auth/scopes": { - "get": { - "produces": ["application/json"], - "tags": ["Authorization"], - "summary": "List API key scopes", - "operationId": "list-api-key-scopes", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.ExternalAPIKeyScopes" - } - } - } - } - }, - "/authcheck": { - "post": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Authorization"], - "summary": "Check authorization", - "operationId": "check-authorization", - "parameters": [ - { - "description": "Authorization request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.AuthorizationRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.AuthorizationResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/buildinfo": { - "get": { - "produces": ["application/json"], - "tags": ["General"], - "summary": "Build info", - "operationId": "build-info", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.BuildInfoResponse" - } - } - } - } - }, - "/chats/insights/pull-requests": { - "get": { - "produces": ["application/json"], - "tags": ["Chats"], - "summary": "Get PR insights", - "operationId": "get-pr-insights", - "parameters": [ - { - "type": "string", - "description": "Start date (RFC3339)", - "name": "start_date", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "End date (RFC3339)", - "name": "end_date", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.PRInsightsResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/connectionlog": { - "get": { - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Get connection logs", - "operationId": "get-connection-logs", - "parameters": [ - { - "type": "string", - "description": "Search query", - "name": "q", - "in": "query" - }, - { - "type": "integer", - "description": "Page limit", - "name": "limit", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "Page offset", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.ConnectionLogResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/csp/reports": { - "post": { - "consumes": ["application/json"], - "tags": ["General"], - "summary": "Report CSP violations", - "operationId": "report-csp-violations", - "parameters": [ - { - "description": "Violation report", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/coderd.cspViolation" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/debug/coordinator": { - "get": { - "produces": ["text/html"], - "tags": ["Debug"], - "summary": "Debug Info Wireguard Coordinator", - "operationId": "debug-info-wireguard-coordinator", - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/debug/derp/traffic": { - "get": { - "produces": ["application/json"], - "tags": ["Debug"], - "summary": "Debug DERP traffic", - "operationId": "debug-derp-traffic", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/derp.BytesSentRecv" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/debug/expvar": { - "get": { - "produces": ["application/json"], - "tags": ["Debug"], - "summary": "Debug expvar", - "operationId": "debug-expvar", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "object", - "additionalProperties": true - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/debug/health": { - "get": { - "produces": ["application/json"], - "tags": ["Debug"], - "summary": "Debug Info Deployment Health", - "operationId": "debug-info-deployment-health", - "parameters": [ - { - "type": "boolean", - "description": "Force a healthcheck to run", - "name": "force", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/healthsdk.HealthcheckReport" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/debug/health/settings": { - "get": { - "produces": ["application/json"], - "tags": ["Debug"], - "summary": "Get health settings", - "operationId": "get-health-settings", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/healthsdk.HealthSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "put": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Debug"], - "summary": "Update health settings", - "operationId": "update-health-settings", - "parameters": [ - { - "description": "Update health settings", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/healthsdk.UpdateHealthSettings" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/healthsdk.UpdateHealthSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/debug/metrics": { - "get": { - "tags": ["Debug"], - "summary": "Debug metrics", - "operationId": "debug-metrics", - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/debug/pprof": { - "get": { - "tags": ["Debug"], - "summary": "Debug pprof index", - "operationId": "debug-pprof-index", - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/debug/pprof/cmdline": { - "get": { - "tags": ["Debug"], - "summary": "Debug pprof cmdline", - "operationId": "debug-pprof-cmdline", - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/debug/pprof/profile": { - "get": { - "tags": ["Debug"], - "summary": "Debug pprof profile", - "operationId": "debug-pprof-profile", - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/debug/pprof/symbol": { - "get": { - "tags": ["Debug"], - "summary": "Debug pprof symbol", - "operationId": "debug-pprof-symbol", - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/debug/pprof/trace": { - "get": { - "tags": ["Debug"], - "summary": "Debug pprof trace", - "operationId": "debug-pprof-trace", - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/debug/profile": { - "post": { - "tags": ["Debug"], - "summary": "Collect debug profiles", - "operationId": "collect-debug-profiles", - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/debug/tailnet": { - "get": { - "produces": ["text/html"], - "tags": ["Debug"], - "summary": "Debug Info Tailnet", - "operationId": "debug-info-tailnet", - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/debug/ws": { - "get": { - "produces": ["application/json"], - "tags": ["Debug"], - "summary": "Debug Info Websocket Test", - "operationId": "debug-info-websocket-test", - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/debug/{user}/debug-link": { - "get": { - "tags": ["Agents"], - "summary": "Debug OIDC context for a user", - "operationId": "debug-oidc-context-for-a-user", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Success" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/deployment/config": { - "get": { - "produces": ["application/json"], - "tags": ["General"], - "summary": "Get deployment config", - "operationId": "get-deployment-config", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.DeploymentConfig" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/deployment/ssh": { - "get": { - "produces": ["application/json"], - "tags": ["General"], - "summary": "SSH Config", - "operationId": "ssh-config", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.SSHConfigResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/deployment/stats": { - "get": { - "produces": ["application/json"], - "tags": ["General"], - "summary": "Get deployment stats", - "operationId": "get-deployment-stats", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.DeploymentStats" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/derp-map": { - "get": { - "tags": ["Agents"], - "summary": "Get DERP map updates", - "operationId": "get-derp-map-updates", - "responses": { - "101": { - "description": "Switching Protocols" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/entitlements": { - "get": { - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Get entitlements", - "operationId": "get-entitlements", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Entitlements" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/experimental/chats/config/retention-days": { + "/api/experimental/chats/config/retention-days": { "get": { "produces": ["application/json"], "tags": ["Chats"], @@ -1158,7 +103,47 @@ } } }, - "/experimental/watch-all-workspacebuilds": { + "/api/experimental/chats/insights/pull-requests": { + "get": { + "produces": ["application/json"], + "tags": ["Chats"], + "summary": "Get PR insights", + "operationId": "get-pr-insights", + "parameters": [ + { + "type": "string", + "description": "Start date (RFC3339)", + "name": "start_date", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "End date (RFC3339)", + "name": "end_date", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.PRInsightsResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/experimental/watch-all-workspacebuilds": { "get": { "produces": ["application/json"], "tags": ["Workspaces"], @@ -1179,7 +164,1022 @@ } } }, - "/experiments": { + "/api/v2/": { + "get": { + "produces": ["application/json"], + "tags": ["General"], + "summary": "API root handler", + "operationId": "api-root-handler", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + } + } + }, + "/api/v2/aibridge/clients": { + "get": { + "produces": ["application/json"], + "tags": ["AI Bridge"], + "summary": "List AI Bridge clients", + "operationId": "list-ai-bridge-clients", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/aibridge/interceptions": { + "get": { + "produces": ["application/json"], + "tags": ["AI Bridge"], + "summary": "List AI Bridge interceptions", + "operationId": "list-ai-bridge-interceptions", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "Search query in the format `key:value`. Available keys are: initiator, provider, model, started_after, started_before.", + "name": "q", + "in": "query" + }, + { + "type": "integer", + "description": "Page limit", + "name": "limit", + "in": "query" + }, + { + "type": "string", + "description": "Cursor pagination after ID (cannot be used with offset)", + "name": "after_id", + "in": "query" + }, + { + "type": "integer", + "description": "Offset pagination (cannot be used with after_id)", + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.AIBridgeListInterceptionsResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/aibridge/models": { + "get": { + "produces": ["application/json"], + "tags": ["AI Bridge"], + "summary": "List AI Bridge models", + "operationId": "list-ai-bridge-models", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/aibridge/sessions": { + "get": { + "produces": ["application/json"], + "tags": ["AI Bridge"], + "summary": "List AI Bridge sessions", + "operationId": "list-ai-bridge-sessions", + "parameters": [ + { + "type": "string", + "description": "Search query in the format `key:value`. Available keys are: initiator, provider, model, client, session_id, started_after, started_before.", + "name": "q", + "in": "query" + }, + { + "type": "integer", + "description": "Page limit", + "name": "limit", + "in": "query" + }, + { + "type": "string", + "description": "Cursor pagination after session ID (cannot be used with offset)", + "name": "after_session_id", + "in": "query" + }, + { + "type": "integer", + "description": "Offset pagination (cannot be used with after_session_id)", + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.AIBridgeListSessionsResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/aibridge/sessions/{session_id}": { + "get": { + "produces": ["application/json"], + "tags": ["AI Bridge"], + "summary": "Get AI Bridge session threads", + "operationId": "get-ai-bridge-session-threads", + "parameters": [ + { + "type": "string", + "description": "Session ID (client_session_id or interception UUID)", + "name": "session_id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Thread pagination cursor (forward/older)", + "name": "after_id", + "in": "query" + }, + { + "type": "string", + "description": "Thread pagination cursor (backward/newer)", + "name": "before_id", + "in": "query" + }, + { + "type": "integer", + "description": "Number of threads per page (default 50)", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.AIBridgeSessionThreadsResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/appearance": { + "get": { + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Get appearance", + "operationId": "get-appearance", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.AppearanceConfig" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "put": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Update appearance", + "operationId": "update-appearance", + "parameters": [ + { + "description": "Update appearance request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateAppearanceConfig" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.UpdateAppearanceConfig" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/applications/auth-redirect": { + "get": { + "tags": ["Applications"], + "summary": "Redirect to URI with encrypted API key", + "operationId": "redirect-to-uri-with-encrypted-api-key", + "parameters": [ + { + "type": "string", + "description": "Redirect destination", + "name": "redirect_uri", + "in": "query" + } + ], + "responses": { + "307": { + "description": "Temporary Redirect" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/applications/host": { + "get": { + "produces": ["application/json"], + "tags": ["Applications"], + "summary": "Get applications host", + "operationId": "get-applications-host", + "deprecated": true, + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.AppHostResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/applications/reconnecting-pty-signed-token": { + "post": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Issue signed app token for reconnecting PTY", + "operationId": "issue-signed-app-token-for-reconnecting-pty", + "parameters": [ + { + "description": "Issue reconnecting PTY signed token request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.IssueReconnectingPTYSignedTokenRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.IssueReconnectingPTYSignedTokenResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/audit": { + "get": { + "produces": ["application/json"], + "tags": ["Audit"], + "summary": "Get audit logs", + "operationId": "get-audit-logs", + "parameters": [ + { + "type": "string", + "description": "Search query", + "name": "q", + "in": "query" + }, + { + "type": "integer", + "description": "Page limit", + "name": "limit", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "Page offset", + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.AuditLogResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/audit/testgenerate": { + "post": { + "consumes": ["application/json"], + "tags": ["Audit"], + "summary": "Generate fake audit log", + "operationId": "generate-fake-audit-log", + "parameters": [ + { + "description": "Audit log request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.CreateTestAuditLogRequest" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/auth/scopes": { + "get": { + "produces": ["application/json"], + "tags": ["Authorization"], + "summary": "List API key scopes", + "operationId": "list-api-key-scopes", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.ExternalAPIKeyScopes" + } + } + } + } + }, + "/api/v2/authcheck": { + "post": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Authorization"], + "summary": "Check authorization", + "operationId": "check-authorization", + "parameters": [ + { + "description": "Authorization request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.AuthorizationRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.AuthorizationResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/buildinfo": { + "get": { + "produces": ["application/json"], + "tags": ["General"], + "summary": "Build info", + "operationId": "build-info", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.BuildInfoResponse" + } + } + } + } + }, + "/api/v2/connectionlog": { + "get": { + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Get connection logs", + "operationId": "get-connection-logs", + "parameters": [ + { + "type": "string", + "description": "Search query", + "name": "q", + "in": "query" + }, + { + "type": "integer", + "description": "Page limit", + "name": "limit", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "Page offset", + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.ConnectionLogResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/csp/reports": { + "post": { + "consumes": ["application/json"], + "tags": ["General"], + "summary": "Report CSP violations", + "operationId": "report-csp-violations", + "parameters": [ + { + "description": "Violation report", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/coderd.cspViolation" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/debug/coordinator": { + "get": { + "produces": ["text/html"], + "tags": ["Debug"], + "summary": "Debug Info Wireguard Coordinator", + "operationId": "debug-info-wireguard-coordinator", + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/debug/derp/traffic": { + "get": { + "produces": ["application/json"], + "tags": ["Debug"], + "summary": "Debug DERP traffic", + "operationId": "debug-derp-traffic", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/derp.BytesSentRecv" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/debug/expvar": { + "get": { + "produces": ["application/json"], + "tags": ["Debug"], + "summary": "Debug expvar", + "operationId": "debug-expvar", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object", + "additionalProperties": true + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/debug/health": { + "get": { + "produces": ["application/json"], + "tags": ["Debug"], + "summary": "Debug Info Deployment Health", + "operationId": "debug-info-deployment-health", + "parameters": [ + { + "type": "boolean", + "description": "Force a healthcheck to run", + "name": "force", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/healthsdk.HealthcheckReport" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/debug/health/settings": { + "get": { + "produces": ["application/json"], + "tags": ["Debug"], + "summary": "Get health settings", + "operationId": "get-health-settings", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/healthsdk.HealthSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "put": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Debug"], + "summary": "Update health settings", + "operationId": "update-health-settings", + "parameters": [ + { + "description": "Update health settings", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/healthsdk.UpdateHealthSettings" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/healthsdk.UpdateHealthSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/debug/metrics": { + "get": { + "tags": ["Debug"], + "summary": "Debug metrics", + "operationId": "debug-metrics", + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/debug/pprof": { + "get": { + "tags": ["Debug"], + "summary": "Debug pprof index", + "operationId": "debug-pprof-index", + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/debug/pprof/cmdline": { + "get": { + "tags": ["Debug"], + "summary": "Debug pprof cmdline", + "operationId": "debug-pprof-cmdline", + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/debug/pprof/profile": { + "get": { + "tags": ["Debug"], + "summary": "Debug pprof profile", + "operationId": "debug-pprof-profile", + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/debug/pprof/symbol": { + "get": { + "tags": ["Debug"], + "summary": "Debug pprof symbol", + "operationId": "debug-pprof-symbol", + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/debug/pprof/trace": { + "get": { + "tags": ["Debug"], + "summary": "Debug pprof trace", + "operationId": "debug-pprof-trace", + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/debug/profile": { + "post": { + "tags": ["Debug"], + "summary": "Collect debug profiles", + "operationId": "collect-debug-profiles", + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/debug/tailnet": { + "get": { + "produces": ["text/html"], + "tags": ["Debug"], + "summary": "Debug Info Tailnet", + "operationId": "debug-info-tailnet", + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/debug/ws": { + "get": { + "produces": ["application/json"], + "tags": ["Debug"], + "summary": "Debug Info Websocket Test", + "operationId": "debug-info-websocket-test", + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/debug/{user}/debug-link": { + "get": { + "tags": ["Agents"], + "summary": "Debug OIDC context for a user", + "operationId": "debug-oidc-context-for-a-user", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/deployment/config": { + "get": { + "produces": ["application/json"], + "tags": ["General"], + "summary": "Get deployment config", + "operationId": "get-deployment-config", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.DeploymentConfig" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/deployment/ssh": { + "get": { + "produces": ["application/json"], + "tags": ["General"], + "summary": "SSH Config", + "operationId": "ssh-config", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.SSHConfigResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/deployment/stats": { + "get": { + "produces": ["application/json"], + "tags": ["General"], + "summary": "Get deployment stats", + "operationId": "get-deployment-stats", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.DeploymentStats" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/derp-map": { + "get": { + "tags": ["Agents"], + "summary": "Get DERP map updates", + "operationId": "get-derp-map-updates", + "responses": { + "101": { + "description": "Switching Protocols" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/entitlements": { + "get": { + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Get entitlements", + "operationId": "get-entitlements", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Entitlements" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/experiments": { "get": { "produces": ["application/json"], "tags": ["General"], @@ -1203,7 +1203,7 @@ ] } }, - "/experiments/available": { + "/api/v2/experiments/available": { "get": { "produces": ["application/json"], "tags": ["General"], @@ -1227,7 +1227,7 @@ ] } }, - "/external-auth": { + "/api/v2/external-auth": { "get": { "produces": ["application/json"], "tags": ["Git"], @@ -1248,7 +1248,7 @@ ] } }, - "/external-auth/{externalauth}": { + "/api/v2/external-auth/{externalauth}": { "get": { "produces": ["application/json"], "tags": ["Git"], @@ -1308,7 +1308,7 @@ ] } }, - "/external-auth/{externalauth}/device": { + "/api/v2/external-auth/{externalauth}/device": { "get": { "produces": ["application/json"], "tags": ["Git"], @@ -1364,7 +1364,7 @@ ] } }, - "/files": { + "/api/v2/files": { "post": { "description": "Swagger notice: Swagger 2.0 doesn't support file upload with a `content-type` different than `application/x-www-form-urlencoded`.", "consumes": ["application/x-tar"], @@ -1410,7 +1410,7 @@ ] } }, - "/files/{fileID}": { + "/api/v2/files/{fileID}": { "get": { "tags": ["Files"], "summary": "Get file by ID", @@ -1437,7 +1437,7 @@ ] } }, - "/groups": { + "/api/v2/groups": { "get": { "produces": ["application/json"], "tags": ["Enterprise"], @@ -1484,7 +1484,7 @@ ] } }, - "/groups/{group}": { + "/api/v2/groups/{group}": { "get": { "produces": ["application/json"], "tags": ["Enterprise"], @@ -1586,7 +1586,7 @@ ] } }, - "/groups/{group}/members": { + "/api/v2/groups/{group}/members": { "get": { "produces": ["application/json"], "tags": ["Enterprise"], @@ -1641,7 +1641,7 @@ ] } }, - "/init-script/{os}/{arch}": { + "/api/v2/init-script/{os}/{arch}": { "get": { "produces": ["text/plain"], "tags": ["InitScript"], @@ -1670,7 +1670,7 @@ } } }, - "/insights/daus": { + "/api/v2/insights/daus": { "get": { "produces": ["application/json"], "tags": ["Insights"], @@ -1700,7 +1700,7 @@ ] } }, - "/insights/templates": { + "/api/v2/insights/templates": { "get": { "produces": ["application/json"], "tags": ["Insights"], @@ -1757,7 +1757,7 @@ ] } }, - "/insights/user-activity": { + "/api/v2/insights/user-activity": { "get": { "produces": ["application/json"], "tags": ["Insights"], @@ -1806,7 +1806,7 @@ ] } }, - "/insights/user-latency": { + "/api/v2/insights/user-latency": { "get": { "produces": ["application/json"], "tags": ["Insights"], @@ -1855,7 +1855,7 @@ ] } }, - "/insights/user-status-counts": { + "/api/v2/insights/user-status-counts": { "get": { "produces": ["application/json"], "tags": ["Insights"], @@ -1890,7 +1890,7 @@ ] } }, - "/licenses": { + "/api/v2/licenses": { "get": { "produces": ["application/json"], "tags": ["Enterprise"], @@ -1945,7 +1945,7 @@ ] } }, - "/licenses/refresh-entitlements": { + "/api/v2/licenses/refresh-entitlements": { "post": { "produces": ["application/json"], "tags": ["Enterprise"], @@ -1966,7 +1966,7 @@ ] } }, - "/licenses/{id}": { + "/api/v2/licenses/{id}": { "delete": { "produces": ["application/json"], "tags": ["Enterprise"], @@ -1994,7 +1994,7 @@ ] } }, - "/notifications/custom": { + "/api/v2/notifications/custom": { "post": { "consumes": ["application/json"], "produces": ["application/json"], @@ -2042,7 +2042,7 @@ ] } }, - "/notifications/dispatch-methods": { + "/api/v2/notifications/dispatch-methods": { "get": { "produces": ["application/json"], "tags": ["Notifications"], @@ -2066,7 +2066,7 @@ ] } }, - "/notifications/inbox": { + "/api/v2/notifications/inbox": { "get": { "produces": ["application/json"], "tags": ["Notifications"], @@ -2114,7 +2114,7 @@ ] } }, - "/notifications/inbox/mark-all-as-read": { + "/api/v2/notifications/inbox/mark-all-as-read": { "put": { "tags": ["Notifications"], "summary": "Mark all unread notifications as read", @@ -2131,7 +2131,7 @@ ] } }, - "/notifications/inbox/watch": { + "/api/v2/notifications/inbox/watch": { "get": { "produces": ["application/json"], "tags": ["Notifications"], @@ -2179,7 +2179,7 @@ ] } }, - "/notifications/inbox/{id}/read-status": { + "/api/v2/notifications/inbox/{id}/read-status": { "put": { "produces": ["application/json"], "tags": ["Notifications"], @@ -2209,7 +2209,7 @@ ] } }, - "/notifications/settings": { + "/api/v2/notifications/settings": { "get": { "produces": ["application/json"], "tags": ["Notifications"], @@ -2264,7 +2264,7 @@ ] } }, - "/notifications/templates/custom": { + "/api/v2/notifications/templates/custom": { "get": { "produces": ["application/json"], "tags": ["Notifications"], @@ -2294,7 +2294,7 @@ ] } }, - "/notifications/templates/system": { + "/api/v2/notifications/templates/system": { "get": { "produces": ["application/json"], "tags": ["Notifications"], @@ -2324,7 +2324,7 @@ ] } }, - "/notifications/templates/{notification_template}/method": { + "/api/v2/notifications/templates/{notification_template}/method": { "put": { "produces": ["application/json"], "tags": ["Enterprise"], @@ -2354,7 +2354,7 @@ ] } }, - "/notifications/test": { + "/api/v2/notifications/test": { "post": { "tags": ["Notifications"], "summary": "Send a test notification", @@ -2371,7 +2371,7 @@ ] } }, - "/oauth2-provider/apps": { + "/api/v2/oauth2-provider/apps": { "get": { "produces": ["application/json"], "tags": ["Enterprise"], @@ -2434,7 +2434,7 @@ ] } }, - "/oauth2-provider/apps/{app}": { + "/api/v2/oauth2-provider/apps/{app}": { "get": { "produces": ["application/json"], "tags": ["Enterprise"], @@ -2526,7 +2526,7 @@ ] } }, - "/oauth2-provider/apps/{app}/secrets": { + "/api/v2/oauth2-provider/apps/{app}/secrets": { "get": { "produces": ["application/json"], "tags": ["Enterprise"], @@ -2590,7 +2590,7 @@ ] } }, - "/oauth2-provider/apps/{app}/secrets/{secretID}": { + "/api/v2/oauth2-provider/apps/{app}/secrets/{secretID}": { "delete": { "tags": ["Enterprise"], "summary": "Delete OAuth2 application secret.", @@ -2623,6 +2623,8228 @@ ] } }, + "/api/v2/organizations": { + "get": { + "produces": ["application/json"], + "tags": ["Organizations"], + "summary": "Get organizations", + "operationId": "get-organizations", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.Organization" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "post": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Organizations"], + "summary": "Create organization", + "operationId": "create-organization", + "parameters": [ + { + "description": "Create organization request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.CreateOrganizationRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/codersdk.Organization" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}": { + "get": { + "produces": ["application/json"], + "tags": ["Organizations"], + "summary": "Get organization by ID", + "operationId": "get-organization-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Organization" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "delete": { + "produces": ["application/json"], + "tags": ["Organizations"], + "summary": "Delete organization", + "operationId": "delete-organization", + "parameters": [ + { + "type": "string", + "description": "Organization ID or name", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "patch": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Organizations"], + "summary": "Update organization", + "operationId": "update-organization", + "parameters": [ + { + "type": "string", + "description": "Organization ID or name", + "name": "organization", + "in": "path", + "required": true + }, + { + "description": "Patch organization request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateOrganizationRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Organization" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/groups": { + "get": { + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Get groups by organization", + "operationId": "get-groups-by-organization", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.Group" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "post": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Create group for organization", + "operationId": "create-group-for-organization", + "parameters": [ + { + "description": "Create group request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.CreateGroupRequest" + } + }, + { + "type": "string", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/codersdk.Group" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/groups/{groupName}": { + "get": { + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Get group by organization and group name", + "operationId": "get-group-by-organization-and-group-name", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Group name", + "name": "groupName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Group" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/groups/{groupName}/members": { + "get": { + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Get group members by organization and group name", + "operationId": "get-group-members-by-organization-and-group-name", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Group name", + "name": "groupName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Member search query", + "name": "q", + "in": "query" + }, + { + "type": "string", + "format": "uuid", + "description": "After ID", + "name": "after_id", + "in": "query" + }, + { + "type": "integer", + "description": "Page limit", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Page offset", + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.GroupMembersResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/members": { + "get": { + "produces": ["application/json"], + "tags": ["Members"], + "summary": "List organization members", + "operationId": "list-organization-members", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.OrganizationMemberWithUserData" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/members/roles": { + "get": { + "produces": ["application/json"], + "tags": ["Members"], + "summary": "Get member roles by organization", + "operationId": "get-member-roles-by-organization", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.AssignableRoles" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "put": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Members"], + "summary": "Update a custom organization role", + "operationId": "update-a-custom-organization-role", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "description": "Update role request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.CustomRoleRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.Role" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "post": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Members"], + "summary": "Insert a custom organization role", + "operationId": "insert-a-custom-organization-role", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "description": "Insert role request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.CustomRoleRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.Role" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/members/roles/{roleName}": { + "delete": { + "produces": ["application/json"], + "tags": ["Members"], + "summary": "Delete a custom organization role", + "operationId": "delete-a-custom-organization-role", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Role name", + "name": "roleName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.Role" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/members/{user}": { + "get": { + "produces": ["application/json"], + "tags": ["Members"], + "summary": "Get organization member", + "operationId": "get-organization-member", + "parameters": [ + { + "type": "string", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.OrganizationMemberWithUserData" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "post": { + "produces": ["application/json"], + "tags": ["Members"], + "summary": "Add organization member", + "operationId": "add-organization-member", + "parameters": [ + { + "type": "string", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.OrganizationMember" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "delete": { + "tags": ["Members"], + "summary": "Remove organization member", + "operationId": "remove-organization-member", + "parameters": [ + { + "type": "string", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/members/{user}/roles": { + "put": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Members"], + "summary": "Assign role to organization member", + "operationId": "assign-role-to-organization-member", + "parameters": [ + { + "type": "string", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "description": "Update roles request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateRoles" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.OrganizationMember" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/members/{user}/workspace-quota": { + "get": { + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Get workspace quota by user", + "operationId": "get-workspace-quota-by-user", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceQuota" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/members/{user}/workspaces": { + "post": { + "description": "Create a new workspace using a template. The request must\nspecify either the Template ID or the Template Version ID,\nnot both. If the Template ID is specified, the active version\nof the template will be used.", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Workspaces"], + "summary": "Create user workspace by organization", + "operationId": "create-user-workspace-by-organization", + "deprecated": true, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Username, UUID, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "description": "Create workspace request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.CreateWorkspaceRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Workspace" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/members/{user}/workspaces/available-users": { + "get": { + "produces": ["application/json"], + "tags": ["Workspaces"], + "summary": "Get users available for workspace creation", + "operationId": "get-users-available-for-workspace-creation", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Search query", + "name": "q", + "in": "query" + }, + { + "type": "integer", + "description": "Limit results", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Offset for pagination", + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.MinimalUser" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/paginated-members": { + "get": { + "produces": ["application/json"], + "tags": ["Members"], + "summary": "Paginated organization members", + "operationId": "paginated-organization-members", + "parameters": [ + { + "type": "string", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Member search query", + "name": "q", + "in": "query" + }, + { + "type": "string", + "format": "uuid", + "description": "After ID", + "name": "after_id", + "in": "query" + }, + { + "type": "integer", + "description": "Page limit, if 0 returns all members", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Page offset", + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.PaginatedMembersResponse" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/provisionerdaemons": { + "get": { + "produces": ["application/json"], + "tags": ["Provisioning"], + "summary": "Get provisioner daemons", + "operationId": "get-provisioner-daemons", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Page limit", + "name": "limit", + "in": "query" + }, + { + "type": "array", + "format": "uuid", + "items": { + "type": "string" + }, + "collectionFormat": "csv", + "description": "Filter results by job IDs", + "name": "ids", + "in": "query" + }, + { + "enum": [ + "pending", + "running", + "succeeded", + "canceling", + "canceled", + "failed", + "unknown", + "pending", + "running", + "succeeded", + "canceling", + "canceled", + "failed" + ], + "type": "string", + "description": "Filter results by status", + "name": "status", + "in": "query" + }, + { + "type": "object", + "description": "Provisioner tags to filter by (JSON of the form {'tag1':'value1','tag2':'value2'})", + "name": "tags", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.ProvisionerDaemon" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/provisionerdaemons/serve": { + "get": { + "tags": ["Enterprise"], + "summary": "Serve provisioner daemon", + "operationId": "serve-provisioner-daemon", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "101": { + "description": "Switching Protocols" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/provisionerjobs": { + "get": { + "produces": ["application/json"], + "tags": ["Organizations"], + "summary": "Get provisioner jobs", + "operationId": "get-provisioner-jobs", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Page limit", + "name": "limit", + "in": "query" + }, + { + "type": "array", + "format": "uuid", + "items": { + "type": "string" + }, + "collectionFormat": "csv", + "description": "Filter results by job IDs", + "name": "ids", + "in": "query" + }, + { + "enum": [ + "pending", + "running", + "succeeded", + "canceling", + "canceled", + "failed", + "unknown", + "pending", + "running", + "succeeded", + "canceling", + "canceled", + "failed" + ], + "type": "string", + "description": "Filter results by status", + "name": "status", + "in": "query" + }, + { + "type": "object", + "description": "Provisioner tags to filter by (JSON of the form {'tag1':'value1','tag2':'value2'})", + "name": "tags", + "in": "query" + }, + { + "type": "string", + "format": "uuid", + "description": "Filter results by initiator", + "name": "initiator", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.ProvisionerJob" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/provisionerjobs/{job}": { + "get": { + "produces": ["application/json"], + "tags": ["Organizations"], + "summary": "Get provisioner job", + "operationId": "get-provisioner-job", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "Job ID", + "name": "job", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.ProvisionerJob" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/provisionerkeys": { + "get": { + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "List provisioner key", + "operationId": "list-provisioner-key", + "parameters": [ + { + "type": "string", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.ProvisionerKey" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "post": { + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Create provisioner key", + "operationId": "create-provisioner-key", + "parameters": [ + { + "type": "string", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/codersdk.CreateProvisionerKeyResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/provisionerkeys/daemons": { + "get": { + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "List provisioner key daemons", + "operationId": "list-provisioner-key-daemons", + "parameters": [ + { + "type": "string", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.ProvisionerKeyDaemons" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/provisionerkeys/{provisionerkey}": { + "delete": { + "tags": ["Enterprise"], + "summary": "Delete provisioner key", + "operationId": "delete-provisioner-key", + "parameters": [ + { + "type": "string", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Provisioner key name", + "name": "provisionerkey", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/settings/idpsync/available-fields": { + "get": { + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Get the available organization idp sync claim fields", + "operationId": "get-the-available-organization-idp-sync-claim-fields", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/settings/idpsync/field-values": { + "get": { + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Get the organization idp sync claim field values", + "operationId": "get-the-organization-idp-sync-claim-field-values", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "string", + "description": "Claim Field", + "name": "claimField", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/settings/idpsync/groups": { + "get": { + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Get group IdP Sync settings by organization", + "operationId": "get-group-idp-sync-settings-by-organization", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.GroupSyncSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "patch": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Update group IdP Sync settings by organization", + "operationId": "update-group-idp-sync-settings-by-organization", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "description": "New settings", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.GroupSyncSettings" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.GroupSyncSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/settings/idpsync/groups/config": { + "patch": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Update group IdP Sync config", + "operationId": "update-group-idp-sync-config", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID or name", + "name": "organization", + "in": "path", + "required": true + }, + { + "description": "New config values", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.PatchGroupIDPSyncConfigRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.GroupSyncSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/settings/idpsync/groups/mapping": { + "patch": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Update group IdP Sync mapping", + "operationId": "update-group-idp-sync-mapping", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID or name", + "name": "organization", + "in": "path", + "required": true + }, + { + "description": "Description of the mappings to add and remove", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.PatchGroupIDPSyncMappingRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.GroupSyncSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/settings/idpsync/roles": { + "get": { + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Get role IdP Sync settings by organization", + "operationId": "get-role-idp-sync-settings-by-organization", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.RoleSyncSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "patch": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Update role IdP Sync settings by organization", + "operationId": "update-role-idp-sync-settings-by-organization", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "description": "New settings", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.RoleSyncSettings" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.RoleSyncSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/settings/idpsync/roles/config": { + "patch": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Update role IdP Sync config", + "operationId": "update-role-idp-sync-config", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID or name", + "name": "organization", + "in": "path", + "required": true + }, + { + "description": "New config values", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.PatchRoleIDPSyncConfigRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.RoleSyncSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/settings/idpsync/roles/mapping": { + "patch": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Update role IdP Sync mapping", + "operationId": "update-role-idp-sync-mapping", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID or name", + "name": "organization", + "in": "path", + "required": true + }, + { + "description": "Description of the mappings to add and remove", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.PatchRoleIDPSyncMappingRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.RoleSyncSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/settings/workspace-sharing": { + "get": { + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Get workspace sharing settings for organization", + "operationId": "get-workspace-sharing-settings-for-organization", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceSharingSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "patch": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Update workspace sharing settings for organization", + "operationId": "update-workspace-sharing-settings-for-organization", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "description": "Workspace sharing settings", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateWorkspaceSharingSettingsRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceSharingSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/templates": { + "get": { + "description": "Returns a list of templates for the specified organization.\nBy default, only non-deprecated templates are returned.\nTo include deprecated templates, specify `deprecated:true` in the search query.", + "produces": ["application/json"], + "tags": ["Templates"], + "summary": "Get templates by organization", + "operationId": "get-templates-by-organization", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.Template" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "post": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Templates"], + "summary": "Create template by organization", + "operationId": "create-template-by-organization", + "parameters": [ + { + "description": "Request body", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.CreateTemplateRequest" + } + }, + { + "type": "string", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Template" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/templates/examples": { + "get": { + "produces": ["application/json"], + "tags": ["Templates"], + "summary": "Get template examples by organization", + "operationId": "get-template-examples-by-organization", + "deprecated": true, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.TemplateExample" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/templates/{templatename}": { + "get": { + "produces": ["application/json"], + "tags": ["Templates"], + "summary": "Get templates by organization and template name", + "operationId": "get-templates-by-organization-and-template-name", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Template name", + "name": "templatename", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Template" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/templates/{templatename}/versions/{templateversionname}": { + "get": { + "produces": ["application/json"], + "tags": ["Templates"], + "summary": "Get template version by organization, template, and name", + "operationId": "get-template-version-by-organization-template-and-name", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Template name", + "name": "templatename", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Template version name", + "name": "templateversionname", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.TemplateVersion" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/templates/{templatename}/versions/{templateversionname}/previous": { + "get": { + "produces": ["application/json"], + "tags": ["Templates"], + "summary": "Get previous template version by organization, template, and name", + "operationId": "get-previous-template-version-by-organization-template-and-name", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Template name", + "name": "templatename", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Template version name", + "name": "templateversionname", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.TemplateVersion" + } + }, + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/organizations/{organization}/templateversions": { + "post": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Templates"], + "summary": "Create template version by organization", + "operationId": "create-template-version-by-organization", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "description": "Create template version request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.CreateTemplateVersionRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/codersdk.TemplateVersion" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/prebuilds/settings": { + "get": { + "produces": ["application/json"], + "tags": ["Prebuilds"], + "summary": "Get prebuilds settings", + "operationId": "get-prebuilds-settings", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.PrebuildsSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "put": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Prebuilds"], + "summary": "Update prebuilds settings", + "operationId": "update-prebuilds-settings", + "parameters": [ + { + "description": "Prebuilds settings request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.PrebuildsSettings" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.PrebuildsSettings" + } + }, + "304": { + "description": "Not Modified" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/provisionerkeys/{provisionerkey}": { + "get": { + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Fetch provisioner key details", + "operationId": "fetch-provisioner-key-details", + "parameters": [ + { + "type": "string", + "description": "Provisioner Key", + "name": "provisionerkey", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.ProvisionerKey" + } + } + }, + "security": [ + { + "CoderProvisionerKey": [] + } + ] + } + }, + "/api/v2/regions": { + "get": { + "produces": ["application/json"], + "tags": ["WorkspaceProxies"], + "summary": "Get site-wide regions for workspace connections", + "operationId": "get-site-wide-regions-for-workspace-connections", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.RegionsResponse-codersdk_Region" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/replicas": { + "get": { + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Get active replicas", + "operationId": "get-active-replicas", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.Replica" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/settings/idpsync/available-fields": { + "get": { + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Get the available idp sync claim fields", + "operationId": "get-the-available-idp-sync-claim-fields", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/settings/idpsync/field-values": { + "get": { + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Get the idp sync claim field values", + "operationId": "get-the-idp-sync-claim-field-values", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "string", + "description": "Claim Field", + "name": "claimField", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/settings/idpsync/organization": { + "get": { + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Get organization IdP Sync settings", + "operationId": "get-organization-idp-sync-settings", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.OrganizationSyncSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "patch": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Update organization IdP Sync settings", + "operationId": "update-organization-idp-sync-settings", + "parameters": [ + { + "description": "New settings", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.OrganizationSyncSettings" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.OrganizationSyncSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/settings/idpsync/organization/config": { + "patch": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Update organization IdP Sync config", + "operationId": "update-organization-idp-sync-config", + "parameters": [ + { + "description": "New config values", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.PatchOrganizationIDPSyncConfigRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.OrganizationSyncSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/settings/idpsync/organization/mapping": { + "patch": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Update organization IdP Sync mapping", + "operationId": "update-organization-idp-sync-mapping", + "parameters": [ + { + "description": "Description of the mappings to add and remove", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.PatchOrganizationIDPSyncMappingRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.OrganizationSyncSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/tailnet": { + "get": { + "tags": ["Agents"], + "summary": "User-scoped tailnet RPC connection", + "operationId": "user-scoped-tailnet-rpc-connection", + "responses": { + "101": { + "description": "Switching Protocols" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/tasks": { + "get": { + "produces": ["application/json"], + "tags": ["Tasks"], + "summary": "List AI tasks", + "operationId": "list-ai-tasks", + "parameters": [ + { + "type": "string", + "description": "Search query for filtering tasks. Supports: owner:\u003cusername/uuid/me\u003e, organization:\u003corg-name/uuid\u003e, status:\u003cstatus\u003e", + "name": "q", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.TasksListResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/tasks/{user}": { + "post": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Tasks"], + "summary": "Create a new AI task", + "operationId": "create-a-new-ai-task", + "parameters": [ + { + "type": "string", + "description": "Username, user ID, or 'me' for the authenticated user", + "name": "user", + "in": "path", + "required": true + }, + { + "description": "Create task request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.CreateTaskRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/codersdk.Task" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/tasks/{user}/{task}": { + "get": { + "produces": ["application/json"], + "tags": ["Tasks"], + "summary": "Get AI task by ID or name", + "operationId": "get-ai-task-by-id-or-name", + "parameters": [ + { + "type": "string", + "description": "Username, user ID, or 'me' for the authenticated user", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Task ID, or task name", + "name": "task", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Task" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "delete": { + "tags": ["Tasks"], + "summary": "Delete AI task", + "operationId": "delete-ai-task", + "parameters": [ + { + "type": "string", + "description": "Username, user ID, or 'me' for the authenticated user", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Task ID, or task name", + "name": "task", + "in": "path", + "required": true + } + ], + "responses": { + "202": { + "description": "Accepted" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/tasks/{user}/{task}/input": { + "patch": { + "consumes": ["application/json"], + "tags": ["Tasks"], + "summary": "Update AI task input", + "operationId": "update-ai-task-input", + "parameters": [ + { + "type": "string", + "description": "Username, user ID, or 'me' for the authenticated user", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Task ID, or task name", + "name": "task", + "in": "path", + "required": true + }, + { + "description": "Update task input request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateTaskInputRequest" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/tasks/{user}/{task}/logs": { + "get": { + "produces": ["application/json"], + "tags": ["Tasks"], + "summary": "Get AI task logs", + "operationId": "get-ai-task-logs", + "parameters": [ + { + "type": "string", + "description": "Username, user ID, or 'me' for the authenticated user", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Task ID, or task name", + "name": "task", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.TaskLogsResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/tasks/{user}/{task}/pause": { + "post": { + "produces": ["application/json"], + "tags": ["Tasks"], + "summary": "Pause task", + "operationId": "pause-task", + "parameters": [ + { + "type": "string", + "description": "Username, user ID, or 'me' for the authenticated user", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "Task ID", + "name": "task", + "in": "path", + "required": true + } + ], + "responses": { + "202": { + "description": "Accepted", + "schema": { + "$ref": "#/definitions/codersdk.PauseTaskResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/tasks/{user}/{task}/resume": { + "post": { + "produces": ["application/json"], + "tags": ["Tasks"], + "summary": "Resume task", + "operationId": "resume-task", + "parameters": [ + { + "type": "string", + "description": "Username, user ID, or 'me' for the authenticated user", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "Task ID", + "name": "task", + "in": "path", + "required": true + } + ], + "responses": { + "202": { + "description": "Accepted", + "schema": { + "$ref": "#/definitions/codersdk.ResumeTaskResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/tasks/{user}/{task}/send": { + "post": { + "consumes": ["application/json"], + "tags": ["Tasks"], + "summary": "Send input to AI task", + "operationId": "send-input-to-ai-task", + "parameters": [ + { + "type": "string", + "description": "Username, user ID, or 'me' for the authenticated user", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Task ID, or task name", + "name": "task", + "in": "path", + "required": true + }, + { + "description": "Task input request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.TaskSendRequest" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templates": { + "get": { + "description": "Returns a list of templates.\nBy default, only non-deprecated templates are returned.\nTo include deprecated templates, specify `deprecated:true` in the search query.", + "produces": ["application/json"], + "tags": ["Templates"], + "summary": "Get all templates", + "operationId": "get-all-templates", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.Template" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templates/examples": { + "get": { + "produces": ["application/json"], + "tags": ["Templates"], + "summary": "Get template examples", + "operationId": "get-template-examples", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.TemplateExample" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templates/{template}": { + "get": { + "produces": ["application/json"], + "tags": ["Templates"], + "summary": "Get template settings by ID", + "operationId": "get-template-settings-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template ID", + "name": "template", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Template" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "delete": { + "produces": ["application/json"], + "tags": ["Templates"], + "summary": "Delete template by ID", + "operationId": "delete-template-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template ID", + "name": "template", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "patch": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Templates"], + "summary": "Update template settings by ID", + "operationId": "update-template-settings-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template ID", + "name": "template", + "in": "path", + "required": true + }, + { + "description": "Patch template settings request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateTemplateMeta" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Template" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templates/{template}/acl": { + "get": { + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Get template ACLs", + "operationId": "get-template-acls", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template ID", + "name": "template", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.TemplateACL" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "patch": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Update template ACL", + "operationId": "update-template-acl", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template ID", + "name": "template", + "in": "path", + "required": true + }, + { + "description": "Update template ACL request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateTemplateACL" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templates/{template}/acl/available": { + "get": { + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Get template available acl users/groups", + "operationId": "get-template-available-acl-usersgroups", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template ID", + "name": "template", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.ACLAvailable" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templates/{template}/daus": { + "get": { + "produces": ["application/json"], + "tags": ["Templates"], + "summary": "Get template DAUs by ID", + "operationId": "get-template-daus-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template ID", + "name": "template", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.DAUsResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templates/{template}/prebuilds/invalidate": { + "post": { + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Invalidate presets for template", + "operationId": "invalidate-presets-for-template", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template ID", + "name": "template", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.InvalidatePresetsResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templates/{template}/versions": { + "get": { + "produces": ["application/json"], + "tags": ["Templates"], + "summary": "List template versions by template ID", + "operationId": "list-template-versions-by-template-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template ID", + "name": "template", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "After ID", + "name": "after_id", + "in": "query" + }, + { + "type": "boolean", + "description": "Include archived versions in the list", + "name": "include_archived", + "in": "query" + }, + { + "type": "integer", + "description": "Page limit", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Page offset", + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.TemplateVersion" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "patch": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Templates"], + "summary": "Update active template version by template ID", + "operationId": "update-active-template-version-by-template-id", + "parameters": [ + { + "description": "Modified template version", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateActiveTemplateVersion" + } + }, + { + "type": "string", + "format": "uuid", + "description": "Template ID", + "name": "template", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templates/{template}/versions/archive": { + "post": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Templates"], + "summary": "Archive template unused versions by template id", + "operationId": "archive-template-unused-versions-by-template-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template ID", + "name": "template", + "in": "path", + "required": true + }, + { + "description": "Archive request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.ArchiveTemplateVersionsRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templates/{template}/versions/{templateversionname}": { + "get": { + "produces": ["application/json"], + "tags": ["Templates"], + "summary": "Get template version by template ID and name", + "operationId": "get-template-version-by-template-id-and-name", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template ID", + "name": "template", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Template version name", + "name": "templateversionname", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.TemplateVersion" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}": { + "get": { + "produces": ["application/json"], + "tags": ["Templates"], + "summary": "Get template version by ID", + "operationId": "get-template-version-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.TemplateVersion" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "patch": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Templates"], + "summary": "Patch template version by ID", + "operationId": "patch-template-version-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + }, + { + "description": "Patch template version request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.PatchTemplateVersionRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.TemplateVersion" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/archive": { + "post": { + "produces": ["application/json"], + "tags": ["Templates"], + "summary": "Archive template version", + "operationId": "archive-template-version", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/cancel": { + "patch": { + "produces": ["application/json"], + "tags": ["Templates"], + "summary": "Cancel template version by ID", + "operationId": "cancel-template-version-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/dry-run": { + "post": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Templates"], + "summary": "Create template version dry-run", + "operationId": "create-template-version-dry-run", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + }, + { + "description": "Dry-run request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.CreateTemplateVersionDryRunRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/codersdk.ProvisionerJob" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/dry-run/{jobID}": { + "get": { + "produces": ["application/json"], + "tags": ["Templates"], + "summary": "Get template version dry-run by job ID", + "operationId": "get-template-version-dry-run-by-job-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "Job ID", + "name": "jobID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.ProvisionerJob" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/dry-run/{jobID}/cancel": { + "patch": { + "produces": ["application/json"], + "tags": ["Templates"], + "summary": "Cancel template version dry-run by job ID", + "operationId": "cancel-template-version-dry-run-by-job-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Job ID", + "name": "jobID", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/dry-run/{jobID}/logs": { + "get": { + "produces": ["application/json"], + "tags": ["Templates"], + "summary": "Get template version dry-run logs by job ID", + "operationId": "get-template-version-dry-run-logs-by-job-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "Job ID", + "name": "jobID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Before Unix timestamp", + "name": "before", + "in": "query" + }, + { + "type": "integer", + "description": "After Unix timestamp", + "name": "after", + "in": "query" + }, + { + "type": "boolean", + "description": "Follow log stream", + "name": "follow", + "in": "query" + }, + { + "enum": ["json", "text"], + "type": "string", + "description": "Log output format. Accepted: 'json' (default), 'text' (plain text with RFC3339 timestamps and ANSI colors). Not supported with follow=true.", + "name": "format", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.ProvisionerJobLog" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/dry-run/{jobID}/matched-provisioners": { + "get": { + "produces": ["application/json"], + "tags": ["Templates"], + "summary": "Get template version dry-run matched provisioners", + "operationId": "get-template-version-dry-run-matched-provisioners", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "Job ID", + "name": "jobID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.MatchedProvisioners" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/dry-run/{jobID}/resources": { + "get": { + "produces": ["application/json"], + "tags": ["Templates"], + "summary": "Get template version dry-run resources by job ID", + "operationId": "get-template-version-dry-run-resources-by-job-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "Job ID", + "name": "jobID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.WorkspaceResource" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/dynamic-parameters": { + "get": { + "tags": ["Templates"], + "summary": "Open dynamic parameters WebSocket by template version", + "operationId": "open-dynamic-parameters-websocket-by-template-version", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + } + ], + "responses": { + "101": { + "description": "Switching Protocols" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/dynamic-parameters/evaluate": { + "post": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Templates"], + "summary": "Evaluate dynamic parameters for template version", + "operationId": "evaluate-dynamic-parameters-for-template-version", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + }, + { + "description": "Initial parameter values", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.DynamicParametersRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.DynamicParametersResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/external-auth": { + "get": { + "produces": ["application/json"], + "tags": ["Templates"], + "summary": "Get external auth by template version", + "operationId": "get-external-auth-by-template-version", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.TemplateVersionExternalAuth" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/logs": { + "get": { + "produces": ["application/json"], + "tags": ["Templates"], + "summary": "Get logs by template version", + "operationId": "get-logs-by-template-version", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Before log id", + "name": "before", + "in": "query" + }, + { + "type": "integer", + "description": "After log id", + "name": "after", + "in": "query" + }, + { + "type": "boolean", + "description": "Follow log stream", + "name": "follow", + "in": "query" + }, + { + "enum": ["json", "text"], + "type": "string", + "description": "Log output format. Accepted: 'json' (default), 'text' (plain text with RFC3339 timestamps and ANSI colors). Not supported with follow=true.", + "name": "format", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.ProvisionerJobLog" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/parameters": { + "get": { + "tags": ["Templates"], + "summary": "Removed: Get parameters by template version", + "operationId": "removed-get-parameters-by-template-version", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/presets": { + "get": { + "produces": ["application/json"], + "tags": ["Templates"], + "summary": "Get template version presets", + "operationId": "get-template-version-presets", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.Preset" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/resources": { + "get": { + "produces": ["application/json"], + "tags": ["Templates"], + "summary": "Get resources by template version", + "operationId": "get-resources-by-template-version", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.WorkspaceResource" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/rich-parameters": { + "get": { + "produces": ["application/json"], + "tags": ["Templates"], + "summary": "Get rich parameters by template version", + "operationId": "get-rich-parameters-by-template-version", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.TemplateVersionParameter" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/schema": { + "get": { + "tags": ["Templates"], + "summary": "Removed: Get schema by template version", + "operationId": "removed-get-schema-by-template-version", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/unarchive": { + "post": { + "produces": ["application/json"], + "tags": ["Templates"], + "summary": "Unarchive template version", + "operationId": "unarchive-template-version", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/templateversions/{templateversion}/variables": { + "get": { + "produces": ["application/json"], + "tags": ["Templates"], + "summary": "Get template variables by template version", + "operationId": "get-template-variables-by-template-version", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Template version ID", + "name": "templateversion", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.TemplateVersionVariable" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/updatecheck": { + "get": { + "produces": ["application/json"], + "tags": ["General"], + "summary": "Update check", + "operationId": "update-check", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.UpdateCheckResponse" + } + } + } + } + }, + "/api/v2/users": { + "get": { + "produces": ["application/json"], + "tags": ["Users"], + "summary": "Get users", + "operationId": "get-users", + "parameters": [ + { + "type": "string", + "description": "Search query", + "name": "q", + "in": "query" + }, + { + "type": "string", + "format": "uuid", + "description": "After ID", + "name": "after_id", + "in": "query" + }, + { + "type": "integer", + "description": "Page limit", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Page offset", + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.GetUsersResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "post": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Users"], + "summary": "Create new user", + "operationId": "create-new-user", + "parameters": [ + { + "description": "Create user request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.CreateUserRequestWithOrgs" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/codersdk.User" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/authmethods": { + "get": { + "produces": ["application/json"], + "tags": ["Users"], + "summary": "Get authentication methods", + "operationId": "get-authentication-methods", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.AuthMethods" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/first": { + "get": { + "produces": ["application/json"], + "tags": ["Users"], + "summary": "Check initial user created", + "operationId": "check-initial-user-created", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "post": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Users"], + "summary": "Create initial user", + "operationId": "create-initial-user", + "parameters": [ + { + "description": "First user request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.CreateFirstUserRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/codersdk.CreateFirstUserResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/login": { + "post": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Authorization"], + "summary": "Log in user", + "operationId": "log-in-user", + "parameters": [ + { + "description": "Login request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.LoginWithPasswordRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/codersdk.LoginWithPasswordResponse" + } + } + } + } + }, + "/api/v2/users/logout": { + "post": { + "produces": ["application/json"], + "tags": ["Users"], + "summary": "Log out user", + "operationId": "log-out-user", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/oauth2/github/callback": { + "get": { + "tags": ["Users"], + "summary": "OAuth 2.0 GitHub Callback", + "operationId": "oauth-20-github-callback", + "responses": { + "307": { + "description": "Temporary Redirect" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/oauth2/github/device": { + "get": { + "produces": ["application/json"], + "tags": ["Users"], + "summary": "Get Github device auth.", + "operationId": "get-github-device-auth", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.ExternalAuthDevice" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/oidc-claims": { + "get": { + "produces": ["application/json"], + "tags": ["Users"], + "summary": "Get OIDC claims for the authenticated user", + "operationId": "get-oidc-claims-for-the-authenticated-user", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.OIDCClaimsResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/oidc/callback": { + "get": { + "tags": ["Users"], + "summary": "OpenID Connect Callback", + "operationId": "openid-connect-callback", + "responses": { + "307": { + "description": "Temporary Redirect" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/otp/change-password": { + "post": { + "consumes": ["application/json"], + "tags": ["Authorization"], + "summary": "Change password with a one-time passcode", + "operationId": "change-password-with-a-one-time-passcode", + "parameters": [ + { + "description": "Change password request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.ChangePasswordWithOneTimePasscodeRequest" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/api/v2/users/otp/request": { + "post": { + "consumes": ["application/json"], + "tags": ["Authorization"], + "summary": "Request one-time passcode", + "operationId": "request-one-time-passcode", + "parameters": [ + { + "description": "One-time passcode request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.RequestOneTimePasscodeRequest" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/api/v2/users/roles": { + "get": { + "produces": ["application/json"], + "tags": ["Members"], + "summary": "Get site member roles", + "operationId": "get-site-member-roles", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.AssignableRoles" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/validate-password": { + "post": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Authorization"], + "summary": "Validate user password", + "operationId": "validate-user-password", + "parameters": [ + { + "description": "Validate user password request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.ValidateUserPasswordRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.ValidateUserPasswordResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}": { + "get": { + "produces": ["application/json"], + "tags": ["Users"], + "summary": "Get user by name", + "operationId": "get-user-by-name", + "parameters": [ + { + "type": "string", + "description": "User ID, username, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.User" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "delete": { + "tags": ["Users"], + "summary": "Delete user", + "operationId": "delete-user", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/appearance": { + "get": { + "produces": ["application/json"], + "tags": ["Users"], + "summary": "Get user appearance settings", + "operationId": "get-user-appearance-settings", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.UserAppearanceSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "put": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Users"], + "summary": "Update user appearance settings", + "operationId": "update-user-appearance-settings", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "description": "New appearance settings", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateUserAppearanceSettingsRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.UserAppearanceSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/autofill-parameters": { + "get": { + "produces": ["application/json"], + "tags": ["Users"], + "summary": "Get autofill build parameters for user", + "operationId": "get-autofill-build-parameters-for-user", + "parameters": [ + { + "type": "string", + "description": "User ID, username, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Template ID", + "name": "template_id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.UserParameter" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/convert-login": { + "post": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Authorization"], + "summary": "Convert user from password to oauth authentication", + "operationId": "convert-user-from-password-to-oauth-authentication", + "parameters": [ + { + "description": "Convert request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.ConvertLoginRequest" + } + }, + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/codersdk.OAuthConversionResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/gitsshkey": { + "get": { + "produces": ["application/json"], + "tags": ["Users"], + "summary": "Get user Git SSH key", + "operationId": "get-user-git-ssh-key", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.GitSSHKey" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "put": { + "produces": ["application/json"], + "tags": ["Users"], + "summary": "Regenerate user SSH key", + "operationId": "regenerate-user-ssh-key", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.GitSSHKey" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/keys": { + "post": { + "produces": ["application/json"], + "tags": ["Users"], + "summary": "Create new session key", + "operationId": "create-new-session-key", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/codersdk.GenerateAPIKeyResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/keys/tokens": { + "get": { + "produces": ["application/json"], + "tags": ["Users"], + "summary": "Get user tokens", + "operationId": "get-user-tokens", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "boolean", + "description": "Include expired tokens in the list", + "name": "include_expired", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.APIKey" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "post": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Users"], + "summary": "Create token API key", + "operationId": "create-token-api-key", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "description": "Create token request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.CreateTokenRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/codersdk.GenerateAPIKeyResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/keys/tokens/tokenconfig": { + "get": { + "produces": ["application/json"], + "tags": ["General"], + "summary": "Get token config", + "operationId": "get-token-config", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.TokenConfig" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/keys/tokens/{keyname}": { + "get": { + "produces": ["application/json"], + "tags": ["Users"], + "summary": "Get API key by token name", + "operationId": "get-api-key-by-token-name", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "string", + "description": "Key Name", + "name": "keyname", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.APIKey" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/keys/{keyid}": { + "get": { + "produces": ["application/json"], + "tags": ["Users"], + "summary": "Get API key by ID", + "operationId": "get-api-key-by-id", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "string", + "description": "Key ID", + "name": "keyid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.APIKey" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "delete": { + "tags": ["Users"], + "summary": "Delete API key", + "operationId": "delete-api-key", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "string", + "description": "Key ID", + "name": "keyid", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/keys/{keyid}/expire": { + "put": { + "tags": ["Users"], + "summary": "Expire API key", + "operationId": "expire-api-key", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "string", + "description": "Key ID", + "name": "keyid", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/login-type": { + "get": { + "produces": ["application/json"], + "tags": ["Users"], + "summary": "Get user login type", + "operationId": "get-user-login-type", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.UserLoginType" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/notifications/preferences": { + "get": { + "produces": ["application/json"], + "tags": ["Notifications"], + "summary": "Get user notification preferences", + "operationId": "get-user-notification-preferences", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.NotificationPreference" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "put": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Notifications"], + "summary": "Update user notification preferences", + "operationId": "update-user-notification-preferences", + "parameters": [ + { + "description": "Preferences", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateUserNotificationPreferences" + } + }, + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.NotificationPreference" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/organizations": { + "get": { + "produces": ["application/json"], + "tags": ["Users"], + "summary": "Get organizations by user", + "operationId": "get-organizations-by-user", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.Organization" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/organizations/{organizationname}": { + "get": { + "produces": ["application/json"], + "tags": ["Users"], + "summary": "Get organization by user and organization name", + "operationId": "get-organization-by-user-and-organization-name", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Organization name", + "name": "organizationname", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Organization" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/password": { + "put": { + "consumes": ["application/json"], + "tags": ["Users"], + "summary": "Update user password", + "operationId": "update-user-password", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "description": "Update password request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateUserPasswordRequest" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/preferences": { + "get": { + "produces": ["application/json"], + "tags": ["Users"], + "summary": "Get user preference settings", + "operationId": "get-user-preference-settings", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.UserPreferenceSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "put": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Users"], + "summary": "Update user preference settings", + "operationId": "update-user-preference-settings", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "description": "New preference settings", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateUserPreferenceSettingsRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.UserPreferenceSettings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/profile": { + "put": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Users"], + "summary": "Update user profile", + "operationId": "update-user-profile", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "description": "Updated profile", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateUserProfileRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.User" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/quiet-hours": { + "get": { + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Get user quiet hours schedule", + "operationId": "get-user-quiet-hours-schedule", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "User ID", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.UserQuietHoursScheduleResponse" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "put": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Update user quiet hours schedule", + "operationId": "update-user-quiet-hours-schedule", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "User ID", + "name": "user", + "in": "path", + "required": true + }, + { + "description": "Update schedule request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateUserQuietHoursScheduleRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.UserQuietHoursScheduleResponse" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/roles": { + "get": { + "produces": ["application/json"], + "tags": ["Users"], + "summary": "Get user roles", + "operationId": "get-user-roles", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.User" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "put": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Users"], + "summary": "Assign role to user", + "operationId": "assign-role-to-user", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "description": "Update roles request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateRoles" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.User" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/secrets": { + "get": { + "produces": ["application/json"], + "tags": ["Secrets"], + "summary": "List user secrets", + "operationId": "list-user-secrets", + "parameters": [ + { + "type": "string", + "description": "User ID, username, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.UserSecret" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "post": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Secrets"], + "summary": "Create a new user secret", + "operationId": "create-a-new-user-secret", + "parameters": [ + { + "type": "string", + "description": "User ID, username, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "description": "Create secret request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.CreateUserSecretRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/codersdk.UserSecret" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/secrets/{name}": { + "get": { + "produces": ["application/json"], + "tags": ["Secrets"], + "summary": "Get a user secret by name", + "operationId": "get-a-user-secret-by-name", + "parameters": [ + { + "type": "string", + "description": "User ID, username, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Secret name", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.UserSecret" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "delete": { + "tags": ["Secrets"], + "summary": "Delete a user secret", + "operationId": "delete-a-user-secret", + "parameters": [ + { + "type": "string", + "description": "User ID, username, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Secret name", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "patch": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Secrets"], + "summary": "Update a user secret", + "operationId": "update-a-user-secret", + "parameters": [ + { + "type": "string", + "description": "User ID, username, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Secret name", + "name": "name", + "in": "path", + "required": true + }, + { + "description": "Update secret request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateUserSecretRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.UserSecret" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/status/activate": { + "put": { + "produces": ["application/json"], + "tags": ["Users"], + "summary": "Activate user account", + "operationId": "activate-user-account", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.User" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/status/suspend": { + "put": { + "produces": ["application/json"], + "tags": ["Users"], + "summary": "Suspend user account", + "operationId": "suspend-user-account", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.User" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/webpush/subscription": { + "post": { + "consumes": ["application/json"], + "tags": ["Notifications"], + "summary": "Create user webpush subscription", + "operationId": "create-user-webpush-subscription", + "parameters": [ + { + "description": "Webpush subscription", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.WebpushSubscription" + } + }, + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + }, + "delete": { + "consumes": ["application/json"], + "tags": ["Notifications"], + "summary": "Delete user webpush subscription", + "operationId": "delete-user-webpush-subscription", + "parameters": [ + { + "description": "Webpush subscription", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.DeleteWebpushSubscription" + } + }, + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/users/{user}/webpush/test": { + "post": { + "tags": ["Notifications"], + "summary": "Send a test push notification", + "operationId": "send-a-test-push-notification", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/users/{user}/workspace/{workspacename}": { + "get": { + "produces": ["application/json"], + "tags": ["Workspaces"], + "summary": "Get workspace metadata by user and workspace name", + "operationId": "get-workspace-metadata-by-user-and-workspace-name", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Workspace name", + "name": "workspacename", + "in": "path", + "required": true + }, + { + "type": "boolean", + "description": "Return data instead of HTTP 404 if the workspace is deleted", + "name": "include_deleted", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Workspace" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/workspace/{workspacename}/builds/{buildnumber}": { + "get": { + "produces": ["application/json"], + "tags": ["Builds"], + "summary": "Get workspace build by user, workspace name, and build number", + "operationId": "get-workspace-build-by-user-workspace-name-and-build-number", + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Workspace name", + "name": "workspacename", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "number", + "description": "Build number", + "name": "buildnumber", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceBuild" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/users/{user}/workspaces": { + "post": { + "description": "Create a new workspace using a template. The request must\nspecify either the Template ID or the Template Version ID,\nnot both. If the Template ID is specified, the active version\nof the template will be used.", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Workspaces"], + "summary": "Create user workspace", + "operationId": "create-user-workspace", + "parameters": [ + { + "type": "string", + "description": "Username, UUID, or me", + "name": "user", + "in": "path", + "required": true + }, + { + "description": "Create workspace request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.CreateWorkspaceRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Workspace" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspace-quota/{user}": { + "get": { + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Get workspace quota by user deprecated", + "operationId": "get-workspace-quota-by-user-deprecated", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "User ID, name, or me", + "name": "user", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceQuota" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/aws-instance-identity": { + "post": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Agents"], + "summary": "Authenticate agent on AWS instance", + "operationId": "authenticate-agent-on-aws-instance", + "parameters": [ + { + "description": "Instance identity token. The optional agent_name field disambiguates when multiple agents share the same instance ID.", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/agentsdk.AWSInstanceIdentityToken" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/agentsdk.AuthenticateResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/azure-instance-identity": { + "post": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Agents"], + "summary": "Authenticate agent on Azure instance", + "operationId": "authenticate-agent-on-azure-instance", + "parameters": [ + { + "description": "Instance identity token. The optional agent_name field disambiguates when multiple agents share the same instance ID.", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/agentsdk.AzureInstanceIdentityToken" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/agentsdk.AuthenticateResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/connection": { + "get": { + "produces": ["application/json"], + "tags": ["Agents"], + "summary": "Get connection info for workspace agent generic", + "operationId": "get-connection-info-for-workspace-agent-generic", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/workspacesdk.AgentConnectionInfo" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/workspaceagents/google-instance-identity": { + "post": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Agents"], + "summary": "Authenticate agent on Google Cloud instance", + "operationId": "authenticate-agent-on-google-cloud-instance", + "parameters": [ + { + "description": "Instance identity token. The optional agent_name field disambiguates when multiple agents share the same instance ID.", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/agentsdk.GoogleInstanceIdentityToken" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/agentsdk.AuthenticateResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/me/app-status": { + "patch": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Agents"], + "summary": "Patch workspace agent app status", + "operationId": "patch-workspace-agent-app-status", + "deprecated": true, + "parameters": [ + { + "description": "app status", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/agentsdk.PatchAppStatus" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/me/external-auth": { + "get": { + "produces": ["application/json"], + "tags": ["Agents"], + "summary": "Get workspace agent external auth", + "operationId": "get-workspace-agent-external-auth", + "parameters": [ + { + "type": "string", + "description": "Match", + "name": "match", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "Provider ID", + "name": "id", + "in": "query", + "required": true + }, + { + "type": "boolean", + "description": "Wait for a new token to be issued", + "name": "listen", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/agentsdk.ExternalAuthResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/me/gitauth": { + "get": { + "produces": ["application/json"], + "tags": ["Agents"], + "summary": "Removed: Get workspace agent git auth", + "operationId": "removed-get-workspace-agent-git-auth", + "parameters": [ + { + "type": "string", + "description": "Match", + "name": "match", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "Provider ID", + "name": "id", + "in": "query", + "required": true + }, + { + "type": "boolean", + "description": "Wait for a new token to be issued", + "name": "listen", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/agentsdk.ExternalAuthResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/me/gitsshkey": { + "get": { + "produces": ["application/json"], + "tags": ["Agents"], + "summary": "Get workspace agent Git SSH key", + "operationId": "get-workspace-agent-git-ssh-key", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/agentsdk.GitSSHKey" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/me/log-source": { + "post": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Agents"], + "summary": "Post workspace agent log source", + "operationId": "post-workspace-agent-log-source", + "parameters": [ + { + "description": "Log source request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/agentsdk.PostLogSourceRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceAgentLogSource" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/me/logs": { + "patch": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Agents"], + "summary": "Patch workspace agent logs", + "operationId": "patch-workspace-agent-logs", + "parameters": [ + { + "description": "logs", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/agentsdk.PatchLogs" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/me/reinit": { + "get": { + "produces": ["application/json"], + "tags": ["Agents"], + "summary": "Get workspace agent reinitialization", + "operationId": "get-workspace-agent-reinitialization", + "parameters": [ + { + "type": "boolean", + "description": "Opt in to durable reinit checks", + "name": "wait", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/agentsdk.ReinitializationEvent" + } + }, + "409": { + "description": "Conflict", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/me/rpc": { + "get": { + "tags": ["Agents"], + "summary": "Workspace agent RPC API", + "operationId": "workspace-agent-rpc-api", + "responses": { + "101": { + "description": "Switching Protocols" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/workspaceagents/me/tasks/{task}/log-snapshot": { + "post": { + "consumes": ["application/json"], + "tags": ["Tasks"], + "summary": "Upload task log snapshot", + "operationId": "upload-task-log-snapshot", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Task ID", + "name": "task", + "in": "path", + "required": true + }, + { + "enum": ["agentapi"], + "type": "string", + "description": "Snapshot format", + "name": "format", + "in": "query", + "required": true + }, + { + "description": "Raw snapshot payload (structure depends on format parameter)", + "name": "request", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/{workspaceagent}": { + "get": { + "produces": ["application/json"], + "tags": ["Agents"], + "summary": "Get workspace agent by ID", + "operationId": "get-workspace-agent-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace agent ID", + "name": "workspaceagent", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceAgent" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/{workspaceagent}/connection": { + "get": { + "produces": ["application/json"], + "tags": ["Agents"], + "summary": "Get connection info for workspace agent", + "operationId": "get-connection-info-for-workspace-agent", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace agent ID", + "name": "workspaceagent", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/workspacesdk.AgentConnectionInfo" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/{workspaceagent}/containers": { + "get": { + "produces": ["application/json"], + "tags": ["Agents"], + "summary": "Get running containers for workspace agent", + "operationId": "get-running-containers-for-workspace-agent", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace agent ID", + "name": "workspaceagent", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "key=value", + "description": "Labels", + "name": "label", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceAgentListContainersResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/{workspaceagent}/containers/devcontainers/{devcontainer}": { + "delete": { + "tags": ["Agents"], + "summary": "Delete devcontainer for workspace agent", + "operationId": "delete-devcontainer-for-workspace-agent", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace agent ID", + "name": "workspaceagent", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Devcontainer ID", + "name": "devcontainer", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/{workspaceagent}/containers/devcontainers/{devcontainer}/recreate": { + "post": { + "produces": ["application/json"], + "tags": ["Agents"], + "summary": "Recreate devcontainer for workspace agent", + "operationId": "recreate-devcontainer-for-workspace-agent", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace agent ID", + "name": "workspaceagent", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Devcontainer ID", + "name": "devcontainer", + "in": "path", + "required": true + } + ], + "responses": { + "202": { + "description": "Accepted", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/{workspaceagent}/containers/watch": { + "get": { + "produces": ["application/json"], + "tags": ["Agents"], + "summary": "Watch workspace agent for container updates.", + "operationId": "watch-workspace-agent-for-container-updates", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace agent ID", + "name": "workspaceagent", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceAgentListContainersResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/{workspaceagent}/coordinate": { + "get": { + "tags": ["Agents"], + "summary": "Coordinate workspace agent", + "operationId": "coordinate-workspace-agent", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace agent ID", + "name": "workspaceagent", + "in": "path", + "required": true + } + ], + "responses": { + "101": { + "description": "Switching Protocols" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/{workspaceagent}/listening-ports": { + "get": { + "produces": ["application/json"], + "tags": ["Agents"], + "summary": "Get listening ports for workspace agent", + "operationId": "get-listening-ports-for-workspace-agent", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace agent ID", + "name": "workspaceagent", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceAgentListeningPortsResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/{workspaceagent}/logs": { + "get": { + "produces": ["application/json"], + "tags": ["Agents"], + "summary": "Get logs by workspace agent", + "operationId": "get-logs-by-workspace-agent", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace agent ID", + "name": "workspaceagent", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Before log id", + "name": "before", + "in": "query" + }, + { + "type": "integer", + "description": "After log id", + "name": "after", + "in": "query" + }, + { + "type": "boolean", + "description": "Follow log stream", + "name": "follow", + "in": "query" + }, + { + "type": "boolean", + "description": "Disable compression for WebSocket connection", + "name": "no_compression", + "in": "query" + }, + { + "enum": ["json", "text"], + "type": "string", + "description": "Log output format. Accepted: 'json' (default), 'text' (plain text with RFC3339 timestamps and ANSI colors). Not supported with follow=true.", + "name": "format", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.WorkspaceAgentLog" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/{workspaceagent}/pty": { + "get": { + "tags": ["Agents"], + "summary": "Open PTY to workspace agent", + "operationId": "open-pty-to-workspace-agent", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace agent ID", + "name": "workspaceagent", + "in": "path", + "required": true + } + ], + "responses": { + "101": { + "description": "Switching Protocols" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/{workspaceagent}/startup-logs": { + "get": { + "produces": ["application/json"], + "tags": ["Agents"], + "summary": "Removed: Get logs by workspace agent", + "operationId": "removed-get-logs-by-workspace-agent", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace agent ID", + "name": "workspaceagent", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Before log id", + "name": "before", + "in": "query" + }, + { + "type": "integer", + "description": "After log id", + "name": "after", + "in": "query" + }, + { + "type": "boolean", + "description": "Follow log stream", + "name": "follow", + "in": "query" + }, + { + "type": "boolean", + "description": "Disable compression for WebSocket connection", + "name": "no_compression", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.WorkspaceAgentLog" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceagents/{workspaceagent}/watch-metadata": { + "get": { + "tags": ["Agents"], + "summary": "Watch for workspace agent metadata updates", + "operationId": "watch-for-workspace-agent-metadata-updates", + "deprecated": true, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace agent ID", + "name": "workspaceagent", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/workspaceagents/{workspaceagent}/watch-metadata-ws": { + "get": { + "produces": ["application/json"], + "tags": ["Agents"], + "summary": "Watch for workspace agent metadata updates via WebSockets", + "operationId": "watch-for-workspace-agent-metadata-updates-via-websockets", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace agent ID", + "name": "workspaceagent", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.ServerSentEvent" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/workspacebuilds/{workspacebuild}": { + "get": { + "produces": ["application/json"], + "tags": ["Builds"], + "summary": "Get workspace build", + "operationId": "get-workspace-build", + "parameters": [ + { + "type": "string", + "description": "Workspace build ID", + "name": "workspacebuild", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceBuild" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspacebuilds/{workspacebuild}/cancel": { + "patch": { + "produces": ["application/json"], + "tags": ["Builds"], + "summary": "Cancel workspace build", + "operationId": "cancel-workspace-build", + "parameters": [ + { + "type": "string", + "description": "Workspace build ID", + "name": "workspacebuild", + "in": "path", + "required": true + }, + { + "enum": ["running", "pending"], + "type": "string", + "description": "Expected status of the job. If expect_status is supplied, the request will be rejected with 412 Precondition Failed if the job doesn't match the state when performing the cancellation.", + "name": "expect_status", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspacebuilds/{workspacebuild}/logs": { + "get": { + "produces": ["application/json"], + "tags": ["Builds"], + "summary": "Get workspace build logs", + "operationId": "get-workspace-build-logs", + "parameters": [ + { + "type": "string", + "description": "Workspace build ID", + "name": "workspacebuild", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Before log id", + "name": "before", + "in": "query" + }, + { + "type": "integer", + "description": "After log id", + "name": "after", + "in": "query" + }, + { + "type": "boolean", + "description": "Follow log stream", + "name": "follow", + "in": "query" + }, + { + "enum": ["json", "text"], + "type": "string", + "description": "Log output format. Accepted: 'json' (default), 'text' (plain text with RFC3339 timestamps and ANSI colors). Not supported with follow=true.", + "name": "format", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.ProvisionerJobLog" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspacebuilds/{workspacebuild}/parameters": { + "get": { + "produces": ["application/json"], + "tags": ["Builds"], + "summary": "Get build parameters for workspace build", + "operationId": "get-build-parameters-for-workspace-build", + "parameters": [ + { + "type": "string", + "description": "Workspace build ID", + "name": "workspacebuild", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.WorkspaceBuildParameter" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspacebuilds/{workspacebuild}/resources": { + "get": { + "produces": ["application/json"], + "tags": ["Builds"], + "summary": "Removed: Get workspace resources for workspace build", + "operationId": "removed-get-workspace-resources-for-workspace-build", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "Workspace build ID", + "name": "workspacebuild", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.WorkspaceResource" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspacebuilds/{workspacebuild}/state": { + "get": { + "produces": ["application/json"], + "tags": ["Builds"], + "summary": "Get provisioner state for workspace build", + "operationId": "get-provisioner-state-for-workspace-build", + "parameters": [ + { + "type": "string", + "description": "Workspace build ID", + "name": "workspacebuild", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceBuild" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "put": { + "consumes": ["application/json"], + "tags": ["Builds"], + "summary": "Update workspace build state", + "operationId": "update-workspace-build-state", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace build ID", + "name": "workspacebuild", + "in": "path", + "required": true + }, + { + "description": "Request body", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateWorkspaceBuildStateRequest" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspacebuilds/{workspacebuild}/timings": { + "get": { + "produces": ["application/json"], + "tags": ["Builds"], + "summary": "Get workspace build timings by ID", + "operationId": "get-workspace-build-timings-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace build ID", + "name": "workspacebuild", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceBuildTimings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceproxies": { + "get": { + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Get workspace proxies", + "operationId": "get-workspace-proxies", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.RegionsResponse-codersdk_WorkspaceProxy" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "post": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Create workspace proxy", + "operationId": "create-workspace-proxy", + "parameters": [ + { + "description": "Create workspace proxy request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.CreateWorkspaceProxyRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceProxy" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaceproxies/me/app-stats": { + "post": { + "consumes": ["application/json"], + "tags": ["Enterprise"], + "summary": "Report workspace app stats", + "operationId": "report-workspace-app-stats", + "parameters": [ + { + "description": "Report app stats request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/wsproxysdk.ReportAppStatsRequest" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/workspaceproxies/me/coordinate": { + "get": { + "tags": ["Enterprise"], + "summary": "Workspace Proxy Coordinate", + "operationId": "workspace-proxy-coordinate", + "responses": { + "101": { + "description": "Switching Protocols" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/workspaceproxies/me/crypto-keys": { + "get": { + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Get workspace proxy crypto keys", + "operationId": "get-workspace-proxy-crypto-keys", + "parameters": [ + { + "type": "string", + "description": "Feature key", + "name": "feature", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/wsproxysdk.CryptoKeysResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/workspaceproxies/me/deregister": { + "post": { + "consumes": ["application/json"], + "tags": ["Enterprise"], + "summary": "Deregister workspace proxy", + "operationId": "deregister-workspace-proxy", + "parameters": [ + { + "description": "Deregister workspace proxy request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/wsproxysdk.DeregisterWorkspaceProxyRequest" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/workspaceproxies/me/issue-signed-app-token": { + "post": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Issue signed workspace app token", + "operationId": "issue-signed-workspace-app-token", + "parameters": [ + { + "description": "Issue signed app token request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/workspaceapps.IssueTokenRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/wsproxysdk.IssueSignedAppTokenResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/workspaceproxies/me/register": { + "post": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Register workspace proxy", + "operationId": "register-workspace-proxy", + "parameters": [ + { + "description": "Register workspace proxy request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/wsproxysdk.RegisterWorkspaceProxyRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/wsproxysdk.RegisterWorkspaceProxyResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ], + "x-apidocgen": { + "skip": true + } + } + }, + "/api/v2/workspaceproxies/{workspaceproxy}": { + "get": { + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Get workspace proxy", + "operationId": "get-workspace-proxy", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Proxy ID or name", + "name": "workspaceproxy", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceProxy" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "delete": { + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Delete workspace proxy", + "operationId": "delete-workspace-proxy", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Proxy ID or name", + "name": "workspaceproxy", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "patch": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Update workspace proxy", + "operationId": "update-workspace-proxy", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Proxy ID or name", + "name": "workspaceproxy", + "in": "path", + "required": true + }, + { + "description": "Update workspace proxy request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.PatchWorkspaceProxy" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceProxy" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaces": { + "get": { + "produces": ["application/json"], + "tags": ["Workspaces"], + "summary": "List workspaces", + "operationId": "list-workspaces", + "parameters": [ + { + "type": "string", + "description": "Search query in the format `key:value`. Available keys are: owner, template, name, status, has-agent, dormant, last_used_after, last_used_before, has-ai-task, has_external_agent, healthy.", + "name": "q", + "in": "query" + }, + { + "type": "integer", + "description": "Page limit", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Page offset", + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspacesResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaces/{workspace}": { + "get": { + "produces": ["application/json"], + "tags": ["Workspaces"], + "summary": "Get workspace metadata by ID", + "operationId": "get-workspace-metadata-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + }, + { + "type": "boolean", + "description": "Return data instead of HTTP 404 if the workspace is deleted", + "name": "include_deleted", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Workspace" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "patch": { + "consumes": ["application/json"], + "tags": ["Workspaces"], + "summary": "Update workspace metadata by ID", + "operationId": "update-workspace-metadata-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + }, + { + "description": "Metadata update request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateWorkspaceRequest" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaces/{workspace}/acl": { + "get": { + "produces": ["application/json"], + "tags": ["Workspaces"], + "summary": "Get workspace ACLs", + "operationId": "get-workspace-acls", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceACL" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "delete": { + "tags": ["Workspaces"], + "summary": "Completely clears the workspace's user and group ACLs.", + "operationId": "completely-clears-the-workspaces-user-and-group-acls", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "patch": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Workspaces"], + "summary": "Update workspace ACL", + "operationId": "update-workspace-acl", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + }, + { + "description": "Update workspace ACL request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateWorkspaceACL" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaces/{workspace}/autostart": { + "put": { + "consumes": ["application/json"], + "tags": ["Workspaces"], + "summary": "Update workspace autostart schedule by ID", + "operationId": "update-workspace-autostart-schedule-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + }, + { + "description": "Schedule update request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateWorkspaceAutostartRequest" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaces/{workspace}/autoupdates": { + "put": { + "consumes": ["application/json"], + "tags": ["Workspaces"], + "summary": "Update workspace automatic updates by ID", + "operationId": "update-workspace-automatic-updates-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + }, + { + "description": "Automatic updates request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateWorkspaceAutomaticUpdatesRequest" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaces/{workspace}/builds": { + "get": { + "produces": ["application/json"], + "tags": ["Builds"], + "summary": "Get workspace builds by workspace ID", + "operationId": "get-workspace-builds-by-workspace-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "After ID", + "name": "after_id", + "in": "query" + }, + { + "type": "integer", + "description": "Page limit", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Page offset", + "name": "offset", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "description": "Since timestamp", + "name": "since", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.WorkspaceBuild" + } + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "post": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Builds"], + "summary": "Create workspace build", + "operationId": "create-workspace-build", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + }, + { + "description": "Create workspace build request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.CreateWorkspaceBuildRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceBuild" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaces/{workspace}/dormant": { + "put": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Workspaces"], + "summary": "Update workspace dormancy status by id.", + "operationId": "update-workspace-dormancy-status-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + }, + { + "description": "Make a workspace dormant or active", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateWorkspaceDormancy" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Workspace" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaces/{workspace}/extend": { + "put": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["Workspaces"], + "summary": "Extend workspace deadline by ID", + "operationId": "extend-workspace-deadline-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + }, + { + "description": "Extend deadline update request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.PutExtendWorkspaceRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaces/{workspace}/external-agent/{agent}/credentials": { + "get": { + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Get workspace external agent credentials", + "operationId": "get-workspace-external-agent-credentials", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Agent name", + "name": "agent", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.ExternalAgentCredentials" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaces/{workspace}/favorite": { + "put": { + "tags": ["Workspaces"], + "summary": "Favorite workspace by ID.", + "operationId": "favorite-workspace-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "delete": { + "tags": ["Workspaces"], + "summary": "Unfavorite workspace by ID.", + "operationId": "unfavorite-workspace-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaces/{workspace}/port-share": { + "get": { + "produces": ["application/json"], + "tags": ["PortSharing"], + "summary": "Get workspace agent port shares", + "operationId": "get-workspace-agent-port-shares", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceAgentPortShares" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "post": { + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["PortSharing"], + "summary": "Upsert workspace agent port share", + "operationId": "upsert-workspace-agent-port-share", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + }, + { + "description": "Upsert port sharing level request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpsertWorkspaceAgentPortShareRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceAgentPortShare" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + }, + "delete": { + "consumes": ["application/json"], + "tags": ["PortSharing"], + "summary": "Delete workspace agent port share", + "operationId": "delete-workspace-agent-port-share", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + }, + { + "description": "Delete port sharing level request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.DeleteWorkspaceAgentPortShareRequest" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaces/{workspace}/resolve-autostart": { + "get": { + "produces": ["application/json"], + "tags": ["Workspaces"], + "summary": "Resolve workspace autostart by id.", + "operationId": "resolve-workspace-autostart-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.ResolveAutostartResponse" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaces/{workspace}/timings": { + "get": { + "produces": ["application/json"], + "tags": ["Workspaces"], + "summary": "Get workspace timings by ID", + "operationId": "get-workspace-timings-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.WorkspaceBuildTimings" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaces/{workspace}/ttl": { + "put": { + "consumes": ["application/json"], + "tags": ["Workspaces"], + "summary": "Update workspace TTL by ID", + "operationId": "update-workspace-ttl-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + }, + { + "description": "Workspace TTL update request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/codersdk.UpdateWorkspaceTTLRequest" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaces/{workspace}/usage": { + "post": { + "consumes": ["application/json"], + "tags": ["Workspaces"], + "summary": "Post Workspace Usage by ID", + "operationId": "post-workspace-usage-by-id", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + }, + { + "description": "Post workspace usage request", + "name": "request", + "in": "body", + "schema": { + "$ref": "#/definitions/codersdk.PostWorkspaceUsageRequest" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaces/{workspace}/watch": { + "get": { + "produces": ["text/event-stream"], + "tags": ["Workspaces"], + "summary": "Watch workspace by ID", + "operationId": "watch-workspace-by-id", + "deprecated": true, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.Response" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, + "/api/v2/workspaces/{workspace}/watch-ws": { + "get": { + "produces": ["application/json"], + "tags": ["Workspaces"], + "summary": "Watch workspace by ID via WebSockets", + "operationId": "watch-workspace-by-id-via-websockets", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Workspace ID", + "name": "workspace", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/codersdk.ServerSentEvent" + } + } + }, + "security": [ + { + "CoderSessionToken": [] + } + ] + } + }, "/oauth2/authorize": { "get": { "tags": ["Enterprise"], @@ -2948,2095 +11170,6 @@ ] } }, - "/organizations": { - "get": { - "produces": ["application/json"], - "tags": ["Organizations"], - "summary": "Get organizations", - "operationId": "get-organizations", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.Organization" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "post": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Organizations"], - "summary": "Create organization", - "operationId": "create-organization", - "parameters": [ - { - "description": "Create organization request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.CreateOrganizationRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/codersdk.Organization" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}": { - "get": { - "produces": ["application/json"], - "tags": ["Organizations"], - "summary": "Get organization by ID", - "operationId": "get-organization-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Organization" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "delete": { - "produces": ["application/json"], - "tags": ["Organizations"], - "summary": "Delete organization", - "operationId": "delete-organization", - "parameters": [ - { - "type": "string", - "description": "Organization ID or name", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "patch": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Organizations"], - "summary": "Update organization", - "operationId": "update-organization", - "parameters": [ - { - "type": "string", - "description": "Organization ID or name", - "name": "organization", - "in": "path", - "required": true - }, - { - "description": "Patch organization request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateOrganizationRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Organization" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/groups": { - "get": { - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Get groups by organization", - "operationId": "get-groups-by-organization", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.Group" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "post": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Create group for organization", - "operationId": "create-group-for-organization", - "parameters": [ - { - "description": "Create group request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.CreateGroupRequest" - } - }, - { - "type": "string", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/codersdk.Group" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/groups/{groupName}": { - "get": { - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Get group by organization and group name", - "operationId": "get-group-by-organization-and-group-name", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Group name", - "name": "groupName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Group" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/groups/{groupName}/members": { - "get": { - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Get group members by organization and group name", - "operationId": "get-group-members-by-organization-and-group-name", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Group name", - "name": "groupName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Member search query", - "name": "q", - "in": "query" - }, - { - "type": "string", - "format": "uuid", - "description": "After ID", - "name": "after_id", - "in": "query" - }, - { - "type": "integer", - "description": "Page limit", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page offset", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.GroupMembersResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/members": { - "get": { - "produces": ["application/json"], - "tags": ["Members"], - "summary": "List organization members", - "operationId": "list-organization-members", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.OrganizationMemberWithUserData" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/members/roles": { - "get": { - "produces": ["application/json"], - "tags": ["Members"], - "summary": "Get member roles by organization", - "operationId": "get-member-roles-by-organization", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.AssignableRoles" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "put": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Members"], - "summary": "Update a custom organization role", - "operationId": "update-a-custom-organization-role", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "description": "Update role request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.CustomRoleRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.Role" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "post": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Members"], - "summary": "Insert a custom organization role", - "operationId": "insert-a-custom-organization-role", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "description": "Insert role request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.CustomRoleRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.Role" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/members/roles/{roleName}": { - "delete": { - "produces": ["application/json"], - "tags": ["Members"], - "summary": "Delete a custom organization role", - "operationId": "delete-a-custom-organization-role", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Role name", - "name": "roleName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.Role" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/members/{user}": { - "get": { - "produces": ["application/json"], - "tags": ["Members"], - "summary": "Get organization member", - "operationId": "get-organization-member", - "parameters": [ - { - "type": "string", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.OrganizationMemberWithUserData" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "post": { - "produces": ["application/json"], - "tags": ["Members"], - "summary": "Add organization member", - "operationId": "add-organization-member", - "parameters": [ - { - "type": "string", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.OrganizationMember" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "delete": { - "tags": ["Members"], - "summary": "Remove organization member", - "operationId": "remove-organization-member", - "parameters": [ - { - "type": "string", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/members/{user}/roles": { - "put": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Members"], - "summary": "Assign role to organization member", - "operationId": "assign-role-to-organization-member", - "parameters": [ - { - "type": "string", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "description": "Update roles request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateRoles" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.OrganizationMember" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/members/{user}/workspace-quota": { - "get": { - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Get workspace quota by user", - "operationId": "get-workspace-quota-by-user", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceQuota" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/members/{user}/workspaces": { - "post": { - "description": "Create a new workspace using a template. The request must\nspecify either the Template ID or the Template Version ID,\nnot both. If the Template ID is specified, the active version\nof the template will be used.", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Workspaces"], - "summary": "Create user workspace by organization", - "operationId": "create-user-workspace-by-organization", - "deprecated": true, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Username, UUID, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "description": "Create workspace request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.CreateWorkspaceRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Workspace" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/members/{user}/workspaces/available-users": { - "get": { - "produces": ["application/json"], - "tags": ["Workspaces"], - "summary": "Get users available for workspace creation", - "operationId": "get-users-available-for-workspace-creation", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Search query", - "name": "q", - "in": "query" - }, - { - "type": "integer", - "description": "Limit results", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Offset for pagination", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.MinimalUser" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/paginated-members": { - "get": { - "produces": ["application/json"], - "tags": ["Members"], - "summary": "Paginated organization members", - "operationId": "paginated-organization-members", - "parameters": [ - { - "type": "string", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Member search query", - "name": "q", - "in": "query" - }, - { - "type": "string", - "format": "uuid", - "description": "After ID", - "name": "after_id", - "in": "query" - }, - { - "type": "integer", - "description": "Page limit, if 0 returns all members", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page offset", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.PaginatedMembersResponse" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/provisionerdaemons": { - "get": { - "produces": ["application/json"], - "tags": ["Provisioning"], - "summary": "Get provisioner daemons", - "operationId": "get-provisioner-daemons", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Page limit", - "name": "limit", - "in": "query" - }, - { - "type": "array", - "format": "uuid", - "items": { - "type": "string" - }, - "collectionFormat": "csv", - "description": "Filter results by job IDs", - "name": "ids", - "in": "query" - }, - { - "enum": [ - "pending", - "running", - "succeeded", - "canceling", - "canceled", - "failed", - "unknown", - "pending", - "running", - "succeeded", - "canceling", - "canceled", - "failed" - ], - "type": "string", - "description": "Filter results by status", - "name": "status", - "in": "query" - }, - { - "type": "object", - "description": "Provisioner tags to filter by (JSON of the form {'tag1':'value1','tag2':'value2'})", - "name": "tags", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.ProvisionerDaemon" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/provisionerdaemons/serve": { - "get": { - "tags": ["Enterprise"], - "summary": "Serve provisioner daemon", - "operationId": "serve-provisioner-daemon", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "101": { - "description": "Switching Protocols" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/provisionerjobs": { - "get": { - "produces": ["application/json"], - "tags": ["Organizations"], - "summary": "Get provisioner jobs", - "operationId": "get-provisioner-jobs", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Page limit", - "name": "limit", - "in": "query" - }, - { - "type": "array", - "format": "uuid", - "items": { - "type": "string" - }, - "collectionFormat": "csv", - "description": "Filter results by job IDs", - "name": "ids", - "in": "query" - }, - { - "enum": [ - "pending", - "running", - "succeeded", - "canceling", - "canceled", - "failed", - "unknown", - "pending", - "running", - "succeeded", - "canceling", - "canceled", - "failed" - ], - "type": "string", - "description": "Filter results by status", - "name": "status", - "in": "query" - }, - { - "type": "object", - "description": "Provisioner tags to filter by (JSON of the form {'tag1':'value1','tag2':'value2'})", - "name": "tags", - "in": "query" - }, - { - "type": "string", - "format": "uuid", - "description": "Filter results by initiator", - "name": "initiator", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.ProvisionerJob" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/provisionerjobs/{job}": { - "get": { - "produces": ["application/json"], - "tags": ["Organizations"], - "summary": "Get provisioner job", - "operationId": "get-provisioner-job", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "Job ID", - "name": "job", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.ProvisionerJob" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/provisionerkeys": { - "get": { - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "List provisioner key", - "operationId": "list-provisioner-key", - "parameters": [ - { - "type": "string", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.ProvisionerKey" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "post": { - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Create provisioner key", - "operationId": "create-provisioner-key", - "parameters": [ - { - "type": "string", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/codersdk.CreateProvisionerKeyResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/provisionerkeys/daemons": { - "get": { - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "List provisioner key daemons", - "operationId": "list-provisioner-key-daemons", - "parameters": [ - { - "type": "string", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.ProvisionerKeyDaemons" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/provisionerkeys/{provisionerkey}": { - "delete": { - "tags": ["Enterprise"], - "summary": "Delete provisioner key", - "operationId": "delete-provisioner-key", - "parameters": [ - { - "type": "string", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Provisioner key name", - "name": "provisionerkey", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/settings/idpsync/available-fields": { - "get": { - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Get the available organization idp sync claim fields", - "operationId": "get-the-available-organization-idp-sync-claim-fields", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/settings/idpsync/field-values": { - "get": { - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Get the organization idp sync claim field values", - "operationId": "get-the-organization-idp-sync-claim-field-values", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "string", - "description": "Claim Field", - "name": "claimField", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/settings/idpsync/groups": { - "get": { - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Get group IdP Sync settings by organization", - "operationId": "get-group-idp-sync-settings-by-organization", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.GroupSyncSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "patch": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Update group IdP Sync settings by organization", - "operationId": "update-group-idp-sync-settings-by-organization", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "description": "New settings", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.GroupSyncSettings" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.GroupSyncSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/settings/idpsync/groups/config": { - "patch": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Update group IdP Sync config", - "operationId": "update-group-idp-sync-config", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID or name", - "name": "organization", - "in": "path", - "required": true - }, - { - "description": "New config values", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.PatchGroupIDPSyncConfigRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.GroupSyncSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/settings/idpsync/groups/mapping": { - "patch": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Update group IdP Sync mapping", - "operationId": "update-group-idp-sync-mapping", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID or name", - "name": "organization", - "in": "path", - "required": true - }, - { - "description": "Description of the mappings to add and remove", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.PatchGroupIDPSyncMappingRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.GroupSyncSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/settings/idpsync/roles": { - "get": { - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Get role IdP Sync settings by organization", - "operationId": "get-role-idp-sync-settings-by-organization", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.RoleSyncSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "patch": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Update role IdP Sync settings by organization", - "operationId": "update-role-idp-sync-settings-by-organization", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "description": "New settings", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.RoleSyncSettings" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.RoleSyncSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/settings/idpsync/roles/config": { - "patch": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Update role IdP Sync config", - "operationId": "update-role-idp-sync-config", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID or name", - "name": "organization", - "in": "path", - "required": true - }, - { - "description": "New config values", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.PatchRoleIDPSyncConfigRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.RoleSyncSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/settings/idpsync/roles/mapping": { - "patch": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Update role IdP Sync mapping", - "operationId": "update-role-idp-sync-mapping", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID or name", - "name": "organization", - "in": "path", - "required": true - }, - { - "description": "Description of the mappings to add and remove", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.PatchRoleIDPSyncMappingRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.RoleSyncSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/settings/workspace-sharing": { - "get": { - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Get workspace sharing settings for organization", - "operationId": "get-workspace-sharing-settings-for-organization", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceSharingSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "patch": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Update workspace sharing settings for organization", - "operationId": "update-workspace-sharing-settings-for-organization", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "description": "Workspace sharing settings", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateWorkspaceSharingSettingsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceSharingSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/templates": { - "get": { - "description": "Returns a list of templates for the specified organization.\nBy default, only non-deprecated templates are returned.\nTo include deprecated templates, specify `deprecated:true` in the search query.", - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "Get templates by organization", - "operationId": "get-templates-by-organization", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.Template" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "post": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "Create template by organization", - "operationId": "create-template-by-organization", - "parameters": [ - { - "description": "Request body", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.CreateTemplateRequest" - } - }, - { - "type": "string", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Template" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/templates/examples": { - "get": { - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "Get template examples by organization", - "operationId": "get-template-examples-by-organization", - "deprecated": true, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.TemplateExample" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/templates/{templatename}": { - "get": { - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "Get templates by organization and template name", - "operationId": "get-templates-by-organization-and-template-name", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Template name", - "name": "templatename", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Template" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/templates/{templatename}/versions/{templateversionname}": { - "get": { - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "Get template version by organization, template, and name", - "operationId": "get-template-version-by-organization-template-and-name", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Template name", - "name": "templatename", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Template version name", - "name": "templateversionname", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.TemplateVersion" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/templates/{templatename}/versions/{templateversionname}/previous": { - "get": { - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "Get previous template version by organization, template, and name", - "operationId": "get-previous-template-version-by-organization-template-and-name", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Template name", - "name": "templatename", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Template version name", - "name": "templateversionname", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.TemplateVersion" - } - }, - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/organizations/{organization}/templateversions": { - "post": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "Create template version by organization", - "operationId": "create-template-version-by-organization", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "description": "Create template version request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.CreateTemplateVersionRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/codersdk.TemplateVersion" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/prebuilds/settings": { - "get": { - "produces": ["application/json"], - "tags": ["Prebuilds"], - "summary": "Get prebuilds settings", - "operationId": "get-prebuilds-settings", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.PrebuildsSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "put": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Prebuilds"], - "summary": "Update prebuilds settings", - "operationId": "update-prebuilds-settings", - "parameters": [ - { - "description": "Prebuilds settings request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.PrebuildsSettings" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.PrebuildsSettings" - } - }, - "304": { - "description": "Not Modified" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/provisionerkeys/{provisionerkey}": { - "get": { - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Fetch provisioner key details", - "operationId": "fetch-provisioner-key-details", - "parameters": [ - { - "type": "string", - "description": "Provisioner Key", - "name": "provisionerkey", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.ProvisionerKey" - } - } - }, - "security": [ - { - "CoderProvisionerKey": [] - } - ] - } - }, - "/regions": { - "get": { - "produces": ["application/json"], - "tags": ["WorkspaceProxies"], - "summary": "Get site-wide regions for workspace connections", - "operationId": "get-site-wide-regions-for-workspace-connections", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.RegionsResponse-codersdk_Region" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/replicas": { - "get": { - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Get active replicas", - "operationId": "get-active-replicas", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.Replica" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, "/scim/v2/ServiceProviderConfig": { "get": { "produces": ["application/scim+json"], @@ -5201,6139 +11334,6 @@ } ] } - }, - "/settings/idpsync/available-fields": { - "get": { - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Get the available idp sync claim fields", - "operationId": "get-the-available-idp-sync-claim-fields", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/settings/idpsync/field-values": { - "get": { - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Get the idp sync claim field values", - "operationId": "get-the-idp-sync-claim-field-values", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Organization ID", - "name": "organization", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "string", - "description": "Claim Field", - "name": "claimField", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/settings/idpsync/organization": { - "get": { - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Get organization IdP Sync settings", - "operationId": "get-organization-idp-sync-settings", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.OrganizationSyncSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "patch": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Update organization IdP Sync settings", - "operationId": "update-organization-idp-sync-settings", - "parameters": [ - { - "description": "New settings", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.OrganizationSyncSettings" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.OrganizationSyncSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/settings/idpsync/organization/config": { - "patch": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Update organization IdP Sync config", - "operationId": "update-organization-idp-sync-config", - "parameters": [ - { - "description": "New config values", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.PatchOrganizationIDPSyncConfigRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.OrganizationSyncSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/settings/idpsync/organization/mapping": { - "patch": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Update organization IdP Sync mapping", - "operationId": "update-organization-idp-sync-mapping", - "parameters": [ - { - "description": "Description of the mappings to add and remove", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.PatchOrganizationIDPSyncMappingRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.OrganizationSyncSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/tailnet": { - "get": { - "tags": ["Agents"], - "summary": "User-scoped tailnet RPC connection", - "operationId": "user-scoped-tailnet-rpc-connection", - "responses": { - "101": { - "description": "Switching Protocols" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/tasks": { - "get": { - "produces": ["application/json"], - "tags": ["Tasks"], - "summary": "List AI tasks", - "operationId": "list-ai-tasks", - "parameters": [ - { - "type": "string", - "description": "Search query for filtering tasks. Supports: owner:\u003cusername/uuid/me\u003e, organization:\u003corg-name/uuid\u003e, status:\u003cstatus\u003e", - "name": "q", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.TasksListResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/tasks/{user}": { - "post": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Tasks"], - "summary": "Create a new AI task", - "operationId": "create-a-new-ai-task", - "parameters": [ - { - "type": "string", - "description": "Username, user ID, or 'me' for the authenticated user", - "name": "user", - "in": "path", - "required": true - }, - { - "description": "Create task request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.CreateTaskRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/codersdk.Task" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/tasks/{user}/{task}": { - "get": { - "produces": ["application/json"], - "tags": ["Tasks"], - "summary": "Get AI task by ID or name", - "operationId": "get-ai-task-by-id-or-name", - "parameters": [ - { - "type": "string", - "description": "Username, user ID, or 'me' for the authenticated user", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Task ID, or task name", - "name": "task", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Task" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "delete": { - "tags": ["Tasks"], - "summary": "Delete AI task", - "operationId": "delete-ai-task", - "parameters": [ - { - "type": "string", - "description": "Username, user ID, or 'me' for the authenticated user", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Task ID, or task name", - "name": "task", - "in": "path", - "required": true - } - ], - "responses": { - "202": { - "description": "Accepted" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/tasks/{user}/{task}/input": { - "patch": { - "consumes": ["application/json"], - "tags": ["Tasks"], - "summary": "Update AI task input", - "operationId": "update-ai-task-input", - "parameters": [ - { - "type": "string", - "description": "Username, user ID, or 'me' for the authenticated user", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Task ID, or task name", - "name": "task", - "in": "path", - "required": true - }, - { - "description": "Update task input request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateTaskInputRequest" - } - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/tasks/{user}/{task}/logs": { - "get": { - "produces": ["application/json"], - "tags": ["Tasks"], - "summary": "Get AI task logs", - "operationId": "get-ai-task-logs", - "parameters": [ - { - "type": "string", - "description": "Username, user ID, or 'me' for the authenticated user", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Task ID, or task name", - "name": "task", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.TaskLogsResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/tasks/{user}/{task}/pause": { - "post": { - "produces": ["application/json"], - "tags": ["Tasks"], - "summary": "Pause task", - "operationId": "pause-task", - "parameters": [ - { - "type": "string", - "description": "Username, user ID, or 'me' for the authenticated user", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "Task ID", - "name": "task", - "in": "path", - "required": true - } - ], - "responses": { - "202": { - "description": "Accepted", - "schema": { - "$ref": "#/definitions/codersdk.PauseTaskResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/tasks/{user}/{task}/resume": { - "post": { - "produces": ["application/json"], - "tags": ["Tasks"], - "summary": "Resume task", - "operationId": "resume-task", - "parameters": [ - { - "type": "string", - "description": "Username, user ID, or 'me' for the authenticated user", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "Task ID", - "name": "task", - "in": "path", - "required": true - } - ], - "responses": { - "202": { - "description": "Accepted", - "schema": { - "$ref": "#/definitions/codersdk.ResumeTaskResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/tasks/{user}/{task}/send": { - "post": { - "consumes": ["application/json"], - "tags": ["Tasks"], - "summary": "Send input to AI task", - "operationId": "send-input-to-ai-task", - "parameters": [ - { - "type": "string", - "description": "Username, user ID, or 'me' for the authenticated user", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Task ID, or task name", - "name": "task", - "in": "path", - "required": true - }, - { - "description": "Task input request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.TaskSendRequest" - } - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templates": { - "get": { - "description": "Returns a list of templates.\nBy default, only non-deprecated templates are returned.\nTo include deprecated templates, specify `deprecated:true` in the search query.", - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "Get all templates", - "operationId": "get-all-templates", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.Template" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templates/examples": { - "get": { - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "Get template examples", - "operationId": "get-template-examples", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.TemplateExample" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templates/{template}": { - "get": { - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "Get template settings by ID", - "operationId": "get-template-settings-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template ID", - "name": "template", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Template" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "delete": { - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "Delete template by ID", - "operationId": "delete-template-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template ID", - "name": "template", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "patch": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "Update template settings by ID", - "operationId": "update-template-settings-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template ID", - "name": "template", - "in": "path", - "required": true - }, - { - "description": "Patch template settings request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateTemplateMeta" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Template" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templates/{template}/acl": { - "get": { - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Get template ACLs", - "operationId": "get-template-acls", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template ID", - "name": "template", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.TemplateACL" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "patch": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Update template ACL", - "operationId": "update-template-acl", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template ID", - "name": "template", - "in": "path", - "required": true - }, - { - "description": "Update template ACL request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateTemplateACL" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templates/{template}/acl/available": { - "get": { - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Get template available acl users/groups", - "operationId": "get-template-available-acl-usersgroups", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template ID", - "name": "template", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.ACLAvailable" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templates/{template}/daus": { - "get": { - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "Get template DAUs by ID", - "operationId": "get-template-daus-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template ID", - "name": "template", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.DAUsResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templates/{template}/prebuilds/invalidate": { - "post": { - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Invalidate presets for template", - "operationId": "invalidate-presets-for-template", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template ID", - "name": "template", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.InvalidatePresetsResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templates/{template}/versions": { - "get": { - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "List template versions by template ID", - "operationId": "list-template-versions-by-template-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template ID", - "name": "template", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "After ID", - "name": "after_id", - "in": "query" - }, - { - "type": "boolean", - "description": "Include archived versions in the list", - "name": "include_archived", - "in": "query" - }, - { - "type": "integer", - "description": "Page limit", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page offset", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.TemplateVersion" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "patch": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "Update active template version by template ID", - "operationId": "update-active-template-version-by-template-id", - "parameters": [ - { - "description": "Modified template version", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateActiveTemplateVersion" - } - }, - { - "type": "string", - "format": "uuid", - "description": "Template ID", - "name": "template", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templates/{template}/versions/archive": { - "post": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "Archive template unused versions by template id", - "operationId": "archive-template-unused-versions-by-template-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template ID", - "name": "template", - "in": "path", - "required": true - }, - { - "description": "Archive request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.ArchiveTemplateVersionsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templates/{template}/versions/{templateversionname}": { - "get": { - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "Get template version by template ID and name", - "operationId": "get-template-version-by-template-id-and-name", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template ID", - "name": "template", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Template version name", - "name": "templateversionname", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.TemplateVersion" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}": { - "get": { - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "Get template version by ID", - "operationId": "get-template-version-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.TemplateVersion" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "patch": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "Patch template version by ID", - "operationId": "patch-template-version-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - }, - { - "description": "Patch template version request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.PatchTemplateVersionRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.TemplateVersion" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/archive": { - "post": { - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "Archive template version", - "operationId": "archive-template-version", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/cancel": { - "patch": { - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "Cancel template version by ID", - "operationId": "cancel-template-version-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/dry-run": { - "post": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "Create template version dry-run", - "operationId": "create-template-version-dry-run", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - }, - { - "description": "Dry-run request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.CreateTemplateVersionDryRunRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/codersdk.ProvisionerJob" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/dry-run/{jobID}": { - "get": { - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "Get template version dry-run by job ID", - "operationId": "get-template-version-dry-run-by-job-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "Job ID", - "name": "jobID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.ProvisionerJob" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/dry-run/{jobID}/cancel": { - "patch": { - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "Cancel template version dry-run by job ID", - "operationId": "cancel-template-version-dry-run-by-job-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Job ID", - "name": "jobID", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/dry-run/{jobID}/logs": { - "get": { - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "Get template version dry-run logs by job ID", - "operationId": "get-template-version-dry-run-logs-by-job-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "Job ID", - "name": "jobID", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Before Unix timestamp", - "name": "before", - "in": "query" - }, - { - "type": "integer", - "description": "After Unix timestamp", - "name": "after", - "in": "query" - }, - { - "type": "boolean", - "description": "Follow log stream", - "name": "follow", - "in": "query" - }, - { - "enum": ["json", "text"], - "type": "string", - "description": "Log output format. Accepted: 'json' (default), 'text' (plain text with RFC3339 timestamps and ANSI colors). Not supported with follow=true.", - "name": "format", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.ProvisionerJobLog" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/dry-run/{jobID}/matched-provisioners": { - "get": { - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "Get template version dry-run matched provisioners", - "operationId": "get-template-version-dry-run-matched-provisioners", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "Job ID", - "name": "jobID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.MatchedProvisioners" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/dry-run/{jobID}/resources": { - "get": { - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "Get template version dry-run resources by job ID", - "operationId": "get-template-version-dry-run-resources-by-job-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "Job ID", - "name": "jobID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.WorkspaceResource" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/dynamic-parameters": { - "get": { - "tags": ["Templates"], - "summary": "Open dynamic parameters WebSocket by template version", - "operationId": "open-dynamic-parameters-websocket-by-template-version", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - } - ], - "responses": { - "101": { - "description": "Switching Protocols" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/dynamic-parameters/evaluate": { - "post": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "Evaluate dynamic parameters for template version", - "operationId": "evaluate-dynamic-parameters-for-template-version", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - }, - { - "description": "Initial parameter values", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.DynamicParametersRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.DynamicParametersResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/external-auth": { - "get": { - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "Get external auth by template version", - "operationId": "get-external-auth-by-template-version", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.TemplateVersionExternalAuth" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/logs": { - "get": { - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "Get logs by template version", - "operationId": "get-logs-by-template-version", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Before log id", - "name": "before", - "in": "query" - }, - { - "type": "integer", - "description": "After log id", - "name": "after", - "in": "query" - }, - { - "type": "boolean", - "description": "Follow log stream", - "name": "follow", - "in": "query" - }, - { - "enum": ["json", "text"], - "type": "string", - "description": "Log output format. Accepted: 'json' (default), 'text' (plain text with RFC3339 timestamps and ANSI colors). Not supported with follow=true.", - "name": "format", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.ProvisionerJobLog" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/parameters": { - "get": { - "tags": ["Templates"], - "summary": "Removed: Get parameters by template version", - "operationId": "removed-get-parameters-by-template-version", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/presets": { - "get": { - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "Get template version presets", - "operationId": "get-template-version-presets", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.Preset" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/resources": { - "get": { - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "Get resources by template version", - "operationId": "get-resources-by-template-version", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.WorkspaceResource" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/rich-parameters": { - "get": { - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "Get rich parameters by template version", - "operationId": "get-rich-parameters-by-template-version", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.TemplateVersionParameter" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/schema": { - "get": { - "tags": ["Templates"], - "summary": "Removed: Get schema by template version", - "operationId": "removed-get-schema-by-template-version", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/unarchive": { - "post": { - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "Unarchive template version", - "operationId": "unarchive-template-version", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/templateversions/{templateversion}/variables": { - "get": { - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "Get template variables by template version", - "operationId": "get-template-variables-by-template-version", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.TemplateVersionVariable" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/updatecheck": { - "get": { - "produces": ["application/json"], - "tags": ["General"], - "summary": "Update check", - "operationId": "update-check", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.UpdateCheckResponse" - } - } - } - } - }, - "/users": { - "get": { - "produces": ["application/json"], - "tags": ["Users"], - "summary": "Get users", - "operationId": "get-users", - "parameters": [ - { - "type": "string", - "description": "Search query", - "name": "q", - "in": "query" - }, - { - "type": "string", - "format": "uuid", - "description": "After ID", - "name": "after_id", - "in": "query" - }, - { - "type": "integer", - "description": "Page limit", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page offset", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.GetUsersResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "post": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Users"], - "summary": "Create new user", - "operationId": "create-new-user", - "parameters": [ - { - "description": "Create user request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.CreateUserRequestWithOrgs" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/codersdk.User" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/authmethods": { - "get": { - "produces": ["application/json"], - "tags": ["Users"], - "summary": "Get authentication methods", - "operationId": "get-authentication-methods", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.AuthMethods" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/first": { - "get": { - "produces": ["application/json"], - "tags": ["Users"], - "summary": "Check initial user created", - "operationId": "check-initial-user-created", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "post": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Users"], - "summary": "Create initial user", - "operationId": "create-initial-user", - "parameters": [ - { - "description": "First user request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.CreateFirstUserRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/codersdk.CreateFirstUserResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/login": { - "post": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Authorization"], - "summary": "Log in user", - "operationId": "log-in-user", - "parameters": [ - { - "description": "Login request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.LoginWithPasswordRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/codersdk.LoginWithPasswordResponse" - } - } - } - } - }, - "/users/logout": { - "post": { - "produces": ["application/json"], - "tags": ["Users"], - "summary": "Log out user", - "operationId": "log-out-user", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/oauth2/github/callback": { - "get": { - "tags": ["Users"], - "summary": "OAuth 2.0 GitHub Callback", - "operationId": "oauth-20-github-callback", - "responses": { - "307": { - "description": "Temporary Redirect" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/oauth2/github/device": { - "get": { - "produces": ["application/json"], - "tags": ["Users"], - "summary": "Get Github device auth.", - "operationId": "get-github-device-auth", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.ExternalAuthDevice" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/oidc-claims": { - "get": { - "produces": ["application/json"], - "tags": ["Users"], - "summary": "Get OIDC claims for the authenticated user", - "operationId": "get-oidc-claims-for-the-authenticated-user", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.OIDCClaimsResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/oidc/callback": { - "get": { - "tags": ["Users"], - "summary": "OpenID Connect Callback", - "operationId": "openid-connect-callback", - "responses": { - "307": { - "description": "Temporary Redirect" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/otp/change-password": { - "post": { - "consumes": ["application/json"], - "tags": ["Authorization"], - "summary": "Change password with a one-time passcode", - "operationId": "change-password-with-a-one-time-passcode", - "parameters": [ - { - "description": "Change password request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.ChangePasswordWithOneTimePasscodeRequest" - } - } - ], - "responses": { - "204": { - "description": "No Content" - } - } - } - }, - "/users/otp/request": { - "post": { - "consumes": ["application/json"], - "tags": ["Authorization"], - "summary": "Request one-time passcode", - "operationId": "request-one-time-passcode", - "parameters": [ - { - "description": "One-time passcode request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.RequestOneTimePasscodeRequest" - } - } - ], - "responses": { - "204": { - "description": "No Content" - } - } - } - }, - "/users/roles": { - "get": { - "produces": ["application/json"], - "tags": ["Members"], - "summary": "Get site member roles", - "operationId": "get-site-member-roles", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.AssignableRoles" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/validate-password": { - "post": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Authorization"], - "summary": "Validate user password", - "operationId": "validate-user-password", - "parameters": [ - { - "description": "Validate user password request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.ValidateUserPasswordRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.ValidateUserPasswordResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}": { - "get": { - "produces": ["application/json"], - "tags": ["Users"], - "summary": "Get user by name", - "operationId": "get-user-by-name", - "parameters": [ - { - "type": "string", - "description": "User ID, username, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.User" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "delete": { - "tags": ["Users"], - "summary": "Delete user", - "operationId": "delete-user", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/appearance": { - "get": { - "produces": ["application/json"], - "tags": ["Users"], - "summary": "Get user appearance settings", - "operationId": "get-user-appearance-settings", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.UserAppearanceSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "put": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Users"], - "summary": "Update user appearance settings", - "operationId": "update-user-appearance-settings", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "description": "New appearance settings", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateUserAppearanceSettingsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.UserAppearanceSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/autofill-parameters": { - "get": { - "produces": ["application/json"], - "tags": ["Users"], - "summary": "Get autofill build parameters for user", - "operationId": "get-autofill-build-parameters-for-user", - "parameters": [ - { - "type": "string", - "description": "User ID, username, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Template ID", - "name": "template_id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.UserParameter" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/convert-login": { - "post": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Authorization"], - "summary": "Convert user from password to oauth authentication", - "operationId": "convert-user-from-password-to-oauth-authentication", - "parameters": [ - { - "description": "Convert request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.ConvertLoginRequest" - } - }, - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/codersdk.OAuthConversionResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/gitsshkey": { - "get": { - "produces": ["application/json"], - "tags": ["Users"], - "summary": "Get user Git SSH key", - "operationId": "get-user-git-ssh-key", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.GitSSHKey" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "put": { - "produces": ["application/json"], - "tags": ["Users"], - "summary": "Regenerate user SSH key", - "operationId": "regenerate-user-ssh-key", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.GitSSHKey" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/keys": { - "post": { - "produces": ["application/json"], - "tags": ["Users"], - "summary": "Create new session key", - "operationId": "create-new-session-key", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/codersdk.GenerateAPIKeyResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/keys/tokens": { - "get": { - "produces": ["application/json"], - "tags": ["Users"], - "summary": "Get user tokens", - "operationId": "get-user-tokens", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "Include expired tokens in the list", - "name": "include_expired", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.APIKey" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "post": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Users"], - "summary": "Create token API key", - "operationId": "create-token-api-key", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "description": "Create token request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.CreateTokenRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/codersdk.GenerateAPIKeyResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/keys/tokens/tokenconfig": { - "get": { - "produces": ["application/json"], - "tags": ["General"], - "summary": "Get token config", - "operationId": "get-token-config", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.TokenConfig" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/keys/tokens/{keyname}": { - "get": { - "produces": ["application/json"], - "tags": ["Users"], - "summary": "Get API key by token name", - "operationId": "get-api-key-by-token-name", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "string", - "description": "Key Name", - "name": "keyname", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.APIKey" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/keys/{keyid}": { - "get": { - "produces": ["application/json"], - "tags": ["Users"], - "summary": "Get API key by ID", - "operationId": "get-api-key-by-id", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "string", - "description": "Key ID", - "name": "keyid", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.APIKey" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "delete": { - "tags": ["Users"], - "summary": "Delete API key", - "operationId": "delete-api-key", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "string", - "description": "Key ID", - "name": "keyid", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/keys/{keyid}/expire": { - "put": { - "tags": ["Users"], - "summary": "Expire API key", - "operationId": "expire-api-key", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "string", - "description": "Key ID", - "name": "keyid", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/login-type": { - "get": { - "produces": ["application/json"], - "tags": ["Users"], - "summary": "Get user login type", - "operationId": "get-user-login-type", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.UserLoginType" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/notifications/preferences": { - "get": { - "produces": ["application/json"], - "tags": ["Notifications"], - "summary": "Get user notification preferences", - "operationId": "get-user-notification-preferences", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.NotificationPreference" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "put": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Notifications"], - "summary": "Update user notification preferences", - "operationId": "update-user-notification-preferences", - "parameters": [ - { - "description": "Preferences", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateUserNotificationPreferences" - } - }, - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.NotificationPreference" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/organizations": { - "get": { - "produces": ["application/json"], - "tags": ["Users"], - "summary": "Get organizations by user", - "operationId": "get-organizations-by-user", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.Organization" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/organizations/{organizationname}": { - "get": { - "produces": ["application/json"], - "tags": ["Users"], - "summary": "Get organization by user and organization name", - "operationId": "get-organization-by-user-and-organization-name", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Organization name", - "name": "organizationname", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Organization" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/password": { - "put": { - "consumes": ["application/json"], - "tags": ["Users"], - "summary": "Update user password", - "operationId": "update-user-password", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "description": "Update password request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateUserPasswordRequest" - } - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/preferences": { - "get": { - "produces": ["application/json"], - "tags": ["Users"], - "summary": "Get user preference settings", - "operationId": "get-user-preference-settings", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.UserPreferenceSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "put": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Users"], - "summary": "Update user preference settings", - "operationId": "update-user-preference-settings", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "description": "New preference settings", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateUserPreferenceSettingsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.UserPreferenceSettings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/profile": { - "put": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Users"], - "summary": "Update user profile", - "operationId": "update-user-profile", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "description": "Updated profile", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateUserProfileRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.User" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/quiet-hours": { - "get": { - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Get user quiet hours schedule", - "operationId": "get-user-quiet-hours-schedule", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "User ID", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.UserQuietHoursScheduleResponse" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "put": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Update user quiet hours schedule", - "operationId": "update-user-quiet-hours-schedule", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "User ID", - "name": "user", - "in": "path", - "required": true - }, - { - "description": "Update schedule request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateUserQuietHoursScheduleRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.UserQuietHoursScheduleResponse" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/roles": { - "get": { - "produces": ["application/json"], - "tags": ["Users"], - "summary": "Get user roles", - "operationId": "get-user-roles", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.User" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "put": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Users"], - "summary": "Assign role to user", - "operationId": "assign-role-to-user", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "description": "Update roles request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateRoles" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.User" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/secrets": { - "get": { - "produces": ["application/json"], - "tags": ["Secrets"], - "summary": "List user secrets", - "operationId": "list-user-secrets", - "parameters": [ - { - "type": "string", - "description": "User ID, username, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.UserSecret" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "post": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Secrets"], - "summary": "Create a new user secret", - "operationId": "create-a-new-user-secret", - "parameters": [ - { - "type": "string", - "description": "User ID, username, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "description": "Create secret request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.CreateUserSecretRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/codersdk.UserSecret" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/secrets/{name}": { - "get": { - "produces": ["application/json"], - "tags": ["Secrets"], - "summary": "Get a user secret by name", - "operationId": "get-a-user-secret-by-name", - "parameters": [ - { - "type": "string", - "description": "User ID, username, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Secret name", - "name": "name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.UserSecret" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "delete": { - "tags": ["Secrets"], - "summary": "Delete a user secret", - "operationId": "delete-a-user-secret", - "parameters": [ - { - "type": "string", - "description": "User ID, username, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Secret name", - "name": "name", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "patch": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Secrets"], - "summary": "Update a user secret", - "operationId": "update-a-user-secret", - "parameters": [ - { - "type": "string", - "description": "User ID, username, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Secret name", - "name": "name", - "in": "path", - "required": true - }, - { - "description": "Update secret request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateUserSecretRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.UserSecret" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/status/activate": { - "put": { - "produces": ["application/json"], - "tags": ["Users"], - "summary": "Activate user account", - "operationId": "activate-user-account", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.User" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/status/suspend": { - "put": { - "produces": ["application/json"], - "tags": ["Users"], - "summary": "Suspend user account", - "operationId": "suspend-user-account", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.User" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/webpush/subscription": { - "post": { - "consumes": ["application/json"], - "tags": ["Notifications"], - "summary": "Create user webpush subscription", - "operationId": "create-user-webpush-subscription", - "parameters": [ - { - "description": "Webpush subscription", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.WebpushSubscription" - } - }, - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - }, - "delete": { - "consumes": ["application/json"], - "tags": ["Notifications"], - "summary": "Delete user webpush subscription", - "operationId": "delete-user-webpush-subscription", - "parameters": [ - { - "description": "Webpush subscription", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.DeleteWebpushSubscription" - } - }, - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/users/{user}/webpush/test": { - "post": { - "tags": ["Notifications"], - "summary": "Send a test push notification", - "operationId": "send-a-test-push-notification", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/users/{user}/workspace/{workspacename}": { - "get": { - "produces": ["application/json"], - "tags": ["Workspaces"], - "summary": "Get workspace metadata by user and workspace name", - "operationId": "get-workspace-metadata-by-user-and-workspace-name", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Workspace name", - "name": "workspacename", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "Return data instead of HTTP 404 if the workspace is deleted", - "name": "include_deleted", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Workspace" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/workspace/{workspacename}/builds/{buildnumber}": { - "get": { - "produces": ["application/json"], - "tags": ["Builds"], - "summary": "Get workspace build by user, workspace name, and build number", - "operationId": "get-workspace-build-by-user-workspace-name-and-build-number", - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Workspace name", - "name": "workspacename", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "number", - "description": "Build number", - "name": "buildnumber", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceBuild" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/users/{user}/workspaces": { - "post": { - "description": "Create a new workspace using a template. The request must\nspecify either the Template ID or the Template Version ID,\nnot both. If the Template ID is specified, the active version\nof the template will be used.", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Workspaces"], - "summary": "Create user workspace", - "operationId": "create-user-workspace", - "parameters": [ - { - "type": "string", - "description": "Username, UUID, or me", - "name": "user", - "in": "path", - "required": true - }, - { - "description": "Create workspace request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.CreateWorkspaceRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Workspace" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspace-quota/{user}": { - "get": { - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Get workspace quota by user deprecated", - "operationId": "get-workspace-quota-by-user-deprecated", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "User ID, name, or me", - "name": "user", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceQuota" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/aws-instance-identity": { - "post": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Agents"], - "summary": "Authenticate agent on AWS instance", - "operationId": "authenticate-agent-on-aws-instance", - "parameters": [ - { - "description": "Instance identity token. The optional agent_name field disambiguates when multiple agents share the same instance ID.", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/agentsdk.AWSInstanceIdentityToken" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/agentsdk.AuthenticateResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/azure-instance-identity": { - "post": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Agents"], - "summary": "Authenticate agent on Azure instance", - "operationId": "authenticate-agent-on-azure-instance", - "parameters": [ - { - "description": "Instance identity token. The optional agent_name field disambiguates when multiple agents share the same instance ID.", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/agentsdk.AzureInstanceIdentityToken" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/agentsdk.AuthenticateResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/connection": { - "get": { - "produces": ["application/json"], - "tags": ["Agents"], - "summary": "Get connection info for workspace agent generic", - "operationId": "get-connection-info-for-workspace-agent-generic", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/workspacesdk.AgentConnectionInfo" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/workspaceagents/google-instance-identity": { - "post": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Agents"], - "summary": "Authenticate agent on Google Cloud instance", - "operationId": "authenticate-agent-on-google-cloud-instance", - "parameters": [ - { - "description": "Instance identity token. The optional agent_name field disambiguates when multiple agents share the same instance ID.", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/agentsdk.GoogleInstanceIdentityToken" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/agentsdk.AuthenticateResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/me/app-status": { - "patch": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Agents"], - "summary": "Patch workspace agent app status", - "operationId": "patch-workspace-agent-app-status", - "deprecated": true, - "parameters": [ - { - "description": "app status", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/agentsdk.PatchAppStatus" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/me/external-auth": { - "get": { - "produces": ["application/json"], - "tags": ["Agents"], - "summary": "Get workspace agent external auth", - "operationId": "get-workspace-agent-external-auth", - "parameters": [ - { - "type": "string", - "description": "Match", - "name": "match", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "Provider ID", - "name": "id", - "in": "query", - "required": true - }, - { - "type": "boolean", - "description": "Wait for a new token to be issued", - "name": "listen", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/agentsdk.ExternalAuthResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/me/gitauth": { - "get": { - "produces": ["application/json"], - "tags": ["Agents"], - "summary": "Removed: Get workspace agent git auth", - "operationId": "removed-get-workspace-agent-git-auth", - "parameters": [ - { - "type": "string", - "description": "Match", - "name": "match", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "Provider ID", - "name": "id", - "in": "query", - "required": true - }, - { - "type": "boolean", - "description": "Wait for a new token to be issued", - "name": "listen", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/agentsdk.ExternalAuthResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/me/gitsshkey": { - "get": { - "produces": ["application/json"], - "tags": ["Agents"], - "summary": "Get workspace agent Git SSH key", - "operationId": "get-workspace-agent-git-ssh-key", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/agentsdk.GitSSHKey" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/me/log-source": { - "post": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Agents"], - "summary": "Post workspace agent log source", - "operationId": "post-workspace-agent-log-source", - "parameters": [ - { - "description": "Log source request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/agentsdk.PostLogSourceRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceAgentLogSource" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/me/logs": { - "patch": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Agents"], - "summary": "Patch workspace agent logs", - "operationId": "patch-workspace-agent-logs", - "parameters": [ - { - "description": "logs", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/agentsdk.PatchLogs" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/me/reinit": { - "get": { - "produces": ["application/json"], - "tags": ["Agents"], - "summary": "Get workspace agent reinitialization", - "operationId": "get-workspace-agent-reinitialization", - "parameters": [ - { - "type": "boolean", - "description": "Opt in to durable reinit checks", - "name": "wait", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/agentsdk.ReinitializationEvent" - } - }, - "409": { - "description": "Conflict", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/me/rpc": { - "get": { - "tags": ["Agents"], - "summary": "Workspace agent RPC API", - "operationId": "workspace-agent-rpc-api", - "responses": { - "101": { - "description": "Switching Protocols" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/workspaceagents/me/tasks/{task}/log-snapshot": { - "post": { - "consumes": ["application/json"], - "tags": ["Tasks"], - "summary": "Upload task log snapshot", - "operationId": "upload-task-log-snapshot", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Task ID", - "name": "task", - "in": "path", - "required": true - }, - { - "enum": ["agentapi"], - "type": "string", - "description": "Snapshot format", - "name": "format", - "in": "query", - "required": true - }, - { - "description": "Raw snapshot payload (structure depends on format parameter)", - "name": "request", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/{workspaceagent}": { - "get": { - "produces": ["application/json"], - "tags": ["Agents"], - "summary": "Get workspace agent by ID", - "operationId": "get-workspace-agent-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace agent ID", - "name": "workspaceagent", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceAgent" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/{workspaceagent}/connection": { - "get": { - "produces": ["application/json"], - "tags": ["Agents"], - "summary": "Get connection info for workspace agent", - "operationId": "get-connection-info-for-workspace-agent", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace agent ID", - "name": "workspaceagent", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/workspacesdk.AgentConnectionInfo" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/{workspaceagent}/containers": { - "get": { - "produces": ["application/json"], - "tags": ["Agents"], - "summary": "Get running containers for workspace agent", - "operationId": "get-running-containers-for-workspace-agent", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace agent ID", - "name": "workspaceagent", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "key=value", - "description": "Labels", - "name": "label", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceAgentListContainersResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/{workspaceagent}/containers/devcontainers/{devcontainer}": { - "delete": { - "tags": ["Agents"], - "summary": "Delete devcontainer for workspace agent", - "operationId": "delete-devcontainer-for-workspace-agent", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace agent ID", - "name": "workspaceagent", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Devcontainer ID", - "name": "devcontainer", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/{workspaceagent}/containers/devcontainers/{devcontainer}/recreate": { - "post": { - "produces": ["application/json"], - "tags": ["Agents"], - "summary": "Recreate devcontainer for workspace agent", - "operationId": "recreate-devcontainer-for-workspace-agent", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace agent ID", - "name": "workspaceagent", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Devcontainer ID", - "name": "devcontainer", - "in": "path", - "required": true - } - ], - "responses": { - "202": { - "description": "Accepted", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/{workspaceagent}/containers/watch": { - "get": { - "produces": ["application/json"], - "tags": ["Agents"], - "summary": "Watch workspace agent for container updates.", - "operationId": "watch-workspace-agent-for-container-updates", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace agent ID", - "name": "workspaceagent", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceAgentListContainersResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/{workspaceagent}/coordinate": { - "get": { - "tags": ["Agents"], - "summary": "Coordinate workspace agent", - "operationId": "coordinate-workspace-agent", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace agent ID", - "name": "workspaceagent", - "in": "path", - "required": true - } - ], - "responses": { - "101": { - "description": "Switching Protocols" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/{workspaceagent}/listening-ports": { - "get": { - "produces": ["application/json"], - "tags": ["Agents"], - "summary": "Get listening ports for workspace agent", - "operationId": "get-listening-ports-for-workspace-agent", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace agent ID", - "name": "workspaceagent", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceAgentListeningPortsResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/{workspaceagent}/logs": { - "get": { - "produces": ["application/json"], - "tags": ["Agents"], - "summary": "Get logs by workspace agent", - "operationId": "get-logs-by-workspace-agent", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace agent ID", - "name": "workspaceagent", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Before log id", - "name": "before", - "in": "query" - }, - { - "type": "integer", - "description": "After log id", - "name": "after", - "in": "query" - }, - { - "type": "boolean", - "description": "Follow log stream", - "name": "follow", - "in": "query" - }, - { - "type": "boolean", - "description": "Disable compression for WebSocket connection", - "name": "no_compression", - "in": "query" - }, - { - "enum": ["json", "text"], - "type": "string", - "description": "Log output format. Accepted: 'json' (default), 'text' (plain text with RFC3339 timestamps and ANSI colors). Not supported with follow=true.", - "name": "format", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.WorkspaceAgentLog" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/{workspaceagent}/pty": { - "get": { - "tags": ["Agents"], - "summary": "Open PTY to workspace agent", - "operationId": "open-pty-to-workspace-agent", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace agent ID", - "name": "workspaceagent", - "in": "path", - "required": true - } - ], - "responses": { - "101": { - "description": "Switching Protocols" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/{workspaceagent}/startup-logs": { - "get": { - "produces": ["application/json"], - "tags": ["Agents"], - "summary": "Removed: Get logs by workspace agent", - "operationId": "removed-get-logs-by-workspace-agent", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace agent ID", - "name": "workspaceagent", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Before log id", - "name": "before", - "in": "query" - }, - { - "type": "integer", - "description": "After log id", - "name": "after", - "in": "query" - }, - { - "type": "boolean", - "description": "Follow log stream", - "name": "follow", - "in": "query" - }, - { - "type": "boolean", - "description": "Disable compression for WebSocket connection", - "name": "no_compression", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.WorkspaceAgentLog" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceagents/{workspaceagent}/watch-metadata": { - "get": { - "tags": ["Agents"], - "summary": "Watch for workspace agent metadata updates", - "operationId": "watch-for-workspace-agent-metadata-updates", - "deprecated": true, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace agent ID", - "name": "workspaceagent", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Success" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/workspaceagents/{workspaceagent}/watch-metadata-ws": { - "get": { - "produces": ["application/json"], - "tags": ["Agents"], - "summary": "Watch for workspace agent metadata updates via WebSockets", - "operationId": "watch-for-workspace-agent-metadata-updates-via-websockets", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace agent ID", - "name": "workspaceagent", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.ServerSentEvent" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/workspacebuilds/{workspacebuild}": { - "get": { - "produces": ["application/json"], - "tags": ["Builds"], - "summary": "Get workspace build", - "operationId": "get-workspace-build", - "parameters": [ - { - "type": "string", - "description": "Workspace build ID", - "name": "workspacebuild", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceBuild" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspacebuilds/{workspacebuild}/cancel": { - "patch": { - "produces": ["application/json"], - "tags": ["Builds"], - "summary": "Cancel workspace build", - "operationId": "cancel-workspace-build", - "parameters": [ - { - "type": "string", - "description": "Workspace build ID", - "name": "workspacebuild", - "in": "path", - "required": true - }, - { - "enum": ["running", "pending"], - "type": "string", - "description": "Expected status of the job. If expect_status is supplied, the request will be rejected with 412 Precondition Failed if the job doesn't match the state when performing the cancellation.", - "name": "expect_status", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspacebuilds/{workspacebuild}/logs": { - "get": { - "produces": ["application/json"], - "tags": ["Builds"], - "summary": "Get workspace build logs", - "operationId": "get-workspace-build-logs", - "parameters": [ - { - "type": "string", - "description": "Workspace build ID", - "name": "workspacebuild", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Before log id", - "name": "before", - "in": "query" - }, - { - "type": "integer", - "description": "After log id", - "name": "after", - "in": "query" - }, - { - "type": "boolean", - "description": "Follow log stream", - "name": "follow", - "in": "query" - }, - { - "enum": ["json", "text"], - "type": "string", - "description": "Log output format. Accepted: 'json' (default), 'text' (plain text with RFC3339 timestamps and ANSI colors). Not supported with follow=true.", - "name": "format", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.ProvisionerJobLog" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspacebuilds/{workspacebuild}/parameters": { - "get": { - "produces": ["application/json"], - "tags": ["Builds"], - "summary": "Get build parameters for workspace build", - "operationId": "get-build-parameters-for-workspace-build", - "parameters": [ - { - "type": "string", - "description": "Workspace build ID", - "name": "workspacebuild", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.WorkspaceBuildParameter" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspacebuilds/{workspacebuild}/resources": { - "get": { - "produces": ["application/json"], - "tags": ["Builds"], - "summary": "Removed: Get workspace resources for workspace build", - "operationId": "removed-get-workspace-resources-for-workspace-build", - "deprecated": true, - "parameters": [ - { - "type": "string", - "description": "Workspace build ID", - "name": "workspacebuild", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.WorkspaceResource" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspacebuilds/{workspacebuild}/state": { - "get": { - "produces": ["application/json"], - "tags": ["Builds"], - "summary": "Get provisioner state for workspace build", - "operationId": "get-provisioner-state-for-workspace-build", - "parameters": [ - { - "type": "string", - "description": "Workspace build ID", - "name": "workspacebuild", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceBuild" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "put": { - "consumes": ["application/json"], - "tags": ["Builds"], - "summary": "Update workspace build state", - "operationId": "update-workspace-build-state", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace build ID", - "name": "workspacebuild", - "in": "path", - "required": true - }, - { - "description": "Request body", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateWorkspaceBuildStateRequest" - } - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspacebuilds/{workspacebuild}/timings": { - "get": { - "produces": ["application/json"], - "tags": ["Builds"], - "summary": "Get workspace build timings by ID", - "operationId": "get-workspace-build-timings-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace build ID", - "name": "workspacebuild", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceBuildTimings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceproxies": { - "get": { - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Get workspace proxies", - "operationId": "get-workspace-proxies", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.RegionsResponse-codersdk_WorkspaceProxy" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "post": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Create workspace proxy", - "operationId": "create-workspace-proxy", - "parameters": [ - { - "description": "Create workspace proxy request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.CreateWorkspaceProxyRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceProxy" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaceproxies/me/app-stats": { - "post": { - "consumes": ["application/json"], - "tags": ["Enterprise"], - "summary": "Report workspace app stats", - "operationId": "report-workspace-app-stats", - "parameters": [ - { - "description": "Report app stats request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/wsproxysdk.ReportAppStatsRequest" - } - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/workspaceproxies/me/coordinate": { - "get": { - "tags": ["Enterprise"], - "summary": "Workspace Proxy Coordinate", - "operationId": "workspace-proxy-coordinate", - "responses": { - "101": { - "description": "Switching Protocols" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/workspaceproxies/me/crypto-keys": { - "get": { - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Get workspace proxy crypto keys", - "operationId": "get-workspace-proxy-crypto-keys", - "parameters": [ - { - "type": "string", - "description": "Feature key", - "name": "feature", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/wsproxysdk.CryptoKeysResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/workspaceproxies/me/deregister": { - "post": { - "consumes": ["application/json"], - "tags": ["Enterprise"], - "summary": "Deregister workspace proxy", - "operationId": "deregister-workspace-proxy", - "parameters": [ - { - "description": "Deregister workspace proxy request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/wsproxysdk.DeregisterWorkspaceProxyRequest" - } - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/workspaceproxies/me/issue-signed-app-token": { - "post": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Issue signed workspace app token", - "operationId": "issue-signed-workspace-app-token", - "parameters": [ - { - "description": "Issue signed app token request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/workspaceapps.IssueTokenRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/wsproxysdk.IssueSignedAppTokenResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/workspaceproxies/me/register": { - "post": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Register workspace proxy", - "operationId": "register-workspace-proxy", - "parameters": [ - { - "description": "Register workspace proxy request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/wsproxysdk.RegisterWorkspaceProxyRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/wsproxysdk.RegisterWorkspaceProxyResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ], - "x-apidocgen": { - "skip": true - } - } - }, - "/workspaceproxies/{workspaceproxy}": { - "get": { - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Get workspace proxy", - "operationId": "get-workspace-proxy", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Proxy ID or name", - "name": "workspaceproxy", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceProxy" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "delete": { - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Delete workspace proxy", - "operationId": "delete-workspace-proxy", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Proxy ID or name", - "name": "workspaceproxy", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "patch": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Update workspace proxy", - "operationId": "update-workspace-proxy", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Proxy ID or name", - "name": "workspaceproxy", - "in": "path", - "required": true - }, - { - "description": "Update workspace proxy request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.PatchWorkspaceProxy" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceProxy" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaces": { - "get": { - "produces": ["application/json"], - "tags": ["Workspaces"], - "summary": "List workspaces", - "operationId": "list-workspaces", - "parameters": [ - { - "type": "string", - "description": "Search query in the format `key:value`. Available keys are: owner, template, name, status, has-agent, dormant, last_used_after, last_used_before, has-ai-task, has_external_agent, healthy.", - "name": "q", - "in": "query" - }, - { - "type": "integer", - "description": "Page limit", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page offset", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspacesResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaces/{workspace}": { - "get": { - "produces": ["application/json"], - "tags": ["Workspaces"], - "summary": "Get workspace metadata by ID", - "operationId": "get-workspace-metadata-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "Return data instead of HTTP 404 if the workspace is deleted", - "name": "include_deleted", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Workspace" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "patch": { - "consumes": ["application/json"], - "tags": ["Workspaces"], - "summary": "Update workspace metadata by ID", - "operationId": "update-workspace-metadata-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - }, - { - "description": "Metadata update request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateWorkspaceRequest" - } - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaces/{workspace}/acl": { - "get": { - "produces": ["application/json"], - "tags": ["Workspaces"], - "summary": "Get workspace ACLs", - "operationId": "get-workspace-acls", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceACL" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "delete": { - "tags": ["Workspaces"], - "summary": "Completely clears the workspace's user and group ACLs.", - "operationId": "completely-clears-the-workspaces-user-and-group-acls", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "patch": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Workspaces"], - "summary": "Update workspace ACL", - "operationId": "update-workspace-acl", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - }, - { - "description": "Update workspace ACL request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateWorkspaceACL" - } - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaces/{workspace}/autostart": { - "put": { - "consumes": ["application/json"], - "tags": ["Workspaces"], - "summary": "Update workspace autostart schedule by ID", - "operationId": "update-workspace-autostart-schedule-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - }, - { - "description": "Schedule update request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateWorkspaceAutostartRequest" - } - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaces/{workspace}/autoupdates": { - "put": { - "consumes": ["application/json"], - "tags": ["Workspaces"], - "summary": "Update workspace automatic updates by ID", - "operationId": "update-workspace-automatic-updates-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - }, - { - "description": "Automatic updates request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateWorkspaceAutomaticUpdatesRequest" - } - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaces/{workspace}/builds": { - "get": { - "produces": ["application/json"], - "tags": ["Builds"], - "summary": "Get workspace builds by workspace ID", - "operationId": "get-workspace-builds-by-workspace-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "After ID", - "name": "after_id", - "in": "query" - }, - { - "type": "integer", - "description": "Page limit", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page offset", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "format": "date-time", - "description": "Since timestamp", - "name": "since", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.WorkspaceBuild" - } - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "post": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Builds"], - "summary": "Create workspace build", - "operationId": "create-workspace-build", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - }, - { - "description": "Create workspace build request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.CreateWorkspaceBuildRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceBuild" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaces/{workspace}/dormant": { - "put": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Workspaces"], - "summary": "Update workspace dormancy status by id.", - "operationId": "update-workspace-dormancy-status-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - }, - { - "description": "Make a workspace dormant or active", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateWorkspaceDormancy" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Workspace" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaces/{workspace}/extend": { - "put": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["Workspaces"], - "summary": "Extend workspace deadline by ID", - "operationId": "extend-workspace-deadline-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - }, - { - "description": "Extend deadline update request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.PutExtendWorkspaceRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaces/{workspace}/external-agent/{agent}/credentials": { - "get": { - "produces": ["application/json"], - "tags": ["Enterprise"], - "summary": "Get workspace external agent credentials", - "operationId": "get-workspace-external-agent-credentials", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Agent name", - "name": "agent", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.ExternalAgentCredentials" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaces/{workspace}/favorite": { - "put": { - "tags": ["Workspaces"], - "summary": "Favorite workspace by ID.", - "operationId": "favorite-workspace-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "delete": { - "tags": ["Workspaces"], - "summary": "Unfavorite workspace by ID.", - "operationId": "unfavorite-workspace-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaces/{workspace}/port-share": { - "get": { - "produces": ["application/json"], - "tags": ["PortSharing"], - "summary": "Get workspace agent port shares", - "operationId": "get-workspace-agent-port-shares", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceAgentPortShares" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "post": { - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["PortSharing"], - "summary": "Upsert workspace agent port share", - "operationId": "upsert-workspace-agent-port-share", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - }, - { - "description": "Upsert port sharing level request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpsertWorkspaceAgentPortShareRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceAgentPortShare" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - }, - "delete": { - "consumes": ["application/json"], - "tags": ["PortSharing"], - "summary": "Delete workspace agent port share", - "operationId": "delete-workspace-agent-port-share", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - }, - { - "description": "Delete port sharing level request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.DeleteWorkspaceAgentPortShareRequest" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaces/{workspace}/resolve-autostart": { - "get": { - "produces": ["application/json"], - "tags": ["Workspaces"], - "summary": "Resolve workspace autostart by id.", - "operationId": "resolve-workspace-autostart-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.ResolveAutostartResponse" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaces/{workspace}/timings": { - "get": { - "produces": ["application/json"], - "tags": ["Workspaces"], - "summary": "Get workspace timings by ID", - "operationId": "get-workspace-timings-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.WorkspaceBuildTimings" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaces/{workspace}/ttl": { - "put": { - "consumes": ["application/json"], - "tags": ["Workspaces"], - "summary": "Update workspace TTL by ID", - "operationId": "update-workspace-ttl-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - }, - { - "description": "Workspace TTL update request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/codersdk.UpdateWorkspaceTTLRequest" - } - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaces/{workspace}/usage": { - "post": { - "consumes": ["application/json"], - "tags": ["Workspaces"], - "summary": "Post Workspace Usage by ID", - "operationId": "post-workspace-usage-by-id", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - }, - { - "description": "Post workspace usage request", - "name": "request", - "in": "body", - "schema": { - "$ref": "#/definitions/codersdk.PostWorkspaceUsageRequest" - } - } - ], - "responses": { - "204": { - "description": "No Content" - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaces/{workspace}/watch": { - "get": { - "produces": ["text/event-stream"], - "tags": ["Workspaces"], - "summary": "Watch workspace by ID", - "operationId": "watch-workspace-by-id", - "deprecated": true, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.Response" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } - }, - "/workspaces/{workspace}/watch-ws": { - "get": { - "produces": ["application/json"], - "tags": ["Workspaces"], - "summary": "Watch workspace by ID via WebSockets", - "operationId": "watch-workspace-by-id-via-websockets", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Workspace ID", - "name": "workspace", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/codersdk.ServerSentEvent" - } - } - }, - "security": [ - { - "CoderSessionToken": [] - } - ] - } } }, "definitions": { diff --git a/coderd/apikey.go b/coderd/apikey.go index e78ad5d373..4eedd06126 100644 --- a/coderd/apikey.go +++ b/coderd/apikey.go @@ -36,7 +36,7 @@ import ( // @Param user path string true "User ID, name, or me" // @Param request body codersdk.CreateTokenRequest true "Create token request" // @Success 201 {object} codersdk.GenerateAPIKeyResponse -// @Router /users/{user}/keys/tokens [post] +// @Router /api/v2/users/{user}/keys/tokens [post] func (api *API) postToken(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -190,7 +190,7 @@ func (api *API) postToken(rw http.ResponseWriter, r *http.Request) { // @Tags Users // @Param user path string true "User ID, name, or me" // @Success 201 {object} codersdk.GenerateAPIKeyResponse -// @Router /users/{user}/keys [post] +// @Router /api/v2/users/{user}/keys [post] func (api *API) postAPIKey(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -244,7 +244,7 @@ func (api *API) postAPIKey(rw http.ResponseWriter, r *http.Request) { // @Param user path string true "User ID, name, or me" // @Param keyid path string true "Key ID" format(string) // @Success 200 {object} codersdk.APIKey -// @Router /users/{user}/keys/{keyid} [get] +// @Router /api/v2/users/{user}/keys/{keyid} [get] func (api *API) apiKeyByID(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() @@ -273,7 +273,7 @@ func (api *API) apiKeyByID(rw http.ResponseWriter, r *http.Request) { // @Param user path string true "User ID, name, or me" // @Param keyname path string true "Key Name" format(string) // @Success 200 {object} codersdk.APIKey -// @Router /users/{user}/keys/tokens/{keyname} [get] +// @Router /api/v2/users/{user}/keys/tokens/{keyname} [get] func (api *API) apiKeyByName(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -308,7 +308,7 @@ func (api *API) apiKeyByName(rw http.ResponseWriter, r *http.Request) { // @Param user path string true "User ID, name, or me" // @Success 200 {array} codersdk.APIKey // @Param include_expired query bool false "Include expired tokens in the list" -// @Router /users/{user}/keys/tokens [get] +// @Router /api/v2/users/{user}/keys/tokens [get] func (api *API) tokens(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -391,7 +391,7 @@ func (api *API) tokens(rw http.ResponseWriter, r *http.Request) { // @Param user path string true "User ID, name, or me" // @Param keyid path string true "Key ID" format(string) // @Success 204 -// @Router /users/{user}/keys/{keyid} [delete] +// @Router /api/v2/users/{user}/keys/{keyid} [delete] func (api *API) deleteAPIKey(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -436,7 +436,7 @@ func (api *API) deleteAPIKey(rw http.ResponseWriter, r *http.Request) { // @Success 204 // @Failure 404 {object} codersdk.Response // @Failure 500 {object} codersdk.Response -// @Router /users/{user}/keys/{keyid}/expire [put] +// @Router /api/v2/users/{user}/keys/{keyid}/expire [put] func (api *API) expireAPIKey(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -497,7 +497,7 @@ func (api *API) expireAPIKey(rw http.ResponseWriter, r *http.Request) { // @Tags General // @Param user path string true "User ID, name, or me" // @Success 200 {object} codersdk.TokenConfig -// @Router /users/{user}/keys/tokens/tokenconfig [get] +// @Router /api/v2/users/{user}/keys/tokens/tokenconfig [get] func (api *API) tokenConfig(rw http.ResponseWriter, r *http.Request) { user := httpmw.UserParam(r) maxLifetime, err := api.getMaxTokenLifetime(r.Context(), user.ID) diff --git a/coderd/apiroot.go b/coderd/apiroot.go index a0dee428e3..6d6f99afb3 100644 --- a/coderd/apiroot.go +++ b/coderd/apiroot.go @@ -12,7 +12,7 @@ import ( // @Produce json // @Tags General // @Success 200 {object} codersdk.Response -// @Router / [get] +// @Router /api/v2/ [get] func apiRoot(w http.ResponseWriter, r *http.Request) { httpapi.Write(r.Context(), w, http.StatusOK, codersdk.Response{ //nolint:gocritic diff --git a/coderd/audit.go b/coderd/audit.go index d54874669f..b4070622eb 100644 --- a/coderd/audit.go +++ b/coderd/audit.go @@ -40,7 +40,7 @@ const auditLogCountCap = 2000 // @Param limit query int true "Page limit" // @Param offset query int false "Page offset" // @Success 200 {object} codersdk.AuditLogResponse -// @Router /audit [get] +// @Router /api/v2/audit [get] func (api *API) auditLogs(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() apiKey := httpmw.APIKey(r) @@ -115,7 +115,7 @@ func (api *API) auditLogs(rw http.ResponseWriter, r *http.Request) { // @Tags Audit // @Param request body codersdk.CreateTestAuditLogRequest true "Audit log request" // @Success 204 -// @Router /audit/testgenerate [post] +// @Router /api/v2/audit/testgenerate [post] // @x-apidocgen {"skip": true} func (api *API) generateFakeAuditLog(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() diff --git a/coderd/authorize.go b/coderd/authorize.go index 1ea4cf7ff7..6f2cf01cd4 100644 --- a/coderd/authorize.go +++ b/coderd/authorize.go @@ -165,7 +165,7 @@ func (h *HTTPAuthorizer) AuthorizeSQLFilterContext(ctx context.Context, action p // @Tags Authorization // @Param request body codersdk.AuthorizationRequest true "Authorization request" // @Success 200 {object} codersdk.AuthorizationResponse -// @Router /authcheck [post] +// @Router /api/v2/authcheck [post] func (api *API) checkAuthorization(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() auth := httpmw.UserAuthorization(r.Context()) diff --git a/coderd/coderd.go b/coderd/coderd.go index 3901727a06..c109fbd719 100644 --- a/coderd/coderd.go +++ b/coderd/coderd.go @@ -5,6 +5,7 @@ import ( "crypto/tls" "crypto/x509" "database/sql" + _ "embed" "errors" "expvar" "flag" @@ -115,6 +116,9 @@ import ( // See https://github.com/swaggo/http-swagger/issues/78 var globalHTTPSwaggerHandler http.HandlerFunc +//go:embed swagger_request_interceptor.js +var swaggerRequestInterceptor string + func init() { globalHTTPSwaggerHandler = httpSwagger.Handler( httpSwagger.URL("/swagger/doc.json"), @@ -130,16 +134,11 @@ func init() { // So remove authenticating via a cookie, and rely on the authorization // header passed in. httpSwagger.UIConfig(map[string]string{ - // Pulled from https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/ - // 'withCredentials' should disable fetch sending browser credentials, but - // for whatever reason it does not. - // So this `requestInterceptor` ensures browser credentials are - // omitted from all requests. - "requestInterceptor": `(a => { - a.credentials = "omit"; - return a; - })`, - "withCredentials": "false", + // The interceptor source lives in swagger_request_interceptor.js so + // it can be edited as real JavaScript. + // See https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/. + "requestInterceptor": swaggerRequestInterceptor, + "withCredentials": "false", })) } @@ -310,7 +309,7 @@ type Options struct { // @license.name AGPL-3.0 // @license.url https://github.com/coder/coder/blob/main/LICENSE -// @BasePath /api/v2 +// @BasePath / // @securitydefinitions.apiKey Authorization // @in header diff --git a/coderd/coderd_test.go b/coderd/coderd_test.go index 0d0d32f553..0ffbe695b4 100644 --- a/coderd/coderd_test.go +++ b/coderd/coderd_test.go @@ -2,6 +2,7 @@ package coderd_test import ( "context" + "encoding/json" "flag" "fmt" "io" @@ -280,7 +281,9 @@ func TestSwagger(t *testing.T) { require.NoError(t, err) defer resp.Body.Close() - require.Contains(t, string(body), "Swagger UI") + bodyString := string(body) + require.Contains(t, bodyString, "Swagger UI") + require.Contains(t, bodyString, "requestInterceptor") }) t.Run("doc.json exposed", func(t *testing.T) { t.Parallel() @@ -299,7 +302,23 @@ func TestSwagger(t *testing.T) { require.NoError(t, err) defer resp.Body.Close() - require.Contains(t, string(body), `"swagger": "2.0"`) + bodyString := string(body) + require.NotContains(t, bodyString, `"/api/v2/scim/v2`) + + var doc struct { + Swagger string `json:"swagger"` + BasePath string `json:"basePath"` + Paths map[string]map[string]json.RawMessage `json:"paths"` + } + require.NoError(t, json.Unmarshal(body, &doc)) + require.Equal(t, "2.0", doc.Swagger) + require.Equal(t, "/", doc.BasePath) + require.Contains(t, doc.Paths, "/api/v2/users") + require.Contains(t, doc.Paths, "/api/v2/oauth2-provider/apps") + require.Contains(t, doc.Paths, "/api/experimental/watch-all-workspacebuilds") + require.Contains(t, doc.Paths, "/.well-known/oauth-authorization-server") + require.Contains(t, doc.Paths, "/oauth2/tokens") + require.Contains(t, doc.Paths, "/scim/v2/Users") }) t.Run("endpoint disabled by default", func(t *testing.T) { t.Parallel() diff --git a/coderd/coderdtest/swagger_test.go b/coderd/coderdtest/swagger_test.go index 7b50a27964..5f43eb4872 100644 --- a/coderd/coderdtest/swagger_test.go +++ b/coderd/coderdtest/swagger_test.go @@ -21,7 +21,7 @@ func TestEndpointsDocumented(t *testing.T) { require.NotEmpty(t, swaggerComments, "swagger comments must be present") _, _, api := coderdtest.NewWithAPI(t, nil) - coderdtest.VerifySwaggerDefinitions(t, api.APIHandler, swaggerComments) + coderdtest.VerifySwaggerDefinitions(t, api.APIHandler, swaggerComments, coderdtest.WithSwaggerRoutePrefix("/api/v2")) } func TestSDKFieldsFormatted(t *testing.T) { diff --git a/coderd/coderdtest/swaggerparser.go b/coderd/coderdtest/swaggerparser.go index 05854d2f8f..11aa4c10c6 100644 --- a/coderd/coderdtest/swaggerparser.go +++ b/coderd/coderdtest/swaggerparser.go @@ -147,11 +147,33 @@ func parseSwaggerComment(commentGroup *ast.CommentGroup) SwaggerComment { return c } -func isExperimentalEndpoint(route string) bool { - return strings.HasPrefix(route, "/workspaceagents/me/experimental/") +// SwaggerOption configures VerifySwaggerDefinitions. +type SwaggerOption func(*swaggerOptions) + +type swaggerOptions struct { + routePrefix string } -func VerifySwaggerDefinitions(t *testing.T, router chi.Router, swaggerComments []SwaggerComment) { +// WithSwaggerRoutePrefix prepends the given prefix to every route walked from +// the chi router. Use this when calling VerifySwaggerDefinitions with a +// subrouter (for example api.APIHandler at /api/v2) so that routes line up +// with the absolute paths used in @Router annotations. +func WithSwaggerRoutePrefix(prefix string) SwaggerOption { + return func(o *swaggerOptions) { + o.routePrefix = prefix + } +} + +func isExperimentalEndpoint(route string) bool { + return strings.HasPrefix(route, "/api/v2/workspaceagents/me/experimental/") +} + +func VerifySwaggerDefinitions(t *testing.T, router chi.Router, swaggerComments []SwaggerComment, opts ...SwaggerOption) { + cfg := swaggerOptions{} + for _, opt := range opts { + opt(&cfg) + } + assertUniqueRoutes(t, swaggerComments) assertSingleAnnotations(t, swaggerComments) @@ -161,6 +183,18 @@ func VerifySwaggerDefinitions(t *testing.T, router chi.Router, swaggerComments [ route = route[:len(route)-1] } + // chi.Walk yields routes relative to the router that + // VerifySwaggerDefinitions was called with. Prepend the configured + // mount prefix so routes match the absolute paths used in @Router + // annotations. + if cfg.routePrefix != "" { + if route == "/" { + route = cfg.routePrefix + "/" + } else { + route = cfg.routePrefix + route + } + } + t.Run(method+" "+route, func(t *testing.T) { t.Parallel() @@ -313,14 +347,14 @@ func assertSecurityDefined(t *testing.T, comment SwaggerComment) { "CoderProvisionerKey", } - if comment.router == "/updatecheck" || - comment.router == "/buildinfo" || - comment.router == "/" || - comment.router == "/auth/scopes" || - comment.router == "/users/login" || - comment.router == "/users/otp/request" || - comment.router == "/users/otp/change-password" || - comment.router == "/init-script/{os}/{arch}" { + if comment.router == "/api/v2/updatecheck" || + comment.router == "/api/v2/buildinfo" || + comment.router == "/api/v2/" || + comment.router == "/api/v2/auth/scopes" || + comment.router == "/api/v2/users/login" || + comment.router == "/api/v2/users/otp/request" || + comment.router == "/api/v2/users/otp/change-password" || + comment.router == "/api/v2/init-script/{os}/{arch}" { return // endpoints do not require authorization } assert.Containsf(t, authorizedSecurityTags, comment.security, "@Security must be either of these options: %v", authorizedSecurityTags) @@ -365,14 +399,14 @@ func assertProduce(t *testing.T, comment SwaggerComment) { assert.True(t, comment.produce != "", "Route must have @Produce annotation as it responds with a model structure") assert.Contains(t, allowedProduceTypes, comment.produce, "@Produce value is limited to specific types: %s", strings.Join(allowedProduceTypes, ",")) } else { - if (comment.router == "/workspaceagents/me/app-health" && comment.method == "post") || - (comment.router == "/workspaceagents/me/startup" && comment.method == "post") || - (comment.router == "/workspaceagents/me/startup/logs" && comment.method == "patch") || - (comment.router == "/licenses/{id}" && comment.method == "delete") || - (comment.router == "/debug/coordinator" && comment.method == "get") || - (comment.router == "/debug/tailnet" && comment.method == "get") || - (comment.router == "/workspaces/{workspace}/acl" && comment.method == "patch") || - (comment.router == "/init-script/{os}/{arch}" && comment.method == "get") { + if (comment.router == "/api/v2/workspaceagents/me/app-health" && comment.method == "post") || + (comment.router == "/api/v2/workspaceagents/me/startup" && comment.method == "post") || + (comment.router == "/api/v2/workspaceagents/me/startup/logs" && comment.method == "patch") || + (comment.router == "/api/v2/licenses/{id}" && comment.method == "delete") || + (comment.router == "/api/v2/debug/coordinator" && comment.method == "get") || + (comment.router == "/api/v2/debug/tailnet" && comment.method == "get") || + (comment.router == "/api/v2/workspaces/{workspace}/acl" && comment.method == "patch") || + (comment.router == "/api/v2/init-script/{os}/{arch}" && comment.method == "get") { return // Exception: HTTP 200 is returned without response entity } diff --git a/coderd/csp.go b/coderd/csp.go index 2c6c189b37..bba4980743 100644 --- a/coderd/csp.go +++ b/coderd/csp.go @@ -22,7 +22,7 @@ type cspViolation struct { // @Tags General // @Param request body cspViolation true "Violation report" // @Success 200 -// @Router /csp/reports [post] +// @Router /api/v2/csp/reports [post] func (api *API) logReportCSPViolations(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() var v cspViolation diff --git a/coderd/debug.go b/coderd/debug.go index 0887485aaa..5df6bda4a4 100644 --- a/coderd/debug.go +++ b/coderd/debug.go @@ -38,7 +38,7 @@ import ( // @Produce text/html // @Tags Debug // @Success 200 -// @Router /debug/coordinator [get] +// @Router /api/v2/debug/coordinator [get] func (api *API) debugCoordinator(rw http.ResponseWriter, r *http.Request) { (*api.TailnetCoordinator.Load()).ServeHTTPDebug(rw, r) } @@ -49,7 +49,7 @@ func (api *API) debugCoordinator(rw http.ResponseWriter, r *http.Request) { // @Produce text/html // @Tags Debug // @Success 200 -// @Router /debug/tailnet [get] +// @Router /api/v2/debug/tailnet [get] func (api *API) debugTailnet(rw http.ResponseWriter, r *http.Request) { api.agentProvider.ServeHTTPDebug(rw, r) } @@ -60,7 +60,7 @@ func (api *API) debugTailnet(rw http.ResponseWriter, r *http.Request) { // @Produce json // @Tags Debug // @Success 200 {object} healthsdk.HealthcheckReport -// @Router /debug/health [get] +// @Router /api/v2/debug/health [get] // @Param force query boolean false "Force a healthcheck to run" func (api *API) debugDeploymentHealth(rw http.ResponseWriter, r *http.Request) { apiKey := httpmw.APITokenFromRequest(r) @@ -168,7 +168,7 @@ func formatHealthcheck(ctx context.Context, rw http.ResponseWriter, r *http.Requ // @Produce json // @Tags Debug // @Success 200 {object} healthsdk.HealthSettings -// @Router /debug/health/settings [get] +// @Router /api/v2/debug/health/settings [get] func (api *API) deploymentHealthSettings(rw http.ResponseWriter, r *http.Request) { settingsJSON, err := api.Database.GetHealthSettings(r.Context()) if err != nil { @@ -204,7 +204,7 @@ func (api *API) deploymentHealthSettings(rw http.ResponseWriter, r *http.Request // @Tags Debug // @Param request body healthsdk.UpdateHealthSettings true "Update health settings" // @Success 200 {object} healthsdk.UpdateHealthSettings -// @Router /debug/health/settings [put] +// @Router /api/v2/debug/health/settings [put] func (api *API) putDeploymentHealthSettings(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() @@ -297,7 +297,7 @@ func validateHealthSettings(settings healthsdk.HealthSettings) error { // @Produce json // @Tags Debug // @Success 201 {object} codersdk.Response -// @Router /debug/ws [get] +// @Router /api/v2/debug/ws [get] // @x-apidocgen {"skip": true} func _debugws(http.ResponseWriter, *http.Request) {} //nolint:unused @@ -307,7 +307,7 @@ func _debugws(http.ResponseWriter, *http.Request) {} //nolint:unused // @Produce json // @Success 200 {array} derp.BytesSentRecv // @Tags Debug -// @Router /debug/derp/traffic [get] +// @Router /api/v2/debug/derp/traffic [get] // @x-apidocgen {"skip": true} func _debugDERPTraffic(http.ResponseWriter, *http.Request) {} //nolint:unused @@ -317,7 +317,7 @@ func _debugDERPTraffic(http.ResponseWriter, *http.Request) {} //nolint:unused // @Produce json // @Tags Debug // @Success 200 {object} map[string]any -// @Router /debug/expvar [get] +// @Router /api/v2/debug/expvar [get] // @x-apidocgen {"skip": true} func _debugExpVar(http.ResponseWriter, *http.Request) {} //nolint:unused @@ -415,7 +415,7 @@ const ( // @Security CoderSessionToken // @Tags Debug // @Success 200 -// @Router /debug/profile [post] +// @Router /api/v2/debug/profile [post] // @x-apidocgen {"skip": true} func (api *API) debugCollectProfile(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() @@ -634,7 +634,7 @@ func (api *API) debugCollectProfile(rw http.ResponseWriter, r *http.Request) { // @Security CoderSessionToken // @Success 200 // @Tags Debug -// @Router /debug/pprof [get] +// @Router /api/v2/debug/pprof [get] // @x-apidocgen {"skip": true} func _debugPprofIndex(http.ResponseWriter, *http.Request) {} //nolint:unused @@ -643,7 +643,7 @@ func _debugPprofIndex(http.ResponseWriter, *http.Request) {} //nolint:unused // @Security CoderSessionToken // @Success 200 // @Tags Debug -// @Router /debug/pprof/cmdline [get] +// @Router /api/v2/debug/pprof/cmdline [get] // @x-apidocgen {"skip": true} func _debugPprofCmdline(http.ResponseWriter, *http.Request) {} //nolint:unused @@ -652,7 +652,7 @@ func _debugPprofCmdline(http.ResponseWriter, *http.Request) {} //nolint:unused // @Security CoderSessionToken // @Success 200 // @Tags Debug -// @Router /debug/pprof/profile [get] +// @Router /api/v2/debug/pprof/profile [get] // @x-apidocgen {"skip": true} func _debugPprofProfile(http.ResponseWriter, *http.Request) {} //nolint:unused @@ -661,7 +661,7 @@ func _debugPprofProfile(http.ResponseWriter, *http.Request) {} //nolint:unused // @Security CoderSessionToken // @Success 200 // @Tags Debug -// @Router /debug/pprof/symbol [get] +// @Router /api/v2/debug/pprof/symbol [get] // @x-apidocgen {"skip": true} func _debugPprofSymbol(http.ResponseWriter, *http.Request) {} //nolint:unused @@ -670,7 +670,7 @@ func _debugPprofSymbol(http.ResponseWriter, *http.Request) {} //nolint:unused // @Security CoderSessionToken // @Success 200 // @Tags Debug -// @Router /debug/pprof/trace [get] +// @Router /api/v2/debug/pprof/trace [get] // @x-apidocgen {"skip": true} func _debugPprofTrace(http.ResponseWriter, *http.Request) {} //nolint:unused @@ -679,6 +679,6 @@ func _debugPprofTrace(http.ResponseWriter, *http.Request) {} //nolint:unused // @Security CoderSessionToken // @Success 200 // @Tags Debug -// @Router /debug/metrics [get] +// @Router /api/v2/debug/metrics [get] // @x-apidocgen {"skip": true} func _debugMetrics(http.ResponseWriter, *http.Request) {} //nolint:unused diff --git a/coderd/deployment.go b/coderd/deployment.go index 4c78563a80..ed03403b15 100644 --- a/coderd/deployment.go +++ b/coderd/deployment.go @@ -15,7 +15,7 @@ import ( // @Produce json // @Tags General // @Success 200 {object} codersdk.DeploymentConfig -// @Router /deployment/config [get] +// @Router /api/v2/deployment/config [get] func (api *API) deploymentValues(rw http.ResponseWriter, r *http.Request) { if !api.Authorize(r, policy.ActionRead, rbac.ResourceDeploymentConfig) { httpapi.Forbidden(rw) @@ -43,7 +43,7 @@ func (api *API) deploymentValues(rw http.ResponseWriter, r *http.Request) { // @Produce json // @Tags General // @Success 200 {object} codersdk.DeploymentStats -// @Router /deployment/stats [get] +// @Router /api/v2/deployment/stats [get] func (api *API) deploymentStats(rw http.ResponseWriter, r *http.Request) { if !api.Authorize(r, policy.ActionRead, rbac.ResourceDeploymentStats) { httpapi.Forbidden(rw) @@ -66,7 +66,7 @@ func (api *API) deploymentStats(rw http.ResponseWriter, r *http.Request) { // @Produce json // @Tags General // @Success 200 {object} codersdk.BuildInfoResponse -// @Router /buildinfo [get] +// @Router /api/v2/buildinfo [get] func buildInfoHandler(resp codersdk.BuildInfoResponse) http.HandlerFunc { // This is in a handler so that we can generate API docs info. return func(rw http.ResponseWriter, r *http.Request) { @@ -80,7 +80,7 @@ func buildInfoHandler(resp codersdk.BuildInfoResponse) http.HandlerFunc { // @Produce json // @Tags General // @Success 200 {object} codersdk.SSHConfigResponse -// @Router /deployment/ssh [get] +// @Router /api/v2/deployment/ssh [get] func (api *API) sshConfig(rw http.ResponseWriter, r *http.Request) { httpapi.Write(r.Context(), rw, http.StatusOK, api.SSHConfig) } diff --git a/coderd/deprecated.go b/coderd/deprecated.go index 6dc03e540c..3c86409104 100644 --- a/coderd/deprecated.go +++ b/coderd/deprecated.go @@ -14,7 +14,7 @@ import ( // @Tags Templates // @Param templateversion path string true "Template version ID" format(uuid) // @Success 200 -// @Router /templateversions/{templateversion}/parameters [get] +// @Router /api/v2/templateversions/{templateversion}/parameters [get] func templateVersionParametersDeprecated(rw http.ResponseWriter, r *http.Request) { httpapi.Write(r.Context(), rw, http.StatusOK, []struct{}{}) } @@ -25,7 +25,7 @@ func templateVersionParametersDeprecated(rw http.ResponseWriter, r *http.Request // @Tags Templates // @Param templateversion path string true "Template version ID" format(uuid) // @Success 200 -// @Router /templateversions/{templateversion}/schema [get] +// @Router /api/v2/templateversions/{templateversion}/schema [get] func templateVersionSchemaDeprecated(rw http.ResponseWriter, r *http.Request) { httpapi.Write(r.Context(), rw, http.StatusOK, []struct{}{}) } @@ -41,7 +41,7 @@ func templateVersionSchemaDeprecated(rw http.ResponseWriter, r *http.Request) { // @Param follow query bool false "Follow log stream" // @Param no_compression query bool false "Disable compression for WebSocket connection" // @Success 200 {array} codersdk.WorkspaceAgentLog -// @Router /workspaceagents/{workspaceagent}/startup-logs [get] +// @Router /api/v2/workspaceagents/{workspaceagent}/startup-logs [get] func (api *API) workspaceAgentLogsDeprecated(rw http.ResponseWriter, r *http.Request) { api.workspaceAgentLogs(rw, r) } @@ -55,7 +55,7 @@ func (api *API) workspaceAgentLogsDeprecated(rw http.ResponseWriter, r *http.Req // @Param id query string true "Provider ID" // @Param listen query bool false "Wait for a new token to be issued" // @Success 200 {object} agentsdk.ExternalAuthResponse -// @Router /workspaceagents/me/gitauth [get] +// @Router /api/v2/workspaceagents/me/gitauth [get] func (api *API) workspaceAgentsGitAuth(rw http.ResponseWriter, r *http.Request) { api.workspaceAgentsExternalAuth(rw, r) } @@ -67,7 +67,7 @@ func (api *API) workspaceAgentsGitAuth(rw http.ResponseWriter, r *http.Request) // @Tags Builds // @Param workspacebuild path string true "Workspace build ID" // @Success 200 {array} codersdk.WorkspaceResource -// @Router /workspacebuilds/{workspacebuild}/resources [get] +// @Router /api/v2/workspacebuilds/{workspacebuild}/resources [get] // @Deprecated this endpoint is unused and will be removed in future. func (api *API) workspaceBuildResourcesDeprecated(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() diff --git a/coderd/exp_chats.go b/coderd/exp_chats.go index 202bdc1d2f..d18f48492e 100644 --- a/coderd/exp_chats.go +++ b/coderd/exp_chats.go @@ -4486,7 +4486,7 @@ func (api *API) putChatWorkspaceTTL(rw http.ResponseWriter, r *http.Request) { // @Tags Chats // @Produce json // @Success 200 {object} codersdk.ChatRetentionDaysResponse -// @Router /experimental/chats/config/retention-days [get] +// @Router /api/experimental/chats/config/retention-days [get] // @x-apidocgen {"skip": true} // //nolint:revive // get-return: revive assumes get* must be a getter, but this is an HTTP handler. @@ -4516,7 +4516,7 @@ const retentionDaysMaximum = 3650 // ~10 years // @Accept json // @Param request body codersdk.UpdateChatRetentionDaysRequest true "Request body" // @Success 204 -// @Router /experimental/chats/config/retention-days [put] +// @Router /api/experimental/chats/config/retention-days [put] // @x-apidocgen {"skip": true} func (api *API) putChatRetentionDays(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() @@ -6941,7 +6941,7 @@ func (api *API) hasEffectiveCentralProviderAPIKey( // @Param start_date query string true "Start date (RFC3339)" // @Param end_date query string true "End date (RFC3339)" // @Success 200 {object} codersdk.PRInsightsResponse -// @Router /chats/insights/pull-requests [get] +// @Router /api/experimental/chats/insights/pull-requests [get] // @x-apidocgen {"skip": true} func (api *API) prInsights(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() diff --git a/coderd/experiments.go b/coderd/experiments.go index a0949e9411..1d5c111e9d 100644 --- a/coderd/experiments.go +++ b/coderd/experiments.go @@ -13,7 +13,7 @@ import ( // @Produce json // @Tags General // @Success 200 {array} codersdk.Experiment -// @Router /experiments [get] +// @Router /api/v2/experiments [get] func (api *API) handleExperimentsGet(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() httpapi.Write(ctx, rw, http.StatusOK, api.Experiments) @@ -25,7 +25,7 @@ func (api *API) handleExperimentsGet(rw http.ResponseWriter, r *http.Request) { // @Produce json // @Tags General // @Success 200 {array} codersdk.Experiment -// @Router /experiments/available [get] +// @Router /api/v2/experiments/available [get] func handleExperimentsAvailable(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() httpapi.Write(ctx, rw, http.StatusOK, codersdk.AvailableExperiments{ diff --git a/coderd/externalauth.go b/coderd/externalauth.go index 95978a5ac8..29eb53e679 100644 --- a/coderd/externalauth.go +++ b/coderd/externalauth.go @@ -27,7 +27,7 @@ import ( // @Produce json // @Param externalauth path string true "Git Provider ID" format(string) // @Success 200 {object} codersdk.ExternalAuth -// @Router /external-auth/{externalauth} [get] +// @Router /api/v2/external-auth/{externalauth} [get] func (api *API) externalAuthByID(w http.ResponseWriter, r *http.Request) { config := httpmw.ExternalAuthParam(r) apiKey := httpmw.APIKey(r) @@ -89,7 +89,7 @@ func (api *API) externalAuthByID(w http.ResponseWriter, r *http.Request) { // @Produce json // @Param externalauth path string true "Git Provider ID" format(string) // @Success 200 {object} codersdk.DeleteExternalAuthByIDResponse -// @Router /external-auth/{externalauth} [delete] +// @Router /api/v2/external-auth/{externalauth} [delete] func (api *API) deleteExternalAuthByID(w http.ResponseWriter, r *http.Request) { config := httpmw.ExternalAuthParam(r) apiKey := httpmw.APIKey(r) @@ -142,7 +142,7 @@ func (api *API) deleteExternalAuthByID(w http.ResponseWriter, r *http.Request) { // @Tags Git // @Param externalauth path string true "External Provider ID" format(string) // @Success 204 -// @Router /external-auth/{externalauth}/device [post] +// @Router /api/v2/external-auth/{externalauth}/device [post] func (api *API) postExternalAuthDeviceByID(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() apiKey := httpmw.APIKey(r) @@ -232,7 +232,7 @@ func (api *API) postExternalAuthDeviceByID(rw http.ResponseWriter, r *http.Reque // @Tags Git // @Param externalauth path string true "Git Provider ID" format(string) // @Success 200 {object} codersdk.ExternalAuthDevice -// @Router /external-auth/{externalauth}/device [get] +// @Router /api/v2/external-auth/{externalauth}/device [get] func (*API) externalAuthDeviceByID(rw http.ResponseWriter, r *http.Request) { config := httpmw.ExternalAuthParam(r) ctx := r.Context() @@ -345,7 +345,7 @@ func (api *API) externalAuthCallback(externalAuthConfig *externalauth.Config) ht // @Produce json // @Tags Git // @Success 200 {object} codersdk.ExternalAuthLink -// @Router /external-auth [get] +// @Router /api/v2/external-auth [get] func (api *API) listUserExternalAuths(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() key := httpmw.APIKey(r) diff --git a/coderd/files.go b/coderd/files.go index bf1f613993..b77bd81375 100644 --- a/coderd/files.go +++ b/coderd/files.go @@ -43,7 +43,7 @@ const ( // @Param file formData file true "File to be uploaded. If using tar format, file must conform to ustar (pax may cause problems)." // @Success 200 {object} codersdk.UploadResponse "Returns existing file if duplicate" // @Success 201 {object} codersdk.UploadResponse "Returns newly created file" -// @Router /files [post] +// @Router /api/v2/files [post] func (api *API) postFile(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() apiKey := httpmw.APIKey(r) @@ -149,7 +149,7 @@ func (api *API) postFile(rw http.ResponseWriter, r *http.Request) { // @Tags Files // @Param fileID path string true "File ID" format(uuid) // @Success 200 -// @Router /files/{fileID} [get] +// @Router /api/v2/files/{fileID} [get] func (api *API) fileByID(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() diff --git a/coderd/gitsshkey.go b/coderd/gitsshkey.go index b9724689c5..de97af42cb 100644 --- a/coderd/gitsshkey.go +++ b/coderd/gitsshkey.go @@ -20,7 +20,7 @@ import ( // @Tags Users // @Param user path string true "User ID, name, or me" // @Success 200 {object} codersdk.GitSSHKey -// @Router /users/{user}/gitsshkey [put] +// @Router /api/v2/users/{user}/gitsshkey [put] func (api *API) regenerateGitSSHKey(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -84,7 +84,7 @@ func (api *API) regenerateGitSSHKey(rw http.ResponseWriter, r *http.Request) { // @Tags Users // @Param user path string true "User ID, name, or me" // @Success 200 {object} codersdk.GitSSHKey -// @Router /users/{user}/gitsshkey [get] +// @Router /api/v2/users/{user}/gitsshkey [get] func (api *API) gitSSHKey(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() user := httpmw.UserParam(r) @@ -113,7 +113,7 @@ func (api *API) gitSSHKey(rw http.ResponseWriter, r *http.Request) { // @Produce json // @Tags Agents // @Success 200 {object} agentsdk.GitSSHKey -// @Router /workspaceagents/me/gitsshkey [get] +// @Router /api/v2/workspaceagents/me/gitsshkey [get] func (api *API) agentGitSSHKey(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() agent := httpmw.WorkspaceAgent(r) diff --git a/coderd/inboxnotifications.go b/coderd/inboxnotifications.go index e9fc9e34c5..f451315c38 100644 --- a/coderd/inboxnotifications.go +++ b/coderd/inboxnotifications.go @@ -115,7 +115,7 @@ func convertInboxNotificationResponse(ctx context.Context, logger slog.Logger, n // @Param read_status query string false "Filter notifications by read status. Possible values: read, unread, all" // @Param format query string false "Define the output format for notifications title and body." enums(plaintext,markdown) // @Success 200 {object} codersdk.GetInboxNotificationResponse -// @Router /notifications/inbox/watch [get] +// @Router /api/v2/notifications/inbox/watch [get] func (api *API) watchInboxNotifications(rw http.ResponseWriter, r *http.Request) { p := httpapi.NewQueryParamParser() vals := r.URL.Query() @@ -286,7 +286,7 @@ func (api *API) watchInboxNotifications(rw http.ResponseWriter, r *http.Request) // @Param read_status query string false "Filter notifications by read status. Possible values: read, unread, all" // @Param starting_before query string false "ID of the last notification from the current page. Notifications returned will be older than the associated one" format(uuid) // @Success 200 {object} codersdk.ListInboxNotificationsResponse -// @Router /notifications/inbox [get] +// @Router /api/v2/notifications/inbox [get] func (api *API) listInboxNotifications(rw http.ResponseWriter, r *http.Request) { p := httpapi.NewQueryParamParser() vals := r.URL.Query() @@ -372,7 +372,7 @@ func (api *API) listInboxNotifications(rw http.ResponseWriter, r *http.Request) // @Tags Notifications // @Param id path string true "id of the notification" // @Success 200 {object} codersdk.Response -// @Router /notifications/inbox/{id}/read-status [put] +// @Router /api/v2/notifications/inbox/{id}/read-status [put] func (api *API) updateInboxNotificationReadStatus(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -440,7 +440,7 @@ func (api *API) updateInboxNotificationReadStatus(rw http.ResponseWriter, r *htt // @Security CoderSessionToken // @Tags Notifications // @Success 204 -// @Router /notifications/inbox/mark-all-as-read [put] +// @Router /api/v2/notifications/inbox/mark-all-as-read [put] func (api *API) markAllInboxNotificationsAsRead(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() diff --git a/coderd/initscript.go b/coderd/initscript.go index 2051ca7f5f..6ffff465fd 100644 --- a/coderd/initscript.go +++ b/coderd/initscript.go @@ -21,7 +21,7 @@ import ( // @Param os path string true "Operating system" // @Param arch path string true "Architecture" // @Success 200 "Success" -// @Router /init-script/{os}/{arch} [get] +// @Router /api/v2/init-script/{os}/{arch} [get] func (api *API) initScript(rw http.ResponseWriter, r *http.Request) { os := strings.ToLower(chi.URLParam(r, "os")) arch := strings.ToLower(chi.URLParam(r, "arch")) diff --git a/coderd/insights.go b/coderd/insights.go index c477df6342..4cdb8e81f9 100644 --- a/coderd/insights.go +++ b/coderd/insights.go @@ -33,7 +33,7 @@ const insightsTimeLayout = time.RFC3339 // @Tags Insights // @Param tz_offset query int true "Time-zone offset (e.g. -2)" // @Success 200 {object} codersdk.DAUsResponse -// @Router /insights/daus [get] +// @Router /api/v2/insights/daus [get] func (api *API) deploymentDAUs(rw http.ResponseWriter, r *http.Request) { if !api.Authorize(r, policy.ActionRead, rbac.ResourceDeploymentConfig) { httpapi.Forbidden(rw) @@ -106,7 +106,7 @@ func (api *API) returnDAUsInternal(rw http.ResponseWriter, r *http.Request, temp // @Param end_time query string true "End time" format(date-time) // @Param template_ids query []string false "Template IDs" collectionFormat(csv) // @Success 200 {object} codersdk.UserActivityInsightsResponse -// @Router /insights/user-activity [get] +// @Router /api/v2/insights/user-activity [get] func (api *API) insightsUserActivity(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() @@ -209,7 +209,7 @@ func (api *API) insightsUserActivity(rw http.ResponseWriter, r *http.Request) { // @Param end_time query string true "End time" format(date-time) // @Param template_ids query []string false "Template IDs" collectionFormat(csv) // @Success 200 {object} codersdk.UserLatencyInsightsResponse -// @Router /insights/user-latency [get] +// @Router /api/v2/insights/user-latency [get] func (api *API) insightsUserLatency(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() @@ -301,7 +301,7 @@ func (api *API) insightsUserLatency(rw http.ResponseWriter, r *http.Request) { // @Param timezone query string false "IANA timezone name (e.g. America/St_Johns)" // @Param tz_offset query int false "Deprecated: Time-zone offset (e.g. -2). Use timezone instead." // @Success 200 {object} codersdk.GetUserStatusCountsResponse -// @Router /insights/user-status-counts [get] +// @Router /api/v2/insights/user-status-counts [get] func (api *API) insightsUserStatusCounts(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() @@ -396,7 +396,7 @@ func (api *API) insightsUserStatusCounts(rw http.ResponseWriter, r *http.Request // @Param interval query string true "Interval" enums(week,day) // @Param template_ids query []string false "Template IDs" collectionFormat(csv) // @Success 200 {object} codersdk.TemplateInsightsResponse -// @Router /insights/templates [get] +// @Router /api/v2/insights/templates [get] func (api *API) insightsTemplates(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() diff --git a/coderd/members.go b/coderd/members.go index 70b8380f10..7f1511bebb 100644 --- a/coderd/members.go +++ b/coderd/members.go @@ -30,7 +30,7 @@ import ( // @Param organization path string true "Organization ID" // @Param user path string true "User ID, name, or me" // @Success 200 {object} codersdk.OrganizationMember -// @Router /organizations/{organization}/members/{user} [post] +// @Router /api/v2/organizations/{organization}/members/{user} [post] func (api *API) postOrganizationMember(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -97,7 +97,7 @@ func (api *API) postOrganizationMember(rw http.ResponseWriter, r *http.Request) // @Param organization path string true "Organization ID" // @Param user path string true "User ID, name, or me" // @Success 204 -// @Router /organizations/{organization}/members/{user} [delete] +// @Router /api/v2/organizations/{organization}/members/{user} [delete] func (api *API) deleteOrganizationMember(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -154,7 +154,7 @@ func (api *API) deleteOrganizationMember(rw http.ResponseWriter, r *http.Request // @Param user path string true "User ID, name, or me" // @Success 200 {object} codersdk.OrganizationMemberWithUserData // @Produce json -// @Router /organizations/{organization}/members/{user} [get] +// @Router /api/v2/organizations/{organization}/members/{user} [get] func (api *API) organizationMember(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -212,7 +212,7 @@ func (api *API) organizationMember(rw http.ResponseWriter, r *http.Request) { // @Tags Members // @Param organization path string true "Organization ID" // @Success 200 {object} []codersdk.OrganizationMemberWithUserData -// @Router /organizations/{organization}/members [get] +// @Router /api/v2/organizations/{organization}/members [get] func (api *API) listMembers(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -272,7 +272,7 @@ func (api *API) listMembers(rw http.ResponseWriter, r *http.Request) { // @Param limit query int false "Page limit, if 0 returns all members" // @Param offset query int false "Page offset" // @Success 200 {object} []codersdk.PaginatedMembersResponse -// @Router /organizations/{organization}/paginated-members [get] +// @Router /api/v2/organizations/{organization}/paginated-members [get] func (api *API) paginatedMembers(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -403,7 +403,7 @@ func getAISeatSetByUserIDs(ctx context.Context, db database.Store, userIDs []uui // @Param user path string true "User ID, name, or me" // @Param request body codersdk.UpdateRoles true "Update roles request" // @Success 200 {object} codersdk.OrganizationMember -// @Router /organizations/{organization}/members/{user}/roles [put] +// @Router /api/v2/organizations/{organization}/members/{user}/roles [put] func (api *API) putMemberRoles(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() diff --git a/coderd/notifications.go b/coderd/notifications.go index fd57946dbf..1782155109 100644 --- a/coderd/notifications.go +++ b/coderd/notifications.go @@ -27,7 +27,7 @@ import ( // @Produce json // @Tags Notifications // @Success 200 {object} codersdk.NotificationsSettings -// @Router /notifications/settings [get] +// @Router /api/v2/notifications/settings [get] func (api *API) notificationsSettings(rw http.ResponseWriter, r *http.Request) { settingsJSON, err := api.Database.GetNotificationsSettings(r.Context()) if err != nil { @@ -61,7 +61,7 @@ func (api *API) notificationsSettings(rw http.ResponseWriter, r *http.Request) { // @Param request body codersdk.NotificationsSettings true "Notifications settings request" // @Success 200 {object} codersdk.NotificationsSettings // @Success 304 -// @Router /notifications/settings [put] +// @Router /api/v2/notifications/settings [put] func (api *API) putNotificationsSettings(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() @@ -149,7 +149,7 @@ func (api *API) notificationTemplatesByKind(rw http.ResponseWriter, r *http.Requ // @Tags Notifications // @Success 200 {array} codersdk.NotificationTemplate // @Failure 500 {object} codersdk.Response "Failed to retrieve 'system' notifications template" -// @Router /notifications/templates/system [get] +// @Router /api/v2/notifications/templates/system [get] func (api *API) systemNotificationTemplates(rw http.ResponseWriter, r *http.Request) { api.notificationTemplatesByKind(rw, r, database.NotificationTemplateKindSystem) } @@ -161,7 +161,7 @@ func (api *API) systemNotificationTemplates(rw http.ResponseWriter, r *http.Requ // @Tags Notifications // @Success 200 {array} codersdk.NotificationTemplate // @Failure 500 {object} codersdk.Response "Failed to retrieve 'custom' notifications template" -// @Router /notifications/templates/custom [get] +// @Router /api/v2/notifications/templates/custom [get] func (api *API) customNotificationTemplates(rw http.ResponseWriter, r *http.Request) { api.notificationTemplatesByKind(rw, r, database.NotificationTemplateKindCustom) } @@ -172,7 +172,7 @@ func (api *API) customNotificationTemplates(rw http.ResponseWriter, r *http.Requ // @Produce json // @Tags Notifications // @Success 200 {array} codersdk.NotificationMethodsResponse -// @Router /notifications/dispatch-methods [get] +// @Router /api/v2/notifications/dispatch-methods [get] func (api *API) notificationDispatchMethods(rw http.ResponseWriter, r *http.Request) { var methods []string for _, nm := range database.AllNotificationMethodValues() { @@ -195,7 +195,7 @@ func (api *API) notificationDispatchMethods(rw http.ResponseWriter, r *http.Requ // @Security CoderSessionToken // @Tags Notifications // @Success 200 -// @Router /notifications/test [post] +// @Router /api/v2/notifications/test [post] func (api *API) postTestNotification(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -244,7 +244,7 @@ func (api *API) postTestNotification(rw http.ResponseWriter, r *http.Request) { // @Tags Notifications // @Param user path string true "User ID, name, or me" // @Success 200 {array} codersdk.NotificationPreference -// @Router /users/{user}/notifications/preferences [get] +// @Router /api/v2/users/{user}/notifications/preferences [get] func (api *API) userNotificationPreferences(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -276,7 +276,7 @@ func (api *API) userNotificationPreferences(rw http.ResponseWriter, r *http.Requ // @Param request body codersdk.UpdateUserNotificationPreferences true "Preferences" // @Param user path string true "User ID, name, or me" // @Success 200 {array} codersdk.NotificationPreference -// @Router /users/{user}/notifications/preferences [put] +// @Router /api/v2/users/{user}/notifications/preferences [put] func (api *API) putUserNotificationPreferences(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -353,7 +353,7 @@ func (api *API) putUserNotificationPreferences(rw http.ResponseWriter, r *http.R // @Failure 400 {object} codersdk.Response "Invalid request body" // @Failure 403 {object} codersdk.Response "System users cannot send custom notifications" // @Failure 500 {object} codersdk.Response "Failed to send custom notification" -// @Router /notifications/custom [post] +// @Router /api/v2/notifications/custom [post] func (api *API) postCustomNotification(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() diff --git a/coderd/oauth2.go b/coderd/oauth2.go index ac0c87545e..8523b42f8e 100644 --- a/coderd/oauth2.go +++ b/coderd/oauth2.go @@ -13,7 +13,7 @@ import ( // @Tags Enterprise // @Param user_id query string false "Filter by applications authorized for a user" // @Success 200 {array} codersdk.OAuth2ProviderApp -// @Router /oauth2-provider/apps [get] +// @Router /api/v2/oauth2-provider/apps [get] func (api *API) oAuth2ProviderApps() http.HandlerFunc { return oauth2provider.ListApps(api.Database, api.AccessURL) } @@ -25,7 +25,7 @@ func (api *API) oAuth2ProviderApps() http.HandlerFunc { // @Tags Enterprise // @Param app path string true "App ID" // @Success 200 {object} codersdk.OAuth2ProviderApp -// @Router /oauth2-provider/apps/{app} [get] +// @Router /api/v2/oauth2-provider/apps/{app} [get] func (api *API) oAuth2ProviderApp() http.HandlerFunc { return oauth2provider.GetApp(api.AccessURL) } @@ -38,7 +38,7 @@ func (api *API) oAuth2ProviderApp() http.HandlerFunc { // @Tags Enterprise // @Param request body codersdk.PostOAuth2ProviderAppRequest true "The OAuth2 application to create." // @Success 200 {object} codersdk.OAuth2ProviderApp -// @Router /oauth2-provider/apps [post] +// @Router /api/v2/oauth2-provider/apps [post] func (api *API) postOAuth2ProviderApp() http.HandlerFunc { return oauth2provider.CreateApp(api.Database, api.AccessURL, api.Auditor.Load(), api.Logger) } @@ -52,7 +52,7 @@ func (api *API) postOAuth2ProviderApp() http.HandlerFunc { // @Param app path string true "App ID" // @Param request body codersdk.PutOAuth2ProviderAppRequest true "Update an OAuth2 application." // @Success 200 {object} codersdk.OAuth2ProviderApp -// @Router /oauth2-provider/apps/{app} [put] +// @Router /api/v2/oauth2-provider/apps/{app} [put] func (api *API) putOAuth2ProviderApp() http.HandlerFunc { return oauth2provider.UpdateApp(api.Database, api.AccessURL, api.Auditor.Load(), api.Logger) } @@ -63,7 +63,7 @@ func (api *API) putOAuth2ProviderApp() http.HandlerFunc { // @Tags Enterprise // @Param app path string true "App ID" // @Success 204 -// @Router /oauth2-provider/apps/{app} [delete] +// @Router /api/v2/oauth2-provider/apps/{app} [delete] func (api *API) deleteOAuth2ProviderApp() http.HandlerFunc { return oauth2provider.DeleteApp(api.Database, api.Auditor.Load(), api.Logger) } @@ -75,7 +75,7 @@ func (api *API) deleteOAuth2ProviderApp() http.HandlerFunc { // @Tags Enterprise // @Param app path string true "App ID" // @Success 200 {array} codersdk.OAuth2ProviderAppSecret -// @Router /oauth2-provider/apps/{app}/secrets [get] +// @Router /api/v2/oauth2-provider/apps/{app}/secrets [get] func (api *API) oAuth2ProviderAppSecrets() http.HandlerFunc { return oauth2provider.GetAppSecrets(api.Database) } @@ -87,7 +87,7 @@ func (api *API) oAuth2ProviderAppSecrets() http.HandlerFunc { // @Tags Enterprise // @Param app path string true "App ID" // @Success 200 {array} codersdk.OAuth2ProviderAppSecretFull -// @Router /oauth2-provider/apps/{app}/secrets [post] +// @Router /api/v2/oauth2-provider/apps/{app}/secrets [post] func (api *API) postOAuth2ProviderAppSecret() http.HandlerFunc { return oauth2provider.CreateAppSecret(api.Database, api.Auditor.Load(), api.Logger) } @@ -99,7 +99,7 @@ func (api *API) postOAuth2ProviderAppSecret() http.HandlerFunc { // @Param app path string true "App ID" // @Param secretID path string true "Secret ID" // @Success 204 -// @Router /oauth2-provider/apps/{app}/secrets/{secretID} [delete] +// @Router /api/v2/oauth2-provider/apps/{app}/secrets/{secretID} [delete] func (api *API) deleteOAuth2ProviderAppSecret() http.HandlerFunc { return oauth2provider.DeleteAppSecret(api.Database, api.Auditor.Load(), api.Logger) } diff --git a/coderd/organizations.go b/coderd/organizations.go index fb3b18a83f..4b97e0a84e 100644 --- a/coderd/organizations.go +++ b/coderd/organizations.go @@ -17,7 +17,7 @@ import ( // @Produce json // @Tags Organizations // @Success 200 {object} []codersdk.Organization -// @Router /organizations [get] +// @Router /api/v2/organizations [get] func (api *API) organizations(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() organizations, err := api.Database.GetOrganizations(ctx, database.GetOrganizationsParams{}) @@ -43,7 +43,7 @@ func (api *API) organizations(rw http.ResponseWriter, r *http.Request) { // @Tags Organizations // @Param organization path string true "Organization ID" format(uuid) // @Success 200 {object} codersdk.Organization -// @Router /organizations/{organization} [get] +// @Router /api/v2/organizations/{organization} [get] func (*API) organization(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() organization := httpmw.OrganizationParam(r) diff --git a/coderd/parameters.go b/coderd/parameters.go index 1ba928d4cb..f39d05ab2a 100644 --- a/coderd/parameters.go +++ b/coderd/parameters.go @@ -27,7 +27,7 @@ import ( // @Produce json // @Param request body codersdk.DynamicParametersRequest true "Initial parameter values" // @Success 200 {object} codersdk.DynamicParametersResponse -// @Router /templateversions/{templateversion}/dynamic-parameters/evaluate [post] +// @Router /api/v2/templateversions/{templateversion}/dynamic-parameters/evaluate [post] func (api *API) templateVersionDynamicParametersEvaluate(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() var req codersdk.DynamicParametersRequest @@ -44,7 +44,7 @@ func (api *API) templateVersionDynamicParametersEvaluate(rw http.ResponseWriter, // @Tags Templates // @Param templateversion path string true "Template version ID" format(uuid) // @Success 101 -// @Router /templateversions/{templateversion}/dynamic-parameters [get] +// @Router /api/v2/templateversions/{templateversion}/dynamic-parameters [get] func (api *API) templateVersionDynamicParametersWebsocket(rw http.ResponseWriter, r *http.Request) { apikey := httpmw.APIKey(r) userID := apikey.UserID diff --git a/coderd/presets.go b/coderd/presets.go index b002d6168f..f9384bc745 100644 --- a/coderd/presets.go +++ b/coderd/presets.go @@ -16,7 +16,7 @@ import ( // @Tags Templates // @Param templateversion path string true "Template version ID" format(uuid) // @Success 200 {array} codersdk.Preset -// @Router /templateversions/{templateversion}/presets [get] +// @Router /api/v2/templateversions/{templateversion}/presets [get] func (api *API) templateVersionPresets(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() templateVersion := httpmw.TemplateVersionParam(r) diff --git a/coderd/provisionerdaemons.go b/coderd/provisionerdaemons.go index 9c08ed16db..362b39b657 100644 --- a/coderd/provisionerdaemons.go +++ b/coderd/provisionerdaemons.go @@ -28,7 +28,7 @@ import ( // @Param status query codersdk.ProvisionerJobStatus false "Filter results by status" enums(pending,running,succeeded,canceling,canceled,failed) // @Param tags query object false "Provisioner tags to filter by (JSON of the form {'tag1':'value1','tag2':'value2'})" // @Success 200 {array} codersdk.ProvisionerDaemon -// @Router /organizations/{organization}/provisionerdaemons [get] +// @Router /api/v2/organizations/{organization}/provisionerdaemons [get] func (api *API) provisionerDaemons(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() diff --git a/coderd/provisionerjobs.go b/coderd/provisionerjobs.go index bb7c83b2c6..4fe442e17d 100644 --- a/coderd/provisionerjobs.go +++ b/coderd/provisionerjobs.go @@ -38,7 +38,7 @@ import ( // @Param organization path string true "Organization ID" format(uuid) // @Param job path string true "Job ID" format(uuid) // @Success 200 {object} codersdk.ProvisionerJob -// @Router /organizations/{organization}/provisionerjobs/{job} [get] +// @Router /api/v2/organizations/{organization}/provisionerjobs/{job} [get] func (api *API) provisionerJob(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() @@ -78,7 +78,7 @@ func (api *API) provisionerJob(rw http.ResponseWriter, r *http.Request) { // @Param tags query object false "Provisioner tags to filter by (JSON of the form {'tag1':'value1','tag2':'value2'})" // @Param initiator query string false "Filter results by initiator" format(uuid) // @Success 200 {array} codersdk.ProvisionerJob -// @Router /organizations/{organization}/provisionerjobs [get] +// @Router /api/v2/organizations/{organization}/provisionerjobs [get] func (api *API) provisionerJobs(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() diff --git a/coderd/roles.go b/coderd/roles.go index c2125363ce..500ada46e4 100644 --- a/coderd/roles.go +++ b/coderd/roles.go @@ -22,7 +22,7 @@ import ( // @Produce json // @Tags Members // @Success 200 {array} codersdk.AssignableRoles -// @Router /users/roles [get] +// @Router /api/v2/users/roles [get] func (api *API) AssignableSiteRoles(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() actorRoles := httpmw.UserAuthorization(r.Context()) @@ -58,7 +58,7 @@ func (api *API) AssignableSiteRoles(rw http.ResponseWriter, r *http.Request) { // @Tags Members // @Param organization path string true "Organization ID" format(uuid) // @Success 200 {array} codersdk.AssignableRoles -// @Router /organizations/{organization}/members/roles [get] +// @Router /api/v2/organizations/{organization}/members/roles [get] func (api *API) assignableOrgRoles(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() organization := httpmw.OrganizationParam(r) diff --git a/coderd/scopes_catalog.go b/coderd/scopes_catalog.go index 789cbb0af1..37c1112398 100644 --- a/coderd/scopes_catalog.go +++ b/coderd/scopes_catalog.go @@ -16,7 +16,7 @@ import ( // @Tags Authorization // @Produce json // @Success 200 {object} codersdk.ExternalAPIKeyScopes -// @Router /auth/scopes [get] +// @Router /api/v2/auth/scopes [get] func (*API) listExternalScopes(rw http.ResponseWriter, r *http.Request) { scopes := rbac.ExternalScopeNames() external := make([]codersdk.APIKeyScope, 0, len(scopes)) diff --git a/coderd/swagger_request_interceptor.js b/coderd/swagger_request_interceptor.js new file mode 100644 index 0000000000..7adc0a26fb --- /dev/null +++ b/coderd/swagger_request_interceptor.js @@ -0,0 +1,15 @@ +// Swagger UI requestInterceptor. +// +// Returned to Swagger UI as the value of the `requestInterceptor` config +// option. Swagger UI evaluates this string as a JavaScript expression that +// must produce a function which receives a request object and returns the +// (possibly mutated) request. +// +// `withCredentials: false` should disable fetch sending browser credentials, +// but for whatever reason it does not. So this interceptor explicitly omits +// browser credentials from every request to avoid the cookie auth and the +// header auth competing. +(request => { + request.credentials = "omit"; + return request; +}) diff --git a/coderd/templates.go b/coderd/templates.go index 191615b635..4f6ba77f43 100644 --- a/coderd/templates.go +++ b/coderd/templates.go @@ -44,7 +44,7 @@ import ( // @Tags Templates // @Param template path string true "Template ID" format(uuid) // @Success 200 {object} codersdk.Template -// @Router /templates/{template} [get] +// @Router /api/v2/templates/{template} [get] func (api *API) template(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() template := httpmw.TemplateParam(r) @@ -59,7 +59,7 @@ func (api *API) template(rw http.ResponseWriter, r *http.Request) { // @Tags Templates // @Param template path string true "Template ID" format(uuid) // @Success 200 {object} codersdk.Response -// @Router /templates/{template} [delete] +// @Router /api/v2/templates/{template} [delete] func (api *API) deleteTemplate(rw http.ResponseWriter, r *http.Request) { var ( apiKey = httpmw.APIKey(r) @@ -177,7 +177,7 @@ func (api *API) notifyTemplateDeleted(ctx context.Context, template database.Tem // @Param request body codersdk.CreateTemplateRequest true "Request body" // @Param organization path string true "Organization ID" // @Success 200 {object} codersdk.Template -// @Router /organizations/{organization}/templates [post] +// @Router /api/v2/organizations/{organization}/templates [post] func (api *API) postTemplateByOrganization(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -528,7 +528,7 @@ func (api *API) postTemplateByOrganization(rw http.ResponseWriter, r *http.Reque // @Tags Templates // @Param organization path string true "Organization ID" format(uuid) // @Success 200 {array} codersdk.Template -// @Router /organizations/{organization}/templates [get] +// @Router /api/v2/organizations/{organization}/templates [get] func (api *API) templatesByOrganization() http.HandlerFunc { // TODO: Should deprecate this endpoint and make it akin to /workspaces with // a filter. There isn't a need to make the organization filter argument @@ -549,7 +549,7 @@ func (api *API) templatesByOrganization() http.HandlerFunc { // @Produce json // @Tags Templates // @Success 200 {array} codersdk.Template -// @Router /templates [get] +// @Router /api/v2/templates [get] func (api *API) fetchTemplates(mutate func(r *http.Request, arg *database.GetTemplatesWithFilterParams)) http.HandlerFunc { return func(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() @@ -613,7 +613,7 @@ func (api *API) fetchTemplates(mutate func(r *http.Request, arg *database.GetTem // @Param organization path string true "Organization ID" format(uuid) // @Param templatename path string true "Template name" // @Success 200 {object} codersdk.Template -// @Router /organizations/{organization}/templates/{templatename} [get] +// @Router /api/v2/organizations/{organization}/templates/{templatename} [get] func (api *API) templateByOrganizationAndName(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() organization := httpmw.OrganizationParam(r) @@ -647,7 +647,7 @@ func (api *API) templateByOrganizationAndName(rw http.ResponseWriter, r *http.Re // @Param template path string true "Template ID" format(uuid) // @Param request body codersdk.UpdateTemplateMeta true "Patch template settings request" // @Success 200 {object} codersdk.Template -// @Router /templates/{template} [patch] +// @Router /api/v2/templates/{template} [patch] func (api *API) patchTemplateMeta(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -998,7 +998,7 @@ func (api *API) notifyUsersOfTemplateDeprecation(ctx context.Context, template d // @Tags Templates // @Param template path string true "Template ID" format(uuid) // @Success 200 {object} codersdk.DAUsResponse -// @Router /templates/{template}/daus [get] +// @Router /api/v2/templates/{template}/daus [get] func (api *API) templateDAUs(rw http.ResponseWriter, r *http.Request) { template := httpmw.TemplateParam(r) @@ -1012,7 +1012,7 @@ func (api *API) templateDAUs(rw http.ResponseWriter, r *http.Request) { // @Tags Templates // @Param organization path string true "Organization ID" format(uuid) // @Success 200 {array} codersdk.TemplateExample -// @Router /organizations/{organization}/templates/examples [get] +// @Router /api/v2/organizations/{organization}/templates/examples [get] // @Deprecated Use /templates/examples instead func (api *API) templateExamplesByOrganization(rw http.ResponseWriter, r *http.Request) { var ( @@ -1043,7 +1043,7 @@ func (api *API) templateExamplesByOrganization(rw http.ResponseWriter, r *http.R // @Produce json // @Tags Templates // @Success 200 {array} codersdk.TemplateExample -// @Router /templates/examples [get] +// @Router /api/v2/templates/examples [get] func (api *API) templateExamples(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() diff --git a/coderd/templateversions.go b/coderd/templateversions.go index 6490165782..ef7f6e0899 100644 --- a/coderd/templateversions.go +++ b/coderd/templateversions.go @@ -52,7 +52,7 @@ import ( // @Tags Templates // @Param templateversion path string true "Template version ID" format(uuid) // @Success 200 {object} codersdk.TemplateVersion -// @Router /templateversions/{templateversion} [get] +// @Router /api/v2/templateversions/{templateversion} [get] func (api *API) templateVersion(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() templateVersion := httpmw.TemplateVersionParam(r) @@ -114,7 +114,7 @@ func (api *API) templateVersion(rw http.ResponseWriter, r *http.Request) { // @Param templateversion path string true "Template version ID" format(uuid) // @Param request body codersdk.PatchTemplateVersionRequest true "Patch template version request" // @Success 200 {object} codersdk.TemplateVersion -// @Router /templateversions/{templateversion} [patch] +// @Router /api/v2/templateversions/{templateversion} [patch] func (api *API) patchTemplateVersion(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() templateVersion := httpmw.TemplateVersionParam(r) @@ -227,7 +227,7 @@ func (api *API) patchTemplateVersion(rw http.ResponseWriter, r *http.Request) { // @Tags Templates // @Param templateversion path string true "Template version ID" format(uuid) // @Success 200 {object} codersdk.Response -// @Router /templateversions/{templateversion}/cancel [patch] +// @Router /api/v2/templateversions/{templateversion}/cancel [patch] func (api *API) patchCancelTemplateVersion(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() templateVersion := httpmw.TemplateVersionParam(r) @@ -283,7 +283,7 @@ func (api *API) patchCancelTemplateVersion(rw http.ResponseWriter, r *http.Reque // @Tags Templates // @Param templateversion path string true "Template version ID" format(uuid) // @Success 200 {array} codersdk.TemplateVersionParameter -// @Router /templateversions/{templateversion}/rich-parameters [get] +// @Router /api/v2/templateversions/{templateversion}/rich-parameters [get] func (api *API) templateVersionRichParameters(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() templateVersion := httpmw.TemplateVersionParam(r) @@ -329,7 +329,7 @@ func (api *API) templateVersionRichParameters(rw http.ResponseWriter, r *http.Re // @Tags Templates // @Param templateversion path string true "Template version ID" format(uuid) // @Success 200 {array} codersdk.TemplateVersionExternalAuth -// @Router /templateversions/{templateversion}/external-auth [get] +// @Router /api/v2/templateversions/{templateversion}/external-auth [get] func (api *API) templateVersionExternalAuth(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() var ( @@ -423,7 +423,7 @@ func (api *API) templateVersionExternalAuth(rw http.ResponseWriter, r *http.Requ // @Tags Templates // @Param templateversion path string true "Template version ID" format(uuid) // @Success 200 {array} codersdk.TemplateVersionVariable -// @Router /templateversions/{templateversion}/variables [get] +// @Router /api/v2/templateversions/{templateversion}/variables [get] func (api *API) templateVersionVariables(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() templateVersion := httpmw.TemplateVersionParam(r) @@ -463,7 +463,7 @@ func (api *API) templateVersionVariables(rw http.ResponseWriter, r *http.Request // @Param templateversion path string true "Template version ID" format(uuid) // @Param request body codersdk.CreateTemplateVersionDryRunRequest true "Dry-run request" // @Success 201 {object} codersdk.ProvisionerJob -// @Router /templateversions/{templateversion}/dry-run [post] +// @Router /api/v2/templateversions/{templateversion}/dry-run [post] func (api *API) postTemplateVersionDryRun(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() var ( @@ -580,7 +580,7 @@ func (api *API) postTemplateVersionDryRun(rw http.ResponseWriter, r *http.Reques // @Param templateversion path string true "Template version ID" format(uuid) // @Param jobID path string true "Job ID" format(uuid) // @Success 200 {object} codersdk.ProvisionerJob -// @Router /templateversions/{templateversion}/dry-run/{jobID} [get] +// @Router /api/v2/templateversions/{templateversion}/dry-run/{jobID} [get] func (api *API) templateVersionDryRun(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() job, ok := api.fetchTemplateVersionDryRunJob(rw, r) @@ -599,7 +599,7 @@ func (api *API) templateVersionDryRun(rw http.ResponseWriter, r *http.Request) { // @Param templateversion path string true "Template version ID" format(uuid) // @Param jobID path string true "Job ID" format(uuid) // @Success 200 {object} codersdk.MatchedProvisioners -// @Router /templateversions/{templateversion}/dry-run/{jobID}/matched-provisioners [get] +// @Router /api/v2/templateversions/{templateversion}/dry-run/{jobID}/matched-provisioners [get] func (api *API) templateVersionDryRunMatchedProvisioners(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() job, ok := api.fetchTemplateVersionDryRunJob(rw, r) @@ -636,7 +636,7 @@ func (api *API) templateVersionDryRunMatchedProvisioners(rw http.ResponseWriter, // @Param templateversion path string true "Template version ID" format(uuid) // @Param jobID path string true "Job ID" format(uuid) // @Success 200 {array} codersdk.WorkspaceResource -// @Router /templateversions/{templateversion}/dry-run/{jobID}/resources [get] +// @Router /api/v2/templateversions/{templateversion}/dry-run/{jobID}/resources [get] func (api *API) templateVersionDryRunResources(rw http.ResponseWriter, r *http.Request) { job, ok := api.fetchTemplateVersionDryRunJob(rw, r) if !ok { @@ -658,7 +658,7 @@ func (api *API) templateVersionDryRunResources(rw http.ResponseWriter, r *http.R // @Param follow query bool false "Follow log stream" // @Param format query string false "Log output format. Accepted: 'json' (default), 'text' (plain text with RFC3339 timestamps and ANSI colors). Not supported with follow=true." Enums(json,text) // @Success 200 {array} codersdk.ProvisionerJobLog -// @Router /templateversions/{templateversion}/dry-run/{jobID}/logs [get] +// @Router /api/v2/templateversions/{templateversion}/dry-run/{jobID}/logs [get] func (api *API) templateVersionDryRunLogs(rw http.ResponseWriter, r *http.Request) { job, ok := api.fetchTemplateVersionDryRunJob(rw, r) if !ok { @@ -676,7 +676,7 @@ func (api *API) templateVersionDryRunLogs(rw http.ResponseWriter, r *http.Reques // @Param jobID path string true "Job ID" format(uuid) // @Param templateversion path string true "Template version ID" format(uuid) // @Success 200 {object} codersdk.Response -// @Router /templateversions/{templateversion}/dry-run/{jobID}/cancel [patch] +// @Router /api/v2/templateversions/{templateversion}/dry-run/{jobID}/cancel [patch] func (api *API) patchTemplateVersionDryRunCancel(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() templateVersion := httpmw.TemplateVersionParam(r) @@ -804,7 +804,7 @@ func (api *API) fetchTemplateVersionDryRunJob(rw http.ResponseWriter, r *http.Re // @Param limit query int false "Page limit" // @Param offset query int false "Page offset" // @Success 200 {array} codersdk.TemplateVersion -// @Router /templates/{template}/versions [get] +// @Router /api/v2/templates/{template}/versions [get] func (api *API) templateVersionsByTemplate(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() template := httpmw.TemplateParam(r) @@ -925,7 +925,7 @@ func (api *API) templateVersionsByTemplate(rw http.ResponseWriter, r *http.Reque // @Param template path string true "Template ID" format(uuid) // @Param templateversionname path string true "Template version name" // @Success 200 {array} codersdk.TemplateVersion -// @Router /templates/{template}/versions/{templateversionname} [get] +// @Router /api/v2/templates/{template}/versions/{templateversionname} [get] func (api *API) templateVersionByName(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() template := httpmw.TemplateParam(r) @@ -990,7 +990,7 @@ func (api *API) templateVersionByName(rw http.ResponseWriter, r *http.Request) { // @Param templatename path string true "Template name" // @Param templateversionname path string true "Template version name" // @Success 200 {object} codersdk.TemplateVersion -// @Router /organizations/{organization}/templates/{templatename}/versions/{templateversionname} [get] +// @Router /api/v2/organizations/{organization}/templates/{templatename}/versions/{templateversionname} [get] func (api *API) templateVersionByOrganizationTemplateAndName(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() organization := httpmw.OrganizationParam(r) @@ -1075,7 +1075,7 @@ func (api *API) templateVersionByOrganizationTemplateAndName(rw http.ResponseWri // @Param templateversionname path string true "Template version name" // @Success 200 {object} codersdk.TemplateVersion // @Success 204 -// @Router /organizations/{organization}/templates/{templatename}/versions/{templateversionname}/previous [get] +// @Router /api/v2/organizations/{organization}/templates/{templatename}/versions/{templateversionname}/previous [get] func (api *API) previousTemplateVersionByOrganizationTemplateAndName(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() organization := httpmw.OrganizationParam(r) @@ -1178,7 +1178,7 @@ func (api *API) previousTemplateVersionByOrganizationTemplateAndName(rw http.Res // @Param template path string true "Template ID" format(uuid) // @Param request body codersdk.ArchiveTemplateVersionsRequest true "Archive request" // @Success 200 {object} codersdk.Response -// @Router /templates/{template}/versions/archive [post] +// @Router /api/v2/templates/{template}/versions/archive [post] func (api *API) postArchiveTemplateVersions(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -1243,7 +1243,7 @@ func (api *API) postArchiveTemplateVersions(rw http.ResponseWriter, r *http.Requ // @Tags Templates // @Param templateversion path string true "Template version ID" format(uuid) // @Success 200 {object} codersdk.Response -// @Router /templateversions/{templateversion}/archive [post] +// @Router /api/v2/templateversions/{templateversion}/archive [post] func (api *API) postArchiveTemplateVersion() func(rw http.ResponseWriter, r *http.Request) { return api.setArchiveTemplateVersion(true) } @@ -1255,7 +1255,7 @@ func (api *API) postArchiveTemplateVersion() func(rw http.ResponseWriter, r *htt // @Tags Templates // @Param templateversion path string true "Template version ID" format(uuid) // @Success 200 {object} codersdk.Response -// @Router /templateversions/{templateversion}/unarchive [post] +// @Router /api/v2/templateversions/{templateversion}/unarchive [post] func (api *API) postUnarchiveTemplateVersion() func(rw http.ResponseWriter, r *http.Request) { return api.setArchiveTemplateVersion(false) } @@ -1345,7 +1345,7 @@ func (api *API) setArchiveTemplateVersion(archive bool) func(rw http.ResponseWri // @Param request body codersdk.UpdateActiveTemplateVersion true "Modified template version" // @Param template path string true "Template ID" format(uuid) // @Success 200 {object} codersdk.Response -// @Router /templates/{template}/versions [patch] +// @Router /api/v2/templates/{template}/versions [patch] func (api *API) patchActiveTemplateVersion(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -1448,7 +1448,7 @@ func (api *API) patchActiveTemplateVersion(rw http.ResponseWriter, r *http.Reque // @Param organization path string true "Organization ID" format(uuid) // @Param request body codersdk.CreateTemplateVersionRequest true "Create template version request" // @Success 201 {object} codersdk.TemplateVersion -// @Router /organizations/{organization}/templateversions [post] +// @Router /api/v2/organizations/{organization}/templateversions [post] func (api *API) postTemplateVersionsByOrganization(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -1905,7 +1905,7 @@ func (api *API) classicTemplateVersionTags(ctx context.Context, rw http.Response // @Tags Templates // @Param templateversion path string true "Template version ID" format(uuid) // @Success 200 {array} codersdk.WorkspaceResource -// @Router /templateversions/{templateversion}/resources [get] +// @Router /api/v2/templateversions/{templateversion}/resources [get] func (api *API) templateVersionResources(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -1939,7 +1939,7 @@ func (api *API) templateVersionResources(rw http.ResponseWriter, r *http.Request // @Param follow query bool false "Follow log stream" // @Param format query string false "Log output format. Accepted: 'json' (default), 'text' (plain text with RFC3339 timestamps and ANSI colors). Not supported with follow=true." Enums(json,text) // @Success 200 {array} codersdk.ProvisionerJobLog -// @Router /templateversions/{templateversion}/logs [get] +// @Router /api/v2/templateversions/{templateversion}/logs [get] func (api *API) templateVersionLogs(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() diff --git a/coderd/updatecheck.go b/coderd/updatecheck.go index 4e4b07683e..02e59487e2 100644 --- a/coderd/updatecheck.go +++ b/coderd/updatecheck.go @@ -18,7 +18,7 @@ import ( // @Produce json // @Tags General // @Success 200 {object} codersdk.UpdateCheckResponse -// @Router /updatecheck [get] +// @Router /api/v2/updatecheck [get] func (api *API) updateCheck(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() diff --git a/coderd/userauth.go b/coderd/userauth.go index 512e4e4561..046e8dc903 100644 --- a/coderd/userauth.go +++ b/coderd/userauth.go @@ -86,7 +86,7 @@ func (o *OAuthConvertStateClaims) Validate(e jwt.Expected) error { // @Param request body codersdk.ConvertLoginRequest true "Convert request" // @Param user path string true "User ID, name, or me" // @Success 201 {object} codersdk.OAuthConversionResponse -// @Router /users/{user}/convert-login [post] +// @Router /api/v2/users/{user}/convert-login [post] func (api *API) postConvertLoginType(rw http.ResponseWriter, r *http.Request) { var ( user = httpmw.UserParam(r) @@ -225,7 +225,7 @@ func (api *API) postConvertLoginType(rw http.ResponseWriter, r *http.Request) { // @Tags Authorization // @Param request body codersdk.RequestOneTimePasscodeRequest true "One-time passcode request" // @Success 204 -// @Router /users/otp/request [post] +// @Router /api/v2/users/otp/request [post] func (api *API) postRequestOneTimePasscode(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -331,7 +331,7 @@ func (api *API) notifyUserRequestedOneTimePasscode(ctx context.Context, user dat // @Tags Authorization // @Param request body codersdk.ChangePasswordWithOneTimePasscodeRequest true "Change password request" // @Success 204 -// @Router /users/otp/change-password [post] +// @Router /api/v2/users/otp/change-password [post] func (api *API) postChangePasswordWithOneTimePasscode(rw http.ResponseWriter, r *http.Request) { var ( err error @@ -465,7 +465,7 @@ func (api *API) postChangePasswordWithOneTimePasscode(rw http.ResponseWriter, r // @Tags Authorization // @Param request body codersdk.ValidateUserPasswordRequest true "Validate user password request" // @Success 200 {object} codersdk.ValidateUserPasswordResponse -// @Router /users/validate-password [post] +// @Router /api/v2/users/validate-password [post] func (*API) validateUserPassword(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -499,7 +499,7 @@ func (*API) validateUserPassword(rw http.ResponseWriter, r *http.Request) { // @Tags Authorization // @Param request body codersdk.LoginWithPasswordRequest true "Login request" // @Success 201 {object} codersdk.LoginWithPasswordResponse -// @Router /users/login [post] +// @Router /api/v2/users/login [post] func (api *API) postLogin(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -684,7 +684,7 @@ func ActivateDormantUser(logger slog.Logger, auditor *atomic.Pointer[audit.Audit // @Produce json // @Tags Users // @Success 200 {object} codersdk.Response -// @Router /users/logout [post] +// @Router /api/v2/users/logout [post] func (api *API) postLogout(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -796,7 +796,7 @@ func (c *GithubOAuth2Config) AuthCodeURL(state string, opts ...oauth2.AuthCodeOp // @Produce json // @Tags Users // @Success 200 {object} codersdk.AuthMethods -// @Router /users/authmethods [get] +// @Router /api/v2/users/authmethods [get] func (api *API) userAuthMethods(rw http.ResponseWriter, r *http.Request) { var signInText string var iconURL string @@ -831,7 +831,7 @@ func (api *API) userAuthMethods(rw http.ResponseWriter, r *http.Request) { // @Produce json // @Tags Users // @Success 200 {object} codersdk.ExternalAuthDevice -// @Router /users/oauth2/github/device [get] +// @Router /api/v2/users/oauth2/github/device [get] func (api *API) userOAuth2GithubDevice(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -877,7 +877,7 @@ func (api *API) userOAuth2GithubDevice(rw http.ResponseWriter, r *http.Request) // @Security CoderSessionToken // @Tags Users // @Success 307 -// @Router /users/oauth2/github/callback [get] +// @Router /api/v2/users/oauth2/github/callback [get] func (api *API) userOAuth2Github(rw http.ResponseWriter, r *http.Request) { var ( // userOAuth2Github is a system function. @@ -1192,7 +1192,7 @@ func (o *OIDCConfig) PKCESupported() []promoauth.Oauth2PKCEChallengeMethod { // @Security CoderSessionToken // @Tags Users // @Success 307 -// @Router /users/oidc/callback [get] +// @Router /api/v2/users/oidc/callback [get] func (api *API) userOIDC(rw http.ResponseWriter, r *http.Request) { var ( // userOIDC is a system function. diff --git a/coderd/users.go b/coderd/users.go index 79fb10902a..c207e2620f 100644 --- a/coderd/users.go +++ b/coderd/users.go @@ -42,7 +42,7 @@ import ( // @Tags Agents // @Success 200 "Success" // @Param user path string true "User ID, name, or me" -// @Router /debug/{user}/debug-link [get] +// @Router /api/v2/debug/{user}/debug-link [get] // @x-apidocgen {"skip": true} func (api *API) userDebugOIDC(rw http.ResponseWriter, r *http.Request) { var ( @@ -80,7 +80,7 @@ func (api *API) userDebugOIDC(rw http.ResponseWriter, r *http.Request) { // @Produce json // @Tags Users // @Success 200 {object} codersdk.OIDCClaimsResponse -// @Router /users/oidc-claims [get] +// @Router /api/v2/users/oidc-claims [get] func (api *API) userOIDCClaims(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -138,7 +138,7 @@ func (api *API) userOIDCClaims(rw http.ResponseWriter, r *http.Request) { // @Produce json // @Tags Users // @Success 200 {object} codersdk.Response -// @Router /users/first [get] +// @Router /api/v2/users/first [get] func (api *API) firstUser(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() // nolint:gocritic // Getting user count is a system function. @@ -173,7 +173,7 @@ func (api *API) firstUser(rw http.ResponseWriter, r *http.Request) { // @Tags Users // @Param request body codersdk.CreateFirstUserRequest true "First user request" // @Success 201 {object} codersdk.CreateFirstUserResponse -// @Router /users/first [post] +// @Router /api/v2/users/first [post] func (api *API) postFirstUser(rw http.ResponseWriter, r *http.Request) { // The first user can also be created via oidc, so if making changes to the flow, // ensure that the oidc flow is also updated. @@ -312,7 +312,7 @@ func (api *API) postFirstUser(rw http.ResponseWriter, r *http.Request) { // @Param limit query int false "Page limit" // @Param offset query int false "Page offset" // @Success 200 {object} codersdk.GetUsersResponse -// @Router /users [get] +// @Router /api/v2/users [get] func (api *API) users(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() users, userCount, ok := api.GetUsers(rw, r) @@ -432,7 +432,7 @@ func (api *API) GetUsers(rw http.ResponseWriter, r *http.Request) ([]database.Us // @Tags Users // @Param request body codersdk.CreateUserRequestWithOrgs true "Create user request" // @Success 201 {object} codersdk.User -// @Router /users [post] +// @Router /api/v2/users [post] func (api *API) postUser(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() auditor := *api.Auditor.Load() @@ -650,7 +650,7 @@ func (api *API) postUser(rw http.ResponseWriter, r *http.Request) { // @Tags Users // @Param user path string true "User ID, name, or me" // @Success 200 -// @Router /users/{user} [delete] +// @Router /api/v2/users/{user} [delete] func (api *API) deleteUser(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() auditor := *api.Auditor.Load() @@ -756,7 +756,7 @@ func (api *API) deleteUser(rw http.ResponseWriter, r *http.Request) { // @Tags Users // @Param user path string true "User ID, username, or me" // @Success 200 {object} codersdk.User -// @Router /users/{user} [get] +// @Router /api/v2/users/{user} [get] func (api *API) userByName(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() user := httpmw.UserParam(r) @@ -784,7 +784,7 @@ func (api *API) userByName(rw http.ResponseWriter, r *http.Request) { // @Param user path string true "User ID, username, or me" // @Param template_id query string true "Template ID" // @Success 200 {array} codersdk.UserParameter -// @Router /users/{user}/autofill-parameters [get] +// @Router /api/v2/users/{user}/autofill-parameters [get] func (api *API) userAutofillParameters(rw http.ResponseWriter, r *http.Request) { user := httpmw.UserParam(r) @@ -835,7 +835,7 @@ func (api *API) userAutofillParameters(rw http.ResponseWriter, r *http.Request) // @Tags Users // @Param user path string true "User ID, name, or me" // @Success 200 {object} codersdk.UserLoginType -// @Router /users/{user}/login-type [get] +// @Router /api/v2/users/{user}/login-type [get] func (*API) userLoginType(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -865,7 +865,7 @@ func (*API) userLoginType(rw http.ResponseWriter, r *http.Request) { // @Param user path string true "User ID, name, or me" // @Param request body codersdk.UpdateUserProfileRequest true "Updated profile" // @Success 200 {object} codersdk.User -// @Router /users/{user}/profile [put] +// @Router /api/v2/users/{user}/profile [put] func (api *API) putUserProfile(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -956,7 +956,7 @@ func (api *API) putUserProfile(rw http.ResponseWriter, r *http.Request) { // @Tags Users // @Param user path string true "User ID, name, or me" // @Success 200 {object} codersdk.User -// @Router /users/{user}/status/suspend [put] +// @Router /api/v2/users/{user}/status/suspend [put] func (api *API) putSuspendUserAccount() func(rw http.ResponseWriter, r *http.Request) { return api.putUserStatus(database.UserStatusSuspended) } @@ -968,7 +968,7 @@ func (api *API) putSuspendUserAccount() func(rw http.ResponseWriter, r *http.Req // @Tags Users // @Param user path string true "User ID, name, or me" // @Success 200 {object} codersdk.User -// @Router /users/{user}/status/activate [put] +// @Router /api/v2/users/{user}/status/activate [put] func (api *API) putActivateUserAccount() func(rw http.ResponseWriter, r *http.Request) { return api.putUserStatus(database.UserStatusActive) } @@ -1117,7 +1117,7 @@ func (api *API) notifyUserStatusChanged(ctx context.Context, actingUserName stri // @Tags Users // @Param user path string true "User ID, name, or me" // @Success 200 {object} codersdk.UserAppearanceSettings -// @Router /users/{user}/appearance [get] +// @Router /api/v2/users/{user}/appearance [get] func (api *API) userAppearanceSettings(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -1165,7 +1165,7 @@ func (api *API) userAppearanceSettings(rw http.ResponseWriter, r *http.Request) // @Param user path string true "User ID, name, or me" // @Param request body codersdk.UpdateUserAppearanceSettingsRequest true "New appearance settings" // @Success 200 {object} codersdk.UserAppearanceSettings -// @Router /users/{user}/appearance [put] +// @Router /api/v2/users/{user}/appearance [put] func (api *API) putUserAppearanceSettings(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -1221,7 +1221,7 @@ func (api *API) putUserAppearanceSettings(rw http.ResponseWriter, r *http.Reques // @Tags Users // @Param user path string true "User ID, name, or me" // @Success 200 {object} codersdk.UserPreferenceSettings -// @Router /users/{user}/preferences [get] +// @Router /api/v2/users/{user}/preferences [get] func (api *API) userPreferenceSettings(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -1263,7 +1263,7 @@ func (api *API) userPreferenceSettings(rw http.ResponseWriter, r *http.Request) // @Param user path string true "User ID, name, or me" // @Param request body codersdk.UpdateUserPreferenceSettingsRequest true "New preference settings" // @Success 200 {object} codersdk.UserPreferenceSettings -// @Router /users/{user}/preferences [put] +// @Router /api/v2/users/{user}/preferences [put] func (api *API) putUserPreferenceSettings(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -1363,7 +1363,7 @@ func isValidFontName(font codersdk.TerminalFontName) bool { // @Param user path string true "User ID, name, or me" // @Param request body codersdk.UpdateUserPasswordRequest true "Update password request" // @Success 204 -// @Router /users/{user}/password [put] +// @Router /api/v2/users/{user}/password [put] func (api *API) putUserPassword(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -1498,7 +1498,7 @@ func (api *API) putUserPassword(rw http.ResponseWriter, r *http.Request) { // @Tags Users // @Param user path string true "User ID, name, or me" // @Success 200 {object} codersdk.User -// @Router /users/{user}/roles [get] +// @Router /api/v2/users/{user}/roles [get] func (api *API) userRoles(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() user := httpmw.UserParam(r) @@ -1544,7 +1544,7 @@ func (api *API) userRoles(rw http.ResponseWriter, r *http.Request) { // @Param user path string true "User ID, name, or me" // @Param request body codersdk.UpdateRoles true "Update roles request" // @Success 200 {object} codersdk.User -// @Router /users/{user}/roles [put] +// @Router /api/v2/users/{user}/roles [put] func (api *API) putUserRoles(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -1621,7 +1621,7 @@ func (api *API) putUserRoles(rw http.ResponseWriter, r *http.Request) { // @Tags Users // @Param user path string true "User ID, name, or me" // @Success 200 {array} codersdk.Organization -// @Router /users/{user}/organizations [get] +// @Router /api/v2/users/{user}/organizations [get] func (api *API) organizationsByUser(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() user := httpmw.UserParam(r) @@ -1663,7 +1663,7 @@ func (api *API) organizationsByUser(rw http.ResponseWriter, r *http.Request) { // @Param user path string true "User ID, name, or me" // @Param organizationname path string true "Organization name" // @Success 200 {object} codersdk.Organization -// @Router /users/{user}/organizations/{organizationname} [get] +// @Router /api/v2/users/{user}/organizations/{organizationname} [get] func (api *API) organizationByUserAndName(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() organizationName := chi.URLParam(r, "organizationname") diff --git a/coderd/usersecrets.go b/coderd/usersecrets.go index 57c0fbcf24..78ca22f776 100644 --- a/coderd/usersecrets.go +++ b/coderd/usersecrets.go @@ -26,7 +26,7 @@ import ( // @Param user path string true "User ID, username, or me" // @Param request body codersdk.CreateUserSecretRequest true "Create secret request" // @Success 201 {object} codersdk.UserSecret -// @Router /users/{user}/secrets [post] +// @Router /api/v2/users/{user}/secrets [post] func (api *API) postUserSecret(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -116,7 +116,7 @@ func (api *API) postUserSecret(rw http.ResponseWriter, r *http.Request) { // @Tags Secrets // @Param user path string true "User ID, username, or me" // @Success 200 {array} codersdk.UserSecret -// @Router /users/{user}/secrets [get] +// @Router /api/v2/users/{user}/secrets [get] func (api *API) getUserSecrets(rw http.ResponseWriter, r *http.Request) { //nolint:revive // Method name matches route. ctx := r.Context() user := httpmw.UserParam(r) @@ -141,7 +141,7 @@ func (api *API) getUserSecrets(rw http.ResponseWriter, r *http.Request) { //noli // @Param user path string true "User ID, username, or me" // @Param name path string true "Secret name" // @Success 200 {object} codersdk.UserSecret -// @Router /users/{user}/secrets/{name} [get] +// @Router /api/v2/users/{user}/secrets/{name} [get] func (api *API) getUserSecret(rw http.ResponseWriter, r *http.Request) { //nolint:revive // Method name matches route. ctx := r.Context() user := httpmw.UserParam(r) @@ -176,7 +176,7 @@ func (api *API) getUserSecret(rw http.ResponseWriter, r *http.Request) { //nolin // @Param name path string true "Secret name" // @Param request body codersdk.UpdateUserSecretRequest true "Update secret request" // @Success 200 {object} codersdk.UserSecret -// @Router /users/{user}/secrets/{name} [patch] +// @Router /api/v2/users/{user}/secrets/{name} [patch] func (api *API) patchUserSecret(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -313,7 +313,7 @@ func (api *API) patchUserSecret(rw http.ResponseWriter, r *http.Request) { // @Param user path string true "User ID, username, or me" // @Param name path string true "Secret name" // @Success 204 -// @Router /users/{user}/secrets/{name} [delete] +// @Router /api/v2/users/{user}/secrets/{name} [delete] func (api *API) deleteUserSecret(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() diff --git a/coderd/webpush.go b/coderd/webpush.go index adb9b93107..a808a3674b 100644 --- a/coderd/webpush.go +++ b/coderd/webpush.go @@ -28,7 +28,7 @@ import ( // @Tags Notifications // @Param request body codersdk.WebpushSubscription true "Webpush subscription" // @Param user path string true "User ID, name, or me" -// @Router /users/{user}/webpush/subscription [post] +// @Router /api/v2/users/{user}/webpush/subscription [post] // @Success 204 // @x-apidocgen {"skip": true} func (api *API) postUserWebpushSubscription(rw http.ResponseWriter, r *http.Request) { @@ -117,7 +117,7 @@ func validateWebpushEndpoint(rawEndpoint string) error { // @Tags Notifications // @Param request body codersdk.DeleteWebpushSubscription true "Webpush subscription" // @Param user path string true "User ID, name, or me" -// @Router /users/{user}/webpush/subscription [delete] +// @Router /api/v2/users/{user}/webpush/subscription [delete] // @Success 204 // @x-apidocgen {"skip": true} func (api *API) deleteUserWebpushSubscription(rw http.ResponseWriter, r *http.Request) { @@ -176,7 +176,7 @@ func (api *API) deleteUserWebpushSubscription(rw http.ResponseWriter, r *http.Re // @Tags Notifications // @Param user path string true "User ID, name, or me" // @Success 204 -// @Router /users/{user}/webpush/test [post] +// @Router /api/v2/users/{user}/webpush/test [post] // @x-apidocgen {"skip": true} func (api *API) postUserPushNotificationTest(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() diff --git a/coderd/workspaceagentportshare.go b/coderd/workspaceagentportshare.go index c59825a2f3..4d255a6091 100644 --- a/coderd/workspaceagentportshare.go +++ b/coderd/workspaceagentportshare.go @@ -21,7 +21,7 @@ import ( // @Param workspace path string true "Workspace ID" format(uuid) // @Param request body codersdk.UpsertWorkspaceAgentPortShareRequest true "Upsert port sharing level request" // @Success 200 {object} codersdk.WorkspaceAgentPortShare -// @Router /workspaces/{workspace}/port-share [post] +// @Router /api/v2/workspaces/{workspace}/port-share [post] func (api *API) postWorkspaceAgentPortShare(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() workspace := httpmw.WorkspaceParam(r) @@ -119,7 +119,7 @@ func (api *API) postWorkspaceAgentPortShare(rw http.ResponseWriter, r *http.Requ // @Tags PortSharing // @Param workspace path string true "Workspace ID" format(uuid) // @Success 200 {object} codersdk.WorkspaceAgentPortShares -// @Router /workspaces/{workspace}/port-share [get] +// @Router /api/v2/workspaces/{workspace}/port-share [get] func (api *API) workspaceAgentPortShares(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() workspace := httpmw.WorkspaceParam(r) @@ -143,7 +143,7 @@ func (api *API) workspaceAgentPortShares(rw http.ResponseWriter, r *http.Request // @Param workspace path string true "Workspace ID" format(uuid) // @Param request body codersdk.DeleteWorkspaceAgentPortShareRequest true "Delete port sharing level request" // @Success 200 -// @Router /workspaces/{workspace}/port-share [delete] +// @Router /api/v2/workspaces/{workspace}/port-share [delete] func (api *API) deleteWorkspaceAgentPortShare(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() workspace := httpmw.WorkspaceParam(r) diff --git a/coderd/workspaceagents.go b/coderd/workspaceagents.go index d98a027d20..9f830d4f40 100644 --- a/coderd/workspaceagents.go +++ b/coderd/workspaceagents.go @@ -61,7 +61,7 @@ import ( // @Tags Agents // @Param workspaceagent path string true "Workspace agent ID" format(uuid) // @Success 200 {object} codersdk.WorkspaceAgent -// @Router /workspaceagents/{workspaceagent} [get] +// @Router /api/v2/workspaceagents/{workspaceagent} [get] func (api *API) workspaceAgent(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -138,7 +138,7 @@ const AgentAPIVersionREST = "1.0" // @Tags Agents // @Param request body agentsdk.PatchLogs true "logs" // @Success 200 {object} codersdk.Response -// @Router /workspaceagents/me/logs [patch] +// @Router /api/v2/workspaceagents/me/logs [patch] func (api *API) patchWorkspaceAgentLogs(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() workspaceAgent := httpmw.WorkspaceAgent(r) @@ -295,7 +295,7 @@ func (api *API) patchWorkspaceAgentLogs(rw http.ResponseWriter, r *http.Request) // @Tags Agents // @Param request body agentsdk.PatchAppStatus true "app status" // @Success 200 {object} codersdk.Response -// @Router /workspaceagents/me/app-status [patch] +// @Router /api/v2/workspaceagents/me/app-status [patch] // @Deprecated Use UpdateAppStatus on the Agent API instead. func (api *API) patchWorkspaceAgentAppStatus(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() @@ -378,7 +378,7 @@ func (api *API) patchWorkspaceAgentAppStatus(rw http.ResponseWriter, r *http.Req // @Param no_compression query bool false "Disable compression for WebSocket connection" // @Param format query string false "Log output format. Accepted: 'json' (default), 'text' (plain text with RFC3339 timestamps and ANSI colors). Not supported with follow=true." Enums(json,text) // @Success 200 {array} codersdk.WorkspaceAgentLog -// @Router /workspaceagents/{workspaceagent}/logs [get] +// @Router /api/v2/workspaceagents/{workspaceagent}/logs [get] func (api *API) workspaceAgentLogs(rw http.ResponseWriter, r *http.Request) { // This mostly copies how provisioner job logs are streamed! var ( @@ -686,7 +686,7 @@ func (api *API) workspaceAgentLogs(rw http.ResponseWriter, r *http.Request) { // @Tags Agents // @Param workspaceagent path string true "Workspace agent ID" format(uuid) // @Success 200 {object} codersdk.WorkspaceAgentListeningPortsResponse -// @Router /workspaceagents/{workspaceagent}/listening-ports [get] +// @Router /api/v2/workspaceagents/{workspaceagent}/listening-ports [get] func (api *API) workspaceAgentListeningPorts(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() waws := httpmw.WorkspaceAgentAndWorkspaceParam(r) @@ -796,7 +796,7 @@ func (api *API) workspaceAgentListeningPorts(rw http.ResponseWriter, r *http.Req // @Tags Agents // @Param workspaceagent path string true "Workspace agent ID" format(uuid) // @Success 200 {object} codersdk.WorkspaceAgentListContainersResponse -// @Router /workspaceagents/{workspaceagent}/containers/watch [get] +// @Router /api/v2/workspaceagents/{workspaceagent}/containers/watch [get] func (api *API) watchWorkspaceAgentContainers(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -904,7 +904,7 @@ func (api *API) watchWorkspaceAgentContainers(rw http.ResponseWriter, r *http.Re // @Param workspaceagent path string true "Workspace agent ID" format(uuid) // @Param label query string true "Labels" format(key=value) // @Success 200 {object} codersdk.WorkspaceAgentListContainersResponse -// @Router /workspaceagents/{workspaceagent}/containers [get] +// @Router /api/v2/workspaceagents/{workspaceagent}/containers [get] func (api *API) workspaceAgentListContainers(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() waws := httpmw.WorkspaceAgentAndWorkspaceParam(r) @@ -1001,7 +1001,7 @@ func (api *API) workspaceAgentListContainers(rw http.ResponseWriter, r *http.Req // @Param workspaceagent path string true "Workspace agent ID" format(uuid) // @Param devcontainer path string true "Devcontainer ID" // @Success 204 -// @Router /workspaceagents/{workspaceagent}/containers/devcontainers/{devcontainer} [delete] +// @Router /api/v2/workspaceagents/{workspaceagent}/containers/devcontainers/{devcontainer} [delete] func (api *API) workspaceAgentDeleteDevcontainer(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() waws := httpmw.WorkspaceAgentAndWorkspaceParam(r) @@ -1091,7 +1091,7 @@ func (api *API) workspaceAgentDeleteDevcontainer(rw http.ResponseWriter, r *http // @Param workspaceagent path string true "Workspace agent ID" format(uuid) // @Param devcontainer path string true "Devcontainer ID" // @Success 202 {object} codersdk.Response -// @Router /workspaceagents/{workspaceagent}/containers/devcontainers/{devcontainer}/recreate [post] +// @Router /api/v2/workspaceagents/{workspaceagent}/containers/devcontainers/{devcontainer}/recreate [post] func (api *API) workspaceAgentRecreateDevcontainer(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() waws := httpmw.WorkspaceAgentAndWorkspaceParam(r) @@ -1176,7 +1176,7 @@ func (api *API) workspaceAgentRecreateDevcontainer(rw http.ResponseWriter, r *ht // @Tags Agents // @Param workspaceagent path string true "Workspace agent ID" format(uuid) // @Success 200 {object} workspacesdk.AgentConnectionInfo -// @Router /workspaceagents/{workspaceagent}/connection [get] +// @Router /api/v2/workspaceagents/{workspaceagent}/connection [get] func (api *API) workspaceAgentConnection(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() @@ -1197,7 +1197,7 @@ func (api *API) workspaceAgentConnection(rw http.ResponseWriter, r *http.Request // @Produce json // @Tags Agents // @Success 200 {object} workspacesdk.AgentConnectionInfo -// @Router /workspaceagents/connection [get] +// @Router /api/v2/workspaceagents/connection [get] // @x-apidocgen {"skip": true} func (api *API) workspaceAgentConnectionGeneric(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() @@ -1215,7 +1215,7 @@ func (api *API) workspaceAgentConnectionGeneric(rw http.ResponseWriter, r *http. // @Security CoderSessionToken // @Tags Agents // @Success 101 -// @Router /derp-map [get] +// @Router /api/v2/derp-map [get] func (api *API) derpMapUpdates(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() @@ -1297,7 +1297,7 @@ func (api *API) derpMapUpdates(rw http.ResponseWriter, r *http.Request) { // @Tags Agents // @Param workspaceagent path string true "Workspace agent ID" format(uuid) // @Success 101 -// @Router /workspaceagents/{workspaceagent}/coordinate [get] +// @Router /api/v2/workspaceagents/{workspaceagent}/coordinate [get] func (api *API) workspaceAgentClientCoordinate(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() @@ -1421,7 +1421,7 @@ func (api *API) handleResumeToken(ctx context.Context, rw http.ResponseWriter, r // @Tags Agents // @Param request body agentsdk.PostLogSourceRequest true "Log source request" // @Success 200 {object} codersdk.WorkspaceAgentLogSource -// @Router /workspaceagents/me/log-source [post] +// @Router /api/v2/workspaceagents/me/log-source [post] func (api *API) workspaceAgentPostLogSource(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() var req agentsdk.PostLogSourceRequest @@ -1471,7 +1471,7 @@ func (api *API) workspaceAgentPostLogSource(rw http.ResponseWriter, r *http.Requ // @Param wait query bool false "Opt in to durable reinit checks" // @Success 200 {object} agentsdk.ReinitializationEvent // @Failure 409 {object} codersdk.Response -// @Router /workspaceagents/me/reinit [get] +// @Router /api/v2/workspaceagents/me/reinit [get] func (api *API) workspaceAgentReinit(rw http.ResponseWriter, r *http.Request) { // Allow us to interrupt watch via cancel. ctx, cancel := context.WithCancel(r.Context()) @@ -1648,7 +1648,7 @@ func convertScripts(dbScripts []database.GetWorkspaceAgentScriptsByAgentIDsRow) // @Tags Agents // @Success 200 "Success" // @Param workspaceagent path string true "Workspace agent ID" format(uuid) -// @Router /workspaceagents/{workspaceagent}/watch-metadata [get] +// @Router /api/v2/workspaceagents/{workspaceagent}/watch-metadata [get] // @x-apidocgen {"skip": true} // @Deprecated Use /workspaceagents/{workspaceagent}/watch-metadata-ws instead func (api *API) watchWorkspaceAgentMetadataSSE(rw http.ResponseWriter, r *http.Request) { @@ -1662,7 +1662,7 @@ func (api *API) watchWorkspaceAgentMetadataSSE(rw http.ResponseWriter, r *http.R // @Tags Agents // @Success 200 {object} codersdk.ServerSentEvent // @Param workspaceagent path string true "Workspace agent ID" format(uuid) -// @Router /workspaceagents/{workspaceagent}/watch-metadata-ws [get] +// @Router /api/v2/workspaceagents/{workspaceagent}/watch-metadata-ws [get] // @x-apidocgen {"skip": true} func (api *API) watchWorkspaceAgentMetadataWS(rw http.ResponseWriter, r *http.Request) { api.watchWorkspaceAgentMetadata(rw, r, httpapi.OneWayWebSocketEventSender(api.Logger)) @@ -1922,7 +1922,7 @@ func convertWorkspaceAgentMetadata(db []database.WorkspaceAgentMetadatum) []code // @Param id query string true "Provider ID" // @Param listen query bool false "Wait for a new token to be issued" // @Success 200 {object} agentsdk.ExternalAuthResponse -// @Router /workspaceagents/me/external-auth [get] +// @Router /api/v2/workspaceagents/me/external-auth [get] func (api *API) workspaceAgentsExternalAuth(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() query := r.URL.Query() @@ -2203,7 +2203,7 @@ func (api *API) workspaceAgentsExternalAuthListen(ctx context.Context, rw http.R // @Security CoderSessionToken // @Tags Agents // @Success 101 -// @Router /tailnet [get] +// @Router /api/v2/tailnet [get] func (api *API) tailnetRPCConn(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() diff --git a/coderd/workspaceagentsrpc.go b/coderd/workspaceagentsrpc.go index 43863f322c..842a512f44 100644 --- a/coderd/workspaceagentsrpc.go +++ b/coderd/workspaceagentsrpc.go @@ -36,7 +36,7 @@ import ( // @Security CoderSessionToken // @Tags Agents // @Success 101 -// @Router /workspaceagents/me/rpc [get] +// @Router /api/v2/workspaceagents/me/rpc [get] // @x-apidocgen {"skip": true} func (api *API) workspaceAgentRPC(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() diff --git a/coderd/workspaceapps.go b/coderd/workspaceapps.go index afc9538235..3d38afc026 100644 --- a/coderd/workspaceapps.go +++ b/coderd/workspaceapps.go @@ -29,7 +29,7 @@ import ( // @Produce json // @Tags Applications // @Success 200 {object} codersdk.AppHostResponse -// @Router /applications/host [get] +// @Router /api/v2/applications/host [get] // @Deprecated use api/v2/regions and see the primary proxy. func (api *API) appHost(rw http.ResponseWriter, r *http.Request) { httpapi.Write(r.Context(), rw, http.StatusOK, codersdk.AppHostResponse{ @@ -50,7 +50,7 @@ func (api *API) appHost(rw http.ResponseWriter, r *http.Request) { // @Tags Applications // @Param redirect_uri query string false "Redirect destination" // @Success 307 -// @Router /applications/auth-redirect [get] +// @Router /api/v2/applications/auth-redirect [get] func (api *API) workspaceApplicationAuth(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() apiKey := httpmw.APIKey(r) diff --git a/coderd/workspaceapps/proxy.go b/coderd/workspaceapps/proxy.go index 1898ed96f6..86ec757f31 100644 --- a/coderd/workspaceapps/proxy.go +++ b/coderd/workspaceapps/proxy.go @@ -701,7 +701,7 @@ func (s *Server) proxyWorkspaceApp(rw http.ResponseWriter, r *http.Request, appT // @Tags Agents // @Param workspaceagent path string true "Workspace agent ID" format(uuid) // @Success 101 -// @Router /workspaceagents/{workspaceagent}/pty [get] +// @Router /api/v2/workspaceagents/{workspaceagent}/pty [get] func (s *Server) workspaceAgentPTY(rw http.ResponseWriter, r *http.Request) { ctx, cancel := context.WithCancel(r.Context()) defer cancel() diff --git a/coderd/workspacebuilds.go b/coderd/workspacebuilds.go index 6c794e3cdf..fdaaccacfc 100644 --- a/coderd/workspacebuilds.go +++ b/coderd/workspacebuilds.go @@ -44,7 +44,7 @@ import ( // @Tags Builds // @Param workspacebuild path string true "Workspace build ID" // @Success 200 {object} codersdk.WorkspaceBuild -// @Router /workspacebuilds/{workspacebuild} [get] +// @Router /api/v2/workspacebuilds/{workspacebuild} [get] func (api *API) workspaceBuild(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() workspaceBuild := httpmw.WorkspaceBuildParam(r) @@ -113,7 +113,7 @@ func (api *API) workspaceBuild(rw http.ResponseWriter, r *http.Request) { // @Param offset query int false "Page offset" // @Param since query string false "Since timestamp" format(date-time) // @Success 200 {array} codersdk.WorkspaceBuild -// @Router /workspaces/{workspace}/builds [get] +// @Router /api/v2/workspaces/{workspace}/builds [get] func (api *API) workspaceBuilds(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() workspace := httpmw.WorkspaceParam(r) @@ -230,7 +230,7 @@ func (api *API) workspaceBuilds(rw http.ResponseWriter, r *http.Request) { // @Param workspacename path string true "Workspace name" // @Param buildnumber path string true "Build number" format(number) // @Success 200 {object} codersdk.WorkspaceBuild -// @Router /users/{user}/workspace/{workspacename}/builds/{buildnumber} [get] +// @Router /api/v2/users/{user}/workspace/{workspacename}/builds/{buildnumber} [get] func (api *API) workspaceBuildByBuildNumber(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() mems := httpmw.OrganizationMembersParam(r) @@ -324,7 +324,7 @@ func (api *API) workspaceBuildByBuildNumber(rw http.ResponseWriter, r *http.Requ // @Param workspace path string true "Workspace ID" format(uuid) // @Param request body codersdk.CreateWorkspaceBuildRequest true "Create workspace build request" // @Success 200 {object} codersdk.WorkspaceBuild -// @Router /workspaces/{workspace}/builds [post] +// @Router /api/v2/workspaces/{workspace}/builds [post] func (api *API) postWorkspaceBuilds(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() apiKey := httpmw.APIKey(r) @@ -662,7 +662,7 @@ func (api *API) notifyWorkspaceUpdated( // @Param workspacebuild path string true "Workspace build ID" // @Param expect_status query string false "Expected status of the job. If expect_status is supplied, the request will be rejected with 412 Precondition Failed if the job doesn't match the state when performing the cancellation." Enums(running, pending) // @Success 200 {object} codersdk.Response -// @Router /workspacebuilds/{workspacebuild}/cancel [patch] +// @Router /api/v2/workspacebuilds/{workspacebuild}/cancel [patch] func (api *API) patchCancelWorkspaceBuild(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() @@ -817,7 +817,7 @@ func verifyUserCanCancelWorkspaceBuilds(ctx context.Context, store database.Stor // @Tags Builds // @Param workspacebuild path string true "Workspace build ID" // @Success 200 {array} codersdk.WorkspaceBuildParameter -// @Router /workspacebuilds/{workspacebuild}/parameters [get] +// @Router /api/v2/workspacebuilds/{workspacebuild}/parameters [get] func (api *API) workspaceBuildParameters(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() workspaceBuild := httpmw.WorkspaceBuildParam(r) @@ -845,7 +845,7 @@ func (api *API) workspaceBuildParameters(rw http.ResponseWriter, r *http.Request // @Param follow query bool false "Follow log stream" // @Param format query string false "Log output format. Accepted: 'json' (default), 'text' (plain text with RFC3339 timestamps and ANSI colors). Not supported with follow=true." Enums(json,text) // @Success 200 {array} codersdk.ProvisionerJobLog -// @Router /workspacebuilds/{workspacebuild}/logs [get] +// @Router /api/v2/workspacebuilds/{workspacebuild}/logs [get] func (api *API) workspaceBuildLogs(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() workspaceBuild := httpmw.WorkspaceBuildParam(r) @@ -868,7 +868,7 @@ func (api *API) workspaceBuildLogs(rw http.ResponseWriter, r *http.Request) { // @Tags Builds // @Param workspacebuild path string true "Workspace build ID" // @Success 200 {object} codersdk.WorkspaceBuild -// @Router /workspacebuilds/{workspacebuild}/state [get] +// @Router /api/v2/workspacebuilds/{workspacebuild}/state [get] func (api *API) workspaceBuildState(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() workspaceBuild := httpmw.WorkspaceBuildParam(r) @@ -900,7 +900,7 @@ func (api *API) workspaceBuildState(rw http.ResponseWriter, r *http.Request) { // @Param workspacebuild path string true "Workspace build ID" format(uuid) // @Param request body codersdk.UpdateWorkspaceBuildStateRequest true "Request body" // @Success 204 -// @Router /workspacebuilds/{workspacebuild}/state [put] +// @Router /api/v2/workspacebuilds/{workspacebuild}/state [put] func (api *API) workspaceBuildUpdateState(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() workspaceBuild := httpmw.WorkspaceBuildParam(r) @@ -956,7 +956,7 @@ func (api *API) workspaceBuildUpdateState(rw http.ResponseWriter, r *http.Reques // @Tags Builds // @Param workspacebuild path string true "Workspace build ID" format(uuid) // @Success 200 {object} codersdk.WorkspaceBuildTimings -// @Router /workspacebuilds/{workspacebuild}/timings [get] +// @Router /api/v2/workspacebuilds/{workspacebuild}/timings [get] func (api *API) workspaceBuildTimings(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() diff --git a/coderd/workspaceproxies.go b/coderd/workspaceproxies.go index 46f3fb0212..8dda4cc808 100644 --- a/coderd/workspaceproxies.go +++ b/coderd/workspaceproxies.go @@ -74,7 +74,7 @@ func (api *API) PrimaryWorkspaceProxy(ctx context.Context) (database.WorkspacePr // @Produce json // @Tags WorkspaceProxies // @Success 200 {object} codersdk.RegionsResponse[codersdk.Region] -// @Router /regions [get] +// @Router /api/v2/regions [get] func (api *API) regions(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() //nolint:gocritic // this route intentionally requests resources that users diff --git a/coderd/workspaceresourceauth.go b/coderd/workspaceresourceauth.go index f414c3a828..34c74777ab 100644 --- a/coderd/workspaceresourceauth.go +++ b/coderd/workspaceresourceauth.go @@ -31,7 +31,7 @@ import ( // @Tags Agents // @Param request body agentsdk.AzureInstanceIdentityToken true "Instance identity token. The optional agent_name field disambiguates when multiple agents share the same instance ID." // @Success 200 {object} agentsdk.AuthenticateResponse -// @Router /workspaceagents/azure-instance-identity [post] +// @Router /api/v2/workspaceagents/azure-instance-identity [post] func (api *API) postWorkspaceAuthAzureInstanceIdentity(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() var req agentsdk.AzureInstanceIdentityToken @@ -63,7 +63,7 @@ func (api *API) postWorkspaceAuthAzureInstanceIdentity(rw http.ResponseWriter, r // @Tags Agents // @Param request body agentsdk.AWSInstanceIdentityToken true "Instance identity token. The optional agent_name field disambiguates when multiple agents share the same instance ID." // @Success 200 {object} agentsdk.AuthenticateResponse -// @Router /workspaceagents/aws-instance-identity [post] +// @Router /api/v2/workspaceagents/aws-instance-identity [post] func (api *API) postWorkspaceAuthAWSInstanceIdentity(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() var req agentsdk.AWSInstanceIdentityToken @@ -93,7 +93,7 @@ func (api *API) postWorkspaceAuthAWSInstanceIdentity(rw http.ResponseWriter, r * // @Tags Agents // @Param request body agentsdk.GoogleInstanceIdentityToken true "Instance identity token. The optional agent_name field disambiguates when multiple agents share the same instance ID." // @Success 200 {object} agentsdk.AuthenticateResponse -// @Router /workspaceagents/google-instance-identity [post] +// @Router /api/v2/workspaceagents/google-instance-identity [post] func (api *API) postWorkspaceAuthGoogleInstanceIdentity(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() var req agentsdk.GoogleInstanceIdentityToken diff --git a/coderd/workspaces.go b/coderd/workspaces.go index bba70502f5..a39f70cdaa 100644 --- a/coderd/workspaces.go +++ b/coderd/workspaces.go @@ -65,7 +65,7 @@ var ( // @Param workspace path string true "Workspace ID" format(uuid) // @Param include_deleted query bool false "Return data instead of HTTP 404 if the workspace is deleted" // @Success 200 {object} codersdk.Workspace -// @Router /workspaces/{workspace} [get] +// @Router /api/v2/workspaces/{workspace} [get] func (api *API) workspace(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() workspace := httpmw.WorkspaceParam(r) @@ -146,7 +146,7 @@ func (api *API) workspace(rw http.ResponseWriter, r *http.Request) { // @Param limit query int false "Page limit" // @Param offset query int false "Page offset" // @Success 200 {object} codersdk.WorkspacesResponse -// @Router /workspaces [get] +// @Router /api/v2/workspaces [get] func (api *API) workspaces(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() apiKey := httpmw.APIKey(r) @@ -269,7 +269,7 @@ func (api *API) workspaces(rw http.ResponseWriter, r *http.Request) { // @Param workspacename path string true "Workspace name" // @Param include_deleted query bool false "Return data instead of HTTP 404 if the workspace is deleted" // @Success 200 {object} codersdk.Workspace -// @Router /users/{user}/workspace/{workspacename} [get] +// @Router /api/v2/users/{user}/workspace/{workspacename} [get] func (api *API) workspaceByOwnerAndName(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() @@ -371,7 +371,7 @@ func (api *API) workspaceByOwnerAndName(rw http.ResponseWriter, r *http.Request) // @Param user path string true "Username, UUID, or me" // @Param request body codersdk.CreateWorkspaceRequest true "Create workspace request" // @Success 200 {object} codersdk.Workspace -// @Router /organizations/{organization}/members/{user}/workspaces [post] +// @Router /api/v2/organizations/{organization}/members/{user}/workspaces [post] func (api *API) postWorkspacesByOrganization(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -432,7 +432,7 @@ func (api *API) postWorkspacesByOrganization(rw http.ResponseWriter, r *http.Req // @Param user path string true "Username, UUID, or me" // @Param request body codersdk.CreateWorkspaceRequest true "Create workspace request" // @Success 200 {object} codersdk.Workspace -// @Router /users/{user}/workspaces [post] +// @Router /api/v2/users/{user}/workspaces [post] func (api *API) postUserWorkspaces(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -1048,7 +1048,7 @@ func (api *API) notifyWorkspaceCreated( // @Param workspace path string true "Workspace ID" format(uuid) // @Param request body codersdk.UpdateWorkspaceRequest true "Metadata update request" // @Success 204 -// @Router /workspaces/{workspace} [patch] +// @Router /api/v2/workspaces/{workspace} [patch] func (api *API) patchWorkspace(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -1143,7 +1143,7 @@ func (api *API) patchWorkspace(rw http.ResponseWriter, r *http.Request) { // @Param workspace path string true "Workspace ID" format(uuid) // @Param request body codersdk.UpdateWorkspaceAutostartRequest true "Schedule update request" // @Success 204 -// @Router /workspaces/{workspace}/autostart [put] +// @Router /api/v2/workspaces/{workspace}/autostart [put] func (api *API) putWorkspaceAutostart(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -1246,7 +1246,7 @@ func (api *API) putWorkspaceAutostart(rw http.ResponseWriter, r *http.Request) { // @Param workspace path string true "Workspace ID" format(uuid) // @Param request body codersdk.UpdateWorkspaceTTLRequest true "Workspace TTL update request" // @Success 204 -// @Router /workspaces/{workspace}/ttl [put] +// @Router /api/v2/workspaces/{workspace}/ttl [put] func (api *API) putWorkspaceTTL(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -1375,7 +1375,7 @@ func (api *API) putWorkspaceTTL(rw http.ResponseWriter, r *http.Request) { // @Param workspace path string true "Workspace ID" format(uuid) // @Param request body codersdk.UpdateWorkspaceDormancy true "Make a workspace dormant or active" // @Success 200 {object} codersdk.Workspace -// @Router /workspaces/{workspace}/dormant [put] +// @Router /api/v2/workspaces/{workspace}/dormant [put] func (api *API) putWorkspaceDormant(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -1547,7 +1547,7 @@ func (api *API) putWorkspaceDormant(rw http.ResponseWriter, r *http.Request) { // @Param workspace path string true "Workspace ID" format(uuid) // @Param request body codersdk.PutExtendWorkspaceRequest true "Extend deadline update request" // @Success 200 {object} codersdk.Response -// @Router /workspaces/{workspace}/extend [put] +// @Router /api/v2/workspaces/{workspace}/extend [put] func (api *API) putExtendWorkspace(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() workspace := httpmw.WorkspaceParam(r) @@ -1655,7 +1655,7 @@ func (api *API) putExtendWorkspace(rw http.ResponseWriter, r *http.Request) { // @Param workspace path string true "Workspace ID" format(uuid) // @Param request body codersdk.PostWorkspaceUsageRequest false "Post workspace usage request" // @Success 204 -// @Router /workspaces/{workspace}/usage [post] +// @Router /api/v2/workspaces/{workspace}/usage [post] func (api *API) postWorkspaceUsage(rw http.ResponseWriter, r *http.Request) { workspace := httpmw.WorkspaceParam(r) if !api.Authorize(r, policy.ActionUpdate, workspace) { @@ -1769,7 +1769,7 @@ func (api *API) postWorkspaceUsage(rw http.ResponseWriter, r *http.Request) { // @Tags Workspaces // @Param workspace path string true "Workspace ID" format(uuid) // @Success 204 -// @Router /workspaces/{workspace}/favorite [put] +// @Router /api/v2/workspaces/{workspace}/favorite [put] func (api *API) putFavoriteWorkspace(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -1816,7 +1816,7 @@ func (api *API) putFavoriteWorkspace(rw http.ResponseWriter, r *http.Request) { // @Tags Workspaces // @Param workspace path string true "Workspace ID" format(uuid) // @Success 204 -// @Router /workspaces/{workspace}/favorite [delete] +// @Router /api/v2/workspaces/{workspace}/favorite [delete] func (api *API) deleteFavoriteWorkspace(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -1865,7 +1865,7 @@ func (api *API) deleteFavoriteWorkspace(rw http.ResponseWriter, r *http.Request) // @Param workspace path string true "Workspace ID" format(uuid) // @Param request body codersdk.UpdateWorkspaceAutomaticUpdatesRequest true "Automatic updates request" // @Success 204 -// @Router /workspaces/{workspace}/autoupdates [put] +// @Router /api/v2/workspaces/{workspace}/autoupdates [put] func (api *API) putWorkspaceAutoupdates(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -1925,7 +1925,7 @@ func (api *API) putWorkspaceAutoupdates(rw http.ResponseWriter, r *http.Request) // @Tags Workspaces // @Param workspace path string true "Workspace ID" format(uuid) // @Success 200 {object} codersdk.ResolveAutostartResponse -// @Router /workspaces/{workspace}/resolve-autostart [get] +// @Router /api/v2/workspaces/{workspace}/resolve-autostart [get] func (api *API) resolveAutostart(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -2019,7 +2019,7 @@ func (api *API) resolveAutostart(rw http.ResponseWriter, r *http.Request) { // @Tags Workspaces // @Param workspace path string true "Workspace ID" format(uuid) // @Success 200 {object} codersdk.Response -// @Router /workspaces/{workspace}/watch [get] +// @Router /api/v2/workspaces/{workspace}/watch [get] // @Deprecated Use /workspaces/{workspace}/watch-ws instead func (api *API) watchWorkspaceSSE(rw http.ResponseWriter, r *http.Request) { api.watchWorkspace(rw, r, httpapi.ServerSentEventSender) @@ -2032,7 +2032,7 @@ func (api *API) watchWorkspaceSSE(rw http.ResponseWriter, r *http.Request) { // @Tags Workspaces // @Param workspace path string true "Workspace ID" format(uuid) // @Success 200 {object} codersdk.ServerSentEvent -// @Router /workspaces/{workspace}/watch-ws [get] +// @Router /api/v2/workspaces/{workspace}/watch-ws [get] func (api *API) watchWorkspaceWS(rw http.ResponseWriter, r *http.Request) { api.watchWorkspace(rw, r, httpapi.OneWayWebSocketEventSender(api.Logger)) } @@ -2184,7 +2184,7 @@ func (api *API) watchWorkspace( // @Produce json // @Tags Workspaces // @Success 101 -// @Router /experimental/watch-all-workspacebuilds [get] +// @Router /api/experimental/watch-all-workspacebuilds [get] // @x-apidocgen {"skip": true} func (api *API) watchAllWorkspaceBuilds(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() @@ -2257,7 +2257,7 @@ func (api *API) watchAllWorkspaceBuilds(rw http.ResponseWriter, r *http.Request) // @Tags Workspaces // @Param workspace path string true "Workspace ID" format(uuid) // @Success 200 {object} codersdk.WorkspaceBuildTimings -// @Router /workspaces/{workspace}/timings [get] +// @Router /api/v2/workspaces/{workspace}/timings [get] func (api *API) workspaceTimings(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -2292,7 +2292,7 @@ func (api *API) workspaceTimings(rw http.ResponseWriter, r *http.Request) { // @Tags Workspaces // @Param workspace path string true "Workspace ID" format(uuid) // @Success 200 {object} codersdk.WorkspaceACL -// @Router /workspaces/{workspace}/acl [get] +// @Router /api/v2/workspaces/{workspace}/acl [get] func (api *API) workspaceACL(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -2403,7 +2403,7 @@ func (api *API) workspaceACL(rw http.ResponseWriter, r *http.Request) { // @Param workspace path string true "Workspace ID" format(uuid) // @Param request body codersdk.UpdateWorkspaceACL true "Update workspace ACL request" // @Success 204 -// @Router /workspaces/{workspace}/acl [patch] +// @Router /api/v2/workspaces/{workspace}/acl [patch] func (api *API) patchWorkspaceACL(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -2514,7 +2514,7 @@ type workspaceData struct { // @Tags Workspaces // @Param workspace path string true "Workspace ID" format(uuid) // @Success 204 -// @Router /workspaces/{workspace}/acl [delete] +// @Router /api/v2/workspaces/{workspace}/acl [delete] func (api *API) deleteWorkspaceACL(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -3024,7 +3024,7 @@ func convertToWorkspaceRole(actions []policy.Action) codersdk.WorkspaceRole { // @Param limit query int false "Limit results" // @Param offset query int false "Offset for pagination" // @Success 200 {array} codersdk.MinimalUser -// @Router /organizations/{organization}/members/{user}/workspaces/available-users [get] +// @Router /api/v2/organizations/{organization}/members/{user}/workspaces/available-users [get] func (api *API) workspaceAvailableUsers(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() organization := httpmw.OrganizationParam(r) diff --git a/docs/reference/api/agents.md b/docs/reference/api/agents.md index 05ff98209a..de826c6615 100644 --- a/docs/reference/api/agents.md +++ b/docs/reference/api/agents.md @@ -10,7 +10,7 @@ curl -X GET http://coder-server:8080/api/v2/derp-map \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /derp-map` +`GET /api/v2/derp-map` ### Responses @@ -30,7 +30,7 @@ curl -X GET http://coder-server:8080/api/v2/tailnet \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /tailnet` +`GET /api/v2/tailnet` ### Responses @@ -52,7 +52,7 @@ curl -X POST http://coder-server:8080/api/v2/workspaceagents/aws-instance-identi -H 'Coder-Session-Token: API_KEY' ``` -`POST /workspaceagents/aws-instance-identity` +`POST /api/v2/workspaceagents/aws-instance-identity` > Body parameter @@ -100,7 +100,7 @@ curl -X POST http://coder-server:8080/api/v2/workspaceagents/azure-instance-iden -H 'Coder-Session-Token: API_KEY' ``` -`POST /workspaceagents/azure-instance-identity` +`POST /api/v2/workspaceagents/azure-instance-identity` > Body parameter @@ -148,7 +148,7 @@ curl -X POST http://coder-server:8080/api/v2/workspaceagents/google-instance-ide -H 'Coder-Session-Token: API_KEY' ``` -`POST /workspaceagents/google-instance-identity` +`POST /api/v2/workspaceagents/google-instance-identity` > Body parameter @@ -195,7 +195,7 @@ curl -X PATCH http://coder-server:8080/api/v2/workspaceagents/me/app-status \ -H 'Coder-Session-Token: API_KEY' ``` -`PATCH /workspaceagents/me/app-status` +`PATCH /api/v2/workspaceagents/me/app-status` > Body parameter @@ -252,7 +252,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/me/external-auth?mat -H 'Coder-Session-Token: API_KEY' ``` -`GET /workspaceagents/me/external-auth` +`GET /api/v2/workspaceagents/me/external-auth` ### Parameters @@ -296,7 +296,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/me/gitauth?match=str -H 'Coder-Session-Token: API_KEY' ``` -`GET /workspaceagents/me/gitauth` +`GET /api/v2/workspaceagents/me/gitauth` ### Parameters @@ -340,7 +340,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/me/gitsshkey \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /workspaceagents/me/gitsshkey` +`GET /api/v2/workspaceagents/me/gitsshkey` ### Example responses @@ -373,7 +373,7 @@ curl -X POST http://coder-server:8080/api/v2/workspaceagents/me/log-source \ -H 'Coder-Session-Token: API_KEY' ``` -`POST /workspaceagents/me/log-source` +`POST /api/v2/workspaceagents/me/log-source` > Body parameter @@ -425,7 +425,7 @@ curl -X PATCH http://coder-server:8080/api/v2/workspaceagents/me/logs \ -H 'Coder-Session-Token: API_KEY' ``` -`PATCH /workspaceagents/me/logs` +`PATCH /api/v2/workspaceagents/me/logs` > Body parameter @@ -484,7 +484,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/me/reinit \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /workspaceagents/me/reinit` +`GET /api/v2/workspaceagents/me/reinit` ### Parameters @@ -524,7 +524,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/{workspaceagent} \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /workspaceagents/{workspaceagent}` +`GET /api/v2/workspaceagents/{workspaceagent}` ### Parameters @@ -675,7 +675,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/{workspaceagent}/con -H 'Coder-Session-Token: API_KEY' ``` -`GET /workspaceagents/{workspaceagent}/connection` +`GET /api/v2/workspaceagents/{workspaceagent}/connection` ### Parameters @@ -773,7 +773,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/{workspaceagent}/con -H 'Coder-Session-Token: API_KEY' ``` -`GET /workspaceagents/{workspaceagent}/containers` +`GET /api/v2/workspaceagents/{workspaceagent}/containers` ### Parameters @@ -882,7 +882,7 @@ curl -X DELETE http://coder-server:8080/api/v2/workspaceagents/{workspaceagent}/ -H 'Coder-Session-Token: API_KEY' ``` -`DELETE /workspaceagents/{workspaceagent}/containers/devcontainers/{devcontainer}` +`DELETE /api/v2/workspaceagents/{workspaceagent}/containers/devcontainers/{devcontainer}` ### Parameters @@ -910,7 +910,7 @@ curl -X POST http://coder-server:8080/api/v2/workspaceagents/{workspaceagent}/co -H 'Coder-Session-Token: API_KEY' ``` -`POST /workspaceagents/{workspaceagent}/containers/devcontainers/{devcontainer}/recreate` +`POST /api/v2/workspaceagents/{workspaceagent}/containers/devcontainers/{devcontainer}/recreate` ### Parameters @@ -955,7 +955,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/{workspaceagent}/con -H 'Coder-Session-Token: API_KEY' ``` -`GET /workspaceagents/{workspaceagent}/containers/watch` +`GET /api/v2/workspaceagents/{workspaceagent}/containers/watch` ### Parameters @@ -1063,7 +1063,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/{workspaceagent}/coo -H 'Coder-Session-Token: API_KEY' ``` -`GET /workspaceagents/{workspaceagent}/coordinate` +`GET /api/v2/workspaceagents/{workspaceagent}/coordinate` ### Parameters @@ -1090,7 +1090,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/{workspaceagent}/lis -H 'Coder-Session-Token: API_KEY' ``` -`GET /workspaceagents/{workspaceagent}/listening-ports` +`GET /api/v2/workspaceagents/{workspaceagent}/listening-ports` ### Parameters @@ -1133,7 +1133,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/{workspaceagent}/log -H 'Coder-Session-Token: API_KEY' ``` -`GET /workspaceagents/{workspaceagent}/logs` +`GET /api/v2/workspaceagents/{workspaceagent}/logs` ### Parameters @@ -1205,7 +1205,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/{workspaceagent}/pty -H 'Coder-Session-Token: API_KEY' ``` -`GET /workspaceagents/{workspaceagent}/pty` +`GET /api/v2/workspaceagents/{workspaceagent}/pty` ### Parameters @@ -1232,7 +1232,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/{workspaceagent}/sta -H 'Coder-Session-Token: API_KEY' ``` -`GET /workspaceagents/{workspaceagent}/startup-logs` +`GET /api/v2/workspaceagents/{workspaceagent}/startup-logs` ### Parameters diff --git a/docs/reference/api/aibridge.md b/docs/reference/api/aibridge.md index a3f5484767..65580263f4 100644 --- a/docs/reference/api/aibridge.md +++ b/docs/reference/api/aibridge.md @@ -11,7 +11,7 @@ curl -X GET http://coder-server:8080/api/v2/aibridge/clients \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /aibridge/clients` +`GET /api/v2/aibridge/clients` ### Example responses @@ -44,7 +44,7 @@ curl -X GET http://coder-server:8080/api/v2/aibridge/interceptions \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /aibridge/interceptions` +`GET /api/v2/aibridge/interceptions` ### Parameters @@ -152,7 +152,7 @@ curl -X GET http://coder-server:8080/api/v2/aibridge/models \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /aibridge/models` +`GET /api/v2/aibridge/models` ### Example responses @@ -185,7 +185,7 @@ curl -X GET http://coder-server:8080/api/v2/aibridge/sessions \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /aibridge/sessions` +`GET /api/v2/aibridge/sessions` ### Parameters @@ -258,7 +258,7 @@ curl -X GET http://coder-server:8080/api/v2/aibridge/sessions/{session_id} \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /aibridge/sessions/{session_id}` +`GET /api/v2/aibridge/sessions/{session_id}` ### Parameters diff --git a/docs/reference/api/applications.md b/docs/reference/api/applications.md index 77fe7095ee..e8d95f4efb 100644 --- a/docs/reference/api/applications.md +++ b/docs/reference/api/applications.md @@ -10,7 +10,7 @@ curl -X GET http://coder-server:8080/api/v2/applications/auth-redirect \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /applications/auth-redirect` +`GET /api/v2/applications/auth-redirect` ### Parameters @@ -37,7 +37,7 @@ curl -X GET http://coder-server:8080/api/v2/applications/host \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /applications/host` +`GET /api/v2/applications/host` ### Example responses diff --git a/docs/reference/api/audit.md b/docs/reference/api/audit.md index 8ae32c1295..6f2e46931e 100644 --- a/docs/reference/api/audit.md +++ b/docs/reference/api/audit.md @@ -11,7 +11,7 @@ curl -X GET http://coder-server:8080/api/v2/audit?limit=0 \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /audit` +`GET /api/v2/audit` ### Parameters diff --git a/docs/reference/api/authorization.md b/docs/reference/api/authorization.md index e13964b869..ad6632446c 100644 --- a/docs/reference/api/authorization.md +++ b/docs/reference/api/authorization.md @@ -10,7 +10,7 @@ curl -X GET http://coder-server:8080/api/v2/auth/scopes \ -H 'Accept: application/json' ``` -`GET /auth/scopes` +`GET /api/v2/auth/scopes` ### Example responses @@ -42,7 +42,7 @@ curl -X POST http://coder-server:8080/api/v2/authcheck \ -H 'Coder-Session-Token: API_KEY' ``` -`POST /authcheck` +`POST /api/v2/authcheck` > Body parameter @@ -109,7 +109,7 @@ curl -X POST http://coder-server:8080/api/v2/users/login \ -H 'Accept: application/json' ``` -`POST /users/login` +`POST /api/v2/users/login` > Body parameter @@ -152,7 +152,7 @@ curl -X POST http://coder-server:8080/api/v2/users/otp/change-password \ -H 'Content-Type: application/json' ``` -`POST /users/otp/change-password` +`POST /api/v2/users/otp/change-password` > Body parameter @@ -186,7 +186,7 @@ curl -X POST http://coder-server:8080/api/v2/users/otp/request \ -H 'Content-Type: application/json' ``` -`POST /users/otp/request` +`POST /api/v2/users/otp/request` > Body parameter @@ -220,7 +220,7 @@ curl -X POST http://coder-server:8080/api/v2/users/validate-password \ -H 'Coder-Session-Token: API_KEY' ``` -`POST /users/validate-password` +`POST /api/v2/users/validate-password` > Body parameter @@ -267,7 +267,7 @@ curl -X POST http://coder-server:8080/api/v2/users/{user}/convert-login \ -H 'Coder-Session-Token: API_KEY' ``` -`POST /users/{user}/convert-login` +`POST /api/v2/users/{user}/convert-login` > Body parameter diff --git a/docs/reference/api/builds.md b/docs/reference/api/builds.md index 59b68f8b0a..30e6a26d0a 100644 --- a/docs/reference/api/builds.md +++ b/docs/reference/api/builds.md @@ -11,7 +11,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/workspace/{workspacenam -H 'Coder-Session-Token: API_KEY' ``` -`GET /users/{user}/workspace/{workspacename}/builds/{buildnumber}` +`GET /api/v2/users/{user}/workspace/{workspacename}/builds/{buildnumber}` ### Parameters @@ -256,7 +256,7 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild} \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /workspacebuilds/{workspacebuild}` +`GET /api/v2/workspacebuilds/{workspacebuild}` ### Parameters @@ -499,7 +499,7 @@ curl -X PATCH http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/c -H 'Coder-Session-Token: API_KEY' ``` -`PATCH /workspacebuilds/{workspacebuild}/cancel` +`PATCH /api/v2/workspacebuilds/{workspacebuild}/cancel` ### Parameters @@ -550,7 +550,7 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/log -H 'Coder-Session-Token: API_KEY' ``` -`GET /workspacebuilds/{workspacebuild}/logs` +`GET /api/v2/workspacebuilds/{workspacebuild}/logs` ### Parameters @@ -625,7 +625,7 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/par -H 'Coder-Session-Token: API_KEY' ``` -`GET /workspacebuilds/{workspacebuild}/parameters` +`GET /api/v2/workspacebuilds/{workspacebuild}/parameters` ### Parameters @@ -675,7 +675,7 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/res -H 'Coder-Session-Token: API_KEY' ``` -`GET /workspacebuilds/{workspacebuild}/resources` +`GET /api/v2/workspacebuilds/{workspacebuild}/resources` ### Parameters @@ -971,7 +971,7 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/sta -H 'Coder-Session-Token: API_KEY' ``` -`GET /workspacebuilds/{workspacebuild}/state` +`GET /api/v2/workspacebuilds/{workspacebuild}/state` ### Parameters @@ -1214,7 +1214,7 @@ curl -X PUT http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/sta -H 'Coder-Session-Token: API_KEY' ``` -`PUT /workspacebuilds/{workspacebuild}/state` +`PUT /api/v2/workspacebuilds/{workspacebuild}/state` > Body parameter @@ -1252,7 +1252,7 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/tim -H 'Coder-Session-Token: API_KEY' ``` -`GET /workspacebuilds/{workspacebuild}/timings` +`GET /api/v2/workspacebuilds/{workspacebuild}/timings` ### Parameters @@ -1320,7 +1320,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace}/builds \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /workspaces/{workspace}/builds` +`GET /api/v2/workspaces/{workspace}/builds` ### Parameters @@ -1759,7 +1759,7 @@ curl -X POST http://coder-server:8080/api/v2/workspaces/{workspace}/builds \ -H 'Coder-Session-Token: API_KEY' ``` -`POST /workspaces/{workspace}/builds` +`POST /api/v2/workspaces/{workspace}/builds` > Body parameter diff --git a/docs/reference/api/debug.md b/docs/reference/api/debug.md index 93fd3e7b63..67e8f6e440 100644 --- a/docs/reference/api/debug.md +++ b/docs/reference/api/debug.md @@ -10,7 +10,7 @@ curl -X GET http://coder-server:8080/api/v2/debug/coordinator \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /debug/coordinator` +`GET /api/v2/debug/coordinator` ### Responses @@ -31,7 +31,7 @@ curl -X GET http://coder-server:8080/api/v2/debug/health \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /debug/health` +`GET /api/v2/debug/health` ### Parameters @@ -434,7 +434,7 @@ curl -X GET http://coder-server:8080/api/v2/debug/health/settings \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /debug/health/settings` +`GET /api/v2/debug/health/settings` ### Example responses @@ -468,7 +468,7 @@ curl -X PUT http://coder-server:8080/api/v2/debug/health/settings \ -H 'Coder-Session-Token: API_KEY' ``` -`PUT /debug/health/settings` +`PUT /api/v2/debug/health/settings` > Body parameter @@ -516,7 +516,7 @@ curl -X GET http://coder-server:8080/api/v2/debug/tailnet \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /debug/tailnet` +`GET /api/v2/debug/tailnet` ### Responses diff --git a/docs/reference/api/enterprise.md b/docs/reference/api/enterprise.md index 439de03cd3..965241cd85 100644 --- a/docs/reference/api/enterprise.md +++ b/docs/reference/api/enterprise.md @@ -6,7 +6,7 @@ ```shell # Example request using curl -curl -X GET http://coder-server:8080/api/v2/.well-known/oauth-authorization-server \ +curl -X GET http://coder-server:8080/.well-known/oauth-authorization-server \ -H 'Accept: application/json' ``` @@ -53,7 +53,7 @@ curl -X GET http://coder-server:8080/api/v2/.well-known/oauth-authorization-serv ```shell # Example request using curl -curl -X GET http://coder-server:8080/api/v2/.well-known/oauth-protected-resource \ +curl -X GET http://coder-server:8080/.well-known/oauth-protected-resource \ -H 'Accept: application/json' ``` @@ -95,7 +95,7 @@ curl -X GET http://coder-server:8080/api/v2/appearance \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /appearance` +`GET /api/v2/appearance` ### Example responses @@ -149,7 +149,7 @@ curl -X PUT http://coder-server:8080/api/v2/appearance \ -H 'Coder-Session-Token: API_KEY' ``` -`PUT /appearance` +`PUT /api/v2/appearance` > Body parameter @@ -220,7 +220,7 @@ curl -X GET http://coder-server:8080/api/v2/connectionlog?limit=0 \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /connectionlog` +`GET /api/v2/connectionlog` ### Parameters @@ -315,7 +315,7 @@ curl -X GET http://coder-server:8080/api/v2/entitlements \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /entitlements` +`GET /api/v2/entitlements` ### Example responses @@ -379,7 +379,7 @@ curl -X GET http://coder-server:8080/api/v2/groups?organization=string&has_membe -H 'Coder-Session-Token: API_KEY' ``` -`GET /groups` +`GET /api/v2/groups` ### Parameters @@ -484,7 +484,7 @@ curl -X GET http://coder-server:8080/api/v2/groups/{group} \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /groups/{group}` +`GET /api/v2/groups/{group}` ### Parameters @@ -547,7 +547,7 @@ curl -X DELETE http://coder-server:8080/api/v2/groups/{group} \ -H 'Coder-Session-Token: API_KEY' ``` -`DELETE /groups/{group}` +`DELETE /api/v2/groups/{group}` ### Parameters @@ -610,7 +610,7 @@ curl -X PATCH http://coder-server:8080/api/v2/groups/{group} \ -H 'Coder-Session-Token: API_KEY' ``` -`PATCH /groups/{group}` +`PATCH /api/v2/groups/{group}` > Body parameter @@ -690,7 +690,7 @@ curl -X GET http://coder-server:8080/api/v2/groups/{group}/members \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /groups/{group}/members` +`GET /api/v2/groups/{group}/members` ### Parameters @@ -747,7 +747,7 @@ curl -X GET http://coder-server:8080/api/v2/licenses \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /licenses` +`GET /api/v2/licenses` ### Example responses @@ -796,7 +796,7 @@ curl -X POST http://coder-server:8080/api/v2/licenses \ -H 'Coder-Session-Token: API_KEY' ``` -`POST /licenses` +`POST /api/v2/licenses` > Body parameter @@ -844,7 +844,7 @@ curl -X POST http://coder-server:8080/api/v2/licenses/refresh-entitlements \ -H 'Coder-Session-Token: API_KEY' ``` -`POST /licenses/refresh-entitlements` +`POST /api/v2/licenses/refresh-entitlements` ### Example responses @@ -881,7 +881,7 @@ curl -X DELETE http://coder-server:8080/api/v2/licenses/{id} \ -H 'Coder-Session-Token: API_KEY' ``` -`DELETE /licenses/{id}` +`DELETE /api/v2/licenses/{id}` ### Parameters @@ -907,7 +907,7 @@ curl -X PUT http://coder-server:8080/api/v2/notifications/templates/{notificatio -H 'Coder-Session-Token: API_KEY' ``` -`PUT /notifications/templates/{notification_template}/method` +`PUT /api/v2/notifications/templates/{notification_template}/method` ### Parameters @@ -935,7 +935,7 @@ curl -X GET http://coder-server:8080/api/v2/oauth2-provider/apps \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /oauth2-provider/apps` +`GET /api/v2/oauth2-provider/apps` ### Parameters @@ -1001,7 +1001,7 @@ curl -X POST http://coder-server:8080/api/v2/oauth2-provider/apps \ -H 'Coder-Session-Token: API_KEY' ``` -`POST /oauth2-provider/apps` +`POST /api/v2/oauth2-provider/apps` > Body parameter @@ -1057,7 +1057,7 @@ curl -X GET http://coder-server:8080/api/v2/oauth2-provider/apps/{app} \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /oauth2-provider/apps/{app}` +`GET /api/v2/oauth2-provider/apps/{app}` ### Parameters @@ -1104,7 +1104,7 @@ curl -X PUT http://coder-server:8080/api/v2/oauth2-provider/apps/{app} \ -H 'Coder-Session-Token: API_KEY' ``` -`PUT /oauth2-provider/apps/{app}` +`PUT /api/v2/oauth2-provider/apps/{app}` > Body parameter @@ -1160,7 +1160,7 @@ curl -X DELETE http://coder-server:8080/api/v2/oauth2-provider/apps/{app} \ -H 'Coder-Session-Token: API_KEY' ``` -`DELETE /oauth2-provider/apps/{app}` +`DELETE /api/v2/oauth2-provider/apps/{app}` ### Parameters @@ -1187,7 +1187,7 @@ curl -X GET http://coder-server:8080/api/v2/oauth2-provider/apps/{app}/secrets \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /oauth2-provider/apps/{app}/secrets` +`GET /api/v2/oauth2-provider/apps/{app}/secrets` ### Parameters @@ -1239,7 +1239,7 @@ curl -X POST http://coder-server:8080/api/v2/oauth2-provider/apps/{app}/secrets -H 'Coder-Session-Token: API_KEY' ``` -`POST /oauth2-provider/apps/{app}/secrets` +`POST /api/v2/oauth2-provider/apps/{app}/secrets` ### Parameters @@ -1288,7 +1288,7 @@ curl -X DELETE http://coder-server:8080/api/v2/oauth2-provider/apps/{app}/secret -H 'Coder-Session-Token: API_KEY' ``` -`DELETE /oauth2-provider/apps/{app}/secrets/{secretID}` +`DELETE /api/v2/oauth2-provider/apps/{app}/secrets/{secretID}` ### Parameters @@ -1305,473 +1305,6 @@ curl -X DELETE http://coder-server:8080/api/v2/oauth2-provider/apps/{app}/secret To perform this operation, you must be authenticated. [Learn more](authentication.md). -## OAuth2 authorization request (GET - show authorization page) - -### Code samples - -```shell -# Example request using curl -curl -X GET http://coder-server:8080/api/v2/oauth2/authorize?client_id=string&state=string&response_type=code \ - -H 'Coder-Session-Token: API_KEY' -``` - -`GET /oauth2/authorize` - -### Parameters - -| Name | In | Type | Required | Description | -|-----------------|-------|--------|----------|-----------------------------------| -| `client_id` | query | string | true | Client ID | -| `state` | query | string | true | A random unguessable string | -| `response_type` | query | string | true | Response type | -| `redirect_uri` | query | string | false | Redirect here after authorization | -| `scope` | query | string | false | Token scopes (currently ignored) | - -#### Enumerated Values - -| Parameter | Value(s) | -|-----------------|-----------------| -| `response_type` | `code`, `token` | - -### Responses - -| Status | Meaning | Description | Schema | -|--------|---------------------------------------------------------|---------------------------------|--------| -| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | Returns HTML authorization page | | - -To perform this operation, you must be authenticated. [Learn more](authentication.md). - -## OAuth2 authorization request (POST - process authorization) - -### Code samples - -```shell -# Example request using curl -curl -X POST http://coder-server:8080/api/v2/oauth2/authorize?client_id=string&state=string&response_type=code \ - -H 'Coder-Session-Token: API_KEY' -``` - -`POST /oauth2/authorize` - -### Parameters - -| Name | In | Type | Required | Description | -|-----------------|-------|--------|----------|-----------------------------------| -| `client_id` | query | string | true | Client ID | -| `state` | query | string | true | A random unguessable string | -| `response_type` | query | string | true | Response type | -| `redirect_uri` | query | string | false | Redirect here after authorization | -| `scope` | query | string | false | Token scopes (currently ignored) | - -#### Enumerated Values - -| Parameter | Value(s) | -|-----------------|-----------------| -| `response_type` | `code`, `token` | - -### Responses - -| Status | Meaning | Description | Schema | -|--------|------------------------------------------------------------|------------------------------------------|--------| -| 302 | [Found](https://tools.ietf.org/html/rfc7231#section-6.4.3) | Returns redirect with authorization code | | - -To perform this operation, you must be authenticated. [Learn more](authentication.md). - -## Get OAuth2 client configuration (RFC 7592) - -### Code samples - -```shell -# Example request using curl -curl -X GET http://coder-server:8080/api/v2/oauth2/clients/{client_id} \ - -H 'Accept: application/json' -``` - -`GET /oauth2/clients/{client_id}` - -### Parameters - -| Name | In | Type | Required | Description | -|-------------|------|--------|----------|-------------| -| `client_id` | path | string | true | Client ID | - -### Example responses - -> 200 Response - -```json -{ - "client_id": "string", - "client_id_issued_at": 0, - "client_name": "string", - "client_secret_expires_at": 0, - "client_uri": "string", - "contacts": [ - "string" - ], - "grant_types": [ - "authorization_code" - ], - "jwks": {}, - "jwks_uri": "string", - "logo_uri": "string", - "policy_uri": "string", - "redirect_uris": [ - "string" - ], - "registration_access_token": "string", - "registration_client_uri": "string", - "response_types": [ - "code" - ], - "scope": "string", - "software_id": "string", - "software_version": "string", - "token_endpoint_auth_method": "client_secret_basic", - "tos_uri": "string" -} -``` - -### Responses - -| Status | Meaning | Description | Schema | -|--------|---------------------------------------------------------|-------------|------------------------------------------------------------------------------------| -| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.OAuth2ClientConfiguration](schemas.md#codersdkoauth2clientconfiguration) | - -## Update OAuth2 client configuration (RFC 7592) - -### Code samples - -```shell -# Example request using curl -curl -X PUT http://coder-server:8080/api/v2/oauth2/clients/{client_id} \ - -H 'Content-Type: application/json' \ - -H 'Accept: application/json' -``` - -`PUT /oauth2/clients/{client_id}` - -> Body parameter - -```json -{ - "client_name": "string", - "client_uri": "string", - "contacts": [ - "string" - ], - "grant_types": [ - "authorization_code" - ], - "jwks": {}, - "jwks_uri": "string", - "logo_uri": "string", - "policy_uri": "string", - "redirect_uris": [ - "string" - ], - "response_types": [ - "code" - ], - "scope": "string", - "software_id": "string", - "software_statement": "string", - "software_version": "string", - "token_endpoint_auth_method": "client_secret_basic", - "tos_uri": "string" -} -``` - -### Parameters - -| Name | In | Type | Required | Description | -|-------------|------|------------------------------------------------------------------------------------------------|----------|-----------------------| -| `client_id` | path | string | true | Client ID | -| `body` | body | [codersdk.OAuth2ClientRegistrationRequest](schemas.md#codersdkoauth2clientregistrationrequest) | true | Client update request | - -### Example responses - -> 200 Response - -```json -{ - "client_id": "string", - "client_id_issued_at": 0, - "client_name": "string", - "client_secret_expires_at": 0, - "client_uri": "string", - "contacts": [ - "string" - ], - "grant_types": [ - "authorization_code" - ], - "jwks": {}, - "jwks_uri": "string", - "logo_uri": "string", - "policy_uri": "string", - "redirect_uris": [ - "string" - ], - "registration_access_token": "string", - "registration_client_uri": "string", - "response_types": [ - "code" - ], - "scope": "string", - "software_id": "string", - "software_version": "string", - "token_endpoint_auth_method": "client_secret_basic", - "tos_uri": "string" -} -``` - -### Responses - -| Status | Meaning | Description | Schema | -|--------|---------------------------------------------------------|-------------|------------------------------------------------------------------------------------| -| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.OAuth2ClientConfiguration](schemas.md#codersdkoauth2clientconfiguration) | - -## Delete OAuth2 client registration (RFC 7592) - -### Code samples - -```shell -# Example request using curl -curl -X DELETE http://coder-server:8080/api/v2/oauth2/clients/{client_id} - -``` - -`DELETE /oauth2/clients/{client_id}` - -### Parameters - -| Name | In | Type | Required | Description | -|-------------|------|--------|----------|-------------| -| `client_id` | path | string | true | Client ID | - -### Responses - -| Status | Meaning | Description | Schema | -|--------|-----------------------------------------------------------------|-------------|--------| -| 204 | [No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5) | No Content | | - -## OAuth2 dynamic client registration (RFC 7591) - -### Code samples - -```shell -# Example request using curl -curl -X POST http://coder-server:8080/api/v2/oauth2/register \ - -H 'Content-Type: application/json' \ - -H 'Accept: application/json' -``` - -`POST /oauth2/register` - -> Body parameter - -```json -{ - "client_name": "string", - "client_uri": "string", - "contacts": [ - "string" - ], - "grant_types": [ - "authorization_code" - ], - "jwks": {}, - "jwks_uri": "string", - "logo_uri": "string", - "policy_uri": "string", - "redirect_uris": [ - "string" - ], - "response_types": [ - "code" - ], - "scope": "string", - "software_id": "string", - "software_statement": "string", - "software_version": "string", - "token_endpoint_auth_method": "client_secret_basic", - "tos_uri": "string" -} -``` - -### Parameters - -| Name | In | Type | Required | Description | -|--------|------|------------------------------------------------------------------------------------------------|----------|-----------------------------| -| `body` | body | [codersdk.OAuth2ClientRegistrationRequest](schemas.md#codersdkoauth2clientregistrationrequest) | true | Client registration request | - -### Example responses - -> 201 Response - -```json -{ - "client_id": "string", - "client_id_issued_at": 0, - "client_name": "string", - "client_secret": "string", - "client_secret_expires_at": 0, - "client_uri": "string", - "contacts": [ - "string" - ], - "grant_types": [ - "authorization_code" - ], - "jwks": {}, - "jwks_uri": "string", - "logo_uri": "string", - "policy_uri": "string", - "redirect_uris": [ - "string" - ], - "registration_access_token": "string", - "registration_client_uri": "string", - "response_types": [ - "code" - ], - "scope": "string", - "software_id": "string", - "software_version": "string", - "token_endpoint_auth_method": "client_secret_basic", - "tos_uri": "string" -} -``` - -### Responses - -| Status | Meaning | Description | Schema | -|--------|--------------------------------------------------------------|-------------|--------------------------------------------------------------------------------------------------| -| 201 | [Created](https://tools.ietf.org/html/rfc7231#section-6.3.2) | Created | [codersdk.OAuth2ClientRegistrationResponse](schemas.md#codersdkoauth2clientregistrationresponse) | - -## Revoke OAuth2 tokens (RFC 7009) - -### Code samples - -```shell -# Example request using curl -curl -X POST http://coder-server:8080/api/v2/oauth2/revoke \ - -``` - -`POST /oauth2/revoke` - -> Body parameter - -```yaml -client_id: string -token: string -token_type_hint: string - -``` - -### Parameters - -| Name | In | Type | Required | Description | -|---------------------|------|--------|----------|-------------------------------------------------------| -| `body` | body | object | true | | -| `» client_id` | body | string | true | Client ID for authentication | -| `» token` | body | string | true | The token to revoke | -| `» token_type_hint` | body | string | false | Hint about token type (access_token or refresh_token) | - -### Responses - -| Status | Meaning | Description | Schema | -|--------|---------------------------------------------------------|----------------------------|--------| -| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | Token successfully revoked | | - -## OAuth2 token exchange - -### Code samples - -```shell -# Example request using curl -curl -X POST http://coder-server:8080/api/v2/oauth2/tokens \ - -H 'Accept: application/json' -``` - -`POST /oauth2/tokens` - -> Body parameter - -```yaml -client_id: string -client_secret: string -code: string -refresh_token: string -grant_type: authorization_code - -``` - -### Parameters - -| Name | In | Type | Required | Description | -|-------------------|------|--------|----------|---------------------------------------------------------------| -| `body` | body | object | false | | -| `» client_id` | body | string | false | Client ID, required if grant_type=authorization_code | -| `» client_secret` | body | string | false | Client secret, required if grant_type=authorization_code | -| `» code` | body | string | false | Authorization code, required if grant_type=authorization_code | -| `» refresh_token` | body | string | false | Refresh token, required if grant_type=refresh_token | -| `» grant_type` | body | string | true | Grant type | - -#### Enumerated Values - -| Parameter | Value(s) | -|----------------|-------------------------------------------------------------------------------------| -| `» grant_type` | `authorization_code`, `client_credentials`, `implicit`, `password`, `refresh_token` | - -### Example responses - -> 200 Response - -```json -{ - "access_token": "string", - "expires_in": 0, - "expiry": "string", - "refresh_token": "string", - "token_type": "string" -} -``` - -### Responses - -| Status | Meaning | Description | Schema | -|--------|---------------------------------------------------------|-------------|----------------------------------------| -| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [oauth2.Token](schemas.md#oauth2token) | - -## Delete OAuth2 application tokens - -### Code samples - -```shell -# Example request using curl -curl -X DELETE http://coder-server:8080/api/v2/oauth2/tokens?client_id=string \ - -H 'Coder-Session-Token: API_KEY' -``` - -`DELETE /oauth2/tokens` - -### Parameters - -| Name | In | Type | Required | Description | -|-------------|-------|--------|----------|-------------| -| `client_id` | query | string | true | Client ID | - -### Responses - -| Status | Meaning | Description | Schema | -|--------|-----------------------------------------------------------------|-------------|--------| -| 204 | [No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5) | No Content | | - -To perform this operation, you must be authenticated. [Learn more](authentication.md). - ## Get groups by organization ### Code samples @@ -1783,7 +1316,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/groups -H 'Coder-Session-Token: API_KEY' ``` -`GET /organizations/{organization}/groups` +`GET /api/v2/organizations/{organization}/groups` ### Parameters @@ -1887,7 +1420,7 @@ curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/groups -H 'Coder-Session-Token: API_KEY' ``` -`POST /organizations/{organization}/groups` +`POST /api/v2/organizations/{organization}/groups` > Body parameter @@ -1961,7 +1494,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/groups/ -H 'Coder-Session-Token: API_KEY' ``` -`GET /organizations/{organization}/groups/{groupName}` +`GET /api/v2/organizations/{organization}/groups/{groupName}` ### Parameters @@ -2024,7 +1557,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/groups/ -H 'Coder-Session-Token: API_KEY' ``` -`GET /organizations/{organization}/groups/{groupName}/members` +`GET /api/v2/organizations/{organization}/groups/{groupName}/members` ### Parameters @@ -2082,7 +1615,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/members -H 'Coder-Session-Token: API_KEY' ``` -`GET /organizations/{organization}/members/{user}/workspace-quota` +`GET /api/v2/organizations/{organization}/members/{user}/workspace-quota` ### Parameters @@ -2120,7 +1653,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/provisi -H 'Coder-Session-Token: API_KEY' ``` -`GET /organizations/{organization}/provisionerdaemons/serve` +`GET /api/v2/organizations/{organization}/provisionerdaemons/serve` ### Parameters @@ -2147,7 +1680,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/provisi -H 'Coder-Session-Token: API_KEY' ``` -`GET /organizations/{organization}/provisionerkeys` +`GET /api/v2/organizations/{organization}/provisionerkeys` ### Parameters @@ -2207,7 +1740,7 @@ curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/provis -H 'Coder-Session-Token: API_KEY' ``` -`POST /organizations/{organization}/provisionerkeys` +`POST /api/v2/organizations/{organization}/provisionerkeys` ### Parameters @@ -2244,7 +1777,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/provisi -H 'Coder-Session-Token: API_KEY' ``` -`GET /organizations/{organization}/provisionerkeys/daemons` +`GET /api/v2/organizations/{organization}/provisionerkeys/daemons` ### Parameters @@ -2368,7 +1901,7 @@ curl -X DELETE http://coder-server:8080/api/v2/organizations/{organization}/prov -H 'Coder-Session-Token: API_KEY' ``` -`DELETE /organizations/{organization}/provisionerkeys/{provisionerkey}` +`DELETE /api/v2/organizations/{organization}/provisionerkeys/{provisionerkey}` ### Parameters @@ -2396,7 +1929,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/setting -H 'Coder-Session-Token: API_KEY' ``` -`GET /organizations/{organization}/settings/idpsync/available-fields` +`GET /api/v2/organizations/{organization}/settings/idpsync/available-fields` ### Parameters @@ -2435,7 +1968,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/setting -H 'Coder-Session-Token: API_KEY' ``` -`GET /organizations/{organization}/settings/idpsync/field-values` +`GET /api/v2/organizations/{organization}/settings/idpsync/field-values` ### Parameters @@ -2475,7 +2008,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/setting -H 'Coder-Session-Token: API_KEY' ``` -`GET /organizations/{organization}/settings/idpsync/groups` +`GET /api/v2/organizations/{organization}/settings/idpsync/groups` ### Parameters @@ -2527,7 +2060,7 @@ curl -X PATCH http://coder-server:8080/api/v2/organizations/{organization}/setti -H 'Coder-Session-Token: API_KEY' ``` -`PATCH /organizations/{organization}/settings/idpsync/groups` +`PATCH /api/v2/organizations/{organization}/settings/idpsync/groups` > Body parameter @@ -2602,7 +2135,7 @@ curl -X PATCH http://coder-server:8080/api/v2/organizations/{organization}/setti -H 'Coder-Session-Token: API_KEY' ``` -`PATCH /organizations/{organization}/settings/idpsync/groups/config` +`PATCH /api/v2/organizations/{organization}/settings/idpsync/groups/config` > Body parameter @@ -2665,7 +2198,7 @@ curl -X PATCH http://coder-server:8080/api/v2/organizations/{organization}/setti -H 'Coder-Session-Token: API_KEY' ``` -`PATCH /organizations/{organization}/settings/idpsync/groups/mapping` +`PATCH /api/v2/organizations/{organization}/settings/idpsync/groups/mapping` > Body parameter @@ -2736,7 +2269,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/setting -H 'Coder-Session-Token: API_KEY' ``` -`GET /organizations/{organization}/settings/idpsync/roles` +`GET /api/v2/organizations/{organization}/settings/idpsync/roles` ### Parameters @@ -2782,7 +2315,7 @@ curl -X PATCH http://coder-server:8080/api/v2/organizations/{organization}/setti -H 'Coder-Session-Token: API_KEY' ``` -`PATCH /organizations/{organization}/settings/idpsync/roles` +`PATCH /api/v2/organizations/{organization}/settings/idpsync/roles` > Body parameter @@ -2845,7 +2378,7 @@ curl -X PATCH http://coder-server:8080/api/v2/organizations/{organization}/setti -H 'Coder-Session-Token: API_KEY' ``` -`PATCH /organizations/{organization}/settings/idpsync/roles/config` +`PATCH /api/v2/organizations/{organization}/settings/idpsync/roles/config` > Body parameter @@ -2900,7 +2433,7 @@ curl -X PATCH http://coder-server:8080/api/v2/organizations/{organization}/setti -H 'Coder-Session-Token: API_KEY' ``` -`PATCH /organizations/{organization}/settings/idpsync/roles/mapping` +`PATCH /api/v2/organizations/{organization}/settings/idpsync/roles/mapping` > Body parameter @@ -2965,7 +2498,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/setting -H 'Coder-Session-Token: API_KEY' ``` -`GET /organizations/{organization}/settings/workspace-sharing` +`GET /api/v2/organizations/{organization}/settings/workspace-sharing` ### Parameters @@ -3005,7 +2538,7 @@ curl -X PATCH http://coder-server:8080/api/v2/organizations/{organization}/setti -H 'Coder-Session-Token: API_KEY' ``` -`PATCH /organizations/{organization}/settings/workspace-sharing` +`PATCH /api/v2/organizations/{organization}/settings/workspace-sharing` > Body parameter @@ -3053,7 +2586,7 @@ curl -X GET http://coder-server:8080/api/v2/provisionerkeys/{provisionerkey} \ -H 'Accept: application/json' ``` -`GET /provisionerkeys/{provisionerkey}` +`GET /api/v2/provisionerkeys/{provisionerkey}` ### Parameters @@ -3097,7 +2630,7 @@ curl -X GET http://coder-server:8080/api/v2/replicas \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /replicas` +`GET /api/v2/replicas` ### Example responses @@ -3140,346 +2673,6 @@ Status Code **200** To perform this operation, you must be authenticated. [Learn more](authentication.md). -## SCIM 2.0: Service Provider Config - -### Code samples - -```shell -# Example request using curl -curl -X GET http://coder-server:8080/api/v2/scim/v2/ServiceProviderConfig - -``` - -`GET /scim/v2/ServiceProviderConfig` - -### Responses - -| Status | Meaning | Description | Schema | -|--------|---------------------------------------------------------|-------------|--------| -| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | | - -## SCIM 2.0: Get users - -### Code samples - -```shell -# Example request using curl -curl -X GET http://coder-server:8080/api/v2/scim/v2/Users \ - -H 'Authorizaiton: API_KEY' -``` - -`GET /scim/v2/Users` - -### Responses - -| Status | Meaning | Description | Schema | -|--------|---------------------------------------------------------|-------------|--------| -| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | | - -To perform this operation, you must be authenticated. [Learn more](authentication.md). - -## SCIM 2.0: Create new user - -### Code samples - -```shell -# Example request using curl -curl -X POST http://coder-server:8080/api/v2/scim/v2/Users \ - -H 'Content-Type: application/json' \ - -H 'Accept: application/json' \ - -H 'Authorizaiton: API_KEY' -``` - -`POST /scim/v2/Users` - -> Body parameter - -```json -{ - "active": true, - "emails": [ - { - "display": "string", - "primary": true, - "type": "string", - "value": "user@example.com" - } - ], - "groups": [ - null - ], - "id": "string", - "meta": { - "resourceType": "string" - }, - "name": { - "familyName": "string", - "givenName": "string" - }, - "schemas": [ - "string" - ], - "userName": "string" -} -``` - -### Parameters - -| Name | In | Type | Required | Description | -|--------|------|----------------------------------------------|----------|-------------| -| `body` | body | [coderd.SCIMUser](schemas.md#coderdscimuser) | true | New user | - -### Example responses - -> 200 Response - -```json -{ - "active": true, - "emails": [ - { - "display": "string", - "primary": true, - "type": "string", - "value": "user@example.com" - } - ], - "groups": [ - null - ], - "id": "string", - "meta": { - "resourceType": "string" - }, - "name": { - "familyName": "string", - "givenName": "string" - }, - "schemas": [ - "string" - ], - "userName": "string" -} -``` - -### Responses - -| Status | Meaning | Description | Schema | -|--------|---------------------------------------------------------|-------------|----------------------------------------------| -| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [coderd.SCIMUser](schemas.md#coderdscimuser) | - -To perform this operation, you must be authenticated. [Learn more](authentication.md). - -## SCIM 2.0: Get user by ID - -### Code samples - -```shell -# Example request using curl -curl -X GET http://coder-server:8080/api/v2/scim/v2/Users/{id} \ - -H 'Authorizaiton: API_KEY' -``` - -`GET /scim/v2/Users/{id}` - -### Parameters - -| Name | In | Type | Required | Description | -|------|------|--------------|----------|-------------| -| `id` | path | string(uuid) | true | User ID | - -### Responses - -| Status | Meaning | Description | Schema | -|--------|----------------------------------------------------------------|-------------|--------| -| 404 | [Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4) | Not Found | | - -To perform this operation, you must be authenticated. [Learn more](authentication.md). - -## SCIM 2.0: Replace user account - -### Code samples - -```shell -# Example request using curl -curl -X PUT http://coder-server:8080/api/v2/scim/v2/Users/{id} \ - -H 'Content-Type: application/json' \ - -H 'Accept: application/scim+json' \ - -H 'Authorizaiton: API_KEY' -``` - -`PUT /scim/v2/Users/{id}` - -> Body parameter - -```json -{ - "active": true, - "emails": [ - { - "display": "string", - "primary": true, - "type": "string", - "value": "user@example.com" - } - ], - "groups": [ - null - ], - "id": "string", - "meta": { - "resourceType": "string" - }, - "name": { - "familyName": "string", - "givenName": "string" - }, - "schemas": [ - "string" - ], - "userName": "string" -} -``` - -### Parameters - -| Name | In | Type | Required | Description | -|--------|------|----------------------------------------------|----------|----------------------| -| `id` | path | string(uuid) | true | User ID | -| `body` | body | [coderd.SCIMUser](schemas.md#coderdscimuser) | true | Replace user request | - -### Example responses - -> 200 Response - -```json -{ - "avatar_url": "http://example.com", - "created_at": "2019-08-24T14:15:22Z", - "email": "user@example.com", - "has_ai_seat": true, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "is_service_account": true, - "last_seen_at": "2019-08-24T14:15:22Z", - "login_type": "", - "name": "string", - "organization_ids": [ - "497f6eca-6276-4993-bfeb-53cbbbba6f08" - ], - "roles": [ - { - "display_name": "string", - "name": "string", - "organization_id": "string" - } - ], - "status": "active", - "theme_preference": "string", - "updated_at": "2019-08-24T14:15:22Z", - "username": "string" -} -``` - -### Responses - -| Status | Meaning | Description | Schema | -|--------|---------------------------------------------------------|-------------|------------------------------------------| -| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.User](schemas.md#codersdkuser) | - -To perform this operation, you must be authenticated. [Learn more](authentication.md). - -## SCIM 2.0: Update user account - -### Code samples - -```shell -# Example request using curl -curl -X PATCH http://coder-server:8080/api/v2/scim/v2/Users/{id} \ - -H 'Content-Type: application/json' \ - -H 'Accept: application/scim+json' \ - -H 'Authorizaiton: API_KEY' -``` - -`PATCH /scim/v2/Users/{id}` - -> Body parameter - -```json -{ - "active": true, - "emails": [ - { - "display": "string", - "primary": true, - "type": "string", - "value": "user@example.com" - } - ], - "groups": [ - null - ], - "id": "string", - "meta": { - "resourceType": "string" - }, - "name": { - "familyName": "string", - "givenName": "string" - }, - "schemas": [ - "string" - ], - "userName": "string" -} -``` - -### Parameters - -| Name | In | Type | Required | Description | -|--------|------|----------------------------------------------|----------|---------------------| -| `id` | path | string(uuid) | true | User ID | -| `body` | body | [coderd.SCIMUser](schemas.md#coderdscimuser) | true | Update user request | - -### Example responses - -> 200 Response - -```json -{ - "avatar_url": "http://example.com", - "created_at": "2019-08-24T14:15:22Z", - "email": "user@example.com", - "has_ai_seat": true, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "is_service_account": true, - "last_seen_at": "2019-08-24T14:15:22Z", - "login_type": "", - "name": "string", - "organization_ids": [ - "497f6eca-6276-4993-bfeb-53cbbbba6f08" - ], - "roles": [ - { - "display_name": "string", - "name": "string", - "organization_id": "string" - } - ], - "status": "active", - "theme_preference": "string", - "updated_at": "2019-08-24T14:15:22Z", - "username": "string" -} -``` - -### Responses - -| Status | Meaning | Description | Schema | -|--------|---------------------------------------------------------|-------------|------------------------------------------| -| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.User](schemas.md#codersdkuser) | - -To perform this operation, you must be authenticated. [Learn more](authentication.md). - ## Get the available idp sync claim fields ### Code samples @@ -3491,7 +2684,7 @@ curl -X GET http://coder-server:8080/api/v2/settings/idpsync/available-fields \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /settings/idpsync/available-fields` +`GET /api/v2/settings/idpsync/available-fields` ### Parameters @@ -3530,7 +2723,7 @@ curl -X GET http://coder-server:8080/api/v2/settings/idpsync/field-values?claimF -H 'Coder-Session-Token: API_KEY' ``` -`GET /settings/idpsync/field-values` +`GET /api/v2/settings/idpsync/field-values` ### Parameters @@ -3570,7 +2763,7 @@ curl -X GET http://coder-server:8080/api/v2/settings/idpsync/organization \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /settings/idpsync/organization` +`GET /api/v2/settings/idpsync/organization` ### Example responses @@ -3611,7 +2804,7 @@ curl -X PATCH http://coder-server:8080/api/v2/settings/idpsync/organization \ -H 'Coder-Session-Token: API_KEY' ``` -`PATCH /settings/idpsync/organization` +`PATCH /api/v2/settings/idpsync/organization` > Body parameter @@ -3675,7 +2868,7 @@ curl -X PATCH http://coder-server:8080/api/v2/settings/idpsync/organization/conf -H 'Coder-Session-Token: API_KEY' ``` -`PATCH /settings/idpsync/organization/config` +`PATCH /api/v2/settings/idpsync/organization/config` > Body parameter @@ -3731,7 +2924,7 @@ curl -X PATCH http://coder-server:8080/api/v2/settings/idpsync/organization/mapp -H 'Coder-Session-Token: API_KEY' ``` -`PATCH /settings/idpsync/organization/mapping` +`PATCH /api/v2/settings/idpsync/organization/mapping` > Body parameter @@ -3796,7 +2989,7 @@ curl -X GET http://coder-server:8080/api/v2/templates/{template}/acl \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /templates/{template}/acl` +`GET /api/v2/templates/{template}/acl` ### Parameters @@ -3892,7 +3085,7 @@ curl -X PATCH http://coder-server:8080/api/v2/templates/{template}/acl \ -H 'Coder-Session-Token: API_KEY' ``` -`PATCH /templates/{template}/acl` +`PATCH /api/v2/templates/{template}/acl` > Body parameter @@ -3952,7 +3145,7 @@ curl -X GET http://coder-server:8080/api/v2/templates/{template}/acl/available \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /templates/{template}/acl/available` +`GET /api/v2/templates/{template}/acl/available` ### Parameters @@ -4077,7 +3270,7 @@ curl -X POST http://coder-server:8080/api/v2/templates/{template}/prebuilds/inva -H 'Coder-Session-Token: API_KEY' ``` -`POST /templates/{template}/prebuilds/invalidate` +`POST /api/v2/templates/{template}/prebuilds/invalidate` ### Parameters @@ -4120,7 +3313,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/quiet-hours \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /users/{user}/quiet-hours` +`GET /api/v2/users/{user}/quiet-hours` ### Parameters @@ -4179,7 +3372,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/quiet-hours \ -H 'Coder-Session-Token: API_KEY' ``` -`PUT /users/{user}/quiet-hours` +`PUT /api/v2/users/{user}/quiet-hours` > Body parameter @@ -4246,7 +3439,7 @@ curl -X GET http://coder-server:8080/api/v2/workspace-quota/{user} \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /workspace-quota/{user}` +`GET /api/v2/workspace-quota/{user}` ### Parameters @@ -4284,7 +3477,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceproxies \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /workspaceproxies` +`GET /api/v2/workspaceproxies` ### Example responses @@ -4380,7 +3573,7 @@ curl -X POST http://coder-server:8080/api/v2/workspaceproxies \ -H 'Coder-Session-Token: API_KEY' ``` -`POST /workspaceproxies` +`POST /api/v2/workspaceproxies` > Body parameter @@ -4451,7 +3644,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceproxies/{workspaceproxy} \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /workspaceproxies/{workspaceproxy}` +`GET /api/v2/workspaceproxies/{workspaceproxy}` ### Parameters @@ -4512,7 +3705,7 @@ curl -X DELETE http://coder-server:8080/api/v2/workspaceproxies/{workspaceproxy} -H 'Coder-Session-Token: API_KEY' ``` -`DELETE /workspaceproxies/{workspaceproxy}` +`DELETE /api/v2/workspaceproxies/{workspaceproxy}` ### Parameters @@ -4557,7 +3750,7 @@ curl -X PATCH http://coder-server:8080/api/v2/workspaceproxies/{workspaceproxy} -H 'Coder-Session-Token: API_KEY' ``` -`PATCH /workspaceproxies/{workspaceproxy}` +`PATCH /api/v2/workspaceproxies/{workspaceproxy}` > Body parameter @@ -4631,7 +3824,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace}/external-agen -H 'Coder-Session-Token: API_KEY' ``` -`GET /workspaces/{workspace}/external-agent/{agent}/credentials` +`GET /api/v2/workspaces/{workspace}/external-agent/{agent}/credentials` ### Parameters @@ -4658,3 +3851,810 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace}/external-agen | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.ExternalAgentCredentials](schemas.md#codersdkexternalagentcredentials) | To perform this operation, you must be authenticated. [Learn more](authentication.md). + +## OAuth2 authorization request (GET - show authorization page) + +### Code samples + +```shell +# Example request using curl +curl -X GET http://coder-server:8080/oauth2/authorize?client_id=string&state=string&response_type=code \ + -H 'Coder-Session-Token: API_KEY' +``` + +`GET /oauth2/authorize` + +### Parameters + +| Name | In | Type | Required | Description | +|-----------------|-------|--------|----------|-----------------------------------| +| `client_id` | query | string | true | Client ID | +| `state` | query | string | true | A random unguessable string | +| `response_type` | query | string | true | Response type | +| `redirect_uri` | query | string | false | Redirect here after authorization | +| `scope` | query | string | false | Token scopes (currently ignored) | + +#### Enumerated Values + +| Parameter | Value(s) | +|-----------------|-----------------| +| `response_type` | `code`, `token` | + +### Responses + +| Status | Meaning | Description | Schema | +|--------|---------------------------------------------------------|---------------------------------|--------| +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | Returns HTML authorization page | | + +To perform this operation, you must be authenticated. [Learn more](authentication.md). + +## OAuth2 authorization request (POST - process authorization) + +### Code samples + +```shell +# Example request using curl +curl -X POST http://coder-server:8080/oauth2/authorize?client_id=string&state=string&response_type=code \ + -H 'Coder-Session-Token: API_KEY' +``` + +`POST /oauth2/authorize` + +### Parameters + +| Name | In | Type | Required | Description | +|-----------------|-------|--------|----------|-----------------------------------| +| `client_id` | query | string | true | Client ID | +| `state` | query | string | true | A random unguessable string | +| `response_type` | query | string | true | Response type | +| `redirect_uri` | query | string | false | Redirect here after authorization | +| `scope` | query | string | false | Token scopes (currently ignored) | + +#### Enumerated Values + +| Parameter | Value(s) | +|-----------------|-----------------| +| `response_type` | `code`, `token` | + +### Responses + +| Status | Meaning | Description | Schema | +|--------|------------------------------------------------------------|------------------------------------------|--------| +| 302 | [Found](https://tools.ietf.org/html/rfc7231#section-6.4.3) | Returns redirect with authorization code | | + +To perform this operation, you must be authenticated. [Learn more](authentication.md). + +## Get OAuth2 client configuration (RFC 7592) + +### Code samples + +```shell +# Example request using curl +curl -X GET http://coder-server:8080/oauth2/clients/{client_id} \ + -H 'Accept: application/json' +``` + +`GET /oauth2/clients/{client_id}` + +### Parameters + +| Name | In | Type | Required | Description | +|-------------|------|--------|----------|-------------| +| `client_id` | path | string | true | Client ID | + +### Example responses + +> 200 Response + +```json +{ + "client_id": "string", + "client_id_issued_at": 0, + "client_name": "string", + "client_secret_expires_at": 0, + "client_uri": "string", + "contacts": [ + "string" + ], + "grant_types": [ + "authorization_code" + ], + "jwks": {}, + "jwks_uri": "string", + "logo_uri": "string", + "policy_uri": "string", + "redirect_uris": [ + "string" + ], + "registration_access_token": "string", + "registration_client_uri": "string", + "response_types": [ + "code" + ], + "scope": "string", + "software_id": "string", + "software_version": "string", + "token_endpoint_auth_method": "client_secret_basic", + "tos_uri": "string" +} +``` + +### Responses + +| Status | Meaning | Description | Schema | +|--------|---------------------------------------------------------|-------------|------------------------------------------------------------------------------------| +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.OAuth2ClientConfiguration](schemas.md#codersdkoauth2clientconfiguration) | + +## Update OAuth2 client configuration (RFC 7592) + +### Code samples + +```shell +# Example request using curl +curl -X PUT http://coder-server:8080/oauth2/clients/{client_id} \ + -H 'Content-Type: application/json' \ + -H 'Accept: application/json' +``` + +`PUT /oauth2/clients/{client_id}` + +> Body parameter + +```json +{ + "client_name": "string", + "client_uri": "string", + "contacts": [ + "string" + ], + "grant_types": [ + "authorization_code" + ], + "jwks": {}, + "jwks_uri": "string", + "logo_uri": "string", + "policy_uri": "string", + "redirect_uris": [ + "string" + ], + "response_types": [ + "code" + ], + "scope": "string", + "software_id": "string", + "software_statement": "string", + "software_version": "string", + "token_endpoint_auth_method": "client_secret_basic", + "tos_uri": "string" +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +|-------------|------|------------------------------------------------------------------------------------------------|----------|-----------------------| +| `client_id` | path | string | true | Client ID | +| `body` | body | [codersdk.OAuth2ClientRegistrationRequest](schemas.md#codersdkoauth2clientregistrationrequest) | true | Client update request | + +### Example responses + +> 200 Response + +```json +{ + "client_id": "string", + "client_id_issued_at": 0, + "client_name": "string", + "client_secret_expires_at": 0, + "client_uri": "string", + "contacts": [ + "string" + ], + "grant_types": [ + "authorization_code" + ], + "jwks": {}, + "jwks_uri": "string", + "logo_uri": "string", + "policy_uri": "string", + "redirect_uris": [ + "string" + ], + "registration_access_token": "string", + "registration_client_uri": "string", + "response_types": [ + "code" + ], + "scope": "string", + "software_id": "string", + "software_version": "string", + "token_endpoint_auth_method": "client_secret_basic", + "tos_uri": "string" +} +``` + +### Responses + +| Status | Meaning | Description | Schema | +|--------|---------------------------------------------------------|-------------|------------------------------------------------------------------------------------| +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.OAuth2ClientConfiguration](schemas.md#codersdkoauth2clientconfiguration) | + +## Delete OAuth2 client registration (RFC 7592) + +### Code samples + +```shell +# Example request using curl +curl -X DELETE http://coder-server:8080/oauth2/clients/{client_id} + +``` + +`DELETE /oauth2/clients/{client_id}` + +### Parameters + +| Name | In | Type | Required | Description | +|-------------|------|--------|----------|-------------| +| `client_id` | path | string | true | Client ID | + +### Responses + +| Status | Meaning | Description | Schema | +|--------|-----------------------------------------------------------------|-------------|--------| +| 204 | [No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5) | No Content | | + +## OAuth2 dynamic client registration (RFC 7591) + +### Code samples + +```shell +# Example request using curl +curl -X POST http://coder-server:8080/oauth2/register \ + -H 'Content-Type: application/json' \ + -H 'Accept: application/json' +``` + +`POST /oauth2/register` + +> Body parameter + +```json +{ + "client_name": "string", + "client_uri": "string", + "contacts": [ + "string" + ], + "grant_types": [ + "authorization_code" + ], + "jwks": {}, + "jwks_uri": "string", + "logo_uri": "string", + "policy_uri": "string", + "redirect_uris": [ + "string" + ], + "response_types": [ + "code" + ], + "scope": "string", + "software_id": "string", + "software_statement": "string", + "software_version": "string", + "token_endpoint_auth_method": "client_secret_basic", + "tos_uri": "string" +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +|--------|------|------------------------------------------------------------------------------------------------|----------|-----------------------------| +| `body` | body | [codersdk.OAuth2ClientRegistrationRequest](schemas.md#codersdkoauth2clientregistrationrequest) | true | Client registration request | + +### Example responses + +> 201 Response + +```json +{ + "client_id": "string", + "client_id_issued_at": 0, + "client_name": "string", + "client_secret": "string", + "client_secret_expires_at": 0, + "client_uri": "string", + "contacts": [ + "string" + ], + "grant_types": [ + "authorization_code" + ], + "jwks": {}, + "jwks_uri": "string", + "logo_uri": "string", + "policy_uri": "string", + "redirect_uris": [ + "string" + ], + "registration_access_token": "string", + "registration_client_uri": "string", + "response_types": [ + "code" + ], + "scope": "string", + "software_id": "string", + "software_version": "string", + "token_endpoint_auth_method": "client_secret_basic", + "tos_uri": "string" +} +``` + +### Responses + +| Status | Meaning | Description | Schema | +|--------|--------------------------------------------------------------|-------------|--------------------------------------------------------------------------------------------------| +| 201 | [Created](https://tools.ietf.org/html/rfc7231#section-6.3.2) | Created | [codersdk.OAuth2ClientRegistrationResponse](schemas.md#codersdkoauth2clientregistrationresponse) | + +## Revoke OAuth2 tokens (RFC 7009) + +### Code samples + +```shell +# Example request using curl +curl -X POST http://coder-server:8080/oauth2/revoke \ + +``` + +`POST /oauth2/revoke` + +> Body parameter + +```yaml +client_id: string +token: string +token_type_hint: string + +``` + +### Parameters + +| Name | In | Type | Required | Description | +|---------------------|------|--------|----------|-------------------------------------------------------| +| `body` | body | object | true | | +| `» client_id` | body | string | true | Client ID for authentication | +| `» token` | body | string | true | The token to revoke | +| `» token_type_hint` | body | string | false | Hint about token type (access_token or refresh_token) | + +### Responses + +| Status | Meaning | Description | Schema | +|--------|---------------------------------------------------------|----------------------------|--------| +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | Token successfully revoked | | + +## OAuth2 token exchange + +### Code samples + +```shell +# Example request using curl +curl -X POST http://coder-server:8080/oauth2/tokens \ + -H 'Accept: application/json' +``` + +`POST /oauth2/tokens` + +> Body parameter + +```yaml +client_id: string +client_secret: string +code: string +refresh_token: string +grant_type: authorization_code + +``` + +### Parameters + +| Name | In | Type | Required | Description | +|-------------------|------|--------|----------|---------------------------------------------------------------| +| `body` | body | object | false | | +| `» client_id` | body | string | false | Client ID, required if grant_type=authorization_code | +| `» client_secret` | body | string | false | Client secret, required if grant_type=authorization_code | +| `» code` | body | string | false | Authorization code, required if grant_type=authorization_code | +| `» refresh_token` | body | string | false | Refresh token, required if grant_type=refresh_token | +| `» grant_type` | body | string | true | Grant type | + +#### Enumerated Values + +| Parameter | Value(s) | +|----------------|-------------------------------------------------------------------------------------| +| `» grant_type` | `authorization_code`, `client_credentials`, `implicit`, `password`, `refresh_token` | + +### Example responses + +> 200 Response + +```json +{ + "access_token": "string", + "expires_in": 0, + "expiry": "string", + "refresh_token": "string", + "token_type": "string" +} +``` + +### Responses + +| Status | Meaning | Description | Schema | +|--------|---------------------------------------------------------|-------------|----------------------------------------| +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [oauth2.Token](schemas.md#oauth2token) | + +## Delete OAuth2 application tokens + +### Code samples + +```shell +# Example request using curl +curl -X DELETE http://coder-server:8080/oauth2/tokens?client_id=string \ + -H 'Coder-Session-Token: API_KEY' +``` + +`DELETE /oauth2/tokens` + +### Parameters + +| Name | In | Type | Required | Description | +|-------------|-------|--------|----------|-------------| +| `client_id` | query | string | true | Client ID | + +### Responses + +| Status | Meaning | Description | Schema | +|--------|-----------------------------------------------------------------|-------------|--------| +| 204 | [No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5) | No Content | | + +To perform this operation, you must be authenticated. [Learn more](authentication.md). + +## SCIM 2.0: Service Provider Config + +### Code samples + +```shell +# Example request using curl +curl -X GET http://coder-server:8080/scim/v2/ServiceProviderConfig + +``` + +`GET /scim/v2/ServiceProviderConfig` + +### Responses + +| Status | Meaning | Description | Schema | +|--------|---------------------------------------------------------|-------------|--------| +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | | + +## SCIM 2.0: Get users + +### Code samples + +```shell +# Example request using curl +curl -X GET http://coder-server:8080/scim/v2/Users \ + -H 'Authorizaiton: API_KEY' +``` + +`GET /scim/v2/Users` + +### Responses + +| Status | Meaning | Description | Schema | +|--------|---------------------------------------------------------|-------------|--------| +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | | + +To perform this operation, you must be authenticated. [Learn more](authentication.md). + +## SCIM 2.0: Create new user + +### Code samples + +```shell +# Example request using curl +curl -X POST http://coder-server:8080/scim/v2/Users \ + -H 'Content-Type: application/json' \ + -H 'Accept: application/json' \ + -H 'Authorizaiton: API_KEY' +``` + +`POST /scim/v2/Users` + +> Body parameter + +```json +{ + "active": true, + "emails": [ + { + "display": "string", + "primary": true, + "type": "string", + "value": "user@example.com" + } + ], + "groups": [ + null + ], + "id": "string", + "meta": { + "resourceType": "string" + }, + "name": { + "familyName": "string", + "givenName": "string" + }, + "schemas": [ + "string" + ], + "userName": "string" +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +|--------|------|----------------------------------------------|----------|-------------| +| `body` | body | [coderd.SCIMUser](schemas.md#coderdscimuser) | true | New user | + +### Example responses + +> 200 Response + +```json +{ + "active": true, + "emails": [ + { + "display": "string", + "primary": true, + "type": "string", + "value": "user@example.com" + } + ], + "groups": [ + null + ], + "id": "string", + "meta": { + "resourceType": "string" + }, + "name": { + "familyName": "string", + "givenName": "string" + }, + "schemas": [ + "string" + ], + "userName": "string" +} +``` + +### Responses + +| Status | Meaning | Description | Schema | +|--------|---------------------------------------------------------|-------------|----------------------------------------------| +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [coderd.SCIMUser](schemas.md#coderdscimuser) | + +To perform this operation, you must be authenticated. [Learn more](authentication.md). + +## SCIM 2.0: Get user by ID + +### Code samples + +```shell +# Example request using curl +curl -X GET http://coder-server:8080/scim/v2/Users/{id} \ + -H 'Authorizaiton: API_KEY' +``` + +`GET /scim/v2/Users/{id}` + +### Parameters + +| Name | In | Type | Required | Description | +|------|------|--------------|----------|-------------| +| `id` | path | string(uuid) | true | User ID | + +### Responses + +| Status | Meaning | Description | Schema | +|--------|----------------------------------------------------------------|-------------|--------| +| 404 | [Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4) | Not Found | | + +To perform this operation, you must be authenticated. [Learn more](authentication.md). + +## SCIM 2.0: Replace user account + +### Code samples + +```shell +# Example request using curl +curl -X PUT http://coder-server:8080/scim/v2/Users/{id} \ + -H 'Content-Type: application/json' \ + -H 'Accept: application/scim+json' \ + -H 'Authorizaiton: API_KEY' +``` + +`PUT /scim/v2/Users/{id}` + +> Body parameter + +```json +{ + "active": true, + "emails": [ + { + "display": "string", + "primary": true, + "type": "string", + "value": "user@example.com" + } + ], + "groups": [ + null + ], + "id": "string", + "meta": { + "resourceType": "string" + }, + "name": { + "familyName": "string", + "givenName": "string" + }, + "schemas": [ + "string" + ], + "userName": "string" +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +|--------|------|----------------------------------------------|----------|----------------------| +| `id` | path | string(uuid) | true | User ID | +| `body` | body | [coderd.SCIMUser](schemas.md#coderdscimuser) | true | Replace user request | + +### Example responses + +> 200 Response + +```json +{ + "avatar_url": "http://example.com", + "created_at": "2019-08-24T14:15:22Z", + "email": "user@example.com", + "has_ai_seat": true, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "is_service_account": true, + "last_seen_at": "2019-08-24T14:15:22Z", + "login_type": "", + "name": "string", + "organization_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "roles": [ + { + "display_name": "string", + "name": "string", + "organization_id": "string" + } + ], + "status": "active", + "theme_preference": "string", + "updated_at": "2019-08-24T14:15:22Z", + "username": "string" +} +``` + +### Responses + +| Status | Meaning | Description | Schema | +|--------|---------------------------------------------------------|-------------|------------------------------------------| +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.User](schemas.md#codersdkuser) | + +To perform this operation, you must be authenticated. [Learn more](authentication.md). + +## SCIM 2.0: Update user account + +### Code samples + +```shell +# Example request using curl +curl -X PATCH http://coder-server:8080/scim/v2/Users/{id} \ + -H 'Content-Type: application/json' \ + -H 'Accept: application/scim+json' \ + -H 'Authorizaiton: API_KEY' +``` + +`PATCH /scim/v2/Users/{id}` + +> Body parameter + +```json +{ + "active": true, + "emails": [ + { + "display": "string", + "primary": true, + "type": "string", + "value": "user@example.com" + } + ], + "groups": [ + null + ], + "id": "string", + "meta": { + "resourceType": "string" + }, + "name": { + "familyName": "string", + "givenName": "string" + }, + "schemas": [ + "string" + ], + "userName": "string" +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +|--------|------|----------------------------------------------|----------|---------------------| +| `id` | path | string(uuid) | true | User ID | +| `body` | body | [coderd.SCIMUser](schemas.md#coderdscimuser) | true | Update user request | + +### Example responses + +> 200 Response + +```json +{ + "avatar_url": "http://example.com", + "created_at": "2019-08-24T14:15:22Z", + "email": "user@example.com", + "has_ai_seat": true, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "is_service_account": true, + "last_seen_at": "2019-08-24T14:15:22Z", + "login_type": "", + "name": "string", + "organization_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "roles": [ + { + "display_name": "string", + "name": "string", + "organization_id": "string" + } + ], + "status": "active", + "theme_preference": "string", + "updated_at": "2019-08-24T14:15:22Z", + "username": "string" +} +``` + +### Responses + +| Status | Meaning | Description | Schema | +|--------|---------------------------------------------------------|-------------|------------------------------------------| +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.User](schemas.md#codersdkuser) | + +To perform this operation, you must be authenticated. [Learn more](authentication.md). diff --git a/docs/reference/api/files.md b/docs/reference/api/files.md index ac8dc12e7e..251f633f9b 100644 --- a/docs/reference/api/files.md +++ b/docs/reference/api/files.md @@ -12,7 +12,7 @@ curl -X POST http://coder-server:8080/api/v2/files \ -H 'Coder-Session-Token: API_KEY' ``` -`POST /files` +`POST /api/v2/files` > Body parameter @@ -58,7 +58,7 @@ curl -X GET http://coder-server:8080/api/v2/files/{fileID} \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /files/{fileID}` +`GET /api/v2/files/{fileID}` ### Parameters diff --git a/docs/reference/api/general.md b/docs/reference/api/general.md index 857f900c8f..04e919c959 100644 --- a/docs/reference/api/general.md +++ b/docs/reference/api/general.md @@ -10,7 +10,7 @@ curl -X GET http://coder-server:8080/api/v2/ \ -H 'Accept: application/json' ``` -`GET /` +`GET /api/v2/` ### Example responses @@ -45,7 +45,7 @@ curl -X GET http://coder-server:8080/api/v2/buildinfo \ -H 'Accept: application/json' ``` -`GET /buildinfo` +`GET /api/v2/buildinfo` ### Example responses @@ -83,7 +83,7 @@ curl -X POST http://coder-server:8080/api/v2/csp/reports \ -H 'Coder-Session-Token: API_KEY' ``` -`POST /csp/reports` +`POST /api/v2/csp/reports` > Body parameter @@ -118,7 +118,7 @@ curl -X GET http://coder-server:8080/api/v2/deployment/config \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /deployment/config` +`GET /api/v2/deployment/config` ### Example responses @@ -687,7 +687,7 @@ curl -X GET http://coder-server:8080/api/v2/deployment/ssh \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /deployment/ssh` +`GET /api/v2/deployment/ssh` ### Example responses @@ -723,7 +723,7 @@ curl -X GET http://coder-server:8080/api/v2/deployment/stats \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /deployment/stats` +`GET /api/v2/deployment/stats` ### Example responses @@ -775,7 +775,7 @@ curl -X GET http://coder-server:8080/api/v2/experiments \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /experiments` +`GET /api/v2/experiments` ### Example responses @@ -814,7 +814,7 @@ curl -X GET http://coder-server:8080/api/v2/experiments/available \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /experiments/available` +`GET /api/v2/experiments/available` ### Example responses @@ -852,7 +852,7 @@ curl -X GET http://coder-server:8080/api/v2/updatecheck \ -H 'Accept: application/json' ``` -`GET /updatecheck` +`GET /api/v2/updatecheck` ### Example responses @@ -883,7 +883,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/keys/tokens/tokenconfig -H 'Coder-Session-Token: API_KEY' ``` -`GET /users/{user}/keys/tokens/tokenconfig` +`GET /api/v2/users/{user}/keys/tokens/tokenconfig` ### Parameters diff --git a/docs/reference/api/git.md b/docs/reference/api/git.md index 05c572c77e..fb13c8aa25 100644 --- a/docs/reference/api/git.md +++ b/docs/reference/api/git.md @@ -11,7 +11,7 @@ curl -X GET http://coder-server:8080/api/v2/external-auth \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /external-auth` +`GET /api/v2/external-auth` ### Example responses @@ -48,7 +48,7 @@ curl -X GET http://coder-server:8080/api/v2/external-auth/{externalauth} \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /external-auth/{externalauth}` +`GET /api/v2/external-auth/{externalauth}` ### Parameters @@ -110,7 +110,7 @@ curl -X DELETE http://coder-server:8080/api/v2/external-auth/{externalauth} \ -H 'Coder-Session-Token: API_KEY' ``` -`DELETE /external-auth/{externalauth}` +`DELETE /api/v2/external-auth/{externalauth}` ### Parameters @@ -148,7 +148,7 @@ curl -X GET http://coder-server:8080/api/v2/external-auth/{externalauth}/device -H 'Coder-Session-Token: API_KEY' ``` -`GET /external-auth/{externalauth}/device` +`GET /api/v2/external-auth/{externalauth}/device` ### Parameters @@ -188,7 +188,7 @@ curl -X POST http://coder-server:8080/api/v2/external-auth/{externalauth}/device -H 'Coder-Session-Token: API_KEY' ``` -`POST /external-auth/{externalauth}/device` +`POST /api/v2/external-auth/{externalauth}/device` ### Parameters diff --git a/docs/reference/api/initscript.md b/docs/reference/api/initscript.md index ecd8c8008a..80e5056b5d 100644 --- a/docs/reference/api/initscript.md +++ b/docs/reference/api/initscript.md @@ -10,7 +10,7 @@ curl -X GET http://coder-server:8080/api/v2/init-script/{os}/{arch} ``` -`GET /init-script/{os}/{arch}` +`GET /api/v2/init-script/{os}/{arch}` ### Parameters diff --git a/docs/reference/api/insights.md b/docs/reference/api/insights.md index 7e45126fba..c0e3556ba9 100644 --- a/docs/reference/api/insights.md +++ b/docs/reference/api/insights.md @@ -11,7 +11,7 @@ curl -X GET http://coder-server:8080/api/v2/insights/daus?tz_offset=0 \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /insights/daus` +`GET /api/v2/insights/daus` ### Parameters @@ -54,7 +54,7 @@ curl -X GET http://coder-server:8080/api/v2/insights/templates?start_time=2019-0 -H 'Coder-Session-Token: API_KEY' ``` -`GET /insights/templates` +`GET /api/v2/insights/templates` ### Parameters @@ -156,7 +156,7 @@ curl -X GET http://coder-server:8080/api/v2/insights/user-activity?start_time=20 -H 'Coder-Session-Token: API_KEY' ``` -`GET /insights/user-activity` +`GET /api/v2/insights/user-activity` ### Parameters @@ -212,7 +212,7 @@ curl -X GET http://coder-server:8080/api/v2/insights/user-latency?start_time=201 -H 'Coder-Session-Token: API_KEY' ``` -`GET /insights/user-latency` +`GET /api/v2/insights/user-latency` ### Parameters @@ -271,7 +271,7 @@ curl -X GET http://coder-server:8080/api/v2/insights/user-status-counts \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /insights/user-status-counts` +`GET /api/v2/insights/user-status-counts` ### Parameters diff --git a/docs/reference/api/members.md b/docs/reference/api/members.md index 804b143f0f..cd2cc7ea19 100644 --- a/docs/reference/api/members.md +++ b/docs/reference/api/members.md @@ -11,7 +11,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/members -H 'Coder-Session-Token: API_KEY' ``` -`GET /organizations/{organization}/members` +`GET /api/v2/organizations/{organization}/members` ### Parameters @@ -113,7 +113,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/members -H 'Coder-Session-Token: API_KEY' ``` -`GET /organizations/{organization}/members/roles` +`GET /api/v2/organizations/{organization}/members/roles` ### Parameters @@ -212,7 +212,7 @@ curl -X PUT http://coder-server:8080/api/v2/organizations/{organization}/members -H 'Coder-Session-Token: API_KEY' ``` -`PUT /organizations/{organization}/members/roles` +`PUT /api/v2/organizations/{organization}/members/roles` > Body parameter @@ -345,7 +345,7 @@ curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/member -H 'Coder-Session-Token: API_KEY' ``` -`POST /organizations/{organization}/members/roles` +`POST /api/v2/organizations/{organization}/members/roles` > Body parameter @@ -477,7 +477,7 @@ curl -X DELETE http://coder-server:8080/api/v2/organizations/{organization}/memb -H 'Coder-Session-Token: API_KEY' ``` -`DELETE /organizations/{organization}/members/roles/{roleName}` +`DELETE /api/v2/organizations/{organization}/members/roles/{roleName}` ### Parameters @@ -572,7 +572,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/members -H 'Coder-Session-Token: API_KEY' ``` -`GET /organizations/{organization}/members/{user}` +`GET /api/v2/organizations/{organization}/members/{user}` ### Parameters @@ -638,7 +638,7 @@ curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/member -H 'Coder-Session-Token: API_KEY' ``` -`POST /organizations/{organization}/members/{user}` +`POST /api/v2/organizations/{organization}/members/{user}` ### Parameters @@ -685,7 +685,7 @@ curl -X DELETE http://coder-server:8080/api/v2/organizations/{organization}/memb -H 'Coder-Session-Token: API_KEY' ``` -`DELETE /organizations/{organization}/members/{user}` +`DELETE /api/v2/organizations/{organization}/members/{user}` ### Parameters @@ -714,7 +714,7 @@ curl -X PUT http://coder-server:8080/api/v2/organizations/{organization}/members -H 'Coder-Session-Token: API_KEY' ``` -`PUT /organizations/{organization}/members/{user}/roles` +`PUT /api/v2/organizations/{organization}/members/{user}/roles` > Body parameter @@ -773,7 +773,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/paginat -H 'Coder-Session-Token: API_KEY' ``` -`GET /organizations/{organization}/paginated-members` +`GET /api/v2/organizations/{organization}/paginated-members` ### Parameters @@ -886,7 +886,7 @@ curl -X GET http://coder-server:8080/api/v2/users/roles \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /users/roles` +`GET /api/v2/users/roles` ### Example responses diff --git a/docs/reference/api/notifications.md b/docs/reference/api/notifications.md index 21cbc68876..76f32e127b 100644 --- a/docs/reference/api/notifications.md +++ b/docs/reference/api/notifications.md @@ -12,7 +12,7 @@ curl -X POST http://coder-server:8080/api/v2/notifications/custom \ -H 'Coder-Session-Token: API_KEY' ``` -`POST /notifications/custom` +`POST /api/v2/notifications/custom` > Body parameter @@ -70,7 +70,7 @@ curl -X GET http://coder-server:8080/api/v2/notifications/dispatch-methods \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /notifications/dispatch-methods` +`GET /api/v2/notifications/dispatch-methods` ### Example responses @@ -116,7 +116,7 @@ curl -X GET http://coder-server:8080/api/v2/notifications/inbox \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /notifications/inbox` +`GET /api/v2/notifications/inbox` ### Parameters @@ -176,7 +176,7 @@ curl -X PUT http://coder-server:8080/api/v2/notifications/inbox/mark-all-as-read -H 'Coder-Session-Token: API_KEY' ``` -`PUT /notifications/inbox/mark-all-as-read` +`PUT /api/v2/notifications/inbox/mark-all-as-read` ### Responses @@ -197,7 +197,7 @@ curl -X GET http://coder-server:8080/api/v2/notifications/inbox/watch \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /notifications/inbox/watch` +`GET /api/v2/notifications/inbox/watch` ### Parameters @@ -262,7 +262,7 @@ curl -X PUT http://coder-server:8080/api/v2/notifications/inbox/{id}/read-status -H 'Coder-Session-Token: API_KEY' ``` -`PUT /notifications/inbox/{id}/read-status` +`PUT /api/v2/notifications/inbox/{id}/read-status` ### Parameters @@ -306,7 +306,7 @@ curl -X GET http://coder-server:8080/api/v2/notifications/settings \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /notifications/settings` +`GET /api/v2/notifications/settings` ### Example responses @@ -338,7 +338,7 @@ curl -X PUT http://coder-server:8080/api/v2/notifications/settings \ -H 'Coder-Session-Token: API_KEY' ``` -`PUT /notifications/settings` +`PUT /api/v2/notifications/settings` > Body parameter @@ -384,7 +384,7 @@ curl -X GET http://coder-server:8080/api/v2/notifications/templates/custom \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /notifications/templates/custom` +`GET /api/v2/notifications/templates/custom` ### Example responses @@ -443,7 +443,7 @@ curl -X GET http://coder-server:8080/api/v2/notifications/templates/system \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /notifications/templates/system` +`GET /api/v2/notifications/templates/system` ### Example responses @@ -501,7 +501,7 @@ curl -X POST http://coder-server:8080/api/v2/notifications/test \ -H 'Coder-Session-Token: API_KEY' ``` -`POST /notifications/test` +`POST /api/v2/notifications/test` ### Responses @@ -522,7 +522,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/notifications/preferenc -H 'Coder-Session-Token: API_KEY' ``` -`GET /users/{user}/notifications/preferences` +`GET /api/v2/users/{user}/notifications/preferences` ### Parameters @@ -575,7 +575,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/notifications/preferenc -H 'Coder-Session-Token: API_KEY' ``` -`PUT /users/{user}/notifications/preferences` +`PUT /api/v2/users/{user}/notifications/preferences` > Body parameter diff --git a/docs/reference/api/organizations.md b/docs/reference/api/organizations.md index f8f368f900..63a7efcc4e 100644 --- a/docs/reference/api/organizations.md +++ b/docs/reference/api/organizations.md @@ -11,7 +11,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /organizations` +`GET /api/v2/organizations` ### Example responses @@ -68,7 +68,7 @@ curl -X POST http://coder-server:8080/api/v2/organizations \ -H 'Coder-Session-Token: API_KEY' ``` -`POST /organizations` +`POST /api/v2/organizations` > Body parameter @@ -123,7 +123,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization} \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /organizations/{organization}` +`GET /api/v2/organizations/{organization}` ### Parameters @@ -167,7 +167,7 @@ curl -X DELETE http://coder-server:8080/api/v2/organizations/{organization} \ -H 'Coder-Session-Token: API_KEY' ``` -`DELETE /organizations/{organization}` +`DELETE /api/v2/organizations/{organization}` ### Parameters @@ -212,7 +212,7 @@ curl -X PATCH http://coder-server:8080/api/v2/organizations/{organization} \ -H 'Coder-Session-Token: API_KEY' ``` -`PATCH /organizations/{organization}` +`PATCH /api/v2/organizations/{organization}` > Body parameter @@ -268,7 +268,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/provisi -H 'Coder-Session-Token: API_KEY' ``` -`GET /organizations/{organization}/provisionerjobs` +`GET /api/v2/organizations/{organization}/provisionerjobs` ### Parameters @@ -406,7 +406,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/provisi -H 'Coder-Session-Token: API_KEY' ``` -`GET /organizations/{organization}/provisionerjobs/{job}` +`GET /api/v2/organizations/{organization}/provisionerjobs/{job}` ### Parameters diff --git a/docs/reference/api/portsharing.md b/docs/reference/api/portsharing.md index d143e5e2ea..eb7f2efafd 100644 --- a/docs/reference/api/portsharing.md +++ b/docs/reference/api/portsharing.md @@ -11,7 +11,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace}/port-share \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /workspaces/{workspace}/port-share` +`GET /api/v2/workspaces/{workspace}/port-share` ### Parameters @@ -57,7 +57,7 @@ curl -X POST http://coder-server:8080/api/v2/workspaces/{workspace}/port-share \ -H 'Coder-Session-Token: API_KEY' ``` -`POST /workspaces/{workspace}/port-share` +`POST /api/v2/workspaces/{workspace}/port-share` > Body parameter @@ -110,7 +110,7 @@ curl -X DELETE http://coder-server:8080/api/v2/workspaces/{workspace}/port-share -H 'Coder-Session-Token: API_KEY' ``` -`DELETE /workspaces/{workspace}/port-share` +`DELETE /api/v2/workspaces/{workspace}/port-share` > Body parameter diff --git a/docs/reference/api/prebuilds.md b/docs/reference/api/prebuilds.md index 117e06d8c6..362b7c3cad 100644 --- a/docs/reference/api/prebuilds.md +++ b/docs/reference/api/prebuilds.md @@ -11,7 +11,7 @@ curl -X GET http://coder-server:8080/api/v2/prebuilds/settings \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /prebuilds/settings` +`GET /api/v2/prebuilds/settings` ### Example responses @@ -43,7 +43,7 @@ curl -X PUT http://coder-server:8080/api/v2/prebuilds/settings \ -H 'Coder-Session-Token: API_KEY' ``` -`PUT /prebuilds/settings` +`PUT /api/v2/prebuilds/settings` > Body parameter diff --git a/docs/reference/api/provisioning.md b/docs/reference/api/provisioning.md index 9581af2758..7a6a238b60 100644 --- a/docs/reference/api/provisioning.md +++ b/docs/reference/api/provisioning.md @@ -11,7 +11,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/provisi -H 'Coder-Session-Token: API_KEY' ``` -`GET /organizations/{organization}/provisionerdaemons` +`GET /api/v2/organizations/{organization}/provisionerdaemons` ### Parameters diff --git a/docs/reference/api/secrets.md b/docs/reference/api/secrets.md index 1015a60625..cd1ee75e82 100644 --- a/docs/reference/api/secrets.md +++ b/docs/reference/api/secrets.md @@ -11,7 +11,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/secrets \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /users/{user}/secrets` +`GET /api/v2/users/{user}/secrets` ### Parameters @@ -72,7 +72,7 @@ curl -X POST http://coder-server:8080/api/v2/users/{user}/secrets \ -H 'Coder-Session-Token: API_KEY' ``` -`POST /users/{user}/secrets` +`POST /api/v2/users/{user}/secrets` > Body parameter @@ -128,7 +128,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/secrets/{name} \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /users/{user}/secrets/{name}` +`GET /api/v2/users/{user}/secrets/{name}` ### Parameters @@ -171,7 +171,7 @@ curl -X DELETE http://coder-server:8080/api/v2/users/{user}/secrets/{name} \ -H 'Coder-Session-Token: API_KEY' ``` -`DELETE /users/{user}/secrets/{name}` +`DELETE /api/v2/users/{user}/secrets/{name}` ### Parameters @@ -200,7 +200,7 @@ curl -X PATCH http://coder-server:8080/api/v2/users/{user}/secrets/{name} \ -H 'Coder-Session-Token: API_KEY' ``` -`PATCH /users/{user}/secrets/{name}` +`PATCH /api/v2/users/{user}/secrets/{name}` > Body parameter diff --git a/docs/reference/api/tasks.md b/docs/reference/api/tasks.md index f1f112b580..4efe1053cf 100644 --- a/docs/reference/api/tasks.md +++ b/docs/reference/api/tasks.md @@ -11,7 +11,7 @@ curl -X GET http://coder-server:8080/api/v2/tasks \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /tasks` +`GET /api/v2/tasks` ### Parameters @@ -95,7 +95,7 @@ curl -X POST http://coder-server:8080/api/v2/tasks/{user} \ -H 'Coder-Session-Token: API_KEY' ``` -`POST /tasks/{user}` +`POST /api/v2/tasks/{user}` > Body parameter @@ -186,7 +186,7 @@ curl -X GET http://coder-server:8080/api/v2/tasks/{user}/{task} \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /tasks/{user}/{task}` +`GET /api/v2/tasks/{user}/{task}` ### Parameters @@ -264,7 +264,7 @@ curl -X DELETE http://coder-server:8080/api/v2/tasks/{user}/{task} \ -H 'Coder-Session-Token: API_KEY' ``` -`DELETE /tasks/{user}/{task}` +`DELETE /api/v2/tasks/{user}/{task}` ### Parameters @@ -292,7 +292,7 @@ curl -X PATCH http://coder-server:8080/api/v2/tasks/{user}/{task}/input \ -H 'Coder-Session-Token: API_KEY' ``` -`PATCH /tasks/{user}/{task}/input` +`PATCH /api/v2/tasks/{user}/{task}/input` > Body parameter @@ -329,7 +329,7 @@ curl -X GET http://coder-server:8080/api/v2/tasks/{user}/{task}/logs \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /tasks/{user}/{task}/logs` +`GET /api/v2/tasks/{user}/{task}/logs` ### Parameters @@ -376,7 +376,7 @@ curl -X POST http://coder-server:8080/api/v2/tasks/{user}/{task}/pause \ -H 'Coder-Session-Token: API_KEY' ``` -`POST /tasks/{user}/{task}/pause` +`POST /api/v2/tasks/{user}/{task}/pause` ### Parameters @@ -622,7 +622,7 @@ curl -X POST http://coder-server:8080/api/v2/tasks/{user}/{task}/resume \ -H 'Coder-Session-Token: API_KEY' ``` -`POST /tasks/{user}/{task}/resume` +`POST /api/v2/tasks/{user}/{task}/resume` ### Parameters @@ -868,7 +868,7 @@ curl -X POST http://coder-server:8080/api/v2/tasks/{user}/{task}/send \ -H 'Coder-Session-Token: API_KEY' ``` -`POST /tasks/{user}/{task}/send` +`POST /api/v2/tasks/{user}/{task}/send` > Body parameter @@ -905,7 +905,7 @@ curl -X POST http://coder-server:8080/api/v2/workspaceagents/me/tasks/{task}/log -H 'Coder-Session-Token: API_KEY' ``` -`POST /workspaceagents/me/tasks/{task}/log-snapshot` +`POST /api/v2/workspaceagents/me/tasks/{task}/log-snapshot` > Body parameter diff --git a/docs/reference/api/templates.md b/docs/reference/api/templates.md index 1c319bb041..ae9482eb58 100644 --- a/docs/reference/api/templates.md +++ b/docs/reference/api/templates.md @@ -11,7 +11,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/templat -H 'Coder-Session-Token: API_KEY' ``` -`GET /organizations/{organization}/templates` +`GET /api/v2/organizations/{organization}/templates` Returns a list of templates for the specified organization. By default, only non-deprecated templates are returned. @@ -165,7 +165,7 @@ curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/templa -H 'Coder-Session-Token: API_KEY' ``` -`POST /organizations/{organization}/templates` +`POST /api/v2/organizations/{organization}/templates` > Body parameter @@ -291,7 +291,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/templat -H 'Coder-Session-Token: API_KEY' ``` -`GET /organizations/{organization}/templates/examples` +`GET /api/v2/organizations/{organization}/templates/examples` ### Parameters @@ -353,7 +353,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/templat -H 'Coder-Session-Token: API_KEY' ``` -`GET /organizations/{organization}/templates/{templatename}` +`GET /api/v2/organizations/{organization}/templates/{templatename}` ### Parameters @@ -443,7 +443,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/templat -H 'Coder-Session-Token: API_KEY' ``` -`GET /organizations/{organization}/templates/{templatename}/versions/{templateversionname}` +`GET /api/v2/organizations/{organization}/templates/{templatename}/versions/{templateversionname}` ### Parameters @@ -546,7 +546,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/templat -H 'Coder-Session-Token: API_KEY' ``` -`GET /organizations/{organization}/templates/{templatename}/versions/{templateversionname}/previous` +`GET /api/v2/organizations/{organization}/templates/{templatename}/versions/{templateversionname}/previous` ### Parameters @@ -651,7 +651,7 @@ curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/templa -H 'Coder-Session-Token: API_KEY' ``` -`POST /organizations/{organization}/templateversions` +`POST /api/v2/organizations/{organization}/templateversions` > Body parameter @@ -777,7 +777,7 @@ curl -X GET http://coder-server:8080/api/v2/templates \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /templates` +`GET /api/v2/templates` Returns a list of templates. By default, only non-deprecated templates are returned. @@ -924,7 +924,7 @@ curl -X GET http://coder-server:8080/api/v2/templates/examples \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /templates/examples` +`GET /api/v2/templates/examples` ### Example responses @@ -980,7 +980,7 @@ curl -X GET http://coder-server:8080/api/v2/templates/{template} \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /templates/{template}` +`GET /api/v2/templates/{template}` ### Parameters @@ -1069,7 +1069,7 @@ curl -X DELETE http://coder-server:8080/api/v2/templates/{template} \ -H 'Coder-Session-Token: API_KEY' ``` -`DELETE /templates/{template}` +`DELETE /api/v2/templates/{template}` ### Parameters @@ -1114,7 +1114,7 @@ curl -X PATCH http://coder-server:8080/api/v2/templates/{template} \ -H 'Coder-Session-Token: API_KEY' ``` -`PATCH /templates/{template}` +`PATCH /api/v2/templates/{template}` > Body parameter @@ -1243,7 +1243,7 @@ curl -X GET http://coder-server:8080/api/v2/templates/{template}/daus \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /templates/{template}/daus` +`GET /api/v2/templates/{template}/daus` ### Parameters @@ -1286,7 +1286,7 @@ curl -X GET http://coder-server:8080/api/v2/templates/{template}/versions \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /templates/{template}/versions` +`GET /api/v2/templates/{template}/versions` ### Parameters @@ -1465,7 +1465,7 @@ curl -X PATCH http://coder-server:8080/api/v2/templates/{template}/versions \ -H 'Coder-Session-Token: API_KEY' ``` -`PATCH /templates/{template}/versions` +`PATCH /api/v2/templates/{template}/versions` > Body parameter @@ -1519,7 +1519,7 @@ curl -X POST http://coder-server:8080/api/v2/templates/{template}/versions/archi -H 'Coder-Session-Token: API_KEY' ``` -`POST /templates/{template}/versions/archive` +`POST /api/v2/templates/{template}/versions/archive` > Body parameter @@ -1572,7 +1572,7 @@ curl -X GET http://coder-server:8080/api/v2/templates/{template}/versions/{templ -H 'Coder-Session-Token: API_KEY' ``` -`GET /templates/{template}/versions/{templateversionname}` +`GET /api/v2/templates/{template}/versions/{templateversionname}` ### Parameters @@ -1747,7 +1747,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion} \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /templateversions/{templateversion}` +`GET /api/v2/templateversions/{templateversion}` ### Parameters @@ -1849,7 +1849,7 @@ curl -X PATCH http://coder-server:8080/api/v2/templateversions/{templateversion} -H 'Coder-Session-Token: API_KEY' ``` -`PATCH /templateversions/{templateversion}` +`PATCH /api/v2/templateversions/{templateversion}` > Body parameter @@ -1960,7 +1960,7 @@ curl -X POST http://coder-server:8080/api/v2/templateversions/{templateversion}/ -H 'Coder-Session-Token: API_KEY' ``` -`POST /templateversions/{templateversion}/archive` +`POST /api/v2/templateversions/{templateversion}/archive` ### Parameters @@ -2004,7 +2004,7 @@ curl -X PATCH http://coder-server:8080/api/v2/templateversions/{templateversion} -H 'Coder-Session-Token: API_KEY' ``` -`PATCH /templateversions/{templateversion}/cancel` +`PATCH /api/v2/templateversions/{templateversion}/cancel` ### Parameters @@ -2049,7 +2049,7 @@ curl -X POST http://coder-server:8080/api/v2/templateversions/{templateversion}/ -H 'Coder-Session-Token: API_KEY' ``` -`POST /templateversions/{templateversion}/dry-run` +`POST /api/v2/templateversions/{templateversion}/dry-run` > Body parameter @@ -2145,7 +2145,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/d -H 'Coder-Session-Token: API_KEY' ``` -`GET /templateversions/{templateversion}/dry-run/{jobID}` +`GET /api/v2/templateversions/{templateversion}/dry-run/{jobID}` ### Parameters @@ -2221,7 +2221,7 @@ curl -X PATCH http://coder-server:8080/api/v2/templateversions/{templateversion} -H 'Coder-Session-Token: API_KEY' ``` -`PATCH /templateversions/{templateversion}/dry-run/{jobID}/cancel` +`PATCH /api/v2/templateversions/{templateversion}/dry-run/{jobID}/cancel` ### Parameters @@ -2266,7 +2266,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/d -H 'Coder-Session-Token: API_KEY' ``` -`GET /templateversions/{templateversion}/dry-run/{jobID}/logs` +`GET /api/v2/templateversions/{templateversion}/dry-run/{jobID}/logs` ### Parameters @@ -2342,7 +2342,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/d -H 'Coder-Session-Token: API_KEY' ``` -`GET /templateversions/{templateversion}/dry-run/{jobID}/matched-provisioners` +`GET /api/v2/templateversions/{templateversion}/dry-run/{jobID}/matched-provisioners` ### Parameters @@ -2382,7 +2382,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/d -H 'Coder-Session-Token: API_KEY' ``` -`GET /templateversions/{templateversion}/dry-run/{jobID}/resources` +`GET /api/v2/templateversions/{templateversion}/dry-run/{jobID}/resources` ### Parameters @@ -2678,7 +2678,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/d -H 'Coder-Session-Token: API_KEY' ``` -`GET /templateversions/{templateversion}/dynamic-parameters` +`GET /api/v2/templateversions/{templateversion}/dynamic-parameters` ### Parameters @@ -2706,7 +2706,7 @@ curl -X POST http://coder-server:8080/api/v2/templateversions/{templateversion}/ -H 'Coder-Session-Token: API_KEY' ``` -`POST /templateversions/{templateversion}/dynamic-parameters/evaluate` +`POST /api/v2/templateversions/{templateversion}/dynamic-parameters/evaluate` > Body parameter @@ -2833,7 +2833,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/e -H 'Coder-Session-Token: API_KEY' ``` -`GET /templateversions/{templateversion}/external-auth` +`GET /api/v2/templateversions/{templateversion}/external-auth` ### Parameters @@ -2893,7 +2893,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/l -H 'Coder-Session-Token: API_KEY' ``` -`GET /templateversions/{templateversion}/logs` +`GET /api/v2/templateversions/{templateversion}/logs` ### Parameters @@ -2967,7 +2967,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/p -H 'Coder-Session-Token: API_KEY' ``` -`GET /templateversions/{templateversion}/parameters` +`GET /api/v2/templateversions/{templateversion}/parameters` ### Parameters @@ -2994,7 +2994,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/p -H 'Coder-Session-Token: API_KEY' ``` -`GET /templateversions/{templateversion}/presets` +`GET /api/v2/templateversions/{templateversion}/presets` ### Parameters @@ -3061,7 +3061,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/r -H 'Coder-Session-Token: API_KEY' ``` -`GET /templateversions/{templateversion}/resources` +`GET /api/v2/templateversions/{templateversion}/resources` ### Parameters @@ -3357,7 +3357,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/r -H 'Coder-Session-Token: API_KEY' ``` -`GET /templateversions/{templateversion}/rich-parameters` +`GET /api/v2/templateversions/{templateversion}/rich-parameters` ### Parameters @@ -3455,7 +3455,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/s -H 'Coder-Session-Token: API_KEY' ``` -`GET /templateversions/{templateversion}/schema` +`GET /api/v2/templateversions/{templateversion}/schema` ### Parameters @@ -3482,7 +3482,7 @@ curl -X POST http://coder-server:8080/api/v2/templateversions/{templateversion}/ -H 'Coder-Session-Token: API_KEY' ``` -`POST /templateversions/{templateversion}/unarchive` +`POST /api/v2/templateversions/{templateversion}/unarchive` ### Parameters @@ -3526,7 +3526,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/v -H 'Coder-Session-Token: API_KEY' ``` -`GET /templateversions/{templateversion}/variables` +`GET /api/v2/templateversions/{templateversion}/variables` ### Parameters diff --git a/docs/reference/api/users.md b/docs/reference/api/users.md index 8a247da86d..9e62248763 100644 --- a/docs/reference/api/users.md +++ b/docs/reference/api/users.md @@ -11,7 +11,7 @@ curl -X GET http://coder-server:8080/api/v2/users \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /users` +`GET /api/v2/users` ### Parameters @@ -79,7 +79,7 @@ curl -X POST http://coder-server:8080/api/v2/users \ -H 'Coder-Session-Token: API_KEY' ``` -`POST /users` +`POST /api/v2/users` > Body parameter @@ -158,7 +158,7 @@ curl -X GET http://coder-server:8080/api/v2/users/authmethods \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /users/authmethods` +`GET /api/v2/users/authmethods` ### Example responses @@ -201,7 +201,7 @@ curl -X GET http://coder-server:8080/api/v2/users/first \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /users/first` +`GET /api/v2/users/first` ### Example responses @@ -240,7 +240,7 @@ curl -X POST http://coder-server:8080/api/v2/users/first \ -H 'Coder-Session-Token: API_KEY' ``` -`POST /users/first` +`POST /api/v2/users/first` > Body parameter @@ -303,7 +303,7 @@ curl -X POST http://coder-server:8080/api/v2/users/logout \ -H 'Coder-Session-Token: API_KEY' ``` -`POST /users/logout` +`POST /api/v2/users/logout` ### Example responses @@ -340,7 +340,7 @@ curl -X GET http://coder-server:8080/api/v2/users/oauth2/github/callback \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /users/oauth2/github/callback` +`GET /api/v2/users/oauth2/github/callback` ### Responses @@ -361,7 +361,7 @@ curl -X GET http://coder-server:8080/api/v2/users/oauth2/github/device \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /users/oauth2/github/device` +`GET /api/v2/users/oauth2/github/device` ### Example responses @@ -396,7 +396,7 @@ curl -X GET http://coder-server:8080/api/v2/users/oidc-claims \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /users/oidc-claims` +`GET /api/v2/users/oidc-claims` ### Example responses @@ -426,7 +426,7 @@ curl -X GET http://coder-server:8080/api/v2/users/oidc/callback \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /users/oidc/callback` +`GET /api/v2/users/oidc/callback` ### Responses @@ -447,7 +447,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user} \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /users/{user}` +`GET /api/v2/users/{user}` ### Parameters @@ -505,7 +505,7 @@ curl -X DELETE http://coder-server:8080/api/v2/users/{user} \ -H 'Coder-Session-Token: API_KEY' ``` -`DELETE /users/{user}` +`DELETE /api/v2/users/{user}` ### Parameters @@ -532,7 +532,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/appearance \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /users/{user}/appearance` +`GET /api/v2/users/{user}/appearance` ### Parameters @@ -571,7 +571,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/appearance \ -H 'Coder-Session-Token: API_KEY' ``` -`PUT /users/{user}/appearance` +`PUT /api/v2/users/{user}/appearance` > Body parameter @@ -619,7 +619,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/autofill-parameters?tem -H 'Coder-Session-Token: API_KEY' ``` -`GET /users/{user}/autofill-parameters` +`GET /api/v2/users/{user}/autofill-parameters` ### Parameters @@ -670,7 +670,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/gitsshkey \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /users/{user}/gitsshkey` +`GET /api/v2/users/{user}/gitsshkey` ### Parameters @@ -710,7 +710,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/gitsshkey \ -H 'Coder-Session-Token: API_KEY' ``` -`PUT /users/{user}/gitsshkey` +`PUT /api/v2/users/{user}/gitsshkey` ### Parameters @@ -750,7 +750,7 @@ curl -X POST http://coder-server:8080/api/v2/users/{user}/keys \ -H 'Coder-Session-Token: API_KEY' ``` -`POST /users/{user}/keys` +`POST /api/v2/users/{user}/keys` ### Parameters @@ -787,7 +787,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/keys/tokens \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /users/{user}/keys/tokens` +`GET /api/v2/users/{user}/keys/tokens` ### Parameters @@ -876,7 +876,7 @@ curl -X POST http://coder-server:8080/api/v2/users/{user}/keys/tokens \ -H 'Coder-Session-Token: API_KEY' ``` -`POST /users/{user}/keys/tokens` +`POST /api/v2/users/{user}/keys/tokens` > Body parameter @@ -933,7 +933,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/keys/tokens/{keyname} \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /users/{user}/keys/tokens/{keyname}` +`GET /api/v2/users/{user}/keys/tokens/{keyname}` ### Parameters @@ -989,7 +989,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/keys/{keyid} \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /users/{user}/keys/{keyid}` +`GET /api/v2/users/{user}/keys/{keyid}` ### Parameters @@ -1044,7 +1044,7 @@ curl -X DELETE http://coder-server:8080/api/v2/users/{user}/keys/{keyid} \ -H 'Coder-Session-Token: API_KEY' ``` -`DELETE /users/{user}/keys/{keyid}` +`DELETE /api/v2/users/{user}/keys/{keyid}` ### Parameters @@ -1072,7 +1072,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/keys/{keyid}/expire \ -H 'Coder-Session-Token: API_KEY' ``` -`PUT /users/{user}/keys/{keyid}/expire` +`PUT /api/v2/users/{user}/keys/{keyid}/expire` ### Parameters @@ -1106,7 +1106,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/login-type \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /users/{user}/login-type` +`GET /api/v2/users/{user}/login-type` ### Parameters @@ -1143,7 +1143,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/organizations \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /users/{user}/organizations` +`GET /api/v2/users/{user}/organizations` ### Parameters @@ -1205,7 +1205,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/organizations/{organiza -H 'Coder-Session-Token: API_KEY' ``` -`GET /users/{user}/organizations/{organizationname}` +`GET /api/v2/users/{user}/organizations/{organizationname}` ### Parameters @@ -1250,7 +1250,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/password \ -H 'Coder-Session-Token: API_KEY' ``` -`PUT /users/{user}/password` +`PUT /api/v2/users/{user}/password` > Body parameter @@ -1287,7 +1287,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/preferences \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /users/{user}/preferences` +`GET /api/v2/users/{user}/preferences` ### Parameters @@ -1326,7 +1326,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/preferences \ -H 'Coder-Session-Token: API_KEY' ``` -`PUT /users/{user}/preferences` +`PUT /api/v2/users/{user}/preferences` > Body parameter @@ -1375,7 +1375,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/profile \ -H 'Coder-Session-Token: API_KEY' ``` -`PUT /users/{user}/profile` +`PUT /api/v2/users/{user}/profile` > Body parameter @@ -1444,7 +1444,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/roles \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /users/{user}/roles` +`GET /api/v2/users/{user}/roles` ### Parameters @@ -1504,7 +1504,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/roles \ -H 'Coder-Session-Token: API_KEY' ``` -`PUT /users/{user}/roles` +`PUT /api/v2/users/{user}/roles` > Body parameter @@ -1574,7 +1574,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/status/activate \ -H 'Coder-Session-Token: API_KEY' ``` -`PUT /users/{user}/status/activate` +`PUT /api/v2/users/{user}/status/activate` ### Parameters @@ -1633,7 +1633,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/status/suspend \ -H 'Coder-Session-Token: API_KEY' ``` -`PUT /users/{user}/status/suspend` +`PUT /api/v2/users/{user}/status/suspend` ### Parameters diff --git a/docs/reference/api/workspaceproxies.md b/docs/reference/api/workspaceproxies.md index 72527b7e30..97ba371b0d 100644 --- a/docs/reference/api/workspaceproxies.md +++ b/docs/reference/api/workspaceproxies.md @@ -11,7 +11,7 @@ curl -X GET http://coder-server:8080/api/v2/regions \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /regions` +`GET /api/v2/regions` ### Example responses diff --git a/docs/reference/api/workspaces.md b/docs/reference/api/workspaces.md index 0d2e18ce91..758005578c 100644 --- a/docs/reference/api/workspaces.md +++ b/docs/reference/api/workspaces.md @@ -12,7 +12,7 @@ curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/member -H 'Coder-Session-Token: API_KEY' ``` -`POST /organizations/{organization}/members/{user}/workspaces` +`POST /api/v2/organizations/{organization}/members/{user}/workspaces` Create a new workspace using a template. The request must specify either the Template ID or the Template Version ID, @@ -345,7 +345,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/members -H 'Coder-Session-Token: API_KEY' ``` -`GET /organizations/{organization}/members/{user}/workspaces/available-users` +`GET /api/v2/organizations/{organization}/members/{user}/workspaces/available-users` ### Parameters @@ -403,7 +403,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/workspace/{workspacenam -H 'Coder-Session-Token: API_KEY' ``` -`GET /users/{user}/workspace/{workspacename}` +`GET /api/v2/users/{user}/workspace/{workspacename}` ### Parameters @@ -712,7 +712,7 @@ curl -X POST http://coder-server:8080/api/v2/users/{user}/workspaces \ -H 'Coder-Session-Token: API_KEY' ``` -`POST /users/{user}/workspaces` +`POST /api/v2/users/{user}/workspaces` Create a new workspace using a template. The request must specify either the Template ID or the Template Version ID, @@ -1044,7 +1044,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaces \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /workspaces` +`GET /api/v2/workspaces` ### Parameters @@ -1340,7 +1340,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace} \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /workspaces/{workspace}` +`GET /api/v2/workspaces/{workspace}` ### Parameters @@ -1647,7 +1647,7 @@ curl -X PATCH http://coder-server:8080/api/v2/workspaces/{workspace} \ -H 'Coder-Session-Token: API_KEY' ``` -`PATCH /workspaces/{workspace}` +`PATCH /api/v2/workspaces/{workspace}` > Body parameter @@ -1683,7 +1683,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace}/acl \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /workspaces/{workspace}/acl` +`GET /api/v2/workspaces/{workspace}/acl` ### Parameters @@ -1758,7 +1758,7 @@ curl -X DELETE http://coder-server:8080/api/v2/workspaces/{workspace}/acl \ -H 'Coder-Session-Token: API_KEY' ``` -`DELETE /workspaces/{workspace}/acl` +`DELETE /api/v2/workspaces/{workspace}/acl` ### Parameters @@ -1785,7 +1785,7 @@ curl -X PATCH http://coder-server:8080/api/v2/workspaces/{workspace}/acl \ -H 'Coder-Session-Token: API_KEY' ``` -`PATCH /workspaces/{workspace}/acl` +`PATCH /api/v2/workspaces/{workspace}/acl` > Body parameter @@ -1828,7 +1828,7 @@ curl -X PUT http://coder-server:8080/api/v2/workspaces/{workspace}/autostart \ -H 'Coder-Session-Token: API_KEY' ``` -`PUT /workspaces/{workspace}/autostart` +`PUT /api/v2/workspaces/{workspace}/autostart` > Body parameter @@ -1864,7 +1864,7 @@ curl -X PUT http://coder-server:8080/api/v2/workspaces/{workspace}/autoupdates \ -H 'Coder-Session-Token: API_KEY' ``` -`PUT /workspaces/{workspace}/autoupdates` +`PUT /api/v2/workspaces/{workspace}/autoupdates` > Body parameter @@ -1901,7 +1901,7 @@ curl -X PUT http://coder-server:8080/api/v2/workspaces/{workspace}/dormant \ -H 'Coder-Session-Token: API_KEY' ``` -`PUT /workspaces/{workspace}/dormant` +`PUT /api/v2/workspaces/{workspace}/dormant` > Body parameter @@ -2217,7 +2217,7 @@ curl -X PUT http://coder-server:8080/api/v2/workspaces/{workspace}/extend \ -H 'Coder-Session-Token: API_KEY' ``` -`PUT /workspaces/{workspace}/extend` +`PUT /api/v2/workspaces/{workspace}/extend` > Body parameter @@ -2269,7 +2269,7 @@ curl -X PUT http://coder-server:8080/api/v2/workspaces/{workspace}/favorite \ -H 'Coder-Session-Token: API_KEY' ``` -`PUT /workspaces/{workspace}/favorite` +`PUT /api/v2/workspaces/{workspace}/favorite` ### Parameters @@ -2295,7 +2295,7 @@ curl -X DELETE http://coder-server:8080/api/v2/workspaces/{workspace}/favorite \ -H 'Coder-Session-Token: API_KEY' ``` -`DELETE /workspaces/{workspace}/favorite` +`DELETE /api/v2/workspaces/{workspace}/favorite` ### Parameters @@ -2322,7 +2322,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace}/resolve-autos -H 'Coder-Session-Token: API_KEY' ``` -`GET /workspaces/{workspace}/resolve-autostart` +`GET /api/v2/workspaces/{workspace}/resolve-autostart` ### Parameters @@ -2359,7 +2359,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace}/timings \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /workspaces/{workspace}/timings` +`GET /api/v2/workspaces/{workspace}/timings` ### Parameters @@ -2427,7 +2427,7 @@ curl -X PUT http://coder-server:8080/api/v2/workspaces/{workspace}/ttl \ -H 'Coder-Session-Token: API_KEY' ``` -`PUT /workspaces/{workspace}/ttl` +`PUT /api/v2/workspaces/{workspace}/ttl` > Body parameter @@ -2463,7 +2463,7 @@ curl -X POST http://coder-server:8080/api/v2/workspaces/{workspace}/usage \ -H 'Coder-Session-Token: API_KEY' ``` -`POST /workspaces/{workspace}/usage` +`POST /api/v2/workspaces/{workspace}/usage` > Body parameter @@ -2500,7 +2500,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace}/watch \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /workspaces/{workspace}/watch` +`GET /api/v2/workspaces/{workspace}/watch` ### Parameters @@ -2531,7 +2531,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace}/watch-ws \ -H 'Coder-Session-Token: API_KEY' ``` -`GET /workspaces/{workspace}/watch-ws` +`GET /api/v2/workspaces/{workspace}/watch-ws` ### Parameters diff --git a/enterprise/coderd/aibridge.go b/enterprise/coderd/aibridge.go index 4560b2fac5..b1a8d8838a 100644 --- a/enterprise/coderd/aibridge.go +++ b/enterprise/coderd/aibridge.go @@ -107,7 +107,7 @@ func aibridgeHandler(api *API, middlewares ...func(http.Handler) http.Handler) f // @Param after_id query string false "Cursor pagination after ID (cannot be used with offset)" // @Param offset query int false "Offset pagination (cannot be used with after_id)" // @Success 200 {object} codersdk.AIBridgeListInterceptionsResponse -// @Router /aibridge/interceptions [get] +// @Router /api/v2/aibridge/interceptions [get] // @Deprecated Use /aibridge/sessions instead. func (api *API) aiBridgeListInterceptions(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() @@ -221,7 +221,7 @@ func (api *API) aiBridgeListInterceptions(rw http.ResponseWriter, r *http.Reques // @Param after_session_id query string false "Cursor pagination after session ID (cannot be used with offset)" // @Param offset query int false "Offset pagination (cannot be used with after_session_id)" // @Success 200 {object} codersdk.AIBridgeListSessionsResponse -// @Router /aibridge/sessions [get] +// @Router /api/v2/aibridge/sessions [get] func (api *API) aiBridgeListSessions(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() apiKey := httpmw.APIKey(r) @@ -346,7 +346,7 @@ func (api *API) aiBridgeListSessions(rw http.ResponseWriter, r *http.Request) { // @Param before_id query string false "Thread pagination cursor (backward/newer)" // @Param limit query int false "Number of threads per page (default 50)" // @Success 200 {object} codersdk.AIBridgeSessionThreadsResponse -// @Router /aibridge/sessions/{session_id} [get] +// @Router /api/v2/aibridge/sessions/{session_id} [get] func (api *API) aiBridgeGetSessionThreads(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() @@ -533,7 +533,7 @@ func (api *API) aiBridgeGetSessionThreads(rw http.ResponseWriter, r *http.Reques // @Produce json // @Tags AI Bridge // @Success 200 {array} string -// @Router /aibridge/models [get] +// @Router /api/v2/aibridge/models [get] func (api *API) aiBridgeListModels(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() @@ -585,7 +585,7 @@ func (api *API) aiBridgeListModels(rw http.ResponseWriter, r *http.Request) { // @Produce json // @Tags AI Bridge // @Success 200 {array} string -// @Router /aibridge/clients [get] +// @Router /api/v2/aibridge/clients [get] func (api *API) aiBridgeListClients(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() diff --git a/enterprise/coderd/appearance.go b/enterprise/coderd/appearance.go index 6bb7ef6bc8..db845fadea 100644 --- a/enterprise/coderd/appearance.go +++ b/enterprise/coderd/appearance.go @@ -26,7 +26,7 @@ import ( // @Produce json // @Tags Enterprise // @Success 200 {object} codersdk.AppearanceConfig -// @Router /appearance [get] +// @Router /api/v2/appearance [get] func (api *API) appearance(rw http.ResponseWriter, r *http.Request) { af := *api.AGPL.AppearanceFetcher.Load() cfg, err := af.Fetch(r.Context()) @@ -141,7 +141,7 @@ func validateHexColor(color string) error { // @Tags Enterprise // @Param request body codersdk.UpdateAppearanceConfig true "Update appearance request" // @Success 200 {object} codersdk.UpdateAppearanceConfig -// @Router /appearance [put] +// @Router /api/v2/appearance [put] func (api *API) putAppearance(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() diff --git a/enterprise/coderd/coderd.go b/enterprise/coderd/coderd.go index f2bb7dbdfc..a2c81ae5ba 100644 --- a/enterprise/coderd/coderd.go +++ b/enterprise/coderd/coderd.go @@ -1288,7 +1288,7 @@ func derpMapper(logger slog.Logger, proxyHealth *proxyhealth.ProxyHealth) func(* // @Produce json // @Tags Enterprise // @Success 200 {object} codersdk.Entitlements -// @Router /entitlements [get] +// @Router /api/v2/entitlements [get] func (api *API) serveEntitlements(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() httpapi.Write(ctx, rw, http.StatusOK, api.Entitlements.AsJSON()) diff --git a/enterprise/coderd/coderdenttest/swagger_test.go b/enterprise/coderd/coderdenttest/swagger_test.go index c8b9517486..f727a68a89 100644 --- a/enterprise/coderd/coderdenttest/swagger_test.go +++ b/enterprise/coderd/coderdenttest/swagger_test.go @@ -18,5 +18,5 @@ func TestEnterpriseEndpointsDocumented(t *testing.T) { //nolint: dogsled _, _, api, _ := coderdenttest.NewWithAPI(t, nil) - coderdtest.VerifySwaggerDefinitions(t, api.AGPL.APIHandler, swaggerComments) + coderdtest.VerifySwaggerDefinitions(t, api.AGPL.APIHandler, swaggerComments, coderdtest.WithSwaggerRoutePrefix("/api/v2")) } diff --git a/enterprise/coderd/connectionlog.go b/enterprise/coderd/connectionlog.go index c37e2ce497..eccc954ae4 100644 --- a/enterprise/coderd/connectionlog.go +++ b/enterprise/coderd/connectionlog.go @@ -28,7 +28,7 @@ const connectionLogCountCap = 2000 // @Param limit query int true "Page limit" // @Param offset query int false "Page offset" // @Success 200 {object} codersdk.ConnectionLogResponse -// @Router /connectionlog [get] +// @Router /api/v2/connectionlog [get] func (api *API) connectionLogs(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() apiKey := httpmw.APIKey(r) diff --git a/enterprise/coderd/groups.go b/enterprise/coderd/groups.go index 238bc98f3c..95b238f41a 100644 --- a/enterprise/coderd/groups.go +++ b/enterprise/coderd/groups.go @@ -29,7 +29,7 @@ import ( // @Param request body codersdk.CreateGroupRequest true "Create group request" // @Param organization path string true "Organization ID" // @Success 201 {object} codersdk.Group -// @Router /organizations/{organization}/groups [post] +// @Router /api/v2/organizations/{organization}/groups [post] func (api *API) postGroupByOrganization(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -98,7 +98,7 @@ func (api *API) postGroupByOrganization(rw http.ResponseWriter, r *http.Request) // @Param group path string true "Group name" // @Param request body codersdk.PatchGroupRequest true "Patch group request" // @Success 200 {object} codersdk.Group -// @Router /groups/{group} [patch] +// @Router /api/v2/groups/{group} [patch] func (api *API) patchGroup(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -332,7 +332,7 @@ func (api *API) patchGroup(rw http.ResponseWriter, r *http.Request) { // @Tags Enterprise // @Param group path string true "Group name" // @Success 200 {object} codersdk.Group -// @Router /groups/{group} [delete] +// @Router /api/v2/groups/{group} [delete] func (api *API) deleteGroup(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -385,7 +385,7 @@ func (api *API) deleteGroup(rw http.ResponseWriter, r *http.Request) { // @Param organization path string true "Organization ID" format(uuid) // @Param groupName path string true "Group name" // @Success 200 {object} codersdk.Group -// @Router /organizations/{organization}/groups/{groupName} [get] +// @Router /api/v2/organizations/{organization}/groups/{groupName} [get] func (api *API) groupByOrganization(rw http.ResponseWriter, r *http.Request) { api.group(rw, r) } @@ -398,7 +398,7 @@ func (api *API) groupByOrganization(rw http.ResponseWriter, r *http.Request) { // @Param group path string true "Group id" // @Param exclude_members query bool false "Exclude members from the response" // @Success 200 {object} codersdk.Group -// @Router /groups/{group} [get] +// @Router /api/v2/groups/{group} [get] func (api *API) group(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -452,7 +452,7 @@ func (api *API) group(rw http.ResponseWriter, r *http.Request) { // @Param limit query int false "Page limit" // @Param offset query int false "Page offset" // @Success 200 {object} codersdk.GroupMembersResponse -// @Router /organizations/{organization}/groups/{groupName}/members [get] +// @Router /api/v2/organizations/{organization}/groups/{groupName}/members [get] func (api *API) groupMembersByOrganization(rw http.ResponseWriter, r *http.Request) { api.groupMembers(rw, r) } @@ -468,7 +468,7 @@ func (api *API) groupMembersByOrganization(rw http.ResponseWriter, r *http.Reque // @Param limit query int false "Page limit" // @Param offset query int false "Page offset" // @Success 200 {object} codersdk.GroupMembersResponse -// @Router /groups/{group}/members [get] +// @Router /api/v2/groups/{group}/members [get] func (api *API) groupMembers(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -536,7 +536,7 @@ func (api *API) groupMembers(rw http.ResponseWriter, r *http.Request) { // @Tags Enterprise // @Param organization path string true "Organization ID" format(uuid) // @Success 200 {array} codersdk.Group -// @Router /organizations/{organization}/groups [get] +// @Router /api/v2/organizations/{organization}/groups [get] func (api *API) groupsByOrganization(rw http.ResponseWriter, r *http.Request) { org := httpmw.OrganizationParam(r) @@ -556,7 +556,7 @@ func (api *API) groupsByOrganization(rw http.ResponseWriter, r *http.Request) { // @Param has_member query string true "User ID or name" // @Param group_ids query string true "Comma separated list of group IDs" // @Success 200 {array} codersdk.Group -// @Router /groups [get] +// @Router /api/v2/groups [get] func (api *API) groups(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() diff --git a/enterprise/coderd/idpsync.go b/enterprise/coderd/idpsync.go index 416acc7ee0..60faf76a0c 100644 --- a/enterprise/coderd/idpsync.go +++ b/enterprise/coderd/idpsync.go @@ -26,7 +26,7 @@ import ( // @Tags Enterprise // @Param organization path string true "Organization ID" format(uuid) // @Success 200 {object} codersdk.GroupSyncSettings -// @Router /organizations/{organization}/settings/idpsync/groups [get] +// @Router /api/v2/organizations/{organization}/settings/idpsync/groups [get] func (api *API) groupIDPSyncSettings(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() org := httpmw.OrganizationParam(r) @@ -56,7 +56,7 @@ func (api *API) groupIDPSyncSettings(rw http.ResponseWriter, r *http.Request) { // @Param organization path string true "Organization ID" format(uuid) // @Param request body codersdk.GroupSyncSettings true "New settings" // @Success 200 {object} codersdk.GroupSyncSettings -// @Router /organizations/{organization}/settings/idpsync/groups [patch] +// @Router /api/v2/organizations/{organization}/settings/idpsync/groups [patch] func (api *API) patchGroupIDPSyncSettings(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() org := httpmw.OrganizationParam(r) @@ -140,7 +140,7 @@ func (api *API) patchGroupIDPSyncSettings(rw http.ResponseWriter, r *http.Reques // @Success 200 {object} codersdk.GroupSyncSettings // @Param organization path string true "Organization ID or name" format(uuid) // @Param request body codersdk.PatchGroupIDPSyncConfigRequest true "New config values" -// @Router /organizations/{organization}/settings/idpsync/groups/config [patch] +// @Router /api/v2/organizations/{organization}/settings/idpsync/groups/config [patch] func (api *API) patchGroupIDPSyncConfig(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() org := httpmw.OrganizationParam(r) @@ -213,7 +213,7 @@ func (api *API) patchGroupIDPSyncConfig(rw http.ResponseWriter, r *http.Request) // @Success 200 {object} codersdk.GroupSyncSettings // @Param organization path string true "Organization ID or name" format(uuid) // @Param request body codersdk.PatchGroupIDPSyncMappingRequest true "Description of the mappings to add and remove" -// @Router /organizations/{organization}/settings/idpsync/groups/mapping [patch] +// @Router /api/v2/organizations/{organization}/settings/idpsync/groups/mapping [patch] func (api *API) patchGroupIDPSyncMapping(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() org := httpmw.OrganizationParam(r) @@ -285,7 +285,7 @@ func (api *API) patchGroupIDPSyncMapping(rw http.ResponseWriter, r *http.Request // @Tags Enterprise // @Param organization path string true "Organization ID" format(uuid) // @Success 200 {object} codersdk.RoleSyncSettings -// @Router /organizations/{organization}/settings/idpsync/roles [get] +// @Router /api/v2/organizations/{organization}/settings/idpsync/roles [get] func (api *API) roleIDPSyncSettings(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() org := httpmw.OrganizationParam(r) @@ -315,7 +315,7 @@ func (api *API) roleIDPSyncSettings(rw http.ResponseWriter, r *http.Request) { // @Param organization path string true "Organization ID" format(uuid) // @Param request body codersdk.RoleSyncSettings true "New settings" // @Success 200 {object} codersdk.RoleSyncSettings -// @Router /organizations/{organization}/settings/idpsync/roles [patch] +// @Router /api/v2/organizations/{organization}/settings/idpsync/roles [patch] func (api *API) patchRoleIDPSyncSettings(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() org := httpmw.OrganizationParam(r) @@ -380,7 +380,7 @@ func (api *API) patchRoleIDPSyncSettings(rw http.ResponseWriter, r *http.Request // @Success 200 {object} codersdk.RoleSyncSettings // @Param organization path string true "Organization ID or name" format(uuid) // @Param request body codersdk.PatchRoleIDPSyncConfigRequest true "New config values" -// @Router /organizations/{organization}/settings/idpsync/roles/config [patch] +// @Router /api/v2/organizations/{organization}/settings/idpsync/roles/config [patch] func (api *API) patchRoleIDPSyncConfig(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() org := httpmw.OrganizationParam(r) @@ -447,7 +447,7 @@ func (api *API) patchRoleIDPSyncConfig(rw http.ResponseWriter, r *http.Request) // @Success 200 {object} codersdk.RoleSyncSettings // @Param organization path string true "Organization ID or name" format(uuid) // @Param request body codersdk.PatchRoleIDPSyncMappingRequest true "Description of the mappings to add and remove" -// @Router /organizations/{organization}/settings/idpsync/roles/mapping [patch] +// @Router /api/v2/organizations/{organization}/settings/idpsync/roles/mapping [patch] func (api *API) patchRoleIDPSyncMapping(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() org := httpmw.OrganizationParam(r) @@ -512,7 +512,7 @@ func (api *API) patchRoleIDPSyncMapping(rw http.ResponseWriter, r *http.Request) // @Produce json // @Tags Enterprise // @Success 200 {object} codersdk.OrganizationSyncSettings -// @Router /settings/idpsync/organization [get] +// @Router /api/v2/settings/idpsync/organization [get] func (api *API) organizationIDPSyncSettings(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() @@ -544,7 +544,7 @@ func (api *API) organizationIDPSyncSettings(rw http.ResponseWriter, r *http.Requ // @Tags Enterprise // @Success 200 {object} codersdk.OrganizationSyncSettings // @Param request body codersdk.OrganizationSyncSettings true "New settings" -// @Router /settings/idpsync/organization [patch] +// @Router /api/v2/settings/idpsync/organization [patch] func (api *API) patchOrganizationIDPSyncSettings(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() auditor := *api.AGPL.Auditor.Load() @@ -608,7 +608,7 @@ func (api *API) patchOrganizationIDPSyncSettings(rw http.ResponseWriter, r *http // @Tags Enterprise // @Success 200 {object} codersdk.OrganizationSyncSettings // @Param request body codersdk.PatchOrganizationIDPSyncConfigRequest true "New config values" -// @Router /settings/idpsync/organization/config [patch] +// @Router /api/v2/settings/idpsync/organization/config [patch] func (api *API) patchOrganizationIDPSyncConfig(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() auditor := *api.AGPL.Auditor.Load() @@ -674,7 +674,7 @@ func (api *API) patchOrganizationIDPSyncConfig(rw http.ResponseWriter, r *http.R // @Tags Enterprise // @Success 200 {object} codersdk.OrganizationSyncSettings // @Param request body codersdk.PatchOrganizationIDPSyncMappingRequest true "Description of the mappings to add and remove" -// @Router /settings/idpsync/organization/mapping [patch] +// @Router /api/v2/settings/idpsync/organization/mapping [patch] func (api *API) patchOrganizationIDPSyncMapping(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() auditor := *api.AGPL.Auditor.Load() @@ -740,7 +740,7 @@ func (api *API) patchOrganizationIDPSyncMapping(rw http.ResponseWriter, r *http. // @Tags Enterprise // @Param organization path string true "Organization ID" format(uuid) // @Success 200 {array} string -// @Router /organizations/{organization}/settings/idpsync/available-fields [get] +// @Router /api/v2/organizations/{organization}/settings/idpsync/available-fields [get] func (api *API) organizationIDPSyncClaimFields(rw http.ResponseWriter, r *http.Request) { org := httpmw.OrganizationParam(r) api.idpSyncClaimFields(org.ID, rw, r) @@ -753,7 +753,7 @@ func (api *API) organizationIDPSyncClaimFields(rw http.ResponseWriter, r *http.R // @Tags Enterprise // @Param organization path string true "Organization ID" format(uuid) // @Success 200 {array} string -// @Router /settings/idpsync/available-fields [get] +// @Router /api/v2/settings/idpsync/available-fields [get] func (api *API) deploymentIDPSyncClaimFields(rw http.ResponseWriter, r *http.Request) { // nil uuid implies all organizations api.idpSyncClaimFields(uuid.Nil, rw, r) @@ -788,7 +788,7 @@ func (api *API) idpSyncClaimFields(orgID uuid.UUID, rw http.ResponseWriter, r *h // @Param organization path string true "Organization ID" format(uuid) // @Param claimField query string true "Claim Field" format(string) // @Success 200 {array} string -// @Router /organizations/{organization}/settings/idpsync/field-values [get] +// @Router /api/v2/organizations/{organization}/settings/idpsync/field-values [get] func (api *API) organizationIDPSyncClaimFieldValues(rw http.ResponseWriter, r *http.Request) { org := httpmw.OrganizationParam(r) api.idpSyncClaimFieldValues(org.ID, rw, r) @@ -802,7 +802,7 @@ func (api *API) organizationIDPSyncClaimFieldValues(rw http.ResponseWriter, r *h // @Param organization path string true "Organization ID" format(uuid) // @Param claimField query string true "Claim Field" format(string) // @Success 200 {array} string -// @Router /settings/idpsync/field-values [get] +// @Router /api/v2/settings/idpsync/field-values [get] func (api *API) deploymentIDPSyncClaimFieldValues(rw http.ResponseWriter, r *http.Request) { // nil uuid implies all organizations api.idpSyncClaimFieldValues(uuid.Nil, rw, r) diff --git a/enterprise/coderd/licenses.go b/enterprise/coderd/licenses.go index 401ecca7cd..a7f16040d4 100644 --- a/enterprise/coderd/licenses.go +++ b/enterprise/coderd/licenses.go @@ -62,7 +62,7 @@ var Keys = map[string]ed25519.PublicKey{"2022-08-12": ed25519.PublicKey(key20220 // @Tags Enterprise // @Param request body codersdk.AddLicenseRequest true "Add license request" // @Success 201 {object} codersdk.License -// @Router /licenses [post] +// @Router /api/v2/licenses [post] func (api *API) postLicense(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -165,7 +165,7 @@ func (api *API) postLicense(rw http.ResponseWriter, r *http.Request) { // @Produce json // @Tags Enterprise // @Success 201 {object} codersdk.Response -// @Router /licenses/refresh-entitlements [post] +// @Router /api/v2/licenses/refresh-entitlements [post] func (api *API) postRefreshEntitlements(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() @@ -231,7 +231,7 @@ func (api *API) refreshEntitlements(ctx context.Context) error { // @Produce json // @Tags Enterprise // @Success 200 {array} codersdk.License -// @Router /licenses [get] +// @Router /api/v2/licenses [get] func (api *API) licenses(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() licenses, err := api.Database.GetLicenses(ctx) @@ -273,7 +273,7 @@ func (api *API) licenses(rw http.ResponseWriter, r *http.Request) { // @Tags Enterprise // @Param id path string true "License ID" format(number) // @Success 200 -// @Router /licenses/{id} [delete] +// @Router /api/v2/licenses/{id} [delete] func (api *API) deleteLicense(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() diff --git a/enterprise/coderd/notifications.go b/enterprise/coderd/notifications.go index 45b9b93c8b..2c5806937f 100644 --- a/enterprise/coderd/notifications.go +++ b/enterprise/coderd/notifications.go @@ -22,7 +22,7 @@ import ( // @Tags Enterprise // @Success 200 "Success" // @Success 304 "Not modified" -// @Router /notifications/templates/{notification_template}/method [put] +// @Router /api/v2/notifications/templates/{notification_template}/method [put] func (api *API) updateNotificationTemplateMethod(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() diff --git a/enterprise/coderd/organizations.go b/enterprise/coderd/organizations.go index 76d5060be6..fd9f9a4af6 100644 --- a/enterprise/coderd/organizations.go +++ b/enterprise/coderd/organizations.go @@ -29,7 +29,7 @@ import ( // @Param organization path string true "Organization ID or name" // @Param request body codersdk.UpdateOrganizationRequest true "Patch organization request" // @Success 200 {object} codersdk.Organization -// @Router /organizations/{organization} [patch] +// @Router /api/v2/organizations/{organization} [patch] func (api *API) patchOrganization(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -129,7 +129,7 @@ func (api *API) patchOrganization(rw http.ResponseWriter, r *http.Request) { // @Tags Organizations // @Param organization path string true "Organization ID or name" // @Success 200 {object} codersdk.Response -// @Router /organizations/{organization} [delete] +// @Router /api/v2/organizations/{organization} [delete] func (api *API) deleteOrganization(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -216,7 +216,7 @@ func (api *API) deleteOrganization(rw http.ResponseWriter, r *http.Request) { // @Tags Organizations // @Param request body codersdk.CreateOrganizationRequest true "Create organization request" // @Success 201 {object} codersdk.Organization -// @Router /organizations [post] +// @Router /api/v2/organizations [post] func (api *API) postOrganizations(rw http.ResponseWriter, r *http.Request) { var ( // organizationID is required before the audit log entry is created. diff --git a/enterprise/coderd/prebuilds.go b/enterprise/coderd/prebuilds.go index 837bc17ad0..fabb99c6b8 100644 --- a/enterprise/coderd/prebuilds.go +++ b/enterprise/coderd/prebuilds.go @@ -21,7 +21,7 @@ import ( // @Produce json // @Tags Prebuilds // @Success 200 {object} codersdk.PrebuildsSettings -// @Router /prebuilds/settings [get] +// @Router /api/v2/prebuilds/settings [get] func (api *API) prebuildsSettings(rw http.ResponseWriter, r *http.Request) { settingsJSON, err := api.Database.GetPrebuildsSettings(r.Context()) if err != nil { @@ -55,7 +55,7 @@ func (api *API) prebuildsSettings(rw http.ResponseWriter, r *http.Request) { // @Param request body codersdk.PrebuildsSettings true "Prebuilds settings request" // @Success 200 {object} codersdk.PrebuildsSettings // @Success 304 -// @Router /prebuilds/settings [put] +// @Router /api/v2/prebuilds/settings [put] func (api *API) putPrebuildsSettings(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() diff --git a/enterprise/coderd/provisionerdaemons.go b/enterprise/coderd/provisionerdaemons.go index c293abced2..17a00d2242 100644 --- a/enterprise/coderd/provisionerdaemons.go +++ b/enterprise/coderd/provisionerdaemons.go @@ -153,7 +153,7 @@ func (p *provisionerDaemonAuth) authorize(r *http.Request, org database.Organiza // @Tags Enterprise // @Param organization path string true "Organization ID" format(uuid) // @Success 101 -// @Router /organizations/{organization}/provisionerdaemons/serve [get] +// @Router /api/v2/organizations/{organization}/provisionerdaemons/serve [get] func (api *API) provisionerDaemonServe(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() diff --git a/enterprise/coderd/provisionerkeys.go b/enterprise/coderd/provisionerkeys.go index d615819ec3..49640042d4 100644 --- a/enterprise/coderd/provisionerkeys.go +++ b/enterprise/coderd/provisionerkeys.go @@ -23,7 +23,7 @@ import ( // @Tags Enterprise // @Param organization path string true "Organization ID" // @Success 201 {object} codersdk.CreateProvisionerKeyResponse -// @Router /organizations/{organization}/provisionerkeys [post] +// @Router /api/v2/organizations/{organization}/provisionerkeys [post] func (api *API) postProvisionerKey(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() organization := httpmw.OrganizationParam(r) @@ -104,7 +104,7 @@ func (api *API) postProvisionerKey(rw http.ResponseWriter, r *http.Request) { // @Tags Enterprise // @Param organization path string true "Organization ID" // @Success 200 {object} []codersdk.ProvisionerKey -// @Router /organizations/{organization}/provisionerkeys [get] +// @Router /api/v2/organizations/{organization}/provisionerkeys [get] func (api *API) provisionerKeys(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() organization := httpmw.OrganizationParam(r) @@ -125,7 +125,7 @@ func (api *API) provisionerKeys(rw http.ResponseWriter, r *http.Request) { // @Tags Enterprise // @Param organization path string true "Organization ID" // @Success 200 {object} []codersdk.ProvisionerKeyDaemons -// @Router /organizations/{organization}/provisionerkeys/daemons [get] +// @Router /api/v2/organizations/{organization}/provisionerkeys/daemons [get] func (api *API) provisionerKeyDaemons(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() organization := httpmw.OrganizationParam(r) @@ -191,7 +191,7 @@ func (api *API) provisionerKeyDaemons(rw http.ResponseWriter, r *http.Request) { // @Param organization path string true "Organization ID" // @Param provisionerkey path string true "Provisioner key name" // @Success 204 -// @Router /organizations/{organization}/provisionerkeys/{provisionerkey} [delete] +// @Router /api/v2/organizations/{organization}/provisionerkeys/{provisionerkey} [delete] func (api *API) deleteProvisionerKey(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() provisionerKey := httpmw.ProvisionerKeyParam(r) @@ -221,7 +221,7 @@ func (api *API) deleteProvisionerKey(rw http.ResponseWriter, r *http.Request) { // @Tags Enterprise // @Param provisionerkey path string true "Provisioner Key" // @Success 200 {object} codersdk.ProvisionerKey -// @Router /provisionerkeys/{provisionerkey} [get] +// @Router /api/v2/provisionerkeys/{provisionerkey} [get] func (*API) fetchProvisionerKey(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() diff --git a/enterprise/coderd/replicas.go b/enterprise/coderd/replicas.go index 75b6c36fdd..c9f56fb655 100644 --- a/enterprise/coderd/replicas.go +++ b/enterprise/coderd/replicas.go @@ -18,7 +18,7 @@ import ( // @Produce json // @Tags Enterprise // @Success 200 {array} codersdk.Replica -// @Router /replicas [get] +// @Router /api/v2/replicas [get] func (api *API) replicas(rw http.ResponseWriter, r *http.Request) { if !api.AGPL.Authorize(r, policy.ActionRead, rbac.ResourceReplicas) { httpapi.ResourceNotFound(rw) diff --git a/enterprise/coderd/roles.go b/enterprise/coderd/roles.go index 0f7fcf0aa2..318138c0b9 100644 --- a/enterprise/coderd/roles.go +++ b/enterprise/coderd/roles.go @@ -30,7 +30,7 @@ import ( // @Param request body codersdk.CustomRoleRequest true "Insert role request" // @Tags Members // @Success 200 {array} codersdk.Role -// @Router /organizations/{organization}/members/roles [post] +// @Router /api/v2/organizations/{organization}/members/roles [post] func (api *API) postOrgRoles(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -97,7 +97,7 @@ func (api *API) postOrgRoles(rw http.ResponseWriter, r *http.Request) { // @Param request body codersdk.CustomRoleRequest true "Update role request" // @Tags Members // @Success 200 {array} codersdk.Role -// @Router /organizations/{organization}/members/roles [put] +// @Router /api/v2/organizations/{organization}/members/roles [put] func (api *API) putOrgRoles(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -187,7 +187,7 @@ func (api *API) putOrgRoles(rw http.ResponseWriter, r *http.Request) { // @Param roleName path string true "Role name" // @Tags Members // @Success 200 {array} codersdk.Role -// @Router /organizations/{organization}/members/roles/{roleName} [delete] +// @Router /api/v2/organizations/{organization}/members/roles/{roleName} [delete] func (api *API) deleteOrgRole(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() diff --git a/enterprise/coderd/templates.go b/enterprise/coderd/templates.go index 4b0f4ffcde..62c1b35567 100644 --- a/enterprise/coderd/templates.go +++ b/enterprise/coderd/templates.go @@ -28,7 +28,7 @@ import ( // @Tags Enterprise // @Param template path string true "Template ID" format(uuid) // @Success 200 {array} codersdk.ACLAvailable -// @Router /templates/{template}/acl/available [get] +// @Router /api/v2/templates/{template}/acl/available [get] func (api *API) templateAvailablePermissions(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -101,7 +101,7 @@ func (api *API) templateAvailablePermissions(rw http.ResponseWriter, r *http.Req // @Tags Enterprise // @Param template path string true "Template ID" format(uuid) // @Success 200 {object} codersdk.TemplateACL -// @Router /templates/{template}/acl [get] +// @Router /api/v2/templates/{template}/acl [get] func (api *API) templateACL(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -187,7 +187,7 @@ func (api *API) templateACL(rw http.ResponseWriter, r *http.Request) { // @Param template path string true "Template ID" format(uuid) // @Param request body codersdk.UpdateTemplateACL true "Update template ACL request" // @Success 200 {object} codersdk.Response -// @Router /templates/{template}/acl [patch] +// @Router /api/v2/templates/{template}/acl [patch] func (api *API) patchTemplateACL(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -347,7 +347,7 @@ func (api *API) RequireFeatureMW(feat codersdk.FeatureName) func(http.Handler) h // @Tags Enterprise // @Param template path string true "Template ID" format(uuid) // @Success 200 {object} codersdk.InvalidatePresetsResponse -// @Router /templates/{template}/prebuilds/invalidate [post] +// @Router /api/v2/templates/{template}/prebuilds/invalidate [post] func (api *API) postInvalidateTemplatePresets(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() template := httpmw.TemplateParam(r) diff --git a/enterprise/coderd/users.go b/enterprise/coderd/users.go index 246dfde933..d76aa69570 100644 --- a/enterprise/coderd/users.go +++ b/enterprise/coderd/users.go @@ -43,7 +43,7 @@ func (api *API) autostopRequirementEnabledMW(next http.Handler) http.Handler { // @Tags Enterprise // @Param user path string true "User ID" format(uuid) // @Success 200 {array} codersdk.UserQuietHoursScheduleResponse -// @Router /users/{user}/quiet-hours [get] +// @Router /api/v2/users/{user}/quiet-hours [get] func (api *API) userQuietHoursSchedule(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -79,7 +79,7 @@ func (api *API) userQuietHoursSchedule(rw http.ResponseWriter, r *http.Request) // @Param user path string true "User ID" format(uuid) // @Param request body codersdk.UpdateUserQuietHoursScheduleRequest true "Update schedule request" // @Success 200 {array} codersdk.UserQuietHoursScheduleResponse -// @Router /users/{user}/quiet-hours [put] +// @Router /api/v2/users/{user}/quiet-hours [put] func (api *API) putUserQuietHoursSchedule(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() diff --git a/enterprise/coderd/workspaceagents.go b/enterprise/coderd/workspaceagents.go index 739aba6d62..b5c891a7c0 100644 --- a/enterprise/coderd/workspaceagents.go +++ b/enterprise/coderd/workspaceagents.go @@ -31,7 +31,7 @@ func (api *API) shouldBlockNonBrowserConnections(rw http.ResponseWriter) bool { // @Param workspace path string true "Workspace ID" format(uuid) // @Param agent path string true "Agent name" // @Success 200 {object} codersdk.ExternalAgentCredentials -// @Router /workspaces/{workspace}/external-agent/{agent}/credentials [get] +// @Router /api/v2/workspaces/{workspace}/external-agent/{agent}/credentials [get] func (api *API) workspaceExternalAgentCredentials(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() workspace := httpmw.WorkspaceParam(r) diff --git a/enterprise/coderd/workspaceproxy.go b/enterprise/coderd/workspaceproxy.go index 43486da8f5..718aeec38e 100644 --- a/enterprise/coderd/workspaceproxy.go +++ b/enterprise/coderd/workspaceproxy.go @@ -94,7 +94,7 @@ func (api *API) fetchRegions(ctx context.Context) (codersdk.RegionsResponse[code // @Param workspaceproxy path string true "Proxy ID or name" format(uuid) // @Param request body codersdk.PatchWorkspaceProxy true "Update workspace proxy request" // @Success 200 {object} codersdk.WorkspaceProxy -// @Router /workspaceproxies/{workspaceproxy} [patch] +// @Router /api/v2/workspaceproxies/{workspaceproxy} [patch] func (api *API) patchWorkspaceProxy(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -243,7 +243,7 @@ func (api *API) patchPrimaryWorkspaceProxy(req codersdk.PatchWorkspaceProxy, rw // @Tags Enterprise // @Param workspaceproxy path string true "Proxy ID or name" format(uuid) // @Success 200 {object} codersdk.Response -// @Router /workspaceproxies/{workspaceproxy} [delete] +// @Router /api/v2/workspaceproxies/{workspaceproxy} [delete] func (api *API) deleteWorkspaceProxy(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -295,7 +295,7 @@ func (api *API) deleteWorkspaceProxy(rw http.ResponseWriter, r *http.Request) { // @Tags Enterprise // @Param workspaceproxy path string true "Proxy ID or name" format(uuid) // @Success 200 {object} codersdk.WorkspaceProxy -// @Router /workspaceproxies/{workspaceproxy} [get] +// @Router /api/v2/workspaceproxies/{workspaceproxy} [get] func (api *API) workspaceProxy(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -313,7 +313,7 @@ func (api *API) workspaceProxy(rw http.ResponseWriter, r *http.Request) { // @Tags Enterprise // @Param request body codersdk.CreateWorkspaceProxyRequest true "Create workspace proxy request" // @Success 201 {object} codersdk.WorkspaceProxy -// @Router /workspaceproxies [post] +// @Router /api/v2/workspaceproxies [post] func (api *API) postWorkspaceProxy(rw http.ResponseWriter, r *http.Request) { var ( ctx = r.Context() @@ -417,7 +417,7 @@ func validateProxyURL(u string) error { // @Produce json // @Tags Enterprise // @Success 200 {array} codersdk.RegionsResponse[codersdk.WorkspaceProxy] -// @Router /workspaceproxies [get] +// @Router /api/v2/workspaceproxies [get] func (api *API) workspaceProxies(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() proxies, err := api.fetchWorkspaceProxies(r.Context()) @@ -461,7 +461,7 @@ func (api *API) fetchWorkspaceProxies(ctx context.Context) (codersdk.RegionsResp // @Tags Enterprise // @Param request body workspaceapps.IssueTokenRequest true "Issue signed app token request" // @Success 201 {object} wsproxysdk.IssueSignedAppTokenResponse -// @Router /workspaceproxies/me/issue-signed-app-token [post] +// @Router /api/v2/workspaceproxies/me/issue-signed-app-token [post] // @x-apidocgen {"skip": true} func (api *API) workspaceProxyIssueSignedAppToken(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() @@ -513,7 +513,7 @@ func (api *API) workspaceProxyIssueSignedAppToken(rw http.ResponseWriter, r *htt // @Tags Enterprise // @Param request body wsproxysdk.ReportAppStatsRequest true "Report app stats request" // @Success 204 -// @Router /workspaceproxies/me/app-stats [post] +// @Router /api/v2/workspaceproxies/me/app-stats [post] // @x-apidocgen {"skip": true} func (api *API) workspaceProxyReportAppStats(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() @@ -553,7 +553,7 @@ func (api *API) workspaceProxyReportAppStats(rw http.ResponseWriter, r *http.Req // @Tags Enterprise // @Param request body wsproxysdk.RegisterWorkspaceProxyRequest true "Register workspace proxy request" // @Success 201 {object} wsproxysdk.RegisterWorkspaceProxyResponse -// @Router /workspaceproxies/me/register [post] +// @Router /api/v2/workspaceproxies/me/register [post] // @x-apidocgen {"skip": true} func (api *API) workspaceProxyRegister(rw http.ResponseWriter, r *http.Request) { var ( @@ -751,7 +751,7 @@ func (api *API) workspaceProxyRegister(rw http.ResponseWriter, r *http.Request) // @Tags Enterprise // @Param feature query string true "Feature key" // @Success 200 {object} wsproxysdk.CryptoKeysResponse -// @Router /workspaceproxies/me/crypto-keys [get] +// @Router /api/v2/workspaceproxies/me/crypto-keys [get] // @x-apidocgen {"skip": true} func (api *API) workspaceProxyCryptoKeys(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() @@ -789,7 +789,7 @@ func (api *API) workspaceProxyCryptoKeys(rw http.ResponseWriter, r *http.Request // @Tags Enterprise // @Param request body wsproxysdk.DeregisterWorkspaceProxyRequest true "Deregister workspace proxy request" // @Success 204 -// @Router /workspaceproxies/me/deregister [post] +// @Router /api/v2/workspaceproxies/me/deregister [post] // @x-apidocgen {"skip": true} func (api *API) workspaceProxyDeregister(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() @@ -866,7 +866,7 @@ func (api *API) workspaceProxyDeregister(rw http.ResponseWriter, r *http.Request // @Produce json // @Param request body codersdk.IssueReconnectingPTYSignedTokenRequest true "Issue reconnecting PTY signed token request" // @Success 200 {object} codersdk.IssueReconnectingPTYSignedTokenResponse -// @Router /applications/reconnecting-pty-signed-token [post] +// @Router /api/v2/applications/reconnecting-pty-signed-token [post] // @x-apidocgen {"skip": true} func (api *API) reconnectingPTYSignedToken(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() diff --git a/enterprise/coderd/workspaceproxycoordinate.go b/enterprise/coderd/workspaceproxycoordinate.go index 94914d5741..e6aaacee98 100644 --- a/enterprise/coderd/workspaceproxycoordinate.go +++ b/enterprise/coderd/workspaceproxycoordinate.go @@ -17,7 +17,7 @@ import ( // @Security CoderSessionToken // @Tags Enterprise // @Success 101 -// @Router /workspaceproxies/me/coordinate [get] +// @Router /api/v2/workspaceproxies/me/coordinate [get] // @x-apidocgen {"skip": true} func (api *API) workspaceProxyCoordinate(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() diff --git a/enterprise/coderd/workspacequota.go b/enterprise/coderd/workspacequota.go index a6218bf62f..4f064396a5 100644 --- a/enterprise/coderd/workspacequota.go +++ b/enterprise/coderd/workspacequota.go @@ -127,7 +127,7 @@ func (c *committer) CommitQuota( // @Tags Enterprise // @Param user path string true "User ID, name, or me" // @Success 200 {object} codersdk.WorkspaceQuota -// @Router /workspace-quota/{user} [get] +// @Router /api/v2/workspace-quota/{user} [get] // @Deprecated this endpoint will be removed, use /organizations/{organization}/members/{user}/workspace-quota instead func (api *API) workspaceQuotaByUser(rw http.ResponseWriter, r *http.Request) { defaultOrg, err := api.Database.GetDefaultOrganization(r.Context()) @@ -150,7 +150,7 @@ func (api *API) workspaceQuotaByUser(rw http.ResponseWriter, r *http.Request) { // @Param user path string true "User ID, name, or me" // @Param organization path string true "Organization ID" format(uuid) // @Success 200 {object} codersdk.WorkspaceQuota -// @Router /organizations/{organization}/members/{user}/workspace-quota [get] +// @Router /api/v2/organizations/{organization}/members/{user}/workspace-quota [get] func (api *API) workspaceQuota(rw http.ResponseWriter, r *http.Request) { var ( organization = httpmw.OrganizationParam(r) diff --git a/enterprise/coderd/workspacesharing.go b/enterprise/coderd/workspacesharing.go index dfe106d186..2459f8a50f 100644 --- a/enterprise/coderd/workspacesharing.go +++ b/enterprise/coderd/workspacesharing.go @@ -27,7 +27,7 @@ import ( // @Tags Enterprise // @Param organization path string true "Organization ID" format(uuid) // @Success 200 {object} codersdk.WorkspaceSharingSettings -// @Router /organizations/{organization}/settings/workspace-sharing [get] +// @Router /api/v2/organizations/{organization}/settings/workspace-sharing [get] func (api *API) workspaceSharingSettings(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() org := httpmw.OrganizationParam(r) @@ -59,7 +59,7 @@ func (api *API) workspaceSharingSettings(rw http.ResponseWriter, r *http.Request // @Param organization path string true "Organization ID" format(uuid) // @Param request body codersdk.UpdateWorkspaceSharingSettingsRequest true "Workspace sharing settings" // @Success 200 {object} codersdk.WorkspaceSharingSettings -// @Router /organizations/{organization}/settings/workspace-sharing [patch] +// @Router /api/v2/organizations/{organization}/settings/workspace-sharing [patch] func (api *API) patchWorkspaceSharingSettings(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() org := httpmw.OrganizationParam(r)