Bans API

Advanced and powerful global ban list API

post
Add a Ban

https://api.ksoft.si/bans/add
This endpoint allows you to add bans to the list. If you don't have BAN_MANAGER permission your ban will be automatically converted to a ban report and we will take a look and act accordingly.
Request
Response
Headers
Authorization
required
string
Authentication token
Form Data Parameters
user
required
number
Users Discord ID that you are banning/reporting
mod
optional
number
Users Discord ID who posted/reported the ban
user_name
optional
string
Users Discord username
user_discriminator
optional
number
Users Discord discriminator
reason
required
string
Reason why user should be globally banned
proof
required
string
URL of the image showing the act
appeal_possible
optional
boolean
If appeal should be disabled for that user.
200: OK
Ban was successfully recorded.
{"success": true}
400: Bad Request
Errors that are the cause of badly formatted form data.
{"code": 123, "error": true, "message": "missing required parameters"}
or
{"code": 124, "error": true, "message": "appeal_possible got invalid value"}
or
{"code": 124, "error": true, "message": "one of parameters got invalid value"}
409: Conflict
This user is already banned.
{
"code":125,
"error":true,
"exists":true,
"message":"User with this id is already on the list."
}

get
Get ban info

https://api.ksoft.si/bans/info
Get more information about a ban
Request
Response
Headers
Authorization
required
string
Authentication token
Query Parameters
user
required
number
Users Discord ID who's ban you'd like to check
200: OK
This is returned if ban is found
{
"id": 492811511081861130,
"name": "󐂪 discord.gg/bYNTxCJ 󐂪",
"discriminator": "3334",
"moderator_id": 205680187394752512,
"reason": "Anarchy Raider",
"proof": "https://imgur.com/a/eiOgTjS",
"is_ban_active": true,
"can_be_appealed": false,
"timestamp": "2018-09-21T23:58:32.743",
"appeal_reason": "",
"appeal_date": null,
"requested_by": "205680187394752512",
"exists": true
}
404: Not Found
This is returned when the ban is not found.
{
"code": 404,
"error": true,
"exists": false,
"message": "specified user does not exist"
}

get
Check user

https://api.ksoft.si/bans/check
Simple way to check if the user is banned
Request
Response
Headers
Authorization
required
string
Authentication token
Query Parameters
user
required
number
Users Discord ID that you'd like to check
200: OK
It returns true or false
{
"is_banned": true
}

delete
Delete ban

https://api.ksoft.si/bans/delete
Delete a ban, only users with BAN_MANAGER permission can use this.
Request
Response
Headers
Authorization
required
string
Authentication token
Query Parameters
user
required
number
Users Discord ID
force
optional
boolean
Default: false, if true it deletes the entry from the database instead of deactivating
200: OK
If successful
{"done": true}
401: Unauthorized
If you don't have BAN_MANAGER permission
{"code": 401, "error": True, "message": "you are not authorized to remove users"}

get
List of bans

https://api.ksoft.si/bans/list
Pagination of bans, you can request up to 1000 records per page, default is 20.
Request
Response
Headers
Authorization
required
string
Authentication token
Query Parameters
page
optional
integer
Page number (default: 1)
per_page
optional
integer
Number of bans per page (default: 20)
200: OK
{
"ban_count": 402,
"page_count": 134,
"per_page": 3,
"page": 1,
"on_page": 3,
"next_page": 2,
"previous_page": null,
"data": [
{
"id": 492811511081861130,
"name": "󐂪 discord.gg/bYNTxCJ 󐂪",
"discriminator": "3334",
"moderator_id": 205680187394752512,
"reason": "Anarchy Raider",
"proof": "https://imgur.com/a/eiOgTjS",
"is_ban_active": true,
"can_be_appealed": false,
"timestamp": "2018-09-21T23:58:32.743",
"appeal_reason": null,
"appeal_date": null
},
{
"id": 448253132003344384,
"name": "Jet The Red Spider",
"discriminator": "5154",
"moderator_id": 205680187394752512,
"reason": "Server Raiding. ",
"proof": "https://imgur.com/a/S4Eosul",
"is_ban_active": true,
"can_be_appealed": true,
"timestamp": "2018-09-19T12:42:04.353",
"appeal_reason": null,
"appeal_date": null
},
{
"id": 307898291000049684,
"name": "Sam Winchester",
"discriminator": "7053",
"moderator_id": 205680187394752512,
"reason": "DM Advertising",
"proof": "https://xignotic.is-going-to-rickroll.me/i/Bzx58zHJDuV7Jg.png",
"is_ban_active": true,
"can_be_appealed": true,
"timestamp": "2018-09-19T10:27:48.992",
"appeal_reason": null,
"appeal_date": null
}
]
}
400: Bad Request
Errors that you can get
{
"error": true,
"code": 666,
"message": "you are evil, you cannot get more than 1000 results per page"
}
or
{
"code": 124,
"error": true,
"message": "per_page parameter got invalid value"
}
or
{
"code": 124,
"error": true,
"message": "page parameter got invalid value"
}

get
Ban updates

https://api.ksoft.si/bans/updates
Gets updates from the previous update
Request
Response
Headers
Authorization
required
string
Authentication token
Query Parameters
timestamp
required
number
timestamp in seconds from 1.1.1970 (epoch time)
200: OK
{
"data": [
{
"id": 307898291000049684,
"reason": "DM Advertising",
"proof": "https://xignotic.is-going-to-rickroll.me/i/Bzx58zHJDuV7Jg.png",
"moderator_id": 205680187394752512,
"active": true
},
{
"id": 448253132003344384,
"reason": "Server Raiding. ",
"proof": "https://imgur.com/a/S4Eosul",
"moderator_id": 205680187394752512,
"active": true
}
],
"current_timestamp": 1537800258 //store this value for the next update
}