title | description | author | ms.topic | ms.devlang | ms.date | ms.author |
---|---|---|---|---|---|---|
Create userGroup |
Creates a user group object in Dynamics 365 Business Central. |
SusanneWindfeldPedersen |
reference |
al |
12/03/2023 |
solsen |
Note
User groups are replaced with security groups and will be deprecated in version 25. For more information, see security group APIs and Control Access to Business Central Using Security Groups.
Creates a user group in [!INCLUDEd365fin_long_md].
Replace the URL prefix for [!INCLUDE prod_short] depending on environment following the guideline.
POST /microsoft/automation/v2.0/companies({companyId})/userGroups
Header | Value |
---|---|
Authorization | Bearer {token}. Required. |
Content-Type | application/json |
In the request body, supply a JSON representation of a userGroup object.
If successful, this method returns 201 Created
response code and a userGroup object in the response body.
Request
Here is an example of the request.
POST https://api.businesscentral.dynamics.com/v2.0/{environment name}/api/microsoft/automation/v2.0/companies({companyId})/userGroups
Content-type: application/json
{
"code": "NEW USER GROUP",
"displayName": "New User Group",
"defaultProfileID": "ACCOUNTANT"
}
Response Here is an example of the response.
HTTP/1.1 201 Created
Content-type: application/json
{
"id": "90814d0b-caad-eb11-9b52-000d3ab03e45",
"code": "NEW USER GROUP",
"displayName": "New User Group",
"defaultProfileID": "ACCOUNTANT",
"assignToAllNewUsers": false
}