Skip to main content
POST
/
v1
/
users
/
{userId}
/
model-roles
Assign or update user model role
curl --request POST \
  --url https://{instance}.omniapp.co/api/v1/users/{userId}/model-roles \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "connectionId": "bc1f9c9f-208d-48a2-9ae3-ff80f2c79fed",
  "modelId": "7d3e4f5a-6b7c-8d9e-0f1a-2b3c4d5e6f7a",
  "roleName": "QUERIER"
}
'
{
  "userId": "9e8719d9-276a-4964-9395-a493189a247c",
  "connectionId": "bc1f9c9f-208d-48a2-9ae3-ff80f2c79fed",
  "modelId": "7d3e4f5a-6b7c-8d9e-0f1a-2b3c4d5e6f7a",
  "roleName": "QUERIER"
}

Authorizations

Authorization
string
header
required

Can be either an Organization API Key or Personal Access Token (PAT).

Include in the Authorization header as: Bearer YOUR_TOKEN

Path Parameters

userId
string<uuid>
required

The ID of the user to assign or update a model role for.

Body

application/json
roleName
string
required

The role to assign. Available roles include:

  • VIEWER - Can view the model
  • QUERIER - Can view and query the model
  • QUERY_TOPICS - Can query specific topics. Equivalent to Restricted Querier.
  • MODELER - Can edit and model the data
  • CONNECTION_ADMIN - Full administrative access to the connection
  • NO_ACCESS - No access to the model
  • Custom roles defined for your organization
connectionId
string<uuid>

The ID of the connection that the model belongs to:

  • Required if modelId is not provided
  • Optional if modelId is provided, in which case it will be inferred from the model
modelId
string<uuid>

The ID of the model to assign the role for:

  • Optional when assigning CONNECTION_ADMIN or custom roles with CONNECTION_ADMIN as the base role
  • Required for other role types

Response

Model role assigned or updated successfully.

userId
string<uuid>

The ID of the user.

connectionId
string<uuid>

The ID of the connection.

modelId
string<uuid>

The ID of the model.

roleName
string

The assigned role name.