Volcano API
๐Ÿš€ API Endpoints

๐Ÿ‘ค User Management

User information management and profile endpoints. 18 endpoints available.

๐ŸŽฏ Quick Stats

๐Ÿ“Š Methods

  • ๐Ÿ” GET: 7 endpoints
  • โœ๏ธ PUT: 7 endpoints
  • ๐Ÿ“ POST: 2 endpoints
  • ๐Ÿ—‘๏ธ DELETE: 2 endpoints

๐Ÿ” Authentication

All endpoints in this section use the same authentication methods. Choose one:

๐Ÿ”‘ Bearer Token (Recommended)

For user session authentication

Add to request headers:

Authorization: Bearer YOUR_TOKEN

๐Ÿ”ง API Key

For server-side authentication

Add to request headers:

X-API-KEY: YOUR_API_KEY

โš ๏ธ Important: Do not use both authentication methods simultaneously in the same request.

๐Ÿ”— Endpoints Overview

MethodEndpointDescription
๐Ÿ” GET/userGet user by id
๐Ÿ” GET/user/listGet user list
๐Ÿ” GET/user/role/listGet all role list
๐Ÿ” GET/user/permission/listGet all permission list
๐Ÿ” GET/user/rolesGet user roles
๐Ÿ” GET/user/permissionsGet user permissions, including directly assigned permissions and permissions inherited through roles
โœ๏ธ PUT/user/emailUpdate user email address
โœ๏ธ PUT/user/passwordUpdate user password
โœ๏ธ PUT/user/{userId}/assign-roleAssign role to user
โœ๏ธ PUT/user/{userId}/assign-permissionAssign permission to user
๐Ÿ“ POST/user/role/createCreate role
โœ๏ธ PUT/user/role/{roleId}/updateUpdate role
โœ๏ธ PUT/user/role/{roleId}/assign-permissionAssign permission to role
๐Ÿ” GET/user/role/{roleId}/permissionsGet role permission list
๐Ÿ—‘๏ธ DELETE/user/role/{roleId}/deleteDelete role
๐Ÿ“ POST/user/permission/createCreate permission
โœ๏ธ PUT/user/permission/{permissionId}/updateUpdate permission
๐Ÿ—‘๏ธ DELETE/user/permission/{permissionId}/deleteDelete permission

๐Ÿ“– Detailed Documentation

Get user by id

GET/user
Full URL
https://api.market.decenctype.com/user

๐Ÿ“‹ Query Parameters

ParameterTypeRequiredDescription
userIdstringโŒUser ID, if not provided, will get from request credentials

Description: Get user by id

Operation ID: findUserById

Response Status:

  • โœ… 200: The user.

๐Ÿ“‹ Response Examples

response.json
1{
2 "basicKyc": 3,
3 "advancedKyc": 0,
4 "userId": "example-id",
5 "username": "example-username",
6 "firstName": "example-firstName",
7 "lastName": "example-lastName",
8 "email": "user@example.com",
9 "emailVerified": true,
10 "password": "example-password",
11 "number": 1,
12 "path": "example-path",
13 "inviteCode": "example-inviteCode",
14 "parentInviteCode": "example-parentInviteCode",
15 "level": 1,
16 "status": {},
17 "merchantId": "example-id",
18 "lastLoginIp": "example-lastLoginIp",
19 "lastLoginAt": "2024-01-01T12:00:00Z",
20 "role": "example-role",
21 "roles": [
22 {
23 "roleId": 1,
24 "name": "example-name",
25 "description": "example-description",
26 "permissions": [
27 {
28 "permissionId": 1,
29 "action": {},
30 "resource": "example-resource",
31 "name": "example-name",
32 "description": "example-description",
33 "scope": {},
34 "roles": [],
35 "users": []
36 }
37 ],
38 "users": []
39 }
40 ],
41 "permissions": [
42 {
43 "permissionId": 1,
44 "action": {},
45 "resource": "example-resource",
46 "name": "example-name",
47 "description": "example-description",
48 "scope": {},
49 "roles": [
50 {
51 "roleId": 1,
52 "name": "example-name",
53 "description": "example-description",
54 "permissions": [],
55 "users": []
56 }
57 ],
58 "users": []
59 }
60 ],
61 "merchant": "example-merchant",
62 "groupMemberships": [
63 {
64 "membershipId": "123e4567-e89b-12d3-a456-426614174000",
65 "userId": "123e4567-e89b-12d3-a456-426614174000",
66 "groupId": "123e4567-e89b-12d3-a456-426614174000",
67 "role": "member",
68 "status": "active",
69 "user": "example-user",
70 "userGroup": "example-userGroup"
71 }
72 ]
73}

๐Ÿ“ Example Request

curl -X GET "https://api.market.decenctype.com/user" \\
  -H "Authorization: Bearer YOUR_TOKEN" \\
  -H "Content-Type: application/json"

Get user list

GET/user/list
Full URL
https://api.market.decenctype.com/user/list

๐Ÿ“‹ Query Parameters

ParameterTypeRequiredDescription
sortFieldstringโŒๆŽ’ๅบๅญ—ๆฎต
sortstringโŒๆŽ’ๅบๆ–นๅผ
pagenumberโŒ้กต็ ๏ผˆไปŽ1ๅผ€ๅง‹๏ผ‰
pageSizenumberโŒๆฏ้กตๆกๆ•ฐ
merchantIdstringโŒMerchant ID
searchstringโŒSearch by username, first name, last name or email

Description: Get user list

Operation ID: findAll

Response Status:

  • โœ… 200: The list of users.

๐Ÿ“‹ Response Examples

