Roles Management

Assign Roles by UID

copy-icon
curl -X PUT \
'https://api.loginradius.com/identity/v2/manage/account/{uid}/role?apikey=&apisecret=' \
-H 'Cache-Control: no-cache' \
-H 'content-Type: application/json' \
-d "{ "roles" : [ "roles" ] }"

The above command returns JSON structured like this:

copy-icon
{
"Roles" : [
"" , ""
]
}

This API is used to assign your desired roles to a given user.

HTTP Request

Put /identity/v2/manage/account/{uid}/role?apikey=&apisecret=

Query Parameters

ParameterDefaultDescription
apikeynoneLoginRadius API Key [Required]
apisecretnoneLoginRadius API Secret [Required]

Body Attributes

AttributeDescription
RolesArray of String, which represents the role nameModel Class containing Definition of payload for Create Role API [Required]

Upsert Context

copy-icon
curl -X PUT \
'https://api.loginradius.com/identity/v2/manage/account/{uid}/roleContext?apikey=&apisecret=' \
-H 'Cache-Control: no-cache' \
-H 'content-Type: application/json' \
-d "{ "roleContext" : [ {
"additionalPermissions" => ["<additionalPermissions>" ] ,
"context" => "<context>" ,
"expiration" => "<expiration>" ,
"roles" => ["<roles>" ]
} ] }"

The above command returns JSON structured like this:

copy-icon
{
"Data" : [
{
}
]
}

This API creates a Context with a set of Roles

HTTP Request

Put /identity/v2/manage/account/{uid}/roleContext?apikey=&apisecret=

Query Parameters

ParameterDefaultDescription
apikeynoneLoginRadius API Key [Required]
apisecretnoneLoginRadius API Secret [Required]

Body Attributes

AttributeDescription
RoleContextArray of RoleContext object, see body tab for structureModel Class containing Definition of RoleContext payload [Required]

Add Permissions to Role

copy-icon
curl -X PUT \
'https://api.loginradius.com/identity/v2/manage/role/{role}/permission?apikey=&apisecret=' \
-H 'Cache-Control: no-cache' \
-H 'content-Type: application/json' \
-d "{ "permissions" : [ "permissions" ] }"

The above command returns JSON structured like this:

copy-icon
{
"Name" : "Array of String, which represents the role name",
"Permissions" : {"key1":"value1","key2":"value2"}
}

This API is used to add permissions to a given role.

HTTP Request

Put /identity/v2/manage/role/{role}/permission?apikey=&apisecret=

Query Parameters

ParameterDefaultDescription
apikeynoneLoginRadius API Key [Required]
apisecretnoneLoginRadius API Secret [Required]

Body Attributes

AttributeDescription
PermissionsAny Permission name for the roleModel Class containing Definition for PermissionsModel Property [Required]

Roles Create

copy-icon
curl -X POST \
'https://api.loginradius.com/identity/v2/manage/role?apikey=&apisecret=' \
-H 'Cache-Control: no-cache' \
-H 'content-Type: application/json' \
-d "{ "roles" : [ {
"name" => "<name>" ,
"permissions" => {"Permission_name"=>true}
} ] }"

The above command returns JSON structured like this:

copy-icon
{
"Count" : 0,
"data" : [
{
}
]
}

This API creates a role with permissions.

HTTP Request

Post /identity/v2/manage/role?apikey=&apisecret=

Query Parameters

ParameterDefaultDescription
apikeynoneLoginRadius API Key [Required]
apisecretnoneLoginRadius API Secret [Required]

Body Attributes

AttributeDescription
RolesArray of String, which represents the role nameModel Class containing Definition of payload for Roles API [Required]

Roles by UID

copy-icon
curl -X GET \
'https://api.loginradius.com/identity/v2/manage/account/{uid}/role?apikey=&apisecret=' \
-H 'Cache-Control: no-cache' \
-H 'content-Type: application/json' \

The above command returns JSON structured like this:

copy-icon
{
"Roles" : [
"" , ""
]
}

API is used to retrieve all the assigned roles of a particular User.

HTTP Request

Get /identity/v2/manage/account/{uid}/role?apikey=&apisecret=

Query Parameters

ParameterDefaultDescription
apikeynoneLoginRadius API Key [Required]
apisecretnoneLoginRadius API Secret [Required]

Get Context with Roles and Permissions

copy-icon
curl -X GET \
'https://api.loginradius.com/identity/v2/manage/account/{uid}/roleContext?apikey=&apisecret=' \
-H 'Cache-Control: no-cache' \
-H 'content-Type: application/json' \

The above command returns JSON structured like this:

copy-icon
{
"Data" : [
{
}
]
}

This API Gets the contexts that have been configured and the associated roles and permissions.

HTTP Request

Get /identity/v2/manage/account/{uid}/roleContext?apikey=&apisecret=

Query Parameters

ParameterDefaultDescription
apikeynoneLoginRadius API Key [Required]
apisecretnoneLoginRadius API Secret [Required]

Role Context profile

copy-icon
curl -X GET \
'https://api.loginradius.com/identity/v2/manage/account/roleContext/{contextName}?apikey=&apisecret=' \
-H 'Cache-Control: no-cache' \
-H 'content-Type: application/json' \

The above command returns JSON structured like this:

copy-icon
{
"Data" : [
{
}
]
}

The API is used to retrieve role context by the context name.

HTTP Request

Get /identity/v2/manage/account/roleContext/{contextName}?apikey=&apisecret=

Query Parameters

ParameterDefaultDescription
apikeynoneLoginRadius API Key [Required]
apisecretnoneLoginRadius API Secret [Required]

Roles List

