Skip to content
GAMPEONCreate
New project

Change a role

PATCH
/v1/communities/{id}/roles/{roleId}
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.

id
required
integer
>= 1

Community ID

roleId
required
integer
>= 1

Role ID

Media typeapplication/json
object
name
string
>= 1 characters <= 32 characters
color
One of:
string
permissions

Bitmask of permissions, see the table in the Communities section

integer
hoist
boolean
position
integer
>= 1

Example generated

{
"name": "example",
"color": "example",
"permissions": 1,
"hoist": true,
"position": 1
}

Role

Media typeapplication/json
object
id
required
integer
name
required
string
color
required
One of:
string
/^#[0-9a-fA-F]{6}$/
position
required

Higher is more powerful. everyone is always 0

integer
permissions
required

Bitmask of permissions, see the table in the Communities section

integer
hoist
required

Shown as its own group in the member list

boolean
everyone
required

The default role every member has

boolean
members
required
integer

Example generated

{
"id": 1,
"name": "example",
"color": "example",
"position": 1,
"permissions": 1,
"hoist": true,
"everyone": true,
"members": 1
}

Error codes: invalid_field

Media typeapplication/json
object
error
required

Machine-readable error code, for example not_found or rate_limited.

string
message

Human-readable detail. Only present for some errors.

string

Example generated

{
"error": "example",
"message": "example"
}

Error codes: unauthorized

Media typeapplication/json
object
error
required

Machine-readable error code, for example not_found or rate_limited.

string
message

Human-readable detail. Only present for some errors.

string

Example generated

{
"error": "example",
"message": "example"
}

Error codes: token_not_allowed, missing_permission, role_hierarchy

Media typeapplication/json
object
error
required

Machine-readable error code, for example not_found or rate_limited.

string
message

Human-readable detail. Only present for some errors.

string

Example generated

{
"error": "example",
"message": "example"
}

Error codes: not_found

Media typeapplication/json
object
error
required

Machine-readable error code, for example not_found or rate_limited.

string
message

Human-readable detail. Only present for some errors.

string

Example generated

{
"error": "example",
"message": "example"
}

Report a problem with this pageOther ways to give feedback