Webservices » History » Version 1
Sachin Divekar, 02/11/2023 05:06 PM
1 | 1 | Sachin Divekar | # Webservices |
---|---|---|---|
2 | |||
3 | # user_create |
||
4 | |||
5 | Creates a new user. |
||
6 | |||
7 | ## Request |
||
8 | |||
9 | **Endpoint** |
||
10 | |||
11 | ``` |
||
12 | POST /users |
||
13 | ``` |
||
14 | |||
15 | **URL Parameters:** |
||
16 | |||
17 | - `realmName` (string): Name of the realm for new user creation. |
||
18 | |||
19 | |||
20 | ```json |
||
21 | { |
||
22 | "username": "rahuld", |
||
23 | "email": "rahul@example.com", |
||
24 | "firstName": "Rahul", |
||
25 | "lastName": "Deshpande", |
||
26 | "enabled": true |
||
27 | } |
||
28 | ``` |
||
29 | |||
30 | - `username`: string, required. Username for the user. |
||
31 | - `email`: string, required. User's email address. |
||
32 | - `firstName`: string, optional. User's first name. |
||
33 | - `lastName`: string, optional. User's last name. |
||
34 | - `enabled`: boolean, required. Indicates if user account is enabled. |
||
35 | |||
36 | ## Response |
||
37 | |||
38 | ```json |
||
39 | { |
||
40 | "id": "df84nsd....", |
||
41 | "username": "rahuld", |
||
42 | "email": "rahul@example.com", |
||
43 | "firstName": "Rahul", |
||
44 | "lastName": "Deshpande", |
||
45 | "enabled": true |
||
46 | } |
||
47 | ``` |
||
48 | |||
49 | - `id`: string, required. Unique user ID. |
||
50 | - `username`: string, required. Username for the user. |
||
51 | - `email`: string, optional. User's email address. |
||
52 | - `firstName`: string, optional. User's first name. |
||
53 | - `lastName`: string, optional. User's last name. |
||
54 | - `enabled`: boolean, required. Indicates if user account is enabled. |
||
55 | |||
56 | ### Potential Error Codes |
||
57 | - `REALM_NOT_FOUND`: Specified realm does not exist. |
||
58 | - `USERNAME_EXISTS`: User with provided username already exists in the realm. |