- Returning.AI
- Auth
- User
- Server
- Category
- Role
- Channel
- Language Setting
- Leaderboard
- Badge
- Gamification
- Api Token
- Custom Userfields
- Integration
update role
Developing
PUT
/roles/{id}
Request
Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.Example:
Authorization: Bearer ********************
Path Params
id
string
required
Example:
66b1aa09acc0c1bf6143df50
Body Params application/json
class
string
required
description
string
required
order
integer
required
billable
boolean
required
serverPermissions
object
required
allow_dm
boolean
required
create_invite
boolean
required
kick_members
boolean
required
ban_members
boolean
required
manage_roles
boolean
required
manage_channels
boolean
required
server_administrator
boolean
required
channelPermissions
object
required
view_message_history
boolean
required
manage_messages
boolean
required
allow_mentions
boolean
required
post_messages
boolean
required
post_analysis
boolean
required
attach_files
boolean
required
Example
{
"class": "blue",
"description": "Role with permissions to moderate the server",
"order": 2,
"billable": false,
"serverPermissions": {
"allow_dm": false,
"create_invite": false,
"kick_members": true,
"ban_members": true,
"warn_members": true,
"suspend_members": true,
"broadcast_messages": true,
"overwrite_language_settings": true,
"manage_roles": true,
"manage_channels": true,
"server_administrator": true
},
"channelPermissions": {
"view_message_history": true,
"manage_messages": true,
"delete_messages": true,
"allow_mentions": true,
"post_messages": true,
"post_analysis": true,
"attach_files": true
}
}
Request samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request PUT 'https://api.returning.ai/api/v1/roles/66b1aa09acc0c1bf6143df50' \
--header 'Content-Type: application/json' \
--data-raw '{
"class": "blue",
"description": "Role with permissions to moderate the server",
"order": 2,
"billable": false,
"serverPermissions": {
"allow_dm": false,
"create_invite": false,
"kick_members": true,
"ban_members": true,
"warn_members": true,
"suspend_members": true,
"broadcast_messages": true,
"overwrite_language_settings": true,
"manage_roles": true,
"manage_channels": true,
"server_administrator": true
},
"channelPermissions": {
"view_message_history": true,
"manage_messages": true,
"delete_messages": true,
"allow_mentions": true,
"post_messages": true,
"post_analysis": true,
"attach_files": true
}
}'
Responses
🟢200Success
application/json
Body
meta
object
required
success
boolean
required
message
string
required
devMessage
string
required
body
object
required
_id
string
required
order
integer
required
billable
boolean
required
title
string
required
description
string
required
serverPermissions
object
required
channelPermissions
object
required
class
string
required
serverId
string
required
createdAt
string
required
updatedAt
string
required
__v
integer
required
Example
{
"meta": {
"success": true,
"message": "Role has been updated successfully",
"devMessage": "Role has been updated successfully"
},
"body": {
"_id": "66a27a97fe1c87971214288a",
"order": 2,
"billable": false,
"title": "Moderator",
"description": "Role with permissions to moderate the server",
"serverPermissions": {
"allow_dm": true,
"create_invite": true,
"kick_members": true,
"ban_members": true,
"manage_roles": true,
"manage_channels": true,
"server_administrator": true,
"_id": "66a27b91fe1c879712142894"
},
"channelPermissions": {
"view_message_history": true,
"manage_messages": true,
"allow_mentions": true,
"post_messages": true,
"post_analysis": true,
"attach_files": true,
"_id": "66a27b91fe1c879712142895"
},
"class": "blue",
"serverId": "669b462658695ff095d431af",
"createdAt": "2024-07-25T16:17:27.299Z",
"updatedAt": "2024-07-25T16:21:37.761Z",
"__v": 0
}
}
Modified at 2024-08-06 04:44:27