response.json
1{
2 "items": [
3 {
4 "basicKyc": 3,
5 "userId": "example-id",
6 "username": "example-username",
7 "firstName": "example-firstName",
8 "lastName": "example-lastName",
9 "email": "user@example.com",
10 "emailVerified": true,
11 "number": 1,
12 "path": "example-path",
13 "inviteCode": "example-inviteCode",
14 "parentInviteCode": "example-parentInviteCode",
15 "level": 1,
16 "status": {},
17 "merchantId": "example-id",
18 "lastLoginIp": "example-lastLoginIp",
19 "lastLoginAt": "2024-01-01T12:00:00Z",
20 "permissions": [
21 {
22 "permissionId": 1,
23 "action": {},
24 "resource": "example-resource",
25 "name": "example-name",
26 "description": "example-description",
27 "scope": {},
28 "roles": [
29 {
30 "roleId": 1,
31 "name": "example-name",
32 "description": "example-description",
33 "permissions": [],
34 "users": []
35 }
36 ],
37 "users": []
38 }
39 ],
40 "merchant": "example-merchant",
41 "groupMemberships": [
42 {
43 "membershipId": "123e4567-e89b-12d3-a456-426614174000",
44 "userId": "123e4567-e89b-12d3-a456-426614174000",
45 "groupId": "123e4567-e89b-12d3-a456-426614174000",
46 "role": "member",
47 "status": "active",
48 "user": "example-user",
49 "userGroup": "example-userGroup"
50 }
51 ]
52 }
53 ],
54 "meta": "example-meta"
55}

๐Ÿ“ Example Request

curl -X GET "https://api.market.decenctype.com/user/list" \\
  -H "Authorization: Bearer YOUR_TOKEN" \\
  -H "Content-Type: application/json"

Get all role list

GET/user/role/list
Full URL
https://api.market.decenctype.com/user/role/list

๐Ÿ” Authentication: Required (see authentication section above)

Description: Get all role list

Operation ID: getAllRoles

Response Status:

  • โœ… 200: The list of roles.

๐Ÿ“‹ Response Examples

response.json
1[
2 {
3 "roleId": 1,
4 "name": "example-name",
5 "description": "example-description",
6 "permissions": [
7 {
8 "permissionId": 1,
9 "action": {},
10 "resource": "example-resource",
11 "name": "example-name",
12 "description": "example-description",
13 "scope": {},
14 "roles": [],
15 "users": [
16 {
17 "basicKyc": 3,
18 "userId": "example-id",
19 "username": "example-username",
20 "firstName": "example-firstName",
21 "lastName": "example-lastName",
22 "email": "user@example.com",
23 "emailVerified": true,
24 "number": 1,
25 "path": "example-path",
26 "inviteCode": "example-inviteCode",
27 "parentInviteCode": "example-parentInviteCode",
28 "level": 1,
29 "status": {},
30 "merchantId": "example-id",
31 "lastLoginIp": "example-lastLoginIp",
32 "lastLoginAt": "2024-01-01T12:00:00Z",
33 "permissions": [],
34 "merchant": "example-merchant",
35 "groupMemberships": [
36 {
37 "membershipId": "123e4567-e89b-12d3-a456-426614174000",
38 "userId": "123e4567-e89b-12d3-a456-426614174000",
39 "groupId": "123e4567-e89b-12d3-a456-426614174000",
40 "role": "member",
41 "status": "active",
42 "user": "example-user",
43 "userGroup": "example-userGroup"
44 }
45 ]
46 }
47 ]
48 }
49 ],
50 "users": [
51 {
52 "basicKyc": 3,
53 "userId": "example-id",
54 "username": "example-username",
55 "firstName": "example-firstName",
56 "lastName": "example-lastName",
57 "email": "user@example.com",
58 "emailVerified": true,
59 "number": 1,
60 "path": "example-path",
61 "inviteCode": "example-inviteCode",
62 "parentInviteCode": "example-parentInviteCode",
63 "level": 1,
64 "status": {},
65 "merchantId": "example-id",
66 "lastLoginIp": "example-lastLoginIp",
67 "lastLoginAt": "2024-01-01T12:00:00Z",
68 "permissions": [
69 {
70 "permissionId": 1,
71 "action": {},
72 "resource": "example-resource",
73 "name": "example-name",
74 "description": "example-description",
75 "scope": {},
76 "roles": [],
77 "users": []
78 }
79 ],
80 "merchant": "example-merchant",
81 "groupMemberships": [
82 {
83 "membershipId": "123e4567-e89b-12d3-a456-426614174000",
84 "userId": "123e4567-e89b-12d3-a456-426614174000",
85 "groupId": "123e4567-e89b-12d3-a456-426614174000",
86 "role": "member",
87 "status": "active",
88 "user": "example-user",
89 "userGroup": "example-userGroup"
90 }
91 ]
92 }
93 ]
94 }
95]

๐Ÿ“ Example Request

curl -X GET "https://api.market.decenctype.com/user/role/list" \\
  -H "Authorization: Bearer YOUR_TOKEN" \\
  -H "Content-Type: application/json"

Get all permission list

GET/user/permission/list
Full URL
https://api.market.decenctype.com/user/permission/list

๐Ÿ” Authentication: Required (see authentication section above)

Description: Get all permission list

Operation ID: getAllPermissions

Response Status:

  • โœ… 200: The list of permissions.

๐Ÿ“‹ Response Examples

response.json
1[
2 {
3 "permissionId": 1,
4 "action": {},
5 "resource": "example-resource",
6 "name": "example-name",
7 "description": "example-description",
8 "scope": {},
9 "roles": [
10 {
11 "roleId": 1,
12 "name": "example-name",
13 "description": "example-description",
14 "permissions": [],
15 "users": [
16 {
17 "basicKyc": 3,
18 "userId": "example-id",
19 "username": "example-username",
20 "firstName": "example-firstName",
21 "lastName": "example-lastName",
22 "email": "user@example.com",
23 "emailVerified": true,
24 "number": 1,
25 "path": "example-path",
26 "inviteCode": "example-inviteCode",
27 "parentInviteCode": "example-parentInviteCode",
28 "level": 1,
29 "status": {},
30 "merchantId": "example-id",
31 "lastLoginIp": "example-lastLoginIp",
32 "lastLoginAt": "2024-01-01T12:00:00Z",
33 "permissions": [],
34 "merchant": "example-merchant",
35 "groupMemberships": [
36 {
37 "membershipId": "123e4567-e89b-12d3-a456-426614174000",
38 "userId": "123e4567-e89b-12d3-a456-426614174000",
39 "groupId": "123e4567-e89b-12d3-a456-426614174000",
40 "role": "member",
41 "status": "active",
42 "user": "example-user",
43 "userGroup": "example-userGroup"
44 }
45 ]
46 }
47 ]
48 }
49 ],
50 "users": [
51 {
52 "basicKyc": 3,
53 "userId": "example-id",
54 "username": "example-username",
55 "firstName": "example-firstName",
56 "lastName": "example-lastName",
57 "email": "user@example.com",
58 "emailVerified": true,
59 "number": 1,
60 "path": "example-path",
61 "inviteCode": "example-inviteCode",
62 "parentInviteCode": "example-parentInviteCode",
63 "level": 1,
64 "status": {},
65 "merchantId": "example-id",
66 "lastLoginIp": "example-lastLoginIp",
67 "lastLoginAt": "2024-01-01T12:00:00Z",
68 "permissions": [],
69 "merchant": "example-merchant",
70 "groupMemberships": [
71 {
72 "membershipId": "123e4567-e89b-12d3-a456-426614174000",
73 "userId": "123e4567-e89b-12d3-a456-426614174000",
74 "groupId": "123e4567-e89b-12d3-a456-426614174000",
75 "role": "member",
76 "status": "active",
77 "user": "example-user",
78 "userGroup": "example-userGroup"
79 }
80 ]
81 }
82 ]
83 }
84]

