> For the complete documentation index, see [llms.txt](https://osiris-4.gitbook.io/osiris-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://osiris-4.gitbook.io/osiris-documentation/api/createrole.md).

# CreateRole

CreateRole API

```
createRole(SessionToken, data?.ServerId, name, data.ChannelId);
```

To use the `CreateRole` function, you need to require it the Osiris API

```javascript
const { osiris } = require("../../api/osiris.js") // or the path to it
```

Code Example

```javascript
const roleName = "hi";
const Server = data?.ServerId;
const Channel = data.ChannelId;
osiris.createRole(XSessionToken, Server, RoleName, Channel).catch((err) => { // we're including channel so the sendmessage func works.. not actually needed
        return console.log(err); // we need to catch too
})
```
