Update a custom role
PATCH
/v1/roles/{roleId}
const url = 'https://api.varman.io/v1/roles/rol_abc123';const options = { method: 'PATCH', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"name":"Compliance Manager","permissions":{"control":["read","update","delete"],"policy":["read","update","delete"],"risk":["read","update"]},"obligations":{"compliance":true}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.varman.io/v1/roles/rol_abc123 \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "name": "Compliance Manager", "permissions": { "control": [ "read", "update", "delete" ], "policy": [ "read", "update", "delete" ], "risk": [ "read", "update" ] }, "obligations": { "compliance": true } }'Update a custom role in Varman. Create custom roles and resolve permission sets for organization-level access control.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”roleId
required
string
Example
rol_abc123Role ID
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
name
New name for the custom role
string
Example
Compliance Managerpermissions
Updated permissions for the role. Keys are resource names, values are arrays of allowed actions.
object
Example
{ "control": [ "read", "update", "delete" ], "policy": [ "read", "update", "delete" ], "risk": [ "read", "update" ]}obligations
Updated obligations for the role.
object
compliance
Whether the role must complete compliance tasks.
boolean
Example
falseExample
{ "compliance": true}Responses
Section titled “Responses”Role updated successfully
Media typeapplication/json
object
id
string
name
string
permissions
object
isBuiltIn
boolean
createdAt
string format: date-time
updatedAt
string format: date-time
Example generated
{ "id": "example", "name": "example", "permissions": {}, "isBuiltIn": true, "createdAt": "2026-04-15T12:00:00Z", "updatedAt": "2026-04-15T12:00:00Z"}Invalid role data
Unauthorized
Forbidden - cannot grant permissions you do not have
Role not found
Role was modified by another request since it was read. Retry the update.