Skip to content
GAMPEONCreate
New project

Ban someone

POST
/v1/communities/{id}/bans
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.

id
required
integer
>= 1

Community ID

Media typeapplication/json
object
handle
required
string
/^[a-z0-9_]{3,24}$/
reason

Optional reason, shown to the person affected

string
<= 300 characters
deleteMessagesHours

0, 1, 24 or 168

integer

Example generated

{
"handle": "example",
"reason": "example",
"deleteMessagesHours": 1
}

Banned

Media typeapplication/json
object
banned
required
string

Example generated

{
"banned": "example"
}

Error codes: invalid_field

Media typeapplication/json
object
error
required

Machine-readable error code, for example not_found or rate_limited.

string
message

Human-readable detail. Only present for some errors.

string

Example generated

{
"error": "example",
"message": "example"
}

Error codes: unauthorized

Media typeapplication/json
object
error
required

Machine-readable error code, for example not_found or rate_limited.

string
message

Human-readable detail. Only present for some errors.

string

Example generated

{
"error": "example",
"message": "example"
}

Error codes: token_not_allowed, missing_permission, role_hierarchy, forbidden

Media typeapplication/json
object
error
required

Machine-readable error code, for example not_found or rate_limited.

string
message

Human-readable detail. Only present for some errors.

string

Example generated

{
"error": "example",
"message": "example"
}

Error codes: not_found

Media typeapplication/json
object
error
required

Machine-readable error code, for example not_found or rate_limited.

string
message

Human-readable detail. Only present for some errors.

string

Example generated

{
"error": "example",
"message": "example"
}

Report a problem with this pageOther ways to give feedback