GROUP_ID = 12345
audit_logs = JSON.parse HTTPClient.rbx_request(
:get,
"https://groups.roblox.com/v1/groups/#{GROUP_ID}/audit-log",
{
:params => {
:actionType => :ChangeRank, # Optional parameter
:userId => 12345, # Optional parameter
:sortOrder => :Asc, # Optional parameter
:limit => 10, # Optional parameter
:cursor => "2_1_30f7a44e7a6552e7a299b959305e2df8" # Optional parameter
}
}
)
audit_logs.each do |log|
puts "#{log.actor.user.username} | #{log.actionType}"
end
Groups
The Roblox Groups API allows you to perform almost any action related to a group that you can on the website.
All examples here use the function from X-CSRF-Token#Request_function.
Get group information[edit | edit source]
There are two main endpoints you can use to get information about a group: v1 and v2. v2 is fairly recent and provides a creation date, but is missing some information you might need.
Groups v1[edit | edit source]
To get group information with Groups v1, use thehttps://groups.roblox.com/v1/groups/{groupId}
endpoint. It returns data that looks like this:{
"id": 1,
"name": "RobloHunks",
"description": "",
"owner": {
"buildersClubMembershipType": "None",
"userId": 1179762,
"username": "RobloTim",
"displayName": "RobloTim"
},
"shout": null,
"memberCount": 30381,
"isBuildersClubOnly": false,
"publicEntryAllowed": true
}
Field Name | Type | Explanation |
---|---|---|
id | int | The group's ID. |
name | str | The group's name. |
description | str | The group's description |
owner | GroupsV1Owner | The owner of the group. |
shout | str? | The group shout. Will be null if no shout is present. |
memberCount | int | The amount of members in the group. |
isBuildersClubOnly | bool | Whether the group only allows Builders Club (now Premium) members. Deprecated
|
publicEntryAllowed | bool | Whether the group is public or not. |
Field Name | Type | Explanation |
---|---|---|
buildersClubMembershipType | str | Whether the user has Builders Club. Deprecated
|
userId | int | The user's ID. |
username | str | The user's name. |
displayName | str | The user's display name. |
Groups v2[edit | edit source]
To get group information with Groups v2, use the https://groups.roblox.com/v2/groups?groupIds=GROUPIDS
endpoint. It returns data that looks like this:
{
"data": [
{
"id": 1,
"name": "RobloHunks",
"description": "",
"owner": {
"id": 1179762,
"type": "User"
},
"created": "2009-07-30T05:20:30.417Z"
}
]
}
Field Name | Type | Explanation |
---|---|---|
id | int | The group's ID. |
name | str | The group's name. |
description | str | The group's description. |
owner | GroupsV2Owner | The owner of the group. |
created | str | The group's creation date as an ISO 8601 string. |
Field Name | Type | Explanation |
---|---|---|
id | int | The owner's ID. |
type | str | The type of the owner. This is always User. |
Strangely, this endpoint seems to define the type of the group's owner, but all groups must be owned by users.
Get group audit logs[edit | edit source]
To get group audit logs, use the https://groups.roblox.com/v1/groups/{groupId}/audit-log
endpoint.
.ROBLOSECURITY
cookie to use this endpoint.GROUP_ID = 12345
response = rbx_request(
"GET",
f"https://groups.roblox.com/v1/groups/{GROUP_ID}/audit-log",
params={
"actionType": "ChangeRank", # Optional parameter
"userId": 12345, # Optional parameter
"sortOrder": "Asc", # Optional parameter
"limit": 10, # Optional parameter
"cursor": "2_1_30f7a44e7a6552e7a299b959305e2df8" # Optional parameter
})
audit_logs = response.json()
for log in audit_logs .data:
print(f"{log.actor.user.username} | {log.actionType}")
import { Response } from "node-fetch";
const groupid = 12345
rbxRequest("GET", `https://groups.roblox.com/v1/groups/${groupid}/audit-log`, {
"actionType": "ChangeRank", // Optional parameter
"userId": 12345, // Optional parameter
"sortOrder": "Asc", // Optional parameter
"limit": 10, // Optional parameter
"cursor": "2_1_30f7a44e7a6552e7a299b959305e2df8" // Optional parameter
}).then(res: Response => {
res.json().then(json => {
for (const log of json.data) {
console.log(`${log.actor.user.username} | ${log.actionType}`)
}
}).catch(console.error)
}).catch(console.error)
// Replace .then() with awaits if you are working within an async function
const groupid = 12345
rbxRequest("GET", `https://groups.roblox.com/v1/groups/${groupid}/audit-log`, {
"actionType": "ChangeRank", // Optional parameter
"userId": 12345, // Optional parameter
"sortOrder": "Asc", // Optional parameter
"limit": 10, // Optional parameter
"cursor": "2_1_30f7a44e7a6552e7a299b959305e2df8" // Optional parameter
}).then(res => {
res.json().then(json => {
for (const log of json.data) {
console.log(`${log.actor.user.username} | ${log.actionType}`)
}
}).catch(console.error)
}).catch(console.error)
// Replace .then() with awaits if you are working within an async function
This endpoint fetches the following information:
- Previous page cursor (
previousPageCursor
) - Next page cursor (
nextPageCursor
) - Audit log entries [this is an array/list] (
data
)- Action performer (
actor
)- Partial information about action performer (
user
)- Builder's Club membership level (
buildersClubMembershipType
) - User ID (
userId
) - Username (
username
) - Display name (
displayName
)
- Builder's Club membership level (
- Action performer role information (
role
)- Role ID [this isn't 1-255] (
id
) - Role name (
name
) - Role rank [this is 1-255] (
rank
)
- Role ID [this isn't 1-255] (
- Partial information about action performer (
- Action type (
actionType
) - Action description (
description
)- Target user ID (
TargetId
) - Target user name (
TargetName
) - Old role ID (
OldRoleSetId
) - Old role name (
OldRoleSetName
) - New role ID (
NewRoleSetId
) - New role name (
NewRoleSetName
)
- Target user ID (
- Date action performed (
created
)
- Action performer (
Get group settings[edit | edit source]
To get group settings, use the https://groups.roblox.com/v1/groups/{groupId}/settings
endpoint.
.ROBLOSECURITY
cookie to use this endpoint.GROUP_ID = 12345
group_settings = JSON.parse HTTPClient.rbx_request(
:get,
"https://groups.roblox.com/v1/groups/#{GROUP_ID}/settings"
)
puts "Approval required: #{group_settings.isApprovalRequired}"
GROUP_ID = 12345
response = rbx_request(
"GET",
f"https://groups.roblox.com/v1/groups/{GROUP_ID}/settings"
)
group_settings = response.json()
print(f"Approval required: {group_settings.isApprovalRequired}")
This endpoint fetches the following information:
- Member approval [acceptance] required (
isApprovalRequired
) - Builder's Club required (
isBuildersClubRequired
) - Enemies allowed (
areEnemiesAllowed
) - Group funds publicly visible (
areGroupFundsVisible
) - Group games publicly visible (
areGroupGamesVisible
) - Group name change enabled (
isGroupNameChangeEnabled
) - Can change group name (
canChangeGroupName
)