A directory group represents an organizational unit of users in a directory provider.
const group = { id: 'directory_group_01E64QTDNS0EGJ0FMCVY9BWGZT', idpId: '02grqrue4294w24', directoryId: 'directory_01ECAZ4NV9QMV47GW873HDCX74', organizationId: 'org_01EZTR6WYX1A0DSE2CYMGXQ24Y', name: 'Developers', createdAt: '2021-06-25T19:07:33.155Z', updatedAt: '2021-06-25T19:07:33.155Z', rawAttributes: {}, };
interface DirectoryGroupGet the details of an existing Directory Group.
import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS('sk_example_123456789'); const group = await workos.directorySync.getGroup( 'directory_group_01E64QTDNS0EGJ0FMCVY9BWGZT', );
Get a list of all of existing directory groups matching the criteria specified.
import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS('sk_example_123456789'); const groups = await workos.directorySync.listGroups({ directory: 'directory_01ECAZ4NV9QMV47GW873HDCX74', }); console.log(groups.data);
directorySync .listGroups()Parameters objectReturns object