Previous Next JavaScript must be enabled to correctly display this content

## Create segments for a policy by policy Id

post

/PASService/rest/services/v1/policies/{policyId}/segments

Creates single or multiple segments based on the specified policy Id.

### Request

Path Parameters

- policyId(required): string(guid)
  Policy Id

Supported Media Types

- application/json

Request Body - application/json ()
Root Schema : schema
Type: `string`
Back to Top

### Response

#### 201 Response

This response code indicates creation of segments for a policy by policy Id successfully.
Back to Top

### Examples

This example describes how to create a single or multiple segments based on the specified policy Id.

Example cURL Command

Use the following cURL command to submit a request on the REST resource:

    curl -X POST \
         -H "Accept: application/json" \
         -H "Content-Type: application/json" \
         -u 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
         -L "http://server:port/PASService/rest/services/v1/policies/F2ADA56E-D1A0-458A-9FDE-E205DC6665F5/segments" \
         -d '{"Use this placeholder to plug-in the example request body given below"}'

Example Request Body

The following shows an example of the request body in JSON format:

    {
      "segments": [
        {
          "effectiveDate": null,
          "roles": [],

          "parentSegmentId": null,
          "policyId": "F8CC7B38-95F9-4240-A528-B890AF87188C",
          "segmentNameId": "8123E9B1-498C-4A06-A065-5A4D384C2167",
          "status": "24",
          "planSegmentNameId": null,
          "segmentName": {
            "multiFields": null,
            "segmentName": "Base Coverage",
            "activeFromDate": null,
            "activeToDate": null,
            "planSegmentName": null,
            "segmentNameId": "8123E9B1-498C-4A06-A065-5A4D384C2167",
            "planId": "C5EE0DA4-3003-42C1-9468-D91DA546B79F",
            "productId": null,
            "type": "04",
            "status": "01"
          },
          "SegmentAmount": {
            "value": 51000,
            "currency": "USD"
          }
        }
      ]
    }

Example Response Body

The following shows an example of the response body in JSON format:

    {
        "segments": [
            "71A92161-CC46-44F6-85E1-6FACDFE7961D"
        ]
    }

Back to Top