Users Endpoint

Manage general settings and data for all users. This endpoint allows for the creation of users and getting all users in the database.

Get All Users

GET https://accountable.pixelninja.dev/:token/users

This will fetch an array of ALL users in the database. It is good for searching for users and should be cached to save re-fetching due to the ratelimit being 3 per 10 seconds. The cached version should be cleared when you change any value.

Path Parameters

Name
Type
Description

token

string

This is your API token.

[{
    "username": "admin",
    "uuid": "3ae74cfd-3174-49e2-ab99-1310bb89fa67",
    "password": "$2b$12$O1l14ukIqsL8S/0L1E2IsOYtfvkgtS2H7oJYfKcuMMZVlRSAEnakO",
    "accessToken": "M2FlNzRjZmQtMzE3NC00OWUyLWFiOTktMTMxMGJiODlmYTY3.MTYxNjAxODY1MTAyNw.exyGGW61aV04V4GcFUXRIpS1mIqeiSpl",
    "passwordLastChanged": 1616018651027,
    "createdAt": 1616018651027,
    "permissions": 0,
    "customAttributes": {},
    "2fa": {
        "enabled": true,
        "enabledAt": 1616154804936,
        "token": "HBBWWLRYN4WF4YZDGVYWKWRVMFRXQ5JYO4UVIS25KBFVW52WGAXA",
        "mfaToken": "AYIspPs91RUYdabk9WdZvKO3lA9v2MTS"
    },
    "scopes": {
        "key": "",
        "permissions": [],
        "timeout": 0
    }
}, {
    "username": "Example user",
    "uuid": "333394e3-4330-4d35-95bb-7e3433aff320",
    "password": "$2b$12$T9f6EnnE7dtTP/hYjZIwVOXh09LuOIGCXmedjqjEkOZLRXCtww7SS",
    "accessToken": "MzMzMzk0ZTMtNDMzMC00ZDM1LTk1YmItN2UzNDMzYWZmMzIw.MTYxNjQ1MDk0OTAwMg.LPmobKhyza2Q8Hc5G2mESGQXNj19g99a",
    "passwordLastChanged": 1616450949002,
    "createdAt": 1616450949002,
    "permissions": 0,
    "customAttributes": {},
    "2fa": {
        "enabled": false
    },
    "scopes": {
        "key": "",
        "permissions": [],
        "timeout": 0
    }
}]

Create user account

POST https://accountable.pixelninja.dev/:token/users

This will create a new user account with the details provided. You can use this endpoint up to 4 times per 10 seconds - if you needing to create more than this, try a queue system where requests will wait till the time has reset.

Path Parameters

Name
Type
Description

token

string

This is your API token.

Request Body

Name
Type
Description

username

string

This is the username of the user you are creating.

password

string

This is the password of the user you are creating.

permissions

integer

This is a permission integer between 1-1024.

{
    "username": "Example user 1",
    "uuid": "333394e3-4330-4d35-95bb-7e3433aff320",
    "password": "$2b$12$T9f6EnnE7dtTP/hYjZIwVOXh09LuOIGCXmedjqjEkOZLRXCtww7SS",
    "accessToken": "MzMzMzk0ZTMtNDMzMC00ZDM1LTk1YmItN2UzNDMzYWZmMzIw.MTYxNjQ1MDk0OTAwMg.LPmobKhyza2Q8Hc5G2mESGQXNj19g99a",
    "passwordLastChanged": 1616450949002,
    "createdAt": 1616450949002,
    "permissions": 0,
    "customAttributes": {},
    "2fa": {
        "enabled": false
    },
    "scopes": {
        "key": "",
        "permissions": [],
        "timeout": 0
    }
}

Encoding usernames can be useful if you allow special characters.

Last updated

Was this helpful?