Can you ban people Via the Roblox API?
I have tried many times, but it didn’t work.
Here is an example:
https://apis.roblox.com/bans/v1/universes/YOUR_UNIVERSE_ID/bans
It returned every time the error code 0.
Can you ban people Via the Roblox API?
I have tried many times, but it didn’t work.
Here is an example:
https://apis.roblox.com/bans/v1/universes/YOUR_UNIVERSE_ID/bans
It returned every time the error code 0.
You can send a PATCH request to the OpenCloud endpoint with an API key, like @Nitefal said.
//JavaScript example
const userId = //UserId of the user to ban
const banLength = 300; //how long to ban the user for
const universeId = //your universe id
fetch(`https://apis.roblox.com/cloud/v2/universes/${universeId}/user-restrictions/${userId}`, {
method: "PATCH",
headers: {
"content-type": "application/json",
"x-api-key": //your API key
},
body: JSON.stringify({gameJoinRestriction: {
active: true,
duration: String(banLength) + "s",
privateReason: "reason private",
displayReason: "reason to display",
excludeAltAccounts: false
}})
}).catch(error => console.log(error));
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.