Update User
This API updates an existing user account, including its role, active status, and description.
Endpoint Details
| URL | /v1/auth/users/id |
| Method | PUT |
| Authorization | Bearer Token |
Request Headers
| Header | Type | Description |
|---|---|---|
| Content-Type | String | Must be application/json |
Request Path
To update an existing user, use the following request format:
/v1/auth/users/ac7a586b-a0ba-41ce-bb55-343cc8ca6838
Path Parameter
| Parameter | Type | Description |
|---|---|---|
| id | UUID | Unique identifier of the user to update |
Request Body
Use the following format to make a request:
JSON Request
{
"role_code": "member",
"is_active": false,
"description": "contoh teks"
}
Body Parameters
| Parameter | Type | Description |
|---|---|---|
| role_code | String | Updated role assigned to the user |
| is_active | Boolean | Indicates whether the user account is active |
| description | String | Optional description of the user account |
Response
Here is an example response when the data is successfully updated:
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",
"description": "contoh teks",
"created_by": "0a937c60-0ed4-4d06-870a-2e284b54287d",
"updated_by": "0a937c60-0ed4-4d06-870a-2e284b54287d",
"created_at": 1784013339,
"updated_at": 1784014922
}
}
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 |
| description | String | Description of the user account |
| 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
idpath parameter must reference an existing user. - Unix timestamp fields can be converted to a human-readable date and time format as needed.