Skip to main content

DataSegmentationAPI

This service is responsible for creating segments that will determine how access is delegated to identities withing the organization.

All URIs are relative to https://sailpoint.api.identitynow.com/v2025

MethodHTTP requestDescription
create-data-segmentPost /data-segmentsCreate Segment
delete-data-segmentDelete /data-segments/{segmentId}Delete Segment by ID
get-data-segmentGet /data-segments/{segmentId}Get Segment by ID
get-data-segment-identity-membershipGet /data-segments/membership/{identityId}Get SegmentMembership by Identity ID
get-data-segmentation-enabled-for-userGet /data-segments/user-enabled/{identityId}Is Segmentation enabled by Identity
list-data-segmentsGet /data-segmentsGet Segments
patch-data-segmentPatch /data-segments/{segmentId}Update Segment
publish-data-segmentPost /data-segments/{segmentId}Publish segment by ID

create-data-segment

Create Segment This API creates a segment.

Note: Segment definitions may take time to propagate to all identities.

API Spec

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiCreateDataSegmentRequest struct via the builder pattern

NameTypeDescriptionNotes
dataSegmentDataSegment

Return type

DataSegment

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

Example

package main

import (
"context"
"fmt"
"os"
"encoding/json"
v2025 "github.com/sailpoint-oss/golang-sdk/v2/api_v2025"
sailpoint "github.com/sailpoint-oss/golang-sdk/v2"
)

func main() {
datasegment := []byte(``) // DataSegment |


var dataSegment v2025.DataSegment
if err := json.Unmarshal(datasegment, &dataSegment); err != nil {
fmt.Println("Error:", err)
return
}


configuration := sailpoint.NewDefaultConfiguration()
apiClient := sailpoint.NewAPIClient(configuration)
resp, r, err := apiClient.V2025.DataSegmentationAPI.CreateDataSegment(context.Background()).DataSegment(dataSegment).Execute()
//resp, r, err := apiClient.V2025.DataSegmentationAPI.CreateDataSegment(context.Background()).DataSegment(dataSegment).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DataSegmentationAPI.CreateDataSegment``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateDataSegment`: DataSegment
fmt.Fprintf(os.Stdout, "Response from `DataSegmentationAPI.CreateDataSegment`: %v\n", resp)
}

[Back to top]

delete-data-segment

experimental

This API is currently in an experimental state. The API is subject to change based on feedback and further testing. You must include the X-SailPoint-Experimental header and set it to true to use this endpoint.

setting x-sailpoint-experimental header

on the configuration object you can set the x-sailpoint-experimental header to `true' to enable all experimantl endpoints within the SDK. Example:

  configuration = Configuration()
configuration.experimental = True

Delete Segment by ID This API deletes the segment specified by the given ID.

API Spec

Path Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
idstringThe segment ID to delete.

Other Parameters

Other parameters are passed through a pointer to a apiDeleteDataSegmentRequest struct via the builder pattern

NameTypeDescriptionNotes

xSailPointExperimental | string | Use this header to enable this experimental API. | [default to "true"] published | bool | This determines which version of the segment to delete | [default to false]

Return type

(empty response body)

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

Example

package main

import (
"context"
"fmt"
"os"


sailpoint "github.com/sailpoint-oss/golang-sdk/v2"
)

func main() {
id := `ef38f943-47e9-4562-b5bb-8424a56397d8` // string | The segment ID to delete. # string | The segment ID to delete.
xSailPointExperimental := `true` // string | Use this header to enable this experimental API. (default to "true") # string | Use this header to enable this experimental API. (default to "true")
published := false // bool | This determines which version of the segment to delete (optional) (default to false) # bool | This determines which version of the segment to delete (optional) (default to false)



configuration := sailpoint.NewDefaultConfiguration()
apiClient := sailpoint.NewAPIClient(configuration)
r, err := apiClient.V2025.DataSegmentationAPI.DeleteDataSegment(context.Background(), id).XSailPointExperimental(xSailPointExperimental).Execute()
//r, err := apiClient.V2025.DataSegmentationAPI.DeleteDataSegment(context.Background(), id).XSailPointExperimental(xSailPointExperimental).Published(published).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DataSegmentationAPI.DeleteDataSegment``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}

[Back to top]

get-data-segment

experimental

This API is currently in an experimental state. The API is subject to change based on feedback and further testing. You must include the X-SailPoint-Experimental header and set it to true to use this endpoint.

setting x-sailpoint-experimental header

on the configuration object you can set the x-sailpoint-experimental header to `true' to enable all experimantl endpoints within the SDK. Example:

  configuration = Configuration()
