Classic APIs
ClassicGroupsApi
primaryGroupForUser

primaryGroupForUser

Gets a user's primary group.

Parameters

NameTypeDescription
userIdIdentifierThe id of the user to get the primary group for.

Example

const { data: primaryGroup } = await ClassicGroupsApi.primaryGroupForUser({ userId: 45348281 }); 

Example Data

{
  group: {
    id: 5850082,
    name: "MightyPart Games",
    description: "Welcome to my amazing group",
    owner: {
      hasVerifiedBadge: false,
      userId: 45348281,
      username: "MightyPart",
      displayName: "MightyPart",
    },
    shout: null,
    isBuildersClubOnly: false,
    publicEntryAllowed: true,
    hasVerifiedBadge: false,
  },
  role: { id: 38353811, name: "NamelessGuy2005 - Scriptor", rank: 255 },
} 

Endpoint

GET /v1/users/{userId}/groups/primary/role