๐Ÿ“ Example Request

curl -X GET "https://api.market.decenctype.com/user/permission/list" \\
  -H "Authorization: Bearer YOUR_TOKEN" \\
  -H "Content-Type: application/json"

Get user roles

GET/user/roles
Full URL
https://api.market.decenctype.com/user/roles

๐Ÿ“‹ Query Parameters

ParameterTypeRequiredDescription
userIdstringโŒUser ID, if not provided, will get from request credentials

Description: Get user roles

Operation ID: getUserRoles

Response Status:

  • โœ… 200: List of user roles

๐Ÿ“‹ Response Examples

response.json
1[
2 {
3 "roleId": 1,
4 "name": "example-name",
5 "description": "example-description",
6 "permissions": [
7 {
8 "permissionId": 1,
9 "action": {},
10 "resource": "example-resource",
11 "name": "example-name",
12 "description": "example-description",
13 "scope": {},
14 "roles": [],
15 "users": [
16 {
17 "basicKyc": 3,
18 "userId": "example-id",
19 "username": "example-username",
20 "firstName": "example-firstName",
21 "lastName": "example-lastName",
22 "email": "user@example.com",
23 "emailVerified": true,
24 "number": 1,
25 "path": "example-path",
26 "inviteCode": "example-inviteCode",
27 "parentInviteCode": "example-parentInviteCode",
28 "level": 1,
29 "status": {},
30 "merchantId": "example-id",
31 "lastLoginIp": "example-lastLoginIp",
32 "lastLoginAt": "2024-01-01T12:00:00Z",
33 "permissions": [],
34 "merchant": "example-merchant",
35 "groupMemberships": [
36 {
37 "membershipId": "123e4567-e89b-12d3-a456-426614174000",
38 "userId": "123e4567-e89b-12d3-a456-426614174000",
39 "groupId": "123e4567-e89b-12d3-a456-426614174000",
40 "role": "member",
41 "status": "active",
42 "user": "example-user",
43 "userGroup": "example-userGroup"
44 }
45 ]
46 }
47 ]
48 }
49 ],
50 "users": [
51 {
52 "basicKyc": 3,
53 "userId": "example-id",
54 "username": "example-username",
55 "firstName": "example-firstName",
56 "lastName": "example-lastName",
57 "email": "user@example.com",
58 "emailVerified": true,
59 "number": 1,
60 "path": "example-path",
61 "inviteCode": "example-inviteCode",
62 "parentInviteCode": "example-parentInviteCode",
63 "level": 1,
64 "status": {},
65 "merchantId": "example-id",
66 "lastLoginIp": "example-lastLoginIp",
67 "lastLoginAt": "2024-01-01T12:00:00Z",
68 "permissions": [
69 {
70 "permissionId": 1,
71 "action": {},
72 "resource": "example-resource",
73 "name": "example-name",
74 "description": "example-description",
75 "scope": {},
76 "roles": [],
77 "users": []
78 }
79 ],
80 "merchant": "example-merchant",
81 "groupMemberships": [
82 {
83 "membershipId": "123e4567-e89b-12d3-a456-426614174000",
84 "userId": "123e4567-e89b-12d3-a456-426614174000",
85 "groupId": "123e4567-e89b-12d3-a456-426614174000",
86 "role": "member",
87 "status": "active",
88 "user": "example-user",
89 "userGroup": "example-userGroup"
90 }
91 ]
92 }
93 ]
94 }
95]

๐Ÿ“ Example Request

curl -X GET "https://api.market.decenctype.com/user/roles" \\
  -H "Authorization: Bearer YOUR_TOKEN" \\
  -H "Content-Type: application/json"

Get user permissions, including directly assigned permissions and permissions inherited through roles

GET/user/permissions
Full URL
https://api.market.decenctype.com/user/permissions

๐Ÿ“‹ Query Parameters

ParameterTypeRequiredDescription
userIdstringโŒUser ID, if not provided, will get from request credentials

Description: Get user permissions, including directly assigned permissions and permissions inherited through roles

Operation ID: getUserPermissions

Response Status:

  • โœ… 200: List of user permissions

๐Ÿ“‹ Response Examples