configuration.experimental = True

Get Segment by ID This API returns the segment specified by the given ID.

API Spec

Path Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
idstringThe segment ID to retrieve.

Other Parameters

Other parameters are passed through a pointer to a apiGetDataSegmentRequest struct via the builder pattern

NameTypeDescriptionNotes

xSailPointExperimental | string | Use this header to enable this experimental API. | [default to "true"]

Return type

DataSegment

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

Example

package main

import (
"context"
"fmt"
"os"


sailpoint "github.com/sailpoint-oss/golang-sdk/v2"
)

func main() {
id := `ef38f943-47e9-4562-b5bb-8424a56397d8` // string | The segment ID to retrieve. # string | The segment ID to retrieve.
xSailPointExperimental := `true` // string | Use this header to enable this experimental API. (default to "true") # string | Use this header to enable this experimental API. (default to "true")



configuration := sailpoint.NewDefaultConfiguration()
apiClient := sailpoint.NewAPIClient(configuration)
resp, r, err := apiClient.V2025.DataSegmentationAPI.GetDataSegment(context.Background(), id).XSailPointExperimental(xSailPointExperimental).Execute()
//resp, r, err := apiClient.V2025.DataSegmentationAPI.GetDataSegment(context.Background(), id).XSailPointExperimental(xSailPointExperimental).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DataSegmentationAPI.GetDataSegment``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetDataSegment`: DataSegment
fmt.Fprintf(os.Stdout, "Response from `DataSegmentationAPI.GetDataSegment`: %v\n", resp)
}

[Back to top]

get-data-segment-identity-membership

experimental

This API is currently in an experimental state. The API is subject to change based on feedback and further testing. You must include the X-SailPoint-Experimental header and set it to true to use this endpoint.

setting x-sailpoint-experimental header

on the configuration object you can set the x-sailpoint-experimental header to `true' to enable all experimantl endpoints within the SDK. Example:

  configuration = Configuration()
configuration.experimental = True

Get SegmentMembership by Identity ID This API returns the segment membership specified by the given identity ID.

API Spec

Path Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
identityIdstringThe identity ID to retrieve the segments they are in.

Other Parameters

Other parameters are passed through a pointer to a apiGetDataSegmentIdentityMembershipRequest struct via the builder pattern

NameTypeDescriptionNotes

xSailPointExperimental | string | Use this header to enable this experimental API. | [default to "true"]

Return type

map[string]interface

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

Example

package main

import (
"context"
"fmt"
"os"


sailpoint "github.com/sailpoint-oss/golang-sdk/v2"
)

func main() {
identityId := `ef38f943-47e9-4562-b5bb-8424a56397d8` // string | The identity ID to retrieve the segments they are in. # string | The identity ID to retrieve the segments they are in.
xSailPointExperimental := `true` // string | Use this header to enable this experimental API. (default to "true") # string | Use this header to enable this experimental API. (default to "true")



configuration := sailpoint.NewDefaultConfiguration()
apiClient := sailpoint.NewAPIClient(configuration)
resp, r, err := apiClient.V2025.DataSegmentationAPI.GetDataSegmentIdentityMembership(context.Background(), identityId).XSailPointExperimental(xSailPointExperimental).Execute()
//resp, r, err := apiClient.V2025.DataSegmentationAPI.GetDataSegmentIdentityMembership(context.Background(), identityId).XSailPointExperimental(xSailPointExperimental).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DataSegmentationAPI.GetDataSegmentIdentityMembership``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetDataSegmentIdentityMembership`: map[string]interface{}
fmt.Fprintf(os.Stdout, "Response from `DataSegmentationAPI.GetDataSegmentIdentityMembership`: %v\n", resp)
}

