User management

This page provides basic information to facilitate user management interaction. For more comprehensive details, please refer to the Swagger documentation.

To manage users with the API, retrieve your access token as described in the previous sections.

Retrieve current users

To retrieve current users, you can invoke the GET /users/ route using the following curl request.

curl -X 'GET' \
  'http://localhost:8001/users/' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <your_retrieved_access_token>'

Create a new domain

To create a new user, it is imperative that the domain is already in existence. Use the POST /domains/{domainname} endpoint to create a new domain. Below is an example curl request to create the domain example.com:

curl -X 'POST' \
  'http://localhost:8001/domains/example.com/' \
  -H 'accept: application/json'

Create new users

To create a new user, use the POST /users/ route.

Warning

Please ensure that the domain associated with the uid value already exists before proceeding.

curl -X 'POST' \
  'http://localhost:8001/users/' \
  -H 'Authorization: Bearer <your_retrieved_access_token>' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "uid": "max.mustermann@example.com",
  "cn": "Max",
  "sn": "Mustermann",
  "kopanoUser": 1,
  "kopanoAccountEnabled": 1,
  "userPassword": "password123"
}'