Update Role

puthttps://app.fossa.com/api/roles/{id}

Update an existing custom role

Path parameters

idintegerrequired

ID of the role to update

Request body (required) · application/json

namestring

New name for the role

descriptionstring

New 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`.

resourceTypestringrequired

Resource 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`.

actionstringrequired

Action 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 successfully
idinteger

The role's unique identifier

organizationIdinteger

The organization's unique identifier

isCustomboolean

Whether the role is custom

scopeenum

The role's scope

organizationteam
namestring

The role's name

descriptionstring

The role's description

createdAtstring <date-time>

The role's creation date

updatedAtstring <date-time>

The role's last update date

permissionsobject[]
resourceTypestring

The resource type

actionstring

The action

400Bad Request
uuidstring

Unique identifier associated with the error

codeinteger

fossa specific error code

messagestring

message associated with this error

namestring

name of the error

httpStatusCodeinteger

http status code number

403Forbidden
uuidstring

Unique identifier associated with the error

codeinteger

fossa specific error code

messagestring

message associated with this error

namestring

name of the error

httpStatusCodeinteger

http status code number

404Not Found
uuidstring

Unique identifier associated with the error

codeinteger

fossa specific error code

messagestring

message associated with this error

namestring

name of the error

httpStatusCodeinteger

http status code number

409Conflict
uuidstring

Unique identifier associated with the error

codeinteger

fossa specific error code

messagestring

message associated with this error

namestring

name of the error

httpStatusCodeinteger

http status code number

500Server Error
uuidstring

Unique identifier associated with the error

codeinteger

fossa specific error code

messagestring

message associated with this error

namestring

name of the error

httpStatusCodeinteger

http status code number

Try this endpoint

Build a request and run it against app.fossa.com.

Bearer

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/1
curl --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.

Click Try It to run a request and see the response here.
Enter a Bearer token before running this request.

Path params

idintegerrequired

ID of the role to update

application/json