What to distinguish
When working with users via API, distinguish between two separate operations:
Creating a global user – the user is created at the service level.
Adding a user to a specific company – the user gains access to the selected company with a specific role.
Without being added to a company, simply creating the user will have no practical impact on access to that company.
💡 Info: The procedures below have been verified in the Postman app against a Flexi cloud instance.
Creating a global user
You create a global user by sending a PUT or POST request to the endpoint /u.json
JSON is supported in the request body. The available fields for editing can be found by sending a GET request to the same endpoint /u.json
Server permissions (suitable for the ADMIN role) with true/false values corresponding to this setting:
createCompany > allows creating companies
deleteCompany > allows deleting companies
createUser > allows creating users
changePassword > allows changing users' passwords
grantPermisson > allows granting permissions to users
licenseMgmt > allows managing licenses
Procedure
Send a
PUTto the endpoint/uSet the
Content-Type: application/jsonheader.Include in the JSON body the fields you want to set
Once completed successfully, the global user is created.
Verified example
PUT
https://alpe.flexibee.eu:5434/u.json
Content-Type: application/json
{
"username": "json",
"givenName": "name",
"familyName": "familyN",
"email": "json@admin.cz",
"userType": "READ_ONLY",
"password": "heslo_uzivaele_123",
"blocked": false,
"permissions": {
"manageAll": false,
"createCompany": false,
"deleteCompany": false,
"createUser": false,
"changePassword": false,
"grantPermission": false,
"licenseMgmt": false
},
"defaultRole": "UZIVATEL",
"overrideRole": false,
"apiAccessEnabled": false
}
This call creates the user json.
Editing a user
Editing a user is done by calling PUT on the endpoint /u/{uzivatel}.json
and supports JSON in the request body.
Procedure
Send a
PUTto the endpoint/u/{uzivatel}.jsonSet the
Content-Type: application/jsonheader.Include in the JSON body the fields you want to update
Verified example
PUT
https://alpe.flexibee.eu:5434/u/api_new.json
Content-Type: application/json
{
"email": "new_email@email.cz"
}
Adding a user to a company
After creating a global user, you need to add them to a specific company. This is done via the company's user record endpoint.
Procedure
Send a
PUTto the endpoint/c/{firma}/uzivatelSet the
Content-Type: application/jsonheaderInclude in the JSON body the user and the role they should have in the given company
Verified example
PUT
https://alpe.flexibee.eu:5434/c/sk_firma_cloud/uzivatel
Content-Type: application/json
{ "winstrom": { "uzivatel": [ { "id": "code:api_new", "role": "code:ADMIN" } ] } }
In this example, the user api_new is added to the company sk_firma_cloud with the role ADMIN.
💡 Info: The default role assigned when creating a global user and the role assigned within a company are two different things.
Editing a user's role in a company
Just like adding a user, editing is done by calling PUT on the endpoint /c/{firma}/uzivatel
with the values provided in the JSON request body.
Procedure
Send a
PUTto the endpoint/c/{firma}/uzivatelSet the
Content-Type: application/jsonheader.Include in the JSON body the fields you want to update, for example changing the role to SKLADNIK
Verified example
PUT
https://alpe.flexibee.eu:5434/c/flexi_gui_s_r_o_/uzivatel
Content-Type: application/json
{
"winstrom": {
"uzivatel": [
{
"id": "code:api_new",
"role": "code:SKLADNIK"
}
]
}
}
Removing a user from a company
If you need to revoke a user's access to a specific company, delete their link to the company in the uzivatel record.
Procedure
Send a
PUTto the endpoint/c/{firma}/uzivatel.Set the
Content-Type: application/jsonheader.In the body, use the
deleteaction along with the user's identification.
Verified example
PUT
https://alpe.flexibee.eu:5434/c/sk_firma_cloud/uzivatel
Content-Type: application/json
{ "winstrom": { "uzivatel": [ { "@action": "delete", "id": "code:api_new" } ] } }
This call removes the user api_new from the company sk_firma_cloud.
⚠️ Warning: This step removes the user from a specific company, but if that is their only assigned company, the user will be deleted globally.
If the user already has historical records linked to them in the database, removal will fail. In such a case, use User blocking instead.
Blocking a user
Blocking the user normal_v1 with cURL:
curl -u "user:password" -X POST -d "blocked=true" "https://moje.flexibee.eu/u/normal_v1.json"
In Postman:
POST
https://alpe.flexibee.eu:5434/u/normal_v1.json
JSON body
{
"blocked": true,
"blocked@message": "Blocked from API"
}⚠️ Warning: Blocking a user frees up their license and prevents them from logging in. To unblock, use the same call with the value "false".
Listing all users
To review all global users, use a listing query against the endpoint /u.json.
Procedure
GET
https://alpe.flexibee.eu:5434/u.json
Returns a list of all users.
Listing users of a specific company
If you need to find out which users are connected to a specific company, use the company's user record.
Procedure
GET
https://alpe.flexibee.eu:5434/c/sk_firma_cloud/uzivatel.json?limit=0&detail=full
Returns users linked to the specific company.
⚠️ Warning
The parameter limit=0 removes the default limit of 20 records, returning an unlimited number of results, so you can retrieve all users of the given company.
The parameter detail=full displays all fields and their values for full detail.
Listing roles in a company
You can find out the roles available in a company by querying the role record.
Procedure
Send a GET to
c/{firma}/role.jsonIn the JSON body, set the desired level of output detail.
For a clear list, return only the ID, code, and name.
Verified example
GET
https://alpe.flexibee.eu:5434/c/sk_firma_cloud/role.json?limit=0
This way you get an overview of the roles available in the selected company.
⚠️ Warning
Here, the parameter detail=full returns a list of all configured permissions, i.e. over 10,000 rows per single role. If you need to read the permission settings for a role, it's recommended to limit the query to just one role, for example the ADMIN role:
https://alpe.flexibee.eu:5434/c/sk_firma_cloud/role/code:ADMIN.json?detail=full
Endpoint overview
Operation | Method and endpoint | Note |
Creating a global user | PUT or POST | JSON body |
Editing a global user | PUT | JSON body |
Editing a user in a company | PUT | JSON body |
Adding a user to a company | PUT | JSON body |
Removing a user from a company | PUT |
|
Blocking a user | POST | the value blocked=true is sent in Postman via an x-www-form-urlencoded body |
Listing all users | GET | Global users |
Listing users in a company | GET | Users of a specific company |
Listing roles | GET | Recommended custom detail |
What to watch out for
⚠️ Warning: Creating a user and adding them to a company are two separate operations. Both need to be performed.
⚠️ Warning: Listings using detail=full can be significantly large and less readable.
⚠️ Warning: It's recommended to test and fine-tune user management via API in a testing environment or against a test database.
⚠️ Warning: Roles are currently read-only; they cannot be written via the API.
Related articles
Batch operations, Batch API
User roles in the API

