Ban someone
const url = 'https://api.gampeon.com/v1/communities/1/bans';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"handle":"example","reason":"example","deleteMessagesHours":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.gampeon.com/v1/communities/1/bans \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "handle": "example", "reason": "example", "deleteMessagesHours": 1 }'Needs banMembers and a highest role above theirs. Removes them and blocks joining again, also with invites. deleteMessagesHours removes their messages of the last 1, 24 or 168 hours.
Not available with access tokens.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Community ID
Request Bodyrequired
Section titled “Request Bodyrequired”object
Optional reason, shown to the person affected
0, 1, 24 or 168
Example generated
{ "handle": "example", "reason": "example", "deleteMessagesHours": 1}Responses
Section titled “Responses”Banned
object
Example generated
{ "banned": "example"}Error codes: invalid_field
object
Machine-readable error code, for example not_found or rate_limited.
Human-readable detail. Only present for some errors.
Example generated
{ "error": "example", "message": "example"}Error codes: unauthorized
object
Machine-readable error code, for example not_found or rate_limited.
Human-readable detail. Only present for some errors.
Example generated
{ "error": "example", "message": "example"}Error codes: token_not_allowed, missing_permission, role_hierarchy, forbidden
object
Machine-readable error code, for example not_found or rate_limited.
Human-readable detail. Only present for some errors.
Example generated
{ "error": "example", "message": "example"}Error codes: not_found
object
Machine-readable error code, for example not_found or rate_limited.
Human-readable detail. Only present for some errors.
Example generated
{ "error": "example", "message": "example"}