Create a new configuration policy for the specified customer

Applies To

  • Partner Center
  • Partner Center for Microsoft Cloud Germany

How to create a new configuration policy for the specified customer.


  • Credentials as described in Partner Center authentication. This scenario supports authentication with both standalone App and App+User credentials.
  • The customer identifier.


To create a new configuration policy for the specified customer, instantiate a new ConfigurationPolicy object as shown in the following code snippet. Then call the IAggregatePartner.Customers.ById method with the customer ID to retrieve an interface to operations on the specified customer. Next, retrieve the ConfigurationPolicies property to get an interface to configuration policy collection operations. Finally, call the Create or CreateAsync method to create the configuration policy.

// IAggregatePartner partnerOperations;
// string selectedCustomerId;

var configurationPolicyToCreate = new ConfigurationPolicy
    Name = "Test Config Policy",
    Description = "This configuration policy is created by the SDK samples",
    PolicySettings = new List<PolicySettingsType>() { 
        PolicySettingsType.SkipEula }

var createdConfigurationPolicy = 

Sample: Console test app. Project: Partner Center SDK Samples Class: CreateConfigurationPolicy.cs


Request syntax

Method Request URI
POST {baseURL}/v1/customers/{customer-id}/policies HTTP/1.1

URI parameter

Use the following path parameters when creating the request.

Name Type Required Description
customer-id string Yes A GUID-formatted string that identifies the customer.

Request headers

Request body

The request body must contain an object with the configuration policy information as described in the following table:

Name Type Required Description
name string Yes The friendly name of the policy.
category string Yes The policy category.
description string No The policy description.
policySettings array of strings Yes The policy settings.

Request example

Authorization: Bearer <token> 
Accept: application/json
MS-RequestId: e88d014d-ab70-41de-90a0-f7fd1797267d
MS-CorrelationId: de894e18-f027-4ac0-8b5a-34f0c222af0c
X-Locale: en-US
Content-Length: 212
Content-Type: application/json

    "name": "Windows 10 Enterprise E5",
    "category": "o_o_b_e",
    "description": "test policy creation from API",
    "policySettings": ["oobe_user_not_local_admin", "skip_express_settings"]


If successful, the response body contains the ConfigurationPolicy resource for the new policy.

Response success and error codes

Each response comes with an HTTP status code that indicates success or failure and additional debugging information. Use a network trace tool to read this code, error type, and additional parameters. For the full list, see Partner Center REST error codes.

Response example

HTTP/1.1 200 OK
Content-Length: 404
Content-Type: application/json; charset=utf-8
MS-CorrelationId: 4beda413-74fc-4839-b74f-f580c353ab45
MS-RequestId: 0dfadf74-aa66-49ed-9a67-b3b78d9297cc
MS-CV: YrLe3w6BbUSMt1fi.0
MS-ServerId: 030020344
Date: Tue, 25 Jul 2017 18:07:36 GMT

    "id": "40cdb858-edcc-44d7-9083-d6a36d43bd3f",
    "name": "Windows 10 Enterprise E5",
    "category": "o_o_b_e",
    "description": "test policy creation from API",
    "devicesAssigned": 0,
    "policySettings": ["oobe_user_not_local_admin", "skip_express_settings"],
    "createdDate": "2017-07-25T18:07:36",
    "lastModifiedDate": "2017-07-25T18:07:36",
    "attributes": {
        "objectType": "ConfigurationPolicy"