[Back to top]

get-data-segmentation-enabled-for-user

experimental

This API is currently in an experimental state. The API is subject to change based on feedback and further testing. You must include the X-SailPoint-Experimental header and set it to true to use this endpoint.

setting x-sailpoint-experimental header

on the configuration object you can set the x-sailpoint-experimental header to `true' to enable all experimantl endpoints within the SDK. Example:

  configuration = Configuration()
configuration.experimental = True

Is Segmentation enabled by Identity This API returns whether or not segmentation is enabled for the identity.

API Spec

Path Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
identityIdstringThe identity ID to retrieve if segmentation is enabled for the identity.

Other Parameters

Other parameters are passed through a pointer to a apiGetDataSegmentationEnabledForUserRequest struct via the builder pattern

NameTypeDescriptionNotes

xSailPointExperimental | string | Use this header to enable this experimental API. | [default to "true"]

Return type

bool

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

Example

package main

import (
"context"
"fmt"
"os"


sailpoint "github.com/sailpoint-oss/golang-sdk/v2"
)

func main() {
identityId := `ef38f943-47e9-4562-b5bb-8424a56397d8` // string | The identity ID to retrieve if segmentation is enabled for the identity. # string | The identity ID to retrieve if segmentation is enabled for the identity.
xSailPointExperimental := `true` // string | Use this header to enable this experimental API. (default to "true") # string | Use this header to enable this experimental API. (default to "true")



configuration := sailpoint.NewDefaultConfiguration()
apiClient := sailpoint.NewAPIClient(configuration)
resp, r, err := apiClient.V2025.DataSegmentationAPI.GetDataSegmentationEnabledForUser(context.Background(), identityId).XSailPointExperimental(xSailPointExperimental).Execute()
//resp, r, err := apiClient.V2025.DataSegmentationAPI.GetDataSegmentationEnabledForUser(context.Background(), identityId).XSailPointExperimental(xSailPointExperimental).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DataSegmentationAPI.GetDataSegmentationEnabledForUser``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetDataSegmentationEnabledForUser`: bool
fmt.Fprintf(os.Stdout, "Response from `DataSegmentationAPI.GetDataSegmentationEnabledForUser`: %v\n", resp)
}

[Back to top]

list-data-segments

experimental

This API is currently in an experimental state. The API is subject to change based on feedback and further testing. You must include the X-SailPoint-Experimental header and set it to true to use this endpoint.

setting x-sailpoint-experimental header

