Create a New Role
POST/user-svc/role
Create a new role.
The role ID must be prefixed by the callers username (email).
Eg. if the owner's slug is petstore-svc
the role should look like petstore-svc:admin
.
The user account who creates the role will become the owner of that role, and only the owner will be able to edit the role.
Requires the user-svc:role:create
permission.
Request
- application/json
Body
required
Create Role Request
description string
name string
permissionIds string[]
Responses
- 200
- 400
- 401
- 500
Role created successfully
- application/json
- Schema
- Example (from schema)
Schema
role
object
createdAt string
description string
id string
name string
ownerId string
updatedAt string
{
"role": {
"createdAt": "string",
"description": "string",
"id": "string",
"name": "string",
"ownerId": "string",
"updatedAt": "string"
}
}
Invalid JSON
- application/json
- Schema
- Example (from schema)
Schema
error string
{
"error": "string"
}
Unauthorized
- application/json
- Schema
- Example (from schema)
Schema
error string
{
"error": "string"
}
Internal Server Error
- application/json
- Schema
- Example (from schema)
Schema
error string
{
"error": "string"
}
Loading...