Get role history for a user
GET
/api/v1/system-roles/users/{userId}/history
const url = 'http://localhost:3000/api/v1/system-roles/users/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/history';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url http://localhost:3000/api/v1/system-roles/users/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/history \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” userId
required
string format: uuid
User UUID
Responses
Section titled “ Responses ” Media type application/json
Array<object>
object
id
required
System role record ID
string
userId
required
User ID who has this role
string
userEmail
required
User email
string
userName
User name
string
role
required
Role type
string
grantedAt
required
When the role was granted
string format: date-time
grantedById
User ID who granted the role (null if granter was deleted)
string
grantedByEmail
Email of user who granted the role (null if granter was deleted)
string
reason
Reason for granting
string
revokedAt
When the role was revoked (null if active)
string format: date-time
revokedById
User ID who revoked the role
string
revokedByEmail
Email of user who revoked the role
string
isActive
required
Whether the role is currently active
boolean
Example
[ { "role": "SUPERUSER" }]User not found