Patch User Roles

PATCH /users/{userName}/roles

This API call is used to add or remove specific roles for a user. Please refer to the users_roles_schema below to get the list of assignable roles.

Path parameters

  • userName string Required

    Username or ID of the user.

Query parameters

  • action string Required

    Add or delete action for specified roles.

    Values are add or delete.

application/json

Body object Required

One of:

Responses

  • 200 application/json

    Successful Response

    Hide response attributes Show response attributes object
  • 400 application/json

    Failure Response

    Hide response attributes Show response attributes object
  • 401 application/json

    Authentication Error. Invalid credentials.

    Hide response attributes Show response attributes object
  • Authorization Error. Invalid role for request.

  • 404 application/json

    User Not Found

    Hide response attributes Show response attributes object
PATCH /users/{userName}/roles
curl \
 --request PATCH 'https://localhost:8080/users/testuser1/roles?action=add' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '[{"type":"Close","value":"CloseAdmin"},{"type":"Certification","value":"Reconciler"},{"type":"Certification","value":"ProgramAdmin"},{"type":"JournalEntry","value":"Preparer"}]'
Request example
[
  {
    "type": "Close",
    "value": "CloseAdmin"
  },
  {
    "type": "Certification",
    "value": "Reconciler"
  },
  {
    "type": "Certification",
    "value": "ProgramAdmin"
  },
  {
    "type": "JournalEntry",
    "value": "Preparer"
  }
]
Response examples (200)
{
  "status": "Success",
  "messages": [
    "User roles added successfully"
  ]
}
Response examples (400)
{
  "code": "00009",
  "errors": [
    "Invalid value for role type. Allowable values: Certification, Close, JournalEntry"
  ],
  "message": "Validation errors"
}
Response examples (401)
{
  "code": "900901",
  "message": "Invalid Credentials",
  "description": "Access failure for API: /api/admin/v1.1.0, version: v1.1.0 status: (900901) - Invalid Credentials. Make sure you have provided the correct security credentials"
}
Response examples (404)
{
  "status": "Failure",
  "messages": [
    "User not found for specified username."
  ]
}