Update Role
https://app.fossa.com/api/roles/{id}Update an existing custom role
Path parameters
idintegerrequiredID of the role to update
Request body (required) · application/json
namestringNew name for the role
descriptionstringNew description for the role
permissionsobject[]Updated list of permissions for this role. Each entry must be a permission that exists in the system (see `GET /api/roles/all-permissions`) and is valid for the role's `scope`; otherwise the request is rejected with a `400`.
resourceTypestringrequiredResource type for the permission. Must be a valid `resourceType` returned by `GET /api/roles/all-permissions`, and the `resourceType`/`action` combination must be valid for the role's `scope`.
actionstringrequiredAction for the permission. Must be a valid `action` returned by `GET /api/roles/all-permissions`, and the `resourceType`/`action` combination must be valid for the role's `scope`.
Responses
200Role updated successfullyidintegerThe role's unique identifier
organizationIdintegerThe organization's unique identifier
isCustombooleanWhether the role is custom
scopeenumThe role's scope
organizationteamnamestringThe role's name
descriptionstringThe role's description
createdAtstring <date-time>The role's creation date
updatedAtstring <date-time>The role's last update date
permissionsobject[]resourceTypestringThe resource type
actionstringThe action
400Bad RequestuuidstringUnique identifier associated with the error
codeintegerfossa specific error code
messagestringmessage associated with this error
namestringname of the error
httpStatusCodeintegerhttp status code number
403ForbiddenuuidstringUnique identifier associated with the error
codeintegerfossa specific error code
messagestringmessage associated with this error
namestringname of the error
httpStatusCodeintegerhttp status code number
404Not FounduuidstringUnique identifier associated with the error
codeintegerfossa specific error code
messagestringmessage associated with this error
namestringname of the error
httpStatusCodeintegerhttp status code number
409ConflictuuidstringUnique identifier associated with the error
codeintegerfossa specific error code
messagestringmessage associated with this error
namestringname of the error
httpStatusCodeintegerhttp status code number
500Server ErroruuidstringUnique identifier associated with the error
codeintegerfossa specific error code
messagestringmessage associated with this error
namestringname of the error
httpStatusCodeintegerhttp status code number
Try this endpoint
Build a request and run it against app.fossa.com.
Stored in this browser for 24 hours. Try It uses a docs proxy for CORS and does not store tokens server-side.
PUT https://app.fossa.com/api/roles/1curl --request PUT \ --url 'https://app.fossa.com/api/roles/1' \ --header 'accept: application/json' \ --header 'authorization: Bearer YOUR_API_TOKEN' \ --header 'content-type: application/json' \ --data '{ "name": "Updated Admin Role", "description": "Updated admin role with modified permissions", "permissions": [ { "resourceType": "project_any", "action": "view" }, { "resourceType": "project_any", "action": "edit" }, { "resourceType": "project_any", "action": "delete" } ]}'Real request. Mutating methods can change data.
Path params
idintegerrequiredID of the role to update