Skip to content
Get started

Revoke user access

client.viewer.users.revokeAccess(UserRevokeAccessParams { userId } body, RequestOptionsoptions?): UserRevokeAccessResponse { success, message }
POST/v1/viewer/users/revoke-access

Deactivates a user’s access to the system. The user will no longer be able to log in or access resources. User data is preserved and can be reactivated later.

ParametersExpand Collapse
body: UserRevokeAccessParams { userId }
userId: string

User ID to revoke access for. Format: usr_{32-hex-chars}

ReturnsExpand Collapse
UserRevokeAccessResponse { success, message }

Response for revoking user access in Viewer

success: boolean
message?: string

Revoke user access

import Avara from 'avara-software';

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

const response = await client.viewer.users.revokeAccess({
  userId: 'usr_1234567890abcdef1234567890abcdef',
});

console.log(response.success);
{
  "success": true,
  "message": "User access revoked successfully"
}
Returns Examples
{
  "success": true,
  "message": "User access revoked successfully"
}