Roles
Get all roles of a user
GET https://yourwebsite.com/api/users/<user_id>/roles
Path Parameters
Name
Type
Description
user_id*
numeric
User's ID
[
{
"id": "2",
"discordRoleID": "673855784005795840",
"name": "Admin",
"slug": "admin",
"priority": "99",
"expiryDate": "1000-01-01 00:00:00", // Permanent role
},
{
"id": "3",
"discordRoleID": "673855784005795841",
"name": "VIP",
"slug": "vip",
"priority": "5",
"expiryDate": "2023-09-03 12:30:45", // Temporary role
}
]{
"status": false,
"error": "USER_NOT_FOUND",
"message": "User not found!"
}Add role to user
POST https://yourwebsite.com/api/users/<user_id>/roles
Path Parameters
Name
Type
Description
user_id*
numeric
User's ID
Request Body
Name
Type
Description
roleID*
numeric
expiryDate
string
[
{
"id": "2",
"discordRoleID": "673855784005795840",
"name": "Admin",
"slug": "admin",
"priority": "99",
"expiryDate": "1000-01-01 00:00:00", // Permanent role
},
{
"id": "3",
"discordRoleID": "673855784005795841",
"name": "VIP",
"slug": "vip",
"priority": "5",
"expiryDate": "2023-09-03 12:30:45", // Temporary role
}
]{
"status": false,
"error": "USER_NOT_FOUND",
"message": "User not found!"
}Update user roles
PATCH https://yourwebsite.com/api/users/<user_id>/roles/<role>
Path Parameters
Name
Type
Description
user_id*
numeric
User's ID
role
string
Role ID
Request Body
Name
Type
Description
roleID*
numeric
expiryDate
string
[
{
"id": "2",
"discordRoleID": "673855784005795840",
"name": "Admin",
"slug": "admin",
"priority": "99",
"expiryDate": "1000-01-01 00:00:00", // Permanent role
},
{
"id": "3",
"discordRoleID": "673855784005795841",
"name": "VIP",
"slug": "vip",
"priority": "5",
"expiryDate": "2023-09-03 12:30:45", // Temporary role
}
]{
"status": false,
"error": "USER_NOT_FOUND",
"message": "User not found!"
}Remove role from user
DELETE https://yourwebsite.com/api/users/<user_id>/roles/<role>
Path Parameters
Name
Type
Description
user_id*
numeric
User's ID
role*
string
Role ID
[
{
"id": "2",
"discordRoleID": "673855784005795840",
"name": "Admin",
"slug": "admin",
"priority": "99",
"expiryDate": "1000-01-01 00:00:00", // Permanent role
},
{
"id": "3",
"discordRoleID": "673855784005795841",
"name": "VIP",
"slug": "vip",
"priority": "5",
"expiryDate": "2023-09-03 12:30:45", // Temporary role
}
]{
"status": false,
"error": "USER_NOT_FOUND",
"message": "User not found!"
}Last updated