on the configuration object you can set the x-sailpoint-experimental header to `true' to enable all experimantl endpoints within the SDK. Example:

  configuration = Configuration()
configuration.experimental = True

Get Segments This API returns the segment specified by the given ID.

API Spec

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiListDataSegmentsRequest struct via the builder pattern

NameTypeDescriptionNotes
xSailPointExperimentalstringUse this header to enable this experimental API.[default to "true"]
enabledboolThis boolean indicates whether the segment is currently active. Inactive segments have no effect.[default to true]
uniqueboolThis returns only one record if set to true and that would be the published record if exists.[default to false]
publishedboolThis boolean indicates whether the segment is being applied to the accounts. If unpublished its being actively modified until published[default to true]
limitint32Max number of results to return. See V3 API Standard Collection Parameters for more information.[default to 250]
offsetint32Offset into the full result set. Usually specified with limit to paginate through the results. See V3 API Standard Collection Parameters for more information.[default to 0]
countboolIf 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.[default to false]
filtersstringFilter results using the standard syntax described in V3 API Standard Collection Parameters Filtering is supported for the following fields and operators: id: eq, in, sw name: eq, in, sw

Return type

[]DataSegment

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

Example

package main

import (
"context"
"fmt"
"os"


sailpoint "github.com/sailpoint-oss/golang-sdk/v2"
)

func main() {
xSailPointExperimental := `true` // string | Use this header to enable this experimental API. (default to "true") # string | Use this header to enable this experimental API. (default to "true")
enabled := true // bool | This boolean indicates whether the segment is currently active. Inactive segments have no effect. (optional) (default to true) # bool | This boolean indicates whether the segment is currently active. Inactive segments have no effect. (optional) (default to true)
unique := false // bool | This returns only one record if set to true and that would be the published record if exists. (optional) (default to false) # bool | This returns only one record if set to true and that would be the published record if exists. (optional) (default to false)
published := true // bool | This boolean indicates whether the segment is being applied to the accounts. If unpublished its being actively modified until published (optional) (default to true) # bool | This boolean indicates whether the segment is being applied to the accounts. If unpublished its being actively modified until published (optional) (default to true)
limit := 250 // int32 | 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) (default to 250) # int32 | 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) (default to 250)
offset := 0 // int32 | 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) (default to 0) # int32 | 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) (default to 0)
count := true // bool | 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) (default to false) # bool | 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) (default to false)
filters := `name eq ""` // string | Filter results using the standard syntax described in [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters#filtering-results) Filtering is supported for the following fields and operators: **id**: *eq, in, sw* **name**: *eq, in, sw* (optional) # string | Filter results using the standard syntax described in [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters#filtering-results) Filtering is supported for the following fields and operators: **id**: *eq, in, sw* **name**: *eq, in, sw* (optional)



configuration := sailpoint.NewDefaultConfiguration()
apiClient := sailpoint.NewAPIClient(configuration)
resp, r, err := apiClient.V2025.DataSegmentationAPI.ListDataSegments(context.Background()).XSailPointExperimental(xSailPointExperimental).Execute()
//resp, r, err := apiClient.V2025.DataSegmentationAPI.ListDataSegments(context.Background()).XSailPointExperimental(xSailPointExperimental).Enabled(enabled).Unique(unique).Published(published).Limit(limit).Offset(offset).Count(count).Filters(filters).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DataSegmentationAPI.ListDataSegments``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListDataSegments`: []DataSegment
fmt.Fprintf(os.Stdout, "Response from `DataSegmentationAPI.ListDataSegments`: %v\n", resp)
}

[Back to top]

patch-data-segment

experimental

This API is currently in an experimental state. The API is subject to change based on feedback and further testing. You must include the X-SailPoint-Experimental header and set it to true to use this endpoint.

setting x-sailpoint-experimental header

