Skip to main content

Set Role

Updates the AuthLevel (permission role) for a specified user, optionally scoping the role to a specific network or mailbox.

caution

Elevating a user's AuthLevel grants them additional access to networks, mailboxes, and ECGrid IDs. The Root and TechOps roles provide the broadest system access and should be assigned only to fully trusted administrators. Confirm the correct User ID and intended role before calling this endpoint.

Endpoint

POST /v2/users/role

Request Body

FieldTypeRequiredConstraintsDescription
userIdintegerYesMust be an existing userID of the user whose role to change
authLevelAuthLevelYesThe new permission level to assign
networkIdintegerNoScope the role to this network
mailboxIdintegerNoScope the role to this mailbox
{
"userId": 1042,
"authLevel": "NetworkAdmin",
"networkId": 1
}

Response

Returns the updated UserIDInfo object reflecting the new role.

{
"success": true,
"data": {
"userId": 1042,
"login": "jsmith",
"email": "jsmith@example.com",
"firstName": "John",
"lastName": "Smith",
"networkId": 1,
"mailboxId": 101,
"authLevel": "NetworkAdmin",
"status": "Active",
"created": "2024-03-15T10:22:00Z"
}
}

ENUMs

This endpoint uses the following ENUM in its request body. See Appendix: ENUMs for full value lists.

  • AuthLevel — the permission level to assign, from highest to lowest: Root, TechOps, NetOps, NetworkAdmin, NetworkUser, MailboxAdmin, MailboxUser, TPUser, General

Code Examples

curl -X POST "https://rest.ecgrid.io/v2/users/role" \
-H "X-API-Key: $ECGRID_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "userId": 1042, "authLevel": "NetworkAdmin", "networkId": 1 }'

See Also

  • Get User — confirm the user's current role before making changes
  • List Users — filter users by AuthLevel to audit role assignments
  • Update User — update other profile fields without changing the role