response.json
1[
2 {
3 "permissionId": 1,
4 "action": {},
5 "resource": "example-resource",
6 "name": "example-name",
7 "description": "example-description",
8 "scope": {},
9 "roles": [
10 {
11 "roleId": 1,
12 "name": "example-name",
13 "description": "example-description",
14 "permissions": [],
15 "users": [
16 {
17 "basicKyc": 3,
18 "userId": "example-id",
19 "username": "example-username",
20 "firstName": "example-firstName",
21 "lastName": "example-lastName",
22 "email": "user@example.com",
23 "emailVerified": true,
24 "number": 1,
25 "path": "example-path",
26 "inviteCode": "example-inviteCode",
27 "parentInviteCode": "example-parentInviteCode",
28 "level": 1,
29 "status": {},
30 "merchantId": "example-id",
31 "lastLoginIp": "example-lastLoginIp",
32 "lastLoginAt": "2024-01-01T12:00:00Z",
33 "permissions": [],
34 "merchant": "example-merchant",
35 "groupMemberships": [
36 {
37 "membershipId": "123e4567-e89b-12d3-a456-426614174000",
38 "userId": "123e4567-e89b-12d3-a456-426614174000",
39 "groupId": "123e4567-e89b-12d3-a456-426614174000",
40 "role": "member",
41 "status": "active",
42 "user": "example-user",
43 "userGroup": "example-userGroup"
44 }
45 ]
46 }
47 ]
48 }
49 ],
50 "users": [
51 {
52 "basicKyc": 3,
53 "userId": "example-id",
54 "username": "example-username",
55 "firstName": "example-firstName",
56 "lastName": "example-lastName",
57 "email": "user@example.com",
58 "emailVerified": true,
59 "number": 1,
60 "path": "example-path",
61 "inviteCode": "example-inviteCode",
62 "parentInviteCode": "example-parentInviteCode",
63 "level": 1,
64 "status": {},
65 "merchantId": "example-id",
66 "lastLoginIp": "example-lastLoginIp",
67 "lastLoginAt": "2024-01-01T12:00:00Z",
68 "permissions": [],
69 "merchant": "example-merchant",
70 "groupMemberships": [
71 {
72 "membershipId": "123e4567-e89b-12d3-a456-426614174000",
73 "userId": "123e4567-e89b-12d3-a456-426614174000",
74 "groupId": "123e4567-e89b-12d3-a456-426614174000",
75 "role": "member",
76 "status": "active",
77 "user": "example-user",
78 "userGroup": "example-userGroup"
79 }
80 ]
81 }
82 ]
83 }
84]

๐Ÿ“ Example Request

curl -X GET "https://api.market.decenctype.com/user/permissions" \\
  -H "Authorization: Bearer YOUR_TOKEN" \\
  -H "Content-Type: application/json"

Update user email address

PUT/user/email
Full URL
https://api.market.decenctype.com/user/email

๐Ÿ“ Request Body Parameters

ParameterTypeRequiredDescription
emailstringโœ…Current email address
newEmailstringโœ…New email address
verificationCodestringโœ…Verification code for verification

Description: Update user email address

Operation ID: updateUserEmail

Response Status:

  • โœ… 200: User email updated successfully

๐Ÿ“ Example Request

curl -X PUT "https://api.market.decenctype.com/user/email" \\
  -H "Authorization: Bearer YOUR_TOKEN" \\
  -H "Content-Type: application/json" \\
  -d '{
  "email": "currentemail@example.com",
  "newEmail": "newemail@example.com",
  "verificationCode": "123456"
}'

Update user password

PUT/user/password
Full URL
https://api.market.decenctype.com/user/password

๐Ÿ“ Request Body Parameters

ParameterTypeRequiredDescription
currentPasswordstringโœ…Current password for verification
newPasswordstringโœ…New password (ๆœ€ๅฐ้•ฟๅบฆ: 8)
confirmPasswordstringโœ…Confirm new password

Description: Update user password

Operation ID: updateUserPassword

Response Status:

  • โœ… 200: User password updated successfully

๐Ÿ“‹ Response Examples

response.json
1{
2 "message": "Password updated successfully"
3}

๐Ÿ“ Example Request

curl -X PUT "https://api.market.decenctype.com/user/password" \\
  -H "Authorization: Bearer YOUR_TOKEN" \\
  -H "Content-Type: application/json" \\
  -d '{
  "currentPassword": "currentPassword123",
  "newPassword": "newPassword123",
  "confirmPassword": "newPassword123"
}'

Assign role to user

PUT/user/{userId}/assign-role
Full URL
https://api.market.decenctype.com/user/{userId}/assign-role

๐ŸŽฏ Path Parameters

  • userId (string) - โœ… Required: User id

๐Ÿ“ Request Body Parameters

ParameterTypeRequiredDescription
roleIdnumberโœ…Role ID to assign to the user

Description: Assign role to user

Operation ID: assignRoleToUser

Response Status:

  • โœ… 200: Success

๐Ÿ“‹ Response Examples

response.json
1{
2 "basicKyc": 3,
3 "advancedKyc": 0,
4 "userId": "example-id",
5 "username": "example-username",
6 "firstName": "example-firstName",
7 "lastName": "example-lastName",
8 "email": "user@example.com",
9 "emailVerified": true,
10 "password": "example-password",
11 "number": 1,
12 "path": "example-path",
13 "inviteCode": "example-inviteCode",
14 "parentInviteCode": "example-parentInviteCode",
15 "level": 1,
16 "status": {},
17 "merchantId": "example-id",
18 "lastLoginIp": "example-lastLoginIp",
19 "lastLoginAt": "2024-01-01T12:00:00Z",
20 "role": "example-role",
21 "roles": [
22 {
23 "roleId": 1,
24 "name": "example-name",
25 "description": "example-description",
26 "permissions": [
27 {
28 "permissionId": 1,
29 "action": {},
30 "resource": "example-resource",
31 "name": "example-name",
32 "description": "example-description",
33 "scope": {},
34 "roles": [],
35 "users": []
36 }
37 ],
38 "users": []
39 }
40 ],
41 "permissions": [
42 {
43 "permissionId": 1,
44 "action": {},
45 "resource": "example-resource",
46 "name": "example-name",
47 "description": "example-description",
48 "scope": {},
49 "roles": [
50 {
51 "roleId": 1,
52 "name": "example-name",
53 "description": "example-description",
54 "permissions": [],
55 "users": []
56 }
57 ],
58 "users": []
59 }
60 ],
61 "merchant": "example-merchant",
62 "groupMemberships": [
63 {
64 "membershipId": "123e4567-e89b-12d3-a456-426614174000",
65 "userId": "123e4567-e89b-12d3-a456-426614174000",
66 "groupId": "123e4567-e89b-12d3-a456-426614174000",
67 "role": "member",
68 "status": "active",
69 "user": "example-user",
70 "userGroup": "example-userGroup"
71 }
72 ]
73}

๐Ÿ“ Example Request

curl -X PUT "https://api.market.decenctype.com/user/example-id/assign-role" \\
  -H "Authorization: Bearer YOUR_TOKEN" \\
  -H "Content-Type: application/json" \\
  -d '{
  "roleId": 1
}'

Assign permission to user

PUT/user/{userId}/assign-permission
Full URL
https://api.market.decenctype.com/user/{userId}/assign-permission

