Create a user
POST
/api/v1/users
const url = 'http://localhost:8080/api/v1/users';const options = { method: 'POST', headers: { cookie: 'brokerium_session=<brokerium_session>', 'X-Brokerium-Request': '1', 'Content-Type': 'application/json' }, body: '{"username":"example","password":"example","role":"admin","disabled":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:8080/api/v1/users \ --header 'Content-Type: application/json' \ --header 'X-Brokerium-Request: 1' \ --cookie brokerium_session=<brokerium_session> \ --data '{ "username": "example", "password": "example", "role": "admin", "disabled": true }'Role: admin.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”X-Brokerium-Request
required
string
Required on every non-GET request.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
username
string
password
string format: password
role
string
disabled
boolean
Responses
Section titled “Responses”Created.
Media typeapplication/json
object
user
object
id
required
string
username
required
string
role
required
string
disabled
required
boolean
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
Example
{ "user": { "role": "admin" }}Error.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
Example generated
{ "error": { "code": "example", "message": "example" }}Apache®, Apache Kafka® and Kafka® are either registered trademarks or trademarks of the Apache Software Foundation in the United States and/or other countries. Brokerium is not affiliated with, endorsed by, or sponsored by the Apache Software Foundation.