Skip to content

Latest commit

 

History

History
77 lines (57 loc) · 2.22 KB

dynamics_usergroup_create.md

File metadata and controls

77 lines (57 loc) · 2.22 KB
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

Create userGroup

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].

HTTP request

Replace the URL prefix for [!INCLUDE prod_short] depending on environment following the guideline.

POST /microsoft/automation/v2.0/companies({companyId})/userGroups

Request headers

Header Value
Authorization Bearer {token}. Required.
Content-Type application/json

Request body

In the request body, supply a JSON representation of a userGroup object.

Response

If successful, this method returns 201 Created response code and a userGroup object in the response body.

Example

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
}

See Also

Tips for working with the APIs
userGroup