Update User
Updates an existing user's information.
Request
| Property | Value |
|---|---|
| Method | PATCH |
| URL | /api/users/{userId} |
| Content-Type | application/json |
| Authentication | Bearer Token |
Request
curl -X PATCH "{BASE_URL}/api/users/{userId}" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"key": "value"}'
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
userId | integer | Yes | Unique identifier of the user |
Request with parameters
curl -X PATCH "{BASE_URL}/api/users/{userId}" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json"
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
data.attributes.username | string | No | User's username |
data.attributes.password | string | No | User's password |
data.attributes.accessRights | array | No | List of access rights |
data.attributes.accessRights[].name | "server" | "viewer" | "application" | "stream" | Yes* | Access right category |
data.attributes.accessRights[].value | "none" | "read_only" | "read_write" | Yes* | Access right level |
*Required when
accessRightsarray is provided.
Example Request
Request Body
{
"data": {
"attributes": {
"username": "username",
"password": "password",
"accessRights": [
{ "name": "server", "value": "read_write" },
{ "name": "viewer", "value": "read_write" },
{ "name": "application", "value": "read_write" },
{ "name": "stream", "value": "read_write" }
]
}
}
}
Response Body
| Parameter | Type | Description |
|---|---|---|
data.id | integer | Unique identifier of the updated user |
data.attributes.username.value | string | The username of the updated user |
data.attributes.username.editable | boolean | Indicates if the username can be modified |
data.attributes.username.lockedBy | string | Identifier of the entity that locked this field (if locked) |
data.attributes.password.value | string | Masked password value (always returns "******") |
data.attributes.password.editable | boolean | Indicates if the password can be modified |
data.attributes.password.masked | boolean | Indicates if the password value is masked |
data.attributes.password.lockedBy | string | Identifier of the entity that locked this field (if locked) |
data.attributes.algorithm.value | string | Password hashing algorithm |
data.attributes.algorithm.editable | boolean | Indicates if the algorithm can be modified |
data.attributes.algorithm.lockedBy | string | Identifier of the entity that locked this field (if locked) |
data.attributes.accessRights | array | List of access rights assigned to the user |
data.attributes.accessRights[].name | "Server" | "Stream" | "Application" | Access right category name |
data.attributes.accessRights[].value | "NONE" | "READ_ONLY" | "READ_WRITE" | Access right level |
meta.executionTime | integer | Request processing time in milliseconds |
meta.generatedAt | integer | Response generation timestamp (Unix timestamp in ms) |
message | string | Main response status message |
Successful Response (200)
{
"data": {
"id": 1,
"attributes": {
"username": {
"editable": true,
"value": "username"
},
"password": {
"editable": true,
"masked": true,
"value": "******"
},
"algorithm": {
"editable": false,
"value": "PLAIN"
},
"accessRights": [
{ "name": "Server", "value": "NONE" },
{ "name": "Stream", "value": "NONE" },
{ "name": "Application", "value": "NONE" }
]
}
},
"meta": {
"executionTime": 21,
"generatedAt": 1764232021849
},
"message": "User has been updated"
}
Error Responses
| Parameter | Type | Description |
|---|---|---|
message | string | Human-readable error message |
errors.attributes.username | string[] | Array of validation errors for username field |
Username Already Exists (409)
{
"message": "User with given username already exists",
"errors": {
"attributes": {
"username": [
"User with this username already exists"
]
}
}
}
User Not Found (404)
{
"message": "User not found"
}
Notes
- The username must be unique across the system.
- Only provided fields will be updated; omitted fields remain unchanged.
Support Needed?
Create a free ticket and our support team will provide you necessary assistance.