Create or Update a Static Segment Type (ARM)

[This topic is pre-release documentation and is subject to change.]

Creates a new or updates an existing static Segment type.

Request

The request is constructed as follows:

HTTP Verb Request URI
PUT <https://management.azure.com/subscriptions/<subId>/resourceGroups/<rgName>/providers/Microsoft.CustomerInsights/hubs/<hubName>/segments/static/<segmentName>?api-version=2017-04-26

URI Parameters

URI Parameter Required Description
subId Yes The Azure subscription ID
rgName Yes The resource group name
hubName Yes Name of your Customer Insights Hub
segmentName Yes The name of the static segment type to create or update

Request Body

The request body may only contain the following subset of Segment properties that can be directly modified.

Property JSON Type Description
description string Description of segment or its membership
targetProfileTypeName string Name of the profile type the query evaluates to
filterQuery string Query used to initially define static membership; see Segmentation Query Language
memberIds array List of profiles, by ID, to include as members
tags array List of user-defined segment tags (user-defined)

Example

{ 
   "description":"Test salesperson segment",
   "targetProfileTypeName":"Salesperson",
   "filterQuery":"PROFILE(Salesperson).FILTER(FirstName=='Bob')",
   "memberIds":["1","2","3"],
   "tags":["summerCampaign", "static"]
}

Response

The response includes an HTTP status code and a standard set of response headers. If successful, the body will contain a Segment definition for the newly created or modified segment, for example:

{
   "id":"/subscriptions/TESTID/resourceGroups/TESTRG/providers/Microsoft.CustomerInsights/hubs/TESTHUB/segments/TestSegment"
   "name":"TESTHUB/TestSegment", 
   "type":"Microsoft.CustomerInsights/hubs/segments", 
   "properties":
   {
       "name":"SalesTestSegment1", 
       "segmentDefinition":{  
          "filterQuery":""PROFILE(Salesperson).FILTER(FirstName=='Bob')", 
          "memberIds":[ "1", "2", "3" ], 
          "description":"Test salesperson segment", 
          "targetProfileTypeName":"Salesperson", 
          "tags":  ["summerCampaign", "static"] 
       }, 
       "segmentState":{ "segmentSize":2 }, 
       "segmentType":"Static", 
       "changed":"2017-03-09T09:09:37.8718171+00:00", 
       "created":"2017-03-08T09:09:37.8718171+00:00", 
       "provisioningState":"Provisioning"
    }
} 

Status Code

  • 200 (OK) - Request completed successfully
  • 202 (Accepted) - Request accepted and is being processed
  • 400 (Bad request) - Request contains invalid property names or values
  • 403 (Forbidden) - Requester does not have permission to perform this operation
  • 409 (Conflict) - Segment is in an intermediate provisioning state