Skip to main content

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
MethodPOST
AuthorizationBearer Token

Request Headers

HeaderTypeDescription
Content-TypeStringMust 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

ParameterTypeDescription
first_nameStringFirst name of the user
last_nameStringLast name of the user
emailStringEmail address of the user
descriptionStringOptional description of the user account
role_codeStringRole 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

FieldTypeDescription
idUUIDUnique identifier of the user
tenant_idUUIDIdentifier of the tenant that owns the user
emailStringEmail address of the user
first_nameStringFirst name of the user
last_nameStringLast name of the user
role_codeStringRole assigned to the user
is_activeBooleanIndicates whether the user account is active
created_byUUIDIdentifier of the user who created the account
updated_byUUIDIdentifier of the user who last updated the account
created_atIntegerUser creation timestamp in Unix format
updated_atIntegerLast update timestamp in Unix format

info
  • A valid Bearer Token is required to access this endpoint.
  • The role_code value 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.