๐ŸŽฏ Path Parameters

  • userId (string) - โœ… Required: User id

๐Ÿ“ Request Body Parameters

ParameterTypeRequiredDescription
permissionIdsarrayโœ…Array of permission IDs to assign to the user

Description: Assign permission to user

Operation ID: assignPermissionToUser

Response Status:

  • โœ… 200: Success

๐Ÿ“ Example Request

curl -X PUT "https://api.market.decenctype.com/user/example-id/assign-permission" \\
  -H "Authorization: Bearer YOUR_TOKEN" \\
  -H "Content-Type: application/json" \\
  -d '{
  "permissionIds": [
    1,
    2,
    3
  ]
}'

Create role

POST/user/role/create
Full URL
https://api.market.decenctype.com/user/role/create

๐Ÿ“ Request Body Parameters

ParameterTypeRequiredDescription
namestringโœ…Role name

Description: Create role

Operation ID: createRole

Response Status:

  • โœ… 201: Success

๐Ÿ“‹ Response Examples

response.json
1{
2 "roleId": 1,
3 "name": "example-name",
4 "description": "example-description",
5 "permissions": [
6 {
7 "permissionId": 1,
8 "action": {},
9 "resource": "example-resource",
10 "name": "example-name",
11 "description": "example-description",
12 "scope": {},
13 "roles": [],
14 "users": [
15 {
16 "basicKyc": 3,
17 "userId": "example-id",
18 "username": "example-username",
19 "firstName": "example-firstName",
20 "lastName": "example-lastName",
21 "email": "user@example.com",
22 "emailVerified": true,
23 "number": 1,
24 "path": "example-path",
25 "inviteCode": "example-inviteCode",
26 "parentInviteCode": "example-parentInviteCode",
27 "level": 1,
28 "status": {},
29 "merchantId": "example-id",
30 "lastLoginIp": "example-lastLoginIp",
31 "lastLoginAt": "2024-01-01T12:00:00Z",
32 "permissions": [],
33 "merchant": "example-merchant",
34 "groupMemberships": [
35 {
36 "membershipId": "123e4567-e89b-12d3-a456-426614174000",
37 "userId": "123e4567-e89b-12d3-a456-426614174000",
38 "groupId": "123e4567-e89b-12d3-a456-426614174000",
39 "role": "member",
40 "status": "active",
41 "user": "example-user",
42 "userGroup": "example-userGroup"
43 }
44 ]
45 }
46 ]
47 }
48 ],
49 "users": [
50 {
51 "basicKyc": 3,
52 "userId": "example-id",
53 "username": "example-username",
54 "firstName": "example-firstName",
55 "lastName": "example-lastName",
56 "email": "user@example.com",
57 "emailVerified": true,
58 "number": 1,
59 "path": "example-path",
60 "inviteCode": "example-inviteCode",
61 "parentInviteCode": "example-parentInviteCode",
62 "level": 1,
63 "status": {},
64 "merchantId": "example-id",
65 "lastLoginIp": "example-lastLoginIp",
66 "lastLoginAt": "2024-01-01T12:00:00Z",
67 "permissions": [
68 {
69 "permissionId": 1,
70 "action": {},
71 "resource": "example-resource",
72 "name": "example-name",
73 "description": "example-description",
74 "scope": {},
75 "roles": [],
76 "users": []
77 }
78 ],
79 "merchant": "example-merchant",
80 "groupMemberships": [
81 {
82 "membershipId": "123e4567-e89b-12d3-a456-426614174000",
83 "userId": "123e4567-e89b-12d3-a456-426614174000",
84 "groupId": "123e4567-e89b-12d3-a456-426614174000",
85 "role": "member",
86 "status": "active",
87 "user": "example-user",
88 "userGroup": "example-userGroup"
89 }
90 ]
91 }
92 ]
93}

๐Ÿ“ Example Request

curl -X POST "https://api.market.decenctype.com/user/role/create" \\
  -H "Authorization: Bearer YOUR_TOKEN" \\
  -H "Content-Type: application/json" \\
  -d '{
  "name": "admin"
}'

Update role

PUT/user/role/{roleId}/update
Full URL
https://api.market.decenctype.com/user/role/{roleId}/update

๐ŸŽฏ Path Parameters

  • roleId (number) - โœ… Required: Role id

๐Ÿ“ Request Body Parameters

ParameterTypeRequiredDescription
namestringโœ…Role name

Description: Update role

Operation ID: updateRole

Response Status:

  • โœ… 200: Success

๐Ÿ“‹ Response Examples

response.json
1{
2 "roleId": 1,
3 "name": "example-name",
4 "description": "example-description",
5 "permissions": [
6 {
7 "permissionId": 1,
8 "action": {},
9 "resource": "example-resource",
10 "name": "example-name",
11 "description": "example-description",
12 "scope": {},
13 "roles": [],
14 "users": [
15 {
16 "basicKyc": 3,
17 "userId": "example-id",
18 "username": "example-username",
19 "firstName": "example-firstName",
20 "lastName": "example-lastName",
21 "email": "user@example.com",
22 "emailVerified": true,
23 "number": 1,
24 "path": "example-path",
25 "inviteCode": "example-inviteCode",
26 "parentInviteCode": "example-parentInviteCode",
27 "level": 1,
28 "status": {},
29 "merchantId": "example-id",
30 "lastLoginIp": "example-lastLoginIp",
31 "lastLoginAt": "2024-01-01T12:00:00Z",
32 "permissions": [],
33 "merchant": "example-merchant",
34 "groupMemberships": [
35 {
36 "membershipId": "123e4567-e89b-12d3-a456-426614174000",
37 "userId": "123e4567-e89b-12d3-a456-426614174000",
38 "groupId": "123e4567-e89b-12d3-a456-426614174000",
39 "role": "member",
40 "status": "active",
41 "user": "example-user",
42 "userGroup": "example-userGroup"
43 }
44 ]
45 }
46 ]
47 }
48 ],
49 "users": [
50 {
51 "basicKyc": 3,
52 "userId": "example-id",
53 "username": "example-username",
54 "firstName": "example-firstName",
55 "lastName": "example-lastName",
56 "email": "user@example.com",
57 "emailVerified": true,
58 "number": 1,
59 "path": "example-path",
60 "inviteCode": "example-inviteCode",
61 "parentInviteCode": "example-parentInviteCode",
62 "level": 1,
63 "status": {},
64 "merchantId": "example-id",
65 "lastLoginIp": "example-lastLoginIp",
66 "lastLoginAt": "2024-01-01T12:00:00Z",
67 "permissions": [
68 {
69 "permissionId": 1,
70 "action": {},
71 "resource": "example-resource",
72 "name": "example-name",
73 "description": "example-description",
74 "scope": {},
75 "roles": [],
76 "users": []
77 }
78 ],
79 "merchant": "example-merchant",
80 "groupMemberships": [
81 {
82 "membershipId": "123e4567-e89b-12d3-a456-426614174000",
83 "userId": "123e4567-e89b-12d3-a456-426614174000",
84 "groupId": "123e4567-e89b-12d3-a456-426614174000",
85 "role": "member",
86 "status": "active",
87 "user": "example-user",
88 "userGroup": "example-userGroup"
89 }
90 ]
91 }
92 ]
93}

