Create a New User
This API creates a new user account within the tenant. The user is assigned to a role that defines their permissions and responsibilities within the system.
Endpoint Details
| URL | /v1/auth/users |
| Method | POST |
| Authorization | Bearer Token |
Request Headers
| Header | Type | Description |
|---|---|---|
| Content-Type | String | Must be application/json |
Request Body
Use the following format to make a request:
JSON Request
{
"first_name": "member",
"last_name": "aplikasi",
"email": "memberaplikasi12@example.com",
"description": "",
"role_code": "member"
}
Parameters
| Parameter | Type | Description |
|---|---|---|
| first_name | String | First name of the user |
| last_name | String | Last name of the user |
| String | Email address of the user | |
| description | String | Optional description of the user account |
| role_code | String | Role assigned to the user |
Response
Here is an example response after the request has been successfully processed:
Response
{
"user": {
"id": "ac7a586b-a0ba-41ce-bb55-343cc8ca6838",
"tenant_id": "5ebde17c-01a1-4394-977b-9e611250cf5d",
"email": "memberaplikasi12@example.com",
"first_name": "Member",
"last_name": "Aplikasi",
"role_code": "member",
"is_active": true,
"created_by": "0a937c60-0ed4-4d06-870a-2e284b54287d",
"updated_by": "0a937c60-0ed4-4d06-870a-2e284b54287d",
"created_at": 1784013339,
"updated_at": 1784013339
}
}
Field Descriptions
| Field | Type | Description |
|---|---|---|
| id | UUID | Unique identifier of the user |
| tenant_id | UUID | Identifier of the tenant that owns the user |
| String | Email address of the user | |
| first_name | String | First name of the user |
| last_name | String | Last name of the user |
| role_code | String | Role assigned to the user |
| is_active | Boolean | Indicates whether the user account is active |
| created_by | UUID | Identifier of the user who created the account |
| updated_by | UUID | Identifier of the user who last updated the account |
| created_at | Integer | User creation timestamp in Unix format |
| updated_at | Integer | Last update timestamp in Unix format |
info
- A valid Bearer Token is required to access this endpoint.
- The
role_codevalue must correspond to an existing role in the system. - Unix timestamp fields can be converted to a human-readable date and time format as needed.