Skip to content
GAMPEONCreate
New project

Create a role

POST
/v1/communities/{id}/roles
curl --request POST \
--url https://api.gampeon.com/v1/communities/1/roles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "color": "example", "permissions": 1, "hoist": true }'

Needs manageRoles. New roles start at the bottom (position 1) with the permissions of everyone. You can only grant permissions you have. Up to 50 roles.

Not available with access tokens.

id
required
integer
>= 1

Community ID

Media typeapplication/json
object
name
required
string
>= 1 characters <= 32 characters
color
One of:
string
/^#[0-9a-fA-F]{6}$/
permissions

Bitmask of permissions, see the table in the Communities section

integer
hoist
boolean

Example generated

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

Created

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

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: role_limit_reached

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