๐Ÿ“ Example Request

curl -X PUT "https://api.market.decenctype.com/user/role/example-id/update" \\
  -H "Authorization: Bearer YOUR_TOKEN" \\
  -H "Content-Type: application/json" \\
  -d '{
  "name": "admin"
}'

Assign permission to role

PUT/user/role/{roleId}/assign-permission
Full URL
https://api.market.decenctype.com/user/role/{roleId}/assign-permission

๐ŸŽฏ Path Parameters

  • roleId (number) - โœ… Required: Role id

๐Ÿ“ Request Body Parameters

ParameterTypeRequiredDescription
permissionIdsarrayโœ…Array of permission IDs to assign to the user

Description: Assign permission to role

Operation ID: assignPermissionToRole

Response Status:

  • โœ… 200: Success

๐Ÿ“‹ Response Examples

response.json
1{
2 "roleId": 1,
3 "name": "example-name",
4 "description": "example-description",
5 "permissions": [
6 {
7 "permissionId": 1,
8 "action": {},
9 "resource": "example-resource",
10 "name": "example-name",
11 "description": "example-description",
12 "scope": {},
13 "roles": [],
14 "users": [
15 {
16 "basicKyc": 3,
17 "userId": "example-id",
18 "username": "example-username",
19 "firstName": "example-firstName",
20 "lastName": "example-lastName",
21 "email": "user@example.com",
22 "emailVerified": true,
23 "number": 1,
24 "path": "example-path",
25 "inviteCode": "example-inviteCode",
26 "parentInviteCode": "example-parentInviteCode",
27 "level": 1,
28 "status": {},
29 "merchantId": "example-id",
30 "lastLoginIp": "example-lastLoginIp",
31 "lastLoginAt": "2024-01-01T12:00:00Z",
32 "permissions": [],
33 "merchant": "example-merchant",
34 "groupMemberships": [
35 {
36 "membershipId": "123e4567-e89b-12d3-a456-426614174000",
37 "userId": "123e4567-e89b-12d3-a456-426614174000",
38 "groupId": "123e4567-e89b-12d3-a456-426614174000",
39 "role": "member",
40 "status": "active",
41 "user": "example-user",
42 "userGroup": "example-userGroup"
43 }
44 ]
45 }
46 ]
47 }
48 ],
49 "users": [
50 {
51 "basicKyc": 3,
52 "userId": "example-id",
53 "username": "example-username",
54 "firstName": "example-firstName",
55 "lastName": "example-lastName",
56 "email": "user@example.com",
57 "emailVerified": true,
58 "number": 1,
59 "path": "example-path",
60 "inviteCode": "example-inviteCode",
61 "parentInviteCode": "example-parentInviteCode",
62 "level": 1,
63 "status": {},
64 "merchantId": "example-id",
65 "lastLoginIp": "example-lastLoginIp",
66 "lastLoginAt": "2024-01-01T12:00:00Z",
67 "permissions": [
68 {
69 "permissionId": 1,
70 "action": {},
71 "resource": "example-resource",
72 "name": "example-name",
73 "description": "example-description",
74 "scope": {},
75 "roles": [],
76 "users": []
77 }
78 ],
79 "merchant": "example-merchant",
80 "groupMemberships": [
81 {
82 "membershipId": "123e4567-e89b-12d3-a456-426614174000",
83 "userId": "123e4567-e89b-12d3-a456-426614174000",
84 "groupId": "123e4567-e89b-12d3-a456-426614174000",
85 "role": "member",
86 "status": "active",
87 "user": "example-user",
88 "userGroup": "example-userGroup"
89 }
90 ]
91 }
92 ]
93}

๐Ÿ“ Example Request

curl -X PUT "https://api.market.decenctype.com/user/role/example-id/assign-permission" \\
  -H "Authorization: Bearer YOUR_TOKEN" \\
  -H "Content-Type: application/json" \\
  -d '{
  "permissionIds": [
    1,
    2,
    3
  ]
}'

Get role permission list

GET/user/role/{roleId}/permissions
Full URL
https://api.market.decenctype.com/user/role/{roleId}/permissions

๐ŸŽฏ Path Parameters

  • roleId (number) - โœ… Required: Role id

Description: Get role permission list

Operation ID: rolePermissionList

Response Status:

  • โœ… 200: Success

๐Ÿ“‹ Response Examples

