Skip to content

Create a role from permissions you have

POST
/api/v1/workspaces/{workspaceId}/roles
curl --request POST \
--url https://api.crossmart.io/api/v1/workspaces/example/roles \
--header 'Content-Type: application/json' \
--data '{ "name": "Stock clerk", "description": "example", "permissions": [ "workspace:view" ] }'
workspaceId
required
string
Media typeapplication/json
object
name
required
string
<= 60 characters

Example

Stock clerk
description
string
nullable <= 200 characters
permissions
required

At most your own permissions. workspace:view is always added; workspace:delete is for owners only.

Array<string>
Allowed values: workspace:view workspace:manage workspace:delete members:view members:manage api-keys:manage products:view products:edit inventory:view inventory:edit orders:view reports:view channels:view channels:manage listings:edit activity:view suggestions:view suggestions:approve billing:view ai:generate
Media typeapplication/json
object
id
required
string format: uuid
name
required
string
description
required
string
nullable
permissions
required
Array<string>
Allowed values: workspace:view workspace:manage workspace:delete members:view members:manage api-keys:manage products:view products:edit inventory:view inventory:edit orders:view reports:view channels:view channels:manage listings:edit activity:view suggestions:view suggestions:approve billing:view ai:generate
memberCount
required

Members holding the role now

number
createdAt
required
string format: date-time
updatedAt
required
string format: date-time

Example

{
"permissions": [
"workspace:view"
]
}