Upsert Context by UID

Creates or updates a Context with a set of Roles using the UID. This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration.

PUT
/identity/v2/manage/account/{uid}/rolecontext

Creates or updates a Context with a set of Roles using the UID.

This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration.

Authorization

apikey<token>

Tenant API Key for authentication

In: query

apisecret<token>

Tenant API Secret for authentication

In: query

Path Parameters

uid*string

UID of the User

Query Parameters

prevent_webhook?boolean

When true, suppresses webhook events for this operation.

Header Parameters

X-PreventWebhook?boolean

When true, suppresses webhook events for this operation.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X PUT "https://api.loginradius.com/identity/v2/manage/account/680fada271a140ebc0716144/rolecontext?prevent_webhook=true" \  -H "X-PreventWebhook: true" \  -H "Content-Type: application/json" \  -d '{    "rolecontext": [      {        "Roles": [          "Admin",          "Student"        ],        "AdditionalPermissions": [          "read",          "write"        ],        "Context": "school"      }    ]  }'
{
  "Data": [
    {
      "Context": "school",
      "Roles": [
        "Admin",
        "Student"
      ],
      "AdditionalPermissions": [
        "read",
        "write"
      ],
      "Expiration": "2024-05-14T12:34:56.789Z"
    }
  ]
}

{
  "ErrorCode": 908,
  "Message": "A parameter is not formatted correctly",
  "Description": "The uid is a required parameter."
}

{
  "ErrorCode": 902,
  "Message": "The API secret is unauthorized",
  "Description": "The provided LoginRadius API secret is invalid or is not authorized, please use a valid or authorized LoginRadius API secret or check the API secret for your LoginRadius account."
}

{
  "ErrorCode": 1047,
  "Message": "Role does not exist",
  "Description": "The provided Role for the user does not exist, please use a valid Role in order to process this request."
}