response.json
1[
2 {
3 "permissionId": 1,
4 "action": {},
5 "resource": "example-resource",
6 "name": "example-name",
7 "description": "example-description",
8 "scope": {},
9 "roles": [
10 {
11 "roleId": 1,
12 "name": "example-name",
13 "description": "example-description",
14 "permissions": [],
15 "users": [
16 {
17 "basicKyc": 3,
18 "userId": "example-id",
19 "username": "example-username",
20 "firstName": "example-firstName",
21 "lastName": "example-lastName",
22 "email": "user@example.com",
23 "emailVerified": true,
24 "number": 1,
25 "path": "example-path",
26 "inviteCode": "example-inviteCode",
27 "parentInviteCode": "example-parentInviteCode",
28 "level": 1,
29 "status": {},
30 "merchantId": "example-id",
31 "lastLoginIp": "example-lastLoginIp",
32 "lastLoginAt": "2024-01-01T12:00:00Z",
33 "permissions": [],
34 "merchant": "example-merchant",
35 "groupMemberships": [
36 {
37 "membershipId": "123e4567-e89b-12d3-a456-426614174000",
38 "userId": "123e4567-e89b-12d3-a456-426614174000",
39 "groupId": "123e4567-e89b-12d3-a456-426614174000",
40 "role": "member",
41 "status": "active",
42 "user": "example-user",
43 "userGroup": "example-userGroup"
44 }
45 ]
46 }
47 ]
48 }
49 ],
50 "users": [
51 {
52 "basicKyc": 3,
53 "userId": "example-id",
54 "username": "example-username",
55 "firstName": "example-firstName",
56 "lastName": "example-lastName",
57 "email": "user@example.com",
58 "emailVerified": true,
59 "number": 1,
60 "path": "example-path",
61 "inviteCode": "example-inviteCode",
62 "parentInviteCode": "example-parentInviteCode",
63 "level": 1,
64 "status": {},
65 "merchantId": "example-id",
66 "lastLoginIp": "example-lastLoginIp",
67 "lastLoginAt": "2024-01-01T12:00:00Z",
68 "permissions": [],
69 "merchant": "example-merchant",
70 "groupMemberships": [
71 {
72 "membershipId": "123e4567-e89b-12d3-a456-426614174000",
73 "userId": "123e4567-e89b-12d3-a456-426614174000",
74 "groupId": "123e4567-e89b-12d3-a456-426614174000",
75 "role": "member",
76 "status": "active",
77 "user": "example-user",
78 "userGroup": "example-userGroup"
79 }
80 ]
81 }
82 ]
83 }
84]

๐Ÿ“ Example Request

curl -X GET "https://api.market.decenctype.com/user/role/example-id/permissions" \\
  -H "Authorization: Bearer YOUR_TOKEN" \\
  -H "Content-Type: application/json"

Delete role

DELETE/user/role/{roleId}/delete
Full URL
https://api.market.decenctype.com/user/role/{roleId}/delete

๐ŸŽฏ Path Parameters

  • roleId (number) - โœ… Required: Role id

Description: Delete role

Operation ID: deleteRole

Response Status:

  • โœ… 200: Success

๐Ÿ“ Example Request

curl -X DELETE "https://api.market.decenctype.com/user/role/example-id/delete" \\
  -H "Authorization: Bearer YOUR_TOKEN" \\
  -H "Content-Type: application/json"

Create permission

POST/user/permission/create
Full URL
https://api.market.decenctype.com/user/permission/create

๐Ÿ“ Request Body Parameters

ParameterTypeRequiredDescription
actionstring (read, write, manage)โœ…Permission name
resourcestringโœ…Permission resource
scopestring (internal, external)โœ…Permission scope, determines the scope where the permission takes effect (้ป˜่ฎค: external)
descriptionstringโœ…Permission description

Description: Create permission

Operation ID: createPermission

Response Status:

  • โœ… 201: Success

๐Ÿ“‹ Response Examples

response.json
1{
2 "permissionId": 1,
3 "action": {},
4 "resource": "example-resource",
5 "name": "example-name",
6 "description": "example-description",
7 "scope": {},
8 "roles": [
9 {
10 "roleId": 1,
11 "name": "example-name",
12 "description": "example-description",
13 "permissions": [],
14 "users": [
15 {
16 "basicKyc": 3,
17 "userId": "example-id",
18 "username": "example-username",
19 "firstName": "example-firstName",
20 "lastName": "example-lastName",
21 "email": "user@example.com",
22 "emailVerified": true,
23 "number": 1,
24 "path": "example-path",
25 "inviteCode": "example-inviteCode",
26 "parentInviteCode": "example-parentInviteCode",
27 "level": 1,
28 "status": {},
29 "merchantId": "example-id",
30 "lastLoginIp": "example-lastLoginIp",
31 "lastLoginAt": "2024-01-01T12:00:00Z",
32 "permissions": [],
33 "merchant": "example-merchant",
34 "groupMemberships": [
35 {
36 "membershipId": "123e4567-e89b-12d3-a456-426614174000",
37 "userId": "123e4567-e89b-12d3-a456-426614174000",
38 "groupId": "123e4567-e89b-12d3-a456-426614174000",
39 "role": "member",
40 "status": "active",
41 "user": "example-user",
42 "userGroup": "example-userGroup"
43 }
44 ]
45 }
46 ]
47 }
48 ],
49 "users": [
50 {
51 "basicKyc": 3,
52 "userId": "example-id",
53 "username": "example-username",
54 "firstName": "example-firstName",
55 "lastName": "example-lastName",
56 "email": "user@example.com",
57 "emailVerified": true,
58 "number": 1,
59 "path": "example-path",
60 "inviteCode": "example-inviteCode",
61 "parentInviteCode": "example-parentInviteCode",
62 "level": 1,
63 "status": {},
64 "merchantId": "example-id",
65 "lastLoginIp": "example-lastLoginIp",
66 "lastLoginAt": "2024-01-01T12:00:00Z",
67 "permissions": [],
68 "merchant": "example-merchant",
69 "groupMemberships": [
70 {
71 "membershipId": "123e4567-e89b-12d3-a456-426614174000",
72 "userId": "123e4567-e89b-12d3-a456-426614174000",
73 "groupId": "123e4567-e89b-12d3-a456-426614174000",
74 "role": "member",
75 "status": "active",
76 "user": "example-user",
77 "userGroup": "example-userGroup"
78 }
79 ]
80 }
81 ]
82}

๐Ÿ“ Example Request

curl -X POST "https://api.market.decenctype.com/user/permission/create" \\
  -H "Authorization: Bearer YOUR_TOKEN" \\
  -H "Content-Type: application/json" \\
  -d '{
  "action": "read",
  "resource": "roles",
  "scope": "external",
  "description": "Read roles"
}'

Update permission

PUT/user/permission/{permissionId}/update
Full URL
https://api.market.decenctype.com/user/permission/{permissionId}/update

๐ŸŽฏ Path Parameters

  • permissionId (number) - โœ… Required: Permission id

๐Ÿ“ Request Body Parameters

