Create a role with the Node.js SDK
permit.api.roles.create() creates a role in the Permit.io environment that your Node.js SDK client is connected to. This reference is for backend developers who manage roles from code instead of the Permit dashboard.
Prerequisites
- A
permitclient created with an API key for the environment. See Create a Permit client and Get your API key.
Method signature
| Method | Signature | Status |
|---|---|---|
permit.api.roles.create | create(roleData: RoleCreate): Promise<RoleRead> | Recommended |
permit.api.createRole | createRole(role: RoleCreate): Promise<RoleRead> | Deprecated alias with the same argument |