Create a new role for a tenant
POST/roles
Creates a new role under the tenant identified by the required tenant-id header. Use this to define a named grouping of permissions that can later be assigned to users; to modify an existing role use PATCH /roles/{roleId}. The request body accepts a name and an optional description for the new role. Returns 201 with the created role object including the server-assigned id, tenantId, createdAt, and createdBy fields. Returns 400 if the tenant-id header is absent or blank.
Request
Responses
- 201
- 400
- 401
- 403
- 500
Role created successfully
Bad request - Invalid request data or missing required fields
Authentication required - Valid authentication token is missing or invalid
Forbidden - User does not have the required permissions to create roles
Internal server error - An unexpected error occurred while processing the request. No response body is returned.