Skip to content

Class: Groups

Defined in: src/resources/groups.ts:19

API client for Roblox Group endpoints. Provides methods to retrieve group information, shouts, and group memberships.

See

https://create.roblox.com/docs/cloud/reference/Group

Constructors

Constructor

ts
new Groups(http): Groups;

Defined in: src/resources/groups.ts:25

Creates a new Groups API client.

Parameters

ParameterTypeDescription
httpHttpClientHTTP client for making API requests

Returns

Groups

Methods

get()

ts
get(groupId): Promise<Group>;

Defined in: src/resources/groups.ts:43

Retrieves a Roblox group's information by group ID.

Parameters

ParameterTypeDescription
groupIdstringThe unique group ID (numeric string)

Returns

Promise<Group>

Promise resolving to the groups's data

Throws

If API key is invalid

Throws

If the group is not found or other API error occurs

Example

typescript
const group = await client.groups.get('123456789');
console.log(group.displayName); // "Roblox"

See

https://create.roblox.com/docs/cloud/reference/Group#Cloud_GetGroup


listGroupJoinRequests()

ts
listGroupJoinRequests(groupId, options): Promise<JoinRequestItemsPage>;

Defined in: src/resources/groups.ts:80

List join requests under a group. Supports additional filtering. Supports pagination for large invite-only groups.

Parameters

ParameterTypeDescription
groupIdstringThe unique group ID (numeric string)
optionsListOptions & { filter?: string; }List options including pagination and filtering

Returns

Promise<JoinRequestItemsPage>

Promise resolving to a page of group invite items

Throws

If API key is invalid

Throws

If the group is not found or other API error occurs

Example

typescript
// Get first page of join requests
const page1 = await client.groups.listGroupJoinRequests('123456789', {
  maxPageSize: 50
});

// Get next page
const page2 = await client.groups.listGroupJoinRequests('123456789', {
  pageToken: page1.nextPageToken
});

// Filter for a specific user
const user = await client.groups.listGroupJoinRequests('123456789', {
  filter: "user == 'users/156'"
});

See

https://create.roblox.com/docs/cloud/reference/GroupJoinRequest#Cloud_ListGroupJoinRequests


acceptGroupJoinRequest()

ts
acceptGroupJoinRequest(groupId, joinRequestId): Promise<void>;

Defined in: src/resources/groups.ts:116

Accept group join request by group ID and join request ID.

Parameters

ParameterTypeDescription
groupIdstringThe unique group ID (numeric string)
joinRequestIdstringThe unique join request ID (numeric string)

Returns

Promise<void>

Promise resolving when the join request is accepted

Throws

If API key is invalid

Throws

If the group or join request is not found or other API error occurs

Example

typescript
await client.groups.acceptGroupJoinRequest('123456789', '987654321');
console.log('Join request accepted');

See

https://create.roblox.com/docs/cloud/reference/GroupJoinRequest#Cloud_AcceptGroupJoinRequest


declineGroupJoinRequest()

ts
declineGroupJoinRequest(groupId, joinRequestId): Promise<void>;

Defined in: src/resources/groups.ts:145

Decline group join request by group ID and join request ID.

Parameters

ParameterTypeDescription
groupIdstringThe unique group ID (numeric string)
joinRequestIdstringThe unique join request ID (numeric string)

Returns

Promise<void>

Promise resolving when the join request is declined

Throws

If API key is invalid

Throws

If the group or join request is not found or other API error occurs

Example

typescript
await client.groups.declineGroupJoinRequest('123456789', '987654321');
console.log('Join request declined');

See

https://create.roblox.com/docs/cloud/reference/GroupJoinRequest#Cloud_DeclineGroupJoinRequest


listGroupMemberships()

ts
listGroupMemberships(groupId, options): Promise<GroupMembershipItemsPage>;

Defined in: src/resources/groups.ts:178

List group members in a group. Supports pagination for high membercounts.

Parameters

ParameterTypeDescription
groupIdstringThe unique group ID (numeric string)
optionsListOptions & { filter?: string; }List options for pagination

Returns

Promise<GroupMembershipItemsPage>

Promise resolving to a page of group membership items

Throws

If API key is invalid

Throws

If the group is not found or other API error occurs

Example

typescript
const members = await client.groups.listGroupMemberships('123456789');
console.log(members)

See

https://create.roblox.com/docs/cloud/reference/GroupMembership#Cloud_ListGroupMemberships


getGroupShout()

ts
getGroupShout(groupId): Promise<GroupShout>;

Defined in: src/resources/groups.ts:213

Get group shout by group ID.

Parameters

ParameterTypeDescription
groupIdstringThe unique group ID (numeric string)

Returns

Promise<GroupShout>

Promise resolving to the group's shout data

Throws

If API key is invalid

Throws

If the group is not found or other API error occurs

Example

typescript
const shout = await client.groups.getGroupShout('123456789');
console.log(shout.content); // "Welcome to the group!"

See

https://create.roblox.com/docs/cloud/reference/GroupShout#Cloud_GetGroupShout


listGroupRoles()

ts
listGroupRoles(groupId, options): Promise<GroupRolesPage>;

Defined in: src/resources/groups.ts:236

List group roles by group ID.

Parameters

ParameterTypeDescription
groupIdstringThe unique group ID (numeric string)
optionsListOptionsList options for pagination

Returns

Promise<GroupRolesPage>

Promise resolving to an array of group roles

Throws

If API key is invalid

Throws

If the group is not found or other API error occurs

Example

typescript
const roles = await client.groups.listGroupRoles('123456789');
console.log(roles);

See

https://create.roblox.com/docs/cloud/reference/GroupRole#Cloud_ListGroupRoles


getGroupRole()

ts
getGroupRole(groupId, roleId): Promise<GroupRole>;

Defined in: src/resources/groups.ts:268

Get group role by group ID and role ID.

Parameters

ParameterTypeDescription
groupIdstringThe unique group ID (numeric string)
roleIdstringThe unique role ID (numeric string)

Returns

Promise<GroupRole>

Promise resolving to the group's role data

Throws

If API key is invalid

Throws

If the group or role is not found or other API error occurs

Example

typescript
const role = await client.groups.getGroupRole('123456789', '7920705');
console.log(role.displayName); // "Admin"

See

https://create.roblox.com/docs/cloud/reference/GroupRole#Cloud_GetGroupRole


updateGroupMembership()

ts
updateGroupMembership(
   groupId, 
   membershipId, 
roleId): Promise<GroupMembershipItem>;

Defined in: src/resources/groups.ts:292

Update group membership by group ID, membership ID and role ID.

Parameters

ParameterTypeDescription
groupIdstringThe unique group ID (numeric string)
membershipIdstringThe unique membership ID (numeric string)
roleIdstringThe unique role ID to assign (numeric string)

Returns

Promise<GroupMembershipItem>

Promise resolving when the group membership is updated

Throws

If API key is invalid

Throws

If the group, membership, or role is not found or other API error occurs

Example

typescript
const groupMembership = await client.groups.updateGroupMembership('123456789', '456789123', '7920705');
console.log(groupMembership.role);

See

https://create.roblox.com/docs/cloud/reference/GroupMembership#Cloud_UpdateGroupMembership