β Create User
Remember, in SPACE, users are not end-users of your SaaS application.
Instead, they represent the components that need to interact with SPACE through an apiKey
.
Each user account is assigned a role, which determines the operations they can perform.
As a quick reminder, SPACE defines three roles:
- π ADMIN β Can execute all operations, including user and service deletion.
- π οΈ MANAGER β Can perform all operations except destructive deletions (e.g., cannot permanently remove users or services).
- π EVALUATOR β Can only evaluate features. This role is recommended for most components that only need to check feature access.
π For more details, see SPACE Role Based Access Control.
To create a new user in SPACE, follow these steps:
1. Create Users via the UIβ
To create a new user account:
- Go to Access Control in the side panel.
- Click Add User at the top-right corner.
A dialog will appear asking for the new userβs data.
- Fill in the required fields, select a role, and click Add user.
Remember that ADMIN
users can create users with any role, while MANAGER
users can only create EVALUATOR
or MANAGER
users.
2. Create Users via the APIβ
You can also create users programmatically using the SPACE API. To do this, you need either an ADMIN
or MANAGER
API key.
Example with curlβ
curl --header 'x-api-key: <your_api_key>' \
--json '{"username":"johndoe","password":"foobarbaz","role":"MANAGER"}' \
http://localhost:5403/api/v1/users
Simplified POST /api/v1/users
request:β
POST /api/v1/users HTTP/1.1
Host: localhost:5403
Accept: application/json
Content-Type: application/json
x-api-key: <your_api_key>
{
"username": "johndoe",
"password": "foobarbaz",
"role": "MANAGER"
}
Example response bodyβ
{
"username": "johndoe",
"role": "MANAGER",
"createdAt": "2025-08-04T08:29:56.589Z",
"updatedAt": "2025-08-04T08:29:56.589Z",
"apiKey": "b2fb39e2407c47598ba4748189d32bb915c18357bc17c6a9d6e8064591f003dc"
}
β
Once the user is created, copy its apiKey
and use it in the x-api-key header to authenticate requests against the SPACE API for that user.