Teamly API
  1. Roles
Teamly API
  • Introduction
  • Getting Started
    • Quick Start
    • API Versions
  • Permissions
    • Channel Permission Values
    • Team Global Permissions
  • Core Resources
    • Channels
      • Update Channel
        • Update Team Channel
        • Update Channel Role Permissions
      • Get Team Channels
      • Create Team Channel
      • Delete Team Channel
      • Duplicate a Channel on Team
      • Update Channel Priorities of Team
    • Messages
      • Create Channel Message
      • Delete a Channel Message
      • Get Channel Messages
      • Update a Channel Message
      • React to Message
      • Delete Reaction from Message
      • Get a Channel Message by Id
    • Teams
      • Members
        • Add Role to Member
        • Remove Role from Member
        • Kick Member from Team
        • Get Member
      • Bans
        • Get Banned Users
        • Unban User
        • Ban User
      • Get a Team
      • Update a Team
    • Roles
      • Create a Role for Team
        POST
      • Get Team Roles
        GET
      • Delete a Role
        DELETE
      • Clone Role
        POST
      • Update Role Priorities of Team
        PATCH
      • Update a Team Role
        POST
    • Users
      • Get User By Id
      • Get Logged In User
    • Todos
      • Get Todo Items
      • Create Todo Item
      • Delete Todo Item
      • Clone Todo Item
      • Update Todo Item
    • Direct Messages
      • Create a Direct Message
    • Applications
      • Get Application Submissions
      • Update a Application Status
      • Update Team's Application Status
      • Update Team's Application Questions
      • Get Application By Id
    • Reactions
      • Get Team's Custom Reactions
      • Create New Custom Reaction for Team
      • Update a Custom Reaction
      • Delete a Custom Reaction
    • Attachments
      • Upload Attachment
    • Voice
      • Get Credentials for Join Voice Channel
      • Update Your Voice Metadata
      • Leave from Voice Channel
    • Webhooks
      • Create Message With Webhook
      • Webhook for GitHub
    • Blog
      • Get Blog Posts
      • Create a Blog Post
      • Delete a Blog Post
    • Category
      • Create a Category
      • Update a Category
      • Update Category Role Permissions
      • Delete a Category
      • Add a Channel To Category
      • Delete a channel from category
      • Set channel priority of category
      • Set a team's category priority
  • Schemas
    • Message
    • Message Embed
    • Channel
    • Direct Message
    • To-do Item
    • Application
    • Emoji
    • Team
    • User
    • Role
    • Webhook
    • Blog
    • Category
  • Websockets
    • Example Bot
    • WebSocket event envelope
      • WebSocket event envelope
      • Keepalive
      • Welcome Message
      • Gateway Opcodes
      • Gateway Close Event Codes
    • Websocket events
      • CHANNEL_CREATED
      • CHANNEL_DELETED
      • CHANNEL_UPDATED
      • MESSAGE_SEND
      • MESSAGE_UPDATED
      • MESSAGE_DELETED
      • MESSAGE_REACTION_ADDED
      • MESSAGE_REACTION_REMOVED
      • PRESENCE_UPDATE
      • TEAM_ROLE_CREATED
      • TEAM_ROLE_DELETED
      • TEAM_ROLES_UPDATED
      • TEAM_UPDATED
      • TODO_ITEM_CREATED
      • TODO_ITEM_DELETED
      • TODO_ITEM_UPDATED
      • USER_JOINED_TEAM
      • USER_LEFT_TEAM
      • USER_JOINED_VOICE_CHANNEL
      • USER_LEFT_VOICE_CHANNEL
      • USER_PROFILE_UPDATED
      • USER_ROLE_ADDED
      • USER_ROLE_REMOVED
      • USER_UPDATED_VOICE_METADATA
      • BLOG_CREATED
      • BLOG_DELETED
      • CATEGORIES_PRIORITY_UPDATED
      • CATEGORY_UPDATED
      • CATEGORY_DELETED
      • CATEGORY_CREATED
      • CHANNELS_PRIORITY_UPDATED
    • Connecting via WebSocket
  1. Roles

