Calling this request is used to edit an existing role in the MPC Driven system
Request Example:
.. code-block::
editRole(
id="2376234",
name="Role name",
frequency=0,
is_admin=true,
can_approve_transactions=false,
can_edit_contacts_and_address_groups=true,
can_complete_multisig_transactions=false,
amount_limit="123",
fees_limit="123",
user_ids=["[email protected]", "[email protected]"],
request_extra_data={
"message_number": 5,
"session_id": "3478593863424051983840947"
}
)
Response Example:
.. code-block::
{
"FunctionData": {
"StatusCode": 0,
"StatusCodeDescription": "Role edited successfully"
},
"Meta": {
"AccessToken": "2911...9a7",
"Destination": "04bc...9e2",
"Source": "3dcf...ba4",
"Time": "2025-05-22 17:00:44.605"
}
}
Error Responses
| Error Type | Http Code | GK8 error code | Reason / Description | Example Response |
|---|
| Backend Response | 400 | 1 | Unknown role | "StatusCode": 1 |
| Backend Response | 400 | 2 | Role name already exists | "StatusCode": 2 |
| Backend Response | 400 | 3 | Invalid name | "StatusCode": 3 |
| Backend Response | 400 | 4 | Invalid frequency | "StatusCode": 4 |
| Backend Response | 400 | 5 | Invalid amount limit (not a non-negative integer or too large) | "StatusCode": 5 |
| Backend Response | 400 | 6 | Invalid fees limit (not a non-negative integer or too large) | "StatusCode": 6 |
| Backend Response | 400 | 7 | Invalid allowed operations due to removing admin operation from users in admin group | "StatusCode": 7, "UserIds": ["[email protected]"] |
| Backend Response | 400 | 8 | Invalid allowed operations due to not enough approvers in approval workflow | "StatusCode": 8, "ApprovalWorkflowIds": ["123"] |
| Backend Response | 400 | 9 | Cannot change name of system defined role | "StatusCode": 9 |
| Backend Response | 400 | 10 | Cannot change allowed operations of unassigned role | "StatusCode": 10 |
| Backend Response | 400 | 11 | Cannot change admin or transaction approval operations of quorum admin role | "StatusCode": 11 |
| Backend Response | 400 | 12 | Duplicate user | "StatusCode": 12, "UserId": "[email protected]" |
| Backend Response | 400 | 13 | Unknown user | "StatusCode": 13, "UserIds": ["[email protected]", "[email protected]"] |
| Backend Response | 400 | 14 | Cannot change account approver to admin | "StatusCode": 14, "UserIds": ["[email protected]", "[email protected]"] |
| Backend Response | 400 | 15 | Cannot edit system user role | "StatusCode": 15 |
| Backend Response | 400 | 16 | Users are managed externally | "StatusCode": 16 |
roleobject<p>UserRole (see MpcDriven/UserRole.py for examples on how to utilize this class)</p>
request_extra_dataobjectadditional data for the administrative request
acceptstringGenerated from available response content types
200success
curl --request POST \
--url '/editRole?role={%0A%20%20%22Id%22%3A%20%222376234%22%2C%0A%20%20%22Name%22%3A%20%22Role%20name%22%2C%0A%20%20%22Frequency%22%3A%200%2C%0A%20%20%22IsAdmin%22%3A%20true%2C%0A%20%20%22CanApproveTransactions%22%3A%20false%2C%0A%20%20%22CanEditContactsAndAddressGroups%22%3A%20true%2C%0A%20%20%22CanApproveMultisigTransactions%22%3A%20false%2C%0A%20%20%22AmountLimit%22%3A%20%22123%22%2C%0A%20%20%22FeesLimit%22%3A%20%22123%22%2C%0A%20%20%22UserIds%22%3A%20[%22bla%40gk8.io%22%2C%20%22bla2%40gk8.io%22]%0A}%0A&request_extra_data={%0A%20%20%22MessageNumber%22%3A%205%2C%0A%20%20%22SessionId%22%3A%20%223478593863424051983840947%22%0A}%0A' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"FunctionData": {
"Id": "123",
"RequestExtraData": {
"MessageNumber": 5,
"SessionId": "3478593863424051983840947"
}
},
"Meta": {
"FunctionName": "deleteRole",
"RandomData": "288cd49d4b8bf00e7d6114b78d5668d5581d6b953fafef779133caa844cd4229",
"Destination": "b9cb8afe52f1d52521cf2b62dfe12146156ad5328f83c62c20c7da81b263356a61340de745c858998544c041798b01c2f4fac31bebe52a19280a32cd57d6d374ea",
"Time": "2021-02-07T18:37:46.948Z",
"Source": "048b99461a70a49abe63fd585cb224177a22a92d2e9e4ddfbc0027887bee9d1843388f42a3eb2e740565e115ad8b7981abf59e3b03b771f4b063b53c517d7a9d99",
"AccessToken": "51311c84d2c8fd2fafbe56ceb1fb30a99d3417abfc55769577338ab286798087"
}
}'