Software Secure Workload
Activity Configure

Secure Workload OpenAPIs Roles Create a role

Last updated: Jun 09, 2025

Create a role

This endpoint is used to create a new role.

POST /openapi/v1/roles

Parameters:

Name

Type

Description

name

string

User specified name for the role.

description

string

User specified description for the role.

app_scope_id

string

(optional) The scope ID under which the role is created If no scope ID mentioned the role is considered as service provider role.

The requesting user must have access to the provided scope. A role without a scope is called a ‘Service Provider Role’ and only site admin may create them.

Response object: Returns the newly created role object.

Sample python code


  app_scope_id = '<app-scope-id>'
  req_payload = {
        'name': 'Role Name',
        'description': 'Role Description',
        'app_scope_id': app_scope_id
  }
  restclient.post('/roles', json_body=json.dumps(req_payload))