BREAGEN Logo
User Management Service

User Attribute Controller

The User Attribute Management service provides functionality to handle user-specific attributes, allowing for flexible user property management and querying.

User Attribute Operations

Update User Attribute PUT /api/v1/user-attribute/

Resource URL/api/v1/user-attribute/
Response FormatJSON
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Request Body

{
	"userId": 1,
	"attributeId": 1,
	"value": "attribute_value"
}

Example Request

curl -X 'PUT' \
'https://um.braegen.ai/api/v1/user-attribute/' \
-H 'accept: */*' \
-H 'Authorization: Bearer {token}' \
-H 'Content-Type: application/json' \
-d '{
    "userId": 1,
    "attributeId": 1,
    "value": "attribute_value"
}'

Example Response

{
	"success": true,
	"status": "200 OK",
	"message": "User attribute updated successfully",
	"data": {
		"id": 1,
		"user": {
			"id": 1,
			"email": "[email protected]"
		},
		"attribute": {
			"id": 1,
			"attributeName": "role"
		},
		"value": "attribute_value"
	}
}

Delete User Attribute DELETE /api/v1/user-attribute/

Resource URL/api/v1/user-attribute/
Response FormatJSON
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Query Parameters

ParameterTypeRequiredDescription
userIdintegerYesID of the user
attributeIdintegerYesID of the attribute to delete

Example Request

curl -X 'DELETE' \
'https://um.braegen.ai/api/v1/user-attribute/?userId=1&attributeId=1' \
-H 'accept: */*' \
-H 'Authorization: Bearer {token}'

Example Response

{
	"success": true,
	"status": "200 OK",
	"message": "User attribute deleted successfully",
	"data": {
		"deleted_attribute_id": 1
	}
}

Get All User Attributes GET /api/v1/user-attribute

Resource URL/api/v1/user-attribute
Response FormatJSON
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Example Request

curl -X 'GET' \
'https://um.braegen.ai/api/v1/user-attribute' \
-H 'accept: */*' \
-H 'Authorization: Bearer {token}'

Example Response

{
	"success": true,
	"status": "200 OK",
	"data": [
		{
			"id": 1,
			"user": {
				"id": 1,
				"email": "[email protected]"
			},
			"attribute": {
				"id": 1,
				"attributeName": "role"
			},
			"value": "admin"
		}
	]
}

Create User Attribute POST /api/v1/user-attribute

Resource URL/api/v1/user-attribute
Response FormatJSON
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Request Body

{
	"userId": 1,
	"attributeId": 1,
	"value": "new_attribute_value"
}

Example Request

curl -X 'POST' \
'https://um.braegen.ai/api/v1/user-attribute' \
-H 'accept: */*' \
-H 'Authorization: Bearer {token}' \
-H 'Content-Type: application/json' \
-d '{
    "userId": 1,
    "attributeId": 1,
    "value": "new_attribute_value"
}'

Get User Attributes By User ID GET /api/v1/user-attribute/user

Resource URL/api/v1/user-attribute/user
Response FormatJSON
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Query Parameters

ParameterTypeRequiredDescription
userIdintegerYesID of the user to get attributes for

Example Request

curl -X 'GET' \
'https://um.braegen.ai/api/v1/user-attribute/user?userId=1' \
-H 'accept: */*' \
-H 'Authorization: Bearer {token}'

Example Response

{
	"success": true,
	"status": "200 OK",
	"data": {
		"id": 1,
		"email": "[email protected]",
		"firstName": "John",
		"lastName": "Doe",
		"userAttributes": [
			{
				"id": 1,
				"value": "admin",
				"attribute": {
					"id": 1,
					"attributeName": "role"
				}
			}
		]
	}
}

Get User Attribute By User ID and Attribute ID GET /api/v1/user-attribute/user/attribute

Resource URL/api/v1/user-attribute/user/attribute
Response FormatJSON
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Query Parameters

ParameterTypeRequiredDescription
userIdintegerYesID of the user
attributeIdintegerYesID of the attribute

Example Request

curl -X 'GET' \
'https://um.braegen.ai/api/v1/user-attribute/user/attribute?userId=1&attributeId=1' \
-H 'accept: */*' \
-H 'Authorization: Bearer {token}'

Example Response

{
	"success": true,
	"status": "200 OK",
	"data": {
		"id": 1,
		"email": "[email protected]",
		"firstName": "John",
		"lastName": "Doe",
		"userAttributes": [
			{
				"id": 1,
				"value": "admin",
				"attribute": {
					"id": 1,
					"attributeName": "role"
				}
			}
		]
	}
}

HTTP Response Codes

HTTP CodeMessage
200Success
204No Content
400Bad Request
401Unauthorized
403Invalid Input
404Invalid or not found type

All endpoints require proper authentication through Bearer token in the Authorization header. The token should be included in all API requests in the headers:

Authorization: Bearer {token}