Create a Role for Team

POST
https://api.teamly.one/api/v1/teams/{teamId}/roles

Request

Path Params
teamId
string 
required
Header Params
Authorization
string 
required
Default:
Bot {token}
Content-Type
string 
required
Default:
application/json
Body Params application/json
name
string 
required
The name of the role
permissions
number 
required
Permissions level associated with the role
color
string 
required
Color code for the role in hexadecimal format
color2
string  | null 
optional
An additional color code for the role (optional)
isDisplayedSeparately
boolean  | null 
optional
Indicates whether the role should be displayed separately
Example
{
  "required": [],
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "The name of the role",
      "nullable": true
    },
    "permissions": {
      "type": "number",
      "description": "Permissions level associated with the role",
      "nullable": true
    },
    "color": {
      "type": "string",
      "description": "Color code for the role in hexadecimal format",
      "nullable": true
    },
    "color2": {
      "type": "string",
      "description": "An additional color code for the role (optional)",
      "nullable": true
    },
    "isDisplayedSeparately": {
      "type": "boolean",
      "description": "Indicates whether the role should be displayed separately",
      "nullable": true
    }
  },
  "x-apidog-orders": [
    "name",
    "permissions",
    "color",
    "color2",
    "isDisplayedSeparately"
  ]
}

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 POST 'https://api.teamly.one/api/v1/teams//roles' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
  "required": [],
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "The name of the role",
      "nullable": true
    },
    "permissions": {
      "type": "number",
      "description": "Permissions level associated with the role",
      "nullable": true
    },
    "color": {
      "type": "string",
      "description": "Color code for the role in hexadecimal format",
      "nullable": true
    },
    "color2": {
      "type": "string",
      "description": "An additional color code for the role (optional)",
      "nullable": true
    },
    "isDisplayedSeparately": {
      "type": "boolean",
      "description": "Indicates whether the role should be displayed separately",
      "nullable": true
    }
  },
  "x-apidog-orders": [
    "name",
    "permissions",
    "color",
    "color2",
    "isDisplayedSeparately"
  ]
}'

Responses

🟢200Success
application/json
Body
success
boolean 
required
role
object (Role) 
required
id
string 
required
Unique identifier for the role
teamId
string 
required
ID of the team associated with the role
name
string 
required
Name of the role
iconUrl
string <uri>
optional
URL of the role's icon
Default:
null
color
string 
required
Hexadecimal color code for the role
color2
string 
optional
Additional color code for the role
Default:
null
permissions
number 
required
Permission level of the role
Default:
0
priority
number 
required
Priority of the role
Default:
0
createdAt
string <date-time>
required
Timestamp of when the role was created
Default:
CURRENT_TIMESTAMP
updatedAt
string <date-time>
optional
Timestamp of when the role was last updated
Default:
null
isDisplayedSeparately
boolean 
required
Indicates if the role is displayed separately
Default:
true
isSelfAssignable
boolean 
optional
Indicates if the role is self-assignable
Default:
false
iconEmojiId
string 
optional
ID of the emoji used as the role's icon
Default:
null
mentionable
boolean 
required
Indicates if the role is mentionable
Default:
true
botScope
object 
required
Bot-specific scope information for the role
Default:
{}
Example
{
  "success": true,
  "role": {
    "id": "string",
    "teamId": "string",
    "name": "string",
    "iconUrl": null,
    "color": "string",
    "color2": null,
    "permissions": 0,
    "priority": 0,
    "createdAt": "CURRENT_TIMESTAMP",
    "updatedAt": null,
    "isDisplayedSeparately": true,
    "isSelfAssignable": false,
    "iconEmojiId": null,
    "mentionable": true,
    "botScope": {}
  }
}
Previous
Update a Team
Next
Get Team Roles
Built with