Sub-users
Sub-users are users for your API. While you can use your super-user for single user projects, it is a good idea to create sub-users for projects involving multiple users, which can be granted different privileges in the database.
Create a new sub-user
- HTTP
- CLI
Create a new sub-user
POST https://api.centia.io/api/v4/users HTTP/1.1
Content-Type: application/json
Authorization: Bearer abc123
{
"name": "joe",
"email": "joe@example.com",
"password": "Abc123!!"
}
Create multiple sub-users
POST https://api.centia.io/api/v4/users HTTP/1.1
Content-Type: application/json
Authorization: Bearer abc123
{
"users": [
{
"name": "joe",
"email": "joe@example.com",
"password": "Abc123!!"
},
{
"name": "peter",
"email": "peter@example.com",
"password": "Abc123!!"
}
]
}
Create a new sub-user
cen user add "joe"
Get sub-users
- HTTP
- CLI
A single sub-users
GET https://api.centia.io/api/v4/users/joe,peter HTTP/1.1
Accept: application/json; charset=utf-8
Authorization: Bearer abc123
A all sub-users
GET https://api.centia.io/api/v4/users HTTP/1.1
Accept: application/json; charset=utf-8
Authorization: Bearer abc123
A single sub-user
cen user get "joe"
Update sub-users
It is not possible to update the collection of all sub-users. Only explicit given sub-users.
- HTTP
- CLI
Update single sub-users
PATCH https://api.centia.io/api/v4/users/joe,peter HTTP/1.1
Content-Type: application/json
Authorization: Bearer abc123
{
"user_group": "planning"
}
A single user
cen user update "joe"
Delete sub-users
It is not possible to delete the collection of all sub-users. Only explicit given sub-users.
- HTTP
- CLI
Delete single sub-users
DELETE https://api.centia.io/api/v4/users/joe,peter HTTP/1.1
Accept: application/json; charset=utf-8
Authorization: Bearer abc123
cen user drop "joe"