on the configuration object you can set the x-sailpoint-experimental header to `true' to enable all experimantl endpoints within the SDK. Example:

  configuration = Configuration()
configuration.experimental = True

Update Segment Use this API to update segment fields by using the JSON Patch standard.

API Spec

Path Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
idstringThe segment ID to modify.

Other Parameters

Other parameters are passed through a pointer to a apiPatchDataSegmentRequest struct via the builder pattern

NameTypeDescriptionNotes

xSailPointExperimental | string | Use this header to enable this experimental API. | [default to "true"] requestBody | []map[string]interface | A list of segment update operations according to the JSON Patch standard. The following fields are patchable: * name * description * membership * memberFilter * memberSelection * scopes * enabled |

Return type

DataSegment

HTTP request headers

  • Content-Type: application/json-patch+json
  • Accept: application/json

Example

package main

import (
"context"
"fmt"
"os"
"encoding/json"
v2025 "github.com/sailpoint-oss/golang-sdk/v2/api_v2025"
sailpoint "github.com/sailpoint-oss/golang-sdk/v2"
)

func main() {
id := `ef38f943-47e9-4562-b5bb-8424a56397d8` // string | The segment ID to modify. # string | The segment ID to modify.
xSailPointExperimental := `true` // string | Use this header to enable this experimental API. (default to "true") # string | Use this header to enable this experimental API. (default to "true")
requestbody := []byte(`[{op=replace, path=/memberFilter, value={expression={operator=AND, children=[{operator=EQUALS, attribute=location, value={type=STRING, value=Philadelphia}}, {operator=EQUALS, attribute=department, value={type=STRING, value=HR}}]}}}]`) // []map[string]interface{} | 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 * membership * memberFilter * memberSelection * scopes * enabled


var requestBody v2025.[]RequestBody
if err := json.Unmarshal(requestbody, &requestBody); err != nil {
fmt.Println("Error:", err)
return
}


configuration := sailpoint.NewDefaultConfiguration()
apiClient := sailpoint.NewAPIClient(configuration)
resp, r, err := apiClient.V2025.DataSegmentationAPI.PatchDataSegment(context.Background(), id).XSailPointExperimental(xSailPointExperimental).RequestBody(requestBody).Execute()
//resp, r, err := apiClient.V2025.DataSegmentationAPI.PatchDataSegment(context.Background(), id).XSailPointExperimental(xSailPointExperimental).RequestBody(requestBody).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DataSegmentationAPI.PatchDataSegment``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `PatchDataSegment`: DataSegment
fmt.Fprintf(os.Stdout, "Response from `DataSegmentationAPI.PatchDataSegment`: %v\n", resp)
}

[Back to top]

publish-data-segment

experimental

This API is currently in an experimental state. The API is subject to change based on feedback and further testing. You must include the X-SailPoint-Experimental header and set it to true to use this endpoint.

setting x-sailpoint-experimental header

on the configuration object you can set the x-sailpoint-experimental header to `true' to enable all experimantl endpoints within the SDK. Example:

  configuration = Configuration()
configuration.experimental = True

Publish segment by ID This will publish the segment so that it starts applying the segmentation to the desired users if enabled

API Spec

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPublishDataSegmentRequest struct via the builder pattern

NameTypeDescriptionNotes
xSailPointExperimentalstringUse this header to enable this experimental API.[default to "true"]
requestBody[]stringA list of segment ids that you wish to publish
publishAllboolThis flag decides whether you want to publish all unpublished or a list of specific segment ids[default to true]

Return type

(empty response body)

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

Example

package main

import (
"context"
"fmt"
"os"
"encoding/json"
v2025 "github.com/sailpoint-oss/golang-sdk/v2/api_v2025"
sailpoint "github.com/sailpoint-oss/golang-sdk/v2"
)

func main() {
xSailPointExperimental := `true` // string | Use this header to enable this experimental API. (default to "true") # string | Use this header to enable this experimental API. (default to "true")
requestbody := []byte(``) // []string | A list of segment ids that you wish to publish
publishAll := true // bool | This flag decides whether you want to publish all unpublished or a list of specific segment ids (optional) (default to true) # bool | This flag decides whether you want to publish all unpublished or a list of specific segment ids (optional) (default to true)


var requestBody v2025.[]RequestBody
if err := json.Unmarshal(requestbody, &requestBody); err != nil {
fmt.Println("Error:", err)
return
}


configuration := sailpoint.NewDefaultConfiguration()
apiClient := sailpoint.NewAPIClient(configuration)
r, err := apiClient.V2025.DataSegmentationAPI.PublishDataSegment(context.Background()).XSailPointExperimental(xSailPointExperimental).RequestBody(requestBody).Execute()
//r, err := apiClient.V2025.DataSegmentationAPI.PublishDataSegment(context.Background()).XSailPointExperimental(xSailPointExperimental).RequestBody(requestBody).PublishAll(publishAll).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DataSegmentationAPI.PublishDataSegment``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}

[Back to top]