SegmentsApi
Use this API to implement and customize access request segment functionality. With this functionality in place, administrators can create and manage access request segments. Segments provide organizations with a way to make the access their users have even more granular - this can simply the access request process for the organization's users and improves security by reducing the risk of overprovisoning access.
Segments represent sets of identities, all grouped by specified identity attributes, who are only able to see and access the access items associated with their segments. For example, administrators could group all their organization's London office employees into one segment, "London Office Employees," by their shared location. The administrators could then define the access items the London employees would need, and the identities in the "London Office Employees" would then only be able to see and access those items.
In Identity Security Cloud, administrators can use the 'Access' drop-down menu and select 'Segments' to reach the 'Access Requests Segments' page. This page lists all the existing access request segments, along with their statuses, enabled or disabled. Administrators can use this page to create, edit, enable, disable, and delete segments. To create a segment, an administrator must provide a name, define the identities grouped in the segment, and define the items the identities in the segment can access. These items can be access profiles, roles, or entitlements.
When administrators use the API to create and manage segments, they use a JSON expression in the `visibilityCriteria` object to define the segment's identities and access items.
Refer to Managing Access Request Segments for more information about segments in Identity Security Cloud.
All URIs are relative to https://sailpoint.api.identitynow.com
| Method | HTTP request | Description |
|---|---|---|
| create-segment-v1 | POST /segments/v1 | Create segment |
| delete-segment-v1 | DELETE /segments/v1/{id} | Delete segment by id |
| get-segment-v1 | GET /segments/v1/{id} | Get segment by id |
| list-segments-v1 | GET /segments/v1 | List segments |
| patch-segment-v1 | PATCH /segments/v1/{id} | Update segment |
create-segment-v1
Create segment This API creates a segment.
Note: Segment definitions may take time to propagate to all identities.
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| segment | Segment |
Return type
Segment
HTTP request headers
- Content-Type: application/json
- Accept: application/json
Example
import { SegmentsApi } from 'sailpoint-api-client';
import { Configuration } from 'sailpoint-api-client';
import { Segment } from 'sailpoint-api-client/dist/segments/api';
const configuration = new Configuration();
const apiInstance = new SegmentsApi(configuration);
const segment: Segment = ; //
const result = await apiInstance.createSegmentV1({ segment: segment });
console.log(result);
delete-segment-v1
Delete segment by id This API deletes the segment specified by the given ID.
Note: that segment deletion may take some time to become effective.
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | string | The segment ID to delete. | [default to undefined] |
Return type
(empty response body)
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
Example
import { SegmentsApi } from 'sailpoint-api-client';
import { Configuration } from 'sailpoint-api-client';
const configuration = new Configuration();
const apiInstance = new SegmentsApi(configuration);
const id: string = ef38f94347e94562b5bb8424a56397d8; // The segment ID to delete.
const result = await apiInstance.deleteSegmentV1({ id: id });
console.log(result);
get-segment-v1
Get segment by id This API returns the segment specified by the given ID.
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | string | The segment ID to retrieve. | [default to undefined] |
Return type
Segment
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
Example
import { SegmentsApi } from 'sailpoint-api-client';
import { Configuration } from 'sailpoint-api-client';
const configuration = new Configuration();
const apiInstance = new SegmentsApi(configuration);
const id: string = ef38f94347e94562b5bb8424a56397d8; // The segment ID to retrieve.
const result = await apiInstance.getSegmentV1({ id: id });
console.log(result);
list-segments-v1
List segments This API returns a list of all segments.
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| limit | number | Max number of results to return. See V3 API Standard Collection Parameters for more information. | [optional] [default to 250] |
| offset | number | Offset into the full result set. Usually specified with limit to paginate through the results. See V3 API Standard Collection Parameters for more information. | [optional] [default to 0] |
| count | boolean | If true it will populate the X-Total-Count response header with the number of results that would be returned if limit and offset were ignored. Since requesting a total count can have a performance impact, it is recommended not to send count=true if that value will not be used. See V3 API Standard Collection Parameters for more information. | [optional] [default to false] |
Return type
Array<Segment>
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
Example
import { SegmentsApi } from 'sailpoint-api-client';
import { Configuration } from 'sailpoint-api-client';
const configuration = new Configuration();
const apiInstance = new SegmentsApi(configuration);
const limit: number = 250; // Max number of results to return. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information. (optional)
const offset: number = 0; // Offset into the full result set. Usually specified with *limit* to paginate through the results. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information. (optional)
const count: boolean = true; // If *true* it will populate the *X-Total-Count* response header with the number of results that would be returned if *limit* and *offset* were ignored. Since requesting a total count can have a performance impact, it is recommended not to send **count=true** if that value will not be used. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information. (optional)
const result = await apiInstance.listSegmentsV1({ });
console.log(result);
patch-segment-v1
Update segment Use this API to update segment fields by using the JSON Patch standard.
Note: Changes to a segment may take some time to propagate to all identities.
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | string | The segment ID to modify. | [default to undefined] |
| requestBody | Array<object> | A list of segment update operations according to the JSON Patch standard. The following fields are patchable: * name * description * owner * visibilityCriteria * active |
Return type
Segment
HTTP request headers
- Content-Type: application/json-patch+json
- Accept: application/json
Example
import { SegmentsApi } from 'sailpoint-api-client';
import { Configuration } from 'sailpoint-api-client';
const configuration = new Configuration();
const apiInstance = new SegmentsApi(configuration);
const id: string = ef38f94347e94562b5bb8424a56397d8; // The segment ID to modify.
const requestBody: Array<object> = [{"op":"replace","path":"/visibilityCriteria","value":{"expression":{"operator":"AND","children":[{"operator":"EQUALS","attribute":"location","value":{"type":"STRING","value":"Philadelphia"}},{"operator":"EQUALS","attribute":"department","value":{"type":"STRING","value":"HR"}}]}}}]; // A list of segment update operations according to the [JSON Patch](https://tools.ietf.org/html/rfc6902) standard. The following fields are patchable: * name * description * owner * visibilityCriteria * active
const result = await apiInstance.patchSegmentV1({ id: id, requestBody: requestBody });
console.log(result);