Create a role
const url = 'https://api.gampeon.com/v1/communities/1/roles';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","color":"example","permissions":1,"hoist":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Community ID
Request Bodyrequired
Section titled “Request Bodyrequired”Responses
Section titled “Responses”Created
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
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: role_limit_reached
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"}