Skip to main content
POST
/
organizations
/
{orgId}
/
permissionpolicies
/
{permissionPolicyId}
/
addtouser
Add a PermissionPolicy to a user
curl --request POST \
  --url https://api.m3ter.com/organizations/{orgId}/permissionpolicies/{permissionPolicyId}/addtouser \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "principalId": "<string>",
  "version": 123
}
'
{
  "id": "<string>",
  "version": 123,
  "permissionPolicyId": "<string>",
  "principalId": "<string>",
  "principalType": "USER",
  "dtCreated": "2023-11-07T05:31:56Z",
  "dtLastModified": "2023-11-07T05:31:56Z",
  "createdBy": "<string>",
  "lastModifiedBy": "<string>"
}

Authorizations

Authorization
string
header
required

m3ter supports machine to machine authentication using the clientCredentials OAuth2 flow.

The authorizationCode flow controls access for human users via the m3ter Console application.

Path Parameters

orgId
string
required

UUID of the organization

permissionPolicyId
string
required

UUID of the permission policy

Body

application/json
principalId
string
required
Minimum string length: 1
version
integer<int64>

The version number of the entity:

  • Create entity: Not valid for initial insertion of new entity - do not use for Create. On initial Create, version is set at 1 and listed in the response.
  • Update Entity: On Update, version is required and must match the existing version because a check is performed to ensure sequential versioning is preserved. Version is incremented by 1 and listed in the response.

Response

Returns the PrincipalPermission

id
string
required

The UUID of the entity.

version
integer<int64>

The version number:

  • Create: On initial Create to insert a new entity, the version is set at 1 in the response.
  • Update: On successful Update, the version is incremented by 1 in the response.
permissionPolicyId
string
principalId
string
principalType
enum<string>
Available options:
USER,
USERGROUP,
SERVICEUSER,
SUPPORTUSERS
dtCreated
string<date-time>

The DateTime (in ISO-8601 format) when the principal permission was created.

dtLastModified
string<date-time>

The DateTime (in ISO-8601 format) when the principal permission was last modified.

createdBy
string

The id of the user who created this principal permission.

lastModifiedBy
string

The id of the user who last modified this principal permission.