copy-icon
curl -X GET \
'https://api.loginradius.com/identity/v2/manage/role?apikey=&apisecret=' \
-H 'Cache-Control: no-cache' \
-H 'content-Type: application/json' \

The above command returns JSON structured like this:

copy-icon
{
"Count" : 0,
"data" : [
{
}
]
}

This API retrieves the complete list of created roles with permissions of your app.

HTTP Request

Get /identity/v2/manage/role?apikey=&apisecret=

Query Parameters

ParameterDefaultDescription
apikeynoneLoginRadius API Key [Required]
apisecretnoneLoginRadius API Secret [Required]

Unassign Roles by UID

copy-icon
curl -X DELETE \
'https://api.loginradius.com/identity/v2/manage/account/{uid}/role?apikey=&apisecret=' \
-H 'Cache-Control: no-cache' \
-H 'content-Type: application/json' \
-d "{ "roles" : [ "roles" ] }"

The above command returns JSON structured like this:

copy-icon
{
"IsDeleted" : true,
"RecordsDeleted" : 0
}

This API is used to unassign roles from a user.

HTTP Request

Delete /identity/v2/manage/account/{uid}/role?apikey=&apisecret=

Query Parameters

ParameterDefaultDescription
apikeynoneLoginRadius API Key [Required]
apisecretnoneLoginRadius API Secret [Required]

Body Attributes

AttributeDescription
RolesArray of String, which represents the role nameModel Class containing Definition of payload for Create Role API [Required]

Delete Role Context

copy-icon
curl -X DELETE \
'https://api.loginradius.com/identity/v2/manage/account/{uid}/roleContext/{contextName}?apikey=&apisecret=' \
-H 'Cache-Control: no-cache' \
-H 'content-Type: application/json' \

The above command returns JSON structured like this:

copy-icon
{
"IsDeleted" : true,
"RecordsDeleted" : 0
}

This API Deletes the specified Role Context

HTTP Request

Delete /identity/v2/manage/account/{uid}/roleContext/{contextName}?apikey=&apisecret=

Query Parameters

ParameterDefaultDescription
apikeynoneLoginRadius API Key [Required]
apisecretnoneLoginRadius API Secret [Required]

Delete Role from Context

copy-icon
curl -X DELETE \
'https://api.loginradius.com/identity/v2/manage/account/{uid}/roleContext/{contextName}/role?apikey=&apisecret=' \
-H 'Cache-Control: no-cache' \
-H 'content-Type: application/json' \
-d "{ "roles" : [ "roles" ] }"

The above command returns JSON structured like this:

copy-icon
{
"IsDeleted" : true,
"RecordsDeleted" : 0
}

This API Deletes the specified Role from a Context.

HTTP Request

Delete /identity/v2/manage/account/{uid}/roleContext/{contextName}/role?apikey=&apisecret=

Query Parameters

ParameterDefaultDescription
apikeynoneLoginRadius API Key [Required]
apisecretnoneLoginRadius API Secret [Required]

Body Attributes

AttributeDescription
RolesArray of String, which represents the role nameModel Class containing Definition of payload for RoleContextRemoveRole API [Required]

Delete Additional Permission from Context

copy-icon
curl -X DELETE \
'https://api.loginradius.com/identity/v2/manage/account/{uid}/roleContext/{contextName}/additionalPermission?apikey=&apisecret=' \
-H 'Cache-Control: no-cache' \
-H 'content-Type: application/json' \
-d "{ "additionalPermissions" : [ "additionalPermissions" ] }"

The above command returns JSON structured like this:

copy-icon
{
"IsDeleted" : true,
"RecordsDeleted" : 0
}

This API Deletes Additional Permissions from Context.

HTTP Request

Delete /identity/v2/manage/account/{uid}/roleContext/{contextName}/additionalPermission?apikey=&apisecret=

Query Parameters

ParameterDefaultDescription
apikeynoneLoginRadius API Key [Required]
apisecretnoneLoginRadius API Secret [Required]

Body Attributes

AttributeDescription
AdditionalPermissionsArray of String, which represents the additional permissionsModel Class containing Definition of payload for RoleContextAdditionalPermissionRemoveRole API [Required]

Account Delete Role

copy-icon
curl -X DELETE \
'https://api.loginradius.com/identity/v2/manage/role/{role}?apikey=&apisecret=' \
-H 'Cache-Control: no-cache' \
-H 'content-Type: application/json' \

The above command returns JSON structured like this:

copy-icon
{
"IsDeleted" : true,
"RecordsDeleted" : 0
}

This API is used to delete the role.

HTTP Request

Delete /identity/v2/manage/role/{role}?apikey=&apisecret=

Query Parameters

ParameterDefaultDescription
apikeynoneLoginRadius API Key [Required]
apisecretnoneLoginRadius API Secret [Required]

Remove Permissions

copy-icon
curl -X DELETE \
'https://api.loginradius.com/identity/v2/manage/role/{role}/permission?apikey=&apisecret=' \
-H 'Cache-Control: no-cache' \
-H 'content-Type: application/json' \
-d "{ "permissions" : [ "permissions" ] }"

The above command returns JSON structured like this:

copy-icon
{
"Name" : "Array of String, which represents the role name",
"Permissions" : {"key1":"value1","key2":"value2"}
}

API is used to remove permissions from a role.

HTTP Request

Delete /identity/v2/manage/role/{role}/permission?apikey=&apisecret=

Query Parameters

ParameterDefaultDescription
apikeynoneLoginRadius API Key [Required]
apisecretnoneLoginRadius API Secret [Required]

Body Attributes

AttributeDescription
PermissionsAny Permission name for the roleModel Class containing Definition for PermissionsModel Property [Required]