Change a role
const url = 'https://api.gampeon.com/v1/communities/1/roles/1';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","color":"example","permissions":1,"hoist":true,"position":1}'};
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.gampeon.com/v1/communities/1/roles/1 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "color": "example", "permissions": 1, "hoist": true, "position": 1 }'Needs manageRoles, and the role must be below your highest role (except everyone). position moves it (1 is just above everyone); only below your highest role.
Not available with access tokens.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Community ID
Role ID
Request Bodyrequired
Section titled “Request Bodyrequired”Responses
Section titled “Responses”Role
object
Higher is more powerful. everyone is always 0
Bitmask of permissions, see the table in the Communities section
Shown as its own group in the member list
The default role every member has
Example generated
{ "id": 1, "name": "example", "color": "example", "position": 1, "permissions": 1, "hoist": true, "everyone": true, "members": 1}Error codes: invalid_field
object
Machine-readable error code, for example not_found or rate_limited.
Human-readable detail. Only present for some errors.
Example generated
{ "error": "example", "message": "example"}Error codes: unauthorized
object
Machine-readable error code, for example not_found or rate_limited.
Human-readable detail. Only present for some errors.
Example generated
{ "error": "example", "message": "example"}Error codes: token_not_allowed, missing_permission, role_hierarchy
object
Machine-readable error code, for example not_found or rate_limited.
Human-readable detail. Only present for some errors.
Example generated
{ "error": "example", "message": "example"}Error codes: not_found
object
Machine-readable error code, for example not_found or rate_limited.
Human-readable detail. Only present for some errors.
Example generated
{ "error": "example", "message": "example"}