Skip to content
Skip to Content
Coder Docs

Suspend user account

PUT
/api/v2/users/{user}/status/suspend

Authorization

CoderSessionToken
headerCoder-Session-Token<token>

Path Parameters

user*string

User ID, name, or me

Response Body

OK

application/json
  1. response
avatar_url?string
Formaturi
created_at*string
Formatdate-time
email*string
Formatemail
has_ai_seat?boolean

HasAISeat intentionally omits omitempty so the API always includes the field, even when false.

id*string
Formatuuid
is_service_account?boolean
last_seen_at?string
Formatdate-time
login_type?codersdk.LoginType
Value in"""password""github""oidc""token""none"
name?string
organization_ids?array<>
roles?array<>
status?string
Value in"active""suspended"
theme_preference?string

Deprecated: this value should be retrieved from codersdk.UserPreferenceSettings instead.

updated_at?string
Formatdate-time
username*string

The samples read CODER_URL and CODER_SESSION_TOKEN: set up your environment.

curl -X PUT \	"$CODER_URL/api/v2/users/{user}/status/suspend" \	-H "Coder-Session-Token: $CODER_SESSION_TOKEN"
Example Response200
{  "avatar_url": "http://example.com",  "created_at": "2019-08-24T14:15:22Z",  "email": "[email protected]",  "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": [    "7d4232d7-54a0-4c93-9c1e-a8fd2dfcdabe"  ],  "roles": [    {      "display_name": "string",      "name": "string",      "organization_id": "string"    }  ],  "status": "active",  "theme_preference": "string",  "updated_at": "2019-08-24T14:15:22Z",  "username": "string"}