Skip to main content

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

Create a new sub-user
POST https://api.centia.io/api/v4/users HTTP/1.1
Content-Type: application/json
Authorization: Bearer abc123

{
"name": "alx",
"email": "alx@gunsnroses.com",
"password": "Paradise_City!%Rck1987"
}
Create multiple sub-users
POST https://api.centia.io/api/v4/users HTTP/1.1
Content-Type: application/json
Authorization: Bearer abc123

{
"users": [
{
"name": "alx",
"email": "alx@gunsnroses.com",
"password": "Paradise_City!%Rck1987"
},
{
"name": "slash",
"email": "slash@gunsnroses.com",
"password": "November_Rain!%Pno1991"
},
{
"name": "izzy",
"email": "izzy@gunsnroses.com",
"password": "KnockinOn_HeavensDoor!%GnR1990"
},
{
"name": "duff",
"email": "duff@gunsnroses.com",
"password": "Welcome2_Jungle!%AxL1987"
},
{
"name": "steven",
"email": "steven@gunsnroses.com",
"password": "SweetChild_oMine!%Gtr1987"
}
]
}

Get sub-users

A single sub-users
GET https://api.centia.io/api/v4/users/alx,slash 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

Update sub-users

It is not possible to update the collection of all sub-users. Only explicit given sub-users.

Update single sub-users
PATCH https://api.centia.io/api/v4/users/alx,slash HTTP/1.1
Content-Type: application/json
Authorization: Bearer abc123

{
"user_group": "gunsnroses"
}

Delete sub-users

It is not possible to delete the collection of all sub-users. Only explicit given sub-users.

Delete single sub-users
DELETE https://api.centia.io/api/v4/users/izzy,steven HTTP/1.1
Accept: application/json; charset=utf-8
Authorization: Bearer abc123

Signup (Browser – Create a new user)

Centia.io supports signup via the browser. From your app, you can redirect the user to the signup page:

https://api.centia.io/signup?client_id=abc123&parentdb=mydb&redirect_uri=https://myapp.com/login

Parameters:

  • client_id: OAuth client id configured in Centia.io
  • parentdb: The parent/tenant database under which the new user should be created
  • redirect_uri: URL in your app to return to after sign‑up

The SDK has a helper function to redirect the user to the signup page.

Notes:

  • After the user completes sign‑up and is redirected back to your app, start your normal sign‑in flow (e.g., CodeFlow. A session is started when the user signed up, so the user will be signed in automatically in the flow.)
  • Client property allow_signup must be set to true for the used OAuth client.
  • Client property social_signup must be set to true for the user can sign up with social login.