---
title: "Add a PermissionPolicy to a service user"
method: POST
path: "/organizations/{orgId}/permissionpolicies/{permissionPolicyId}/addtoserviceuser"
tags: ["PermissionPolicy"]
---

# Add a PermissionPolicy to a service user

`POST /organizations/{orgId}/permissionpolicies/{permissionPolicyId}/addtoserviceuser`

## Request

- Base URL: `https://api.m3ter.com`
- URL: `https://api.m3ter.com/organizations/{orgId}/permissionpolicies/{permissionPolicyId}/addtoserviceuser`
- Auth: OAuth 2
  - Authorization code: `https://m3ter.auth.us-east-1.amazoncognito.com/oauth2/authorize`, token URL `https://m3ter.auth.us-east-1.amazoncognito.com/oauth2/token`
  - Client credentials, token URL `/oauth/token`
- TypeScript: <https://skmtc.dev/m3ter-com/apis/m3ter-api/docs/organizations/:orgId/permissionpolicies/:permissionPolicyId/addtoserviceuser/post.ts> (a function with typed inputs; its response is checked against the schema)

Add a permission policy to a service user.

## Path parameters

- `orgId` string, required
- `permissionPolicyId` string, required

## Request body

- PrincipalPermissionRequest
  - `version` integer: 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.
  - `principalId` string, required

## Response `200`

Returns the PrincipalPermission

- PrincipalPermissionResponse
  - `id` string, required: The UUID of the entity.
  - `version` integer: 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` '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.

## Other responses

- `4XX`: Error message
- `5XX`: Error message

## Changes

- **2026-10-16** `85c514abc692`: 2 breaking
  - the `allOf[subschema #2]/` request property type changed from no type to `object`
  - the `allOf[subschema #2]/` response's property type changed from no type to `object` for status `200`
- **2025-12-03** `ac93d1a9e6d9`: 9 warning, 1 info
  - removed the optional property `createdBy` from the response with the `200` status
  - removed the optional property `dtCreated` from the response with the `200` status
  - removed the optional property `dtLastModified` from the response with the `200` status
  - removed the optional property `id` from the response with the `200` status
  - …6 more

[Operation history](https://skmtc.dev/m3ter-com/apis/m3ter-api/changes/organizations/:orgId/permissionpolicies/:permissionPolicyId/addtoserviceuser/post.md)

---

[API](https://skmtc.dev/m3ter-com/apis/m3ter-api.md) - [All operations](https://skmtc.dev/m3ter-com/apis/m3ter-api/llms.txt) - [OpenAPI document](https://skmtc.dev/m3ter-com/apis/m3ter-api/revisions/85c514abc692?raw)