ParameterTypeRequiredDescription
actionstring (read, write, manage)โœ…Permission name
resourcestringโœ…Permission resource
scopestring (internal, external)โœ…Permission scope, determines the scope where the permission takes effect (้ป˜่ฎค: external)
descriptionstringโœ…Permission description

Description: Update permission

Operation ID: updatePermission

Response Status:

  • โœ… 200: Success

๐Ÿ“‹ Response Examples

response.json
1{
2 "permissionId": 1,
3 "action": {},
4 "resource": "example-resource",
5 "name": "example-name",
6 "description": "example-description",
7 "scope": {},
8 "roles": [
9 {
10 "roleId": 1,
11 "name": "example-name",
12 "description": "example-description",
13 "permissions": [],
14 "users": [
15 {
16 "basicKyc": 3,
17 "userId": "example-id",
18 "username": "example-username",
19 "firstName": "example-firstName",
20 "lastName": "example-lastName",
21 "email": "user@example.com",
22 "emailVerified": true,
23 "number": 1,
24 "path": "example-path",
25 "inviteCode": "example-inviteCode",
26 "parentInviteCode": "example-parentInviteCode",
27 "level": 1,
28 "status": {},
29 "merchantId": "example-id",
30 "lastLoginIp": "example-lastLoginIp",
31 "lastLoginAt": "2024-01-01T12:00:00Z",
32 "permissions": [],
33 "merchant": "example-merchant",
34 "groupMemberships": [
35 {
36 "membershipId": "123e4567-e89b-12d3-a456-426614174000",
37 "userId": "123e4567-e89b-12d3-a456-426614174000",
38 "groupId": "123e4567-e89b-12d3-a456-426614174000",
39 "role": "member",
40 "status": "active",
41 "user": "example-user",
42 "userGroup": "example-userGroup"
43 }
44 ]
45 }
46 ]
47 }
48 ],
49 "users": [
50 {
51 "basicKyc": 3,
52 "userId": "example-id",
53 "username": "example-username",
54 "firstName": "example-firstName",
55 "lastName": "example-lastName",
56 "email": "user@example.com",
57 "emailVerified": true,
58 "number": 1,
59 "path": "example-path",
60 "inviteCode": "example-inviteCode",
61 "parentInviteCode": "example-parentInviteCode",
62 "level": 1,
63 "status": {},
64 "merchantId": "example-id",
65 "lastLoginIp": "example-lastLoginIp",
66 "lastLoginAt": "2024-01-01T12:00:00Z",
67 "permissions": [],
68 "merchant": "example-merchant",
69 "groupMemberships": [
70 {
71 "membershipId": "123e4567-e89b-12d3-a456-426614174000",
72 "userId": "123e4567-e89b-12d3-a456-426614174000",
73 "groupId": "123e4567-e89b-12d3-a456-426614174000",
74 "role": "member",
75 "status": "active",
76 "user": "example-user",
77 "userGroup": "example-userGroup"
78 }
79 ]
80 }
81 ]
82}

๐Ÿ“ Example Request

curl -X PUT "https://api.market.decenctype.com/user/permission/example-id/update" \\
  -H "Authorization: Bearer YOUR_TOKEN" \\
  -H "Content-Type: application/json" \\
  -d '{
  "action": "read",
  "resource": "roles",
  "scope": "external",
  "description": "Read roles"
}'

Delete permission

DELETE/user/permission/{permissionId}/delete
Full URL
https://api.market.decenctype.com/user/permission/{permissionId}/delete

๐ŸŽฏ Path Parameters

  • permissionId (number) - โœ… Required: Permission id

Description: Delete permission

Operation ID: deletePermission

Response Status:

  • โœ… 200: Success

๐Ÿ“ Example Request

curl -X DELETE "https://api.market.decenctype.com/user/permission/example-id/delete" \\
  -H "Authorization: Bearer YOUR_TOKEN" \\
  -H "Content-Type: application/json"

On this page

๐Ÿ” Authentication๐Ÿ”— Endpoints Overview๐Ÿ“– Detailed DocumentationGet user by id๐Ÿ“‹ Query Parameters๐Ÿ“‹ Response Examples๐Ÿ“ Example RequestGet user list๐Ÿ“‹ Query Parameters๐Ÿ“‹ Response Examples๐Ÿ“ Example RequestGet all role list๐Ÿ“‹ Response Examples๐Ÿ“ Example RequestGet all permission list๐Ÿ“‹ Response Examples๐Ÿ“ Example RequestGet user roles๐Ÿ“‹ Query Parameters๐Ÿ“‹ Response Examples๐Ÿ“ Example RequestGet user permissions, including directly assigned permissions and permissions inherited through roles๐Ÿ“‹ Query Parameters๐Ÿ“‹ Response Examples๐Ÿ“ Example RequestUpdate user email address๐Ÿ“ Request Body Parameters๐Ÿ“ Example RequestUpdate user password๐Ÿ“ Request Body Parameters๐Ÿ“‹ Response Examples๐Ÿ“ Example RequestAssign role to user๐ŸŽฏ Path Parameters๐Ÿ“ Request Body Parameters๐Ÿ“‹ Response Examples๐Ÿ“ Example RequestAssign permission to user๐ŸŽฏ Path Parameters๐Ÿ“ Request Body Parameters๐Ÿ“ Example RequestCreate role๐Ÿ“ Request Body Parameters๐Ÿ“‹ Response Examples๐Ÿ“ Example RequestUpdate role๐ŸŽฏ Path Parameters๐Ÿ“ Request Body Parameters๐Ÿ“‹ Response Examples๐Ÿ“ Example RequestAssign permission to role๐ŸŽฏ Path Parameters๐Ÿ“ Request Body Parameters๐Ÿ“‹ Response Examples๐Ÿ“ Example RequestGet role permission list๐ŸŽฏ Path Parameters๐Ÿ“‹ Response Examples๐Ÿ“ Example RequestDelete role๐ŸŽฏ Path Parameters๐Ÿ“ Example RequestCreate permission๐Ÿ“ Request Body Parameters๐Ÿ“‹ Response Examples๐Ÿ“ Example RequestUpdate permission๐ŸŽฏ Path Parameters๐Ÿ“ Request Body Parameters๐Ÿ“‹ Response Examples๐Ÿ“ Example RequestDelete permission๐ŸŽฏ Path Parameters๐Ÿ“ Example Request