LeaderOS API
  • 👋Getting Started
    • Introduction
    • Authentication
  • 🔐Auth
    • Login
    • Register
    • Sessions
  • 🧑‍🦱Users
    • Profiles
    • Roles
    • Tickets
    • Orders
  • 🛍️Store
    • Listing
    • Products
    • Categories
    • Buy
    • Donations
  • 🍏Bazaar
    • Player Storages
    • Servers
  • 🚨Support
    • Tickets
    • Messages
    • Categories
    • Quick Answers
  • 🪙Credits
    • Show Credits
    • Add Credits
    • Remove Credits
    • Send Credits
    • Set Credits
  • 👍Vote
    • Vote Links
  • 🎮Discord
    • Users
    • Settings
    • Roles
Powered by GitBook
On this page
  • Get all roles of a user
  • Add role to user
  • Update user roles
  • Remove role from user
  1. Users

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!"
}
PreviousProfilesNextTickets

Last updated 4 months ago

🧑‍🦱