Skip to content
Ona Docs

SetSuspended

client.users.setSuspended(UserSetSuspendedParams { suspended, userId } body, RequestOptionsoptions?): UserSetSuspendedResponse
POST/gitpod.v1.UserService/SetSuspended

Sets whether a user account is suspended.

Use this method to:

  • Suspend problematic users
  • Reactivate suspended accounts
  • Manage user access

Examples

  • Suspend user:

    Suspends a user account.

    userId: "f53d2330-3795-4c5d-a1f3-453121af9c60"
    suspended: true
  • Reactivate user:

    Removes suspension from a user account.

    userId: "f53d2330-3795-4c5d-a1f3-453121af9c60"
    suspended: false
ParametersExpand Collapse
body: UserSetSuspendedParams { suspended, userId }
suspended?: boolean
userId?: string
formatuuid
ReturnsExpand Collapse
UserSetSuspendedResponse = unknown

SetSuspended

import Gitpod from '@gitpod/sdk';

const client = new Gitpod({
  bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted
});

const response = await client.users.setSuspended({
  userId: 'f53d2330-3795-4c5d-a1f3-453121af9c60',
});

console.log(response);
{}
Returns Examples
{}