List filter segments in Dynatrace with the Grail Filter Segments API, and add optional fields to include more details in the response.
| GET | SaaS | https://{your-environment-id}.apps.dynatrace.com/v1/filter-segments |
You use add-fields to request additional fields when listing filter segments. The operation returns all filter segments and can include more details when needed, while the lean endpoint is available if you do not need description data.
To execute this request, you need a platform token or OAuth access token with storage:filter-segments:read scope. To learn how to obtain and use it, see Tokens and authentication.
| Parameter | Type | Description | In | Required |
|---|---|---|---|---|
| add-fields | string[] | Add additional fields. The element can hold these values
| query | Optional |
| Code | Type | Description |
|---|---|---|
| 200 | Filter | Filter-segments successfully retrieved. |
| 400 | Error | bad request |
| 401 | Error | unauthorized |
| 403 | Error | missing permissions |
FilterSegments object| Element | Type | Description |
|---|---|---|
| filterSegments | Filter | List of filter-segments. |
FilterSegment objectList of filter-segments.
| Element | Type | Description |
|---|---|---|
| allowedOperations | string[] | Defines the allowed operations of the current user. The element can hold these values
|
| description | string | Description of the filter-segment. |
| externalId | string | Optional unique identifier of the filter-segment. Used for Dynatrace Configuration as Code |
| isPublic | boolean | Indicates if the filter-segment is publicly accessible within the tenant. |
| isReadyMade | boolean | Indicates if the segment is ready-made. |
| name | string | Name of the filter-segment. |
| owner | string | Defines the owner of the filter-segment. |
| uid | string | Unique identifier of the filter-segment. |
| variables | Filter | Variables of the filter-segment. |
| version | integer | Used for optimistic locking. Update requests define with this on which version the data updated is based on. This must match with the version stored, otherwise the update will fail due to concurrent modification. |
FilterSegmentVariables objectVariables of the filter-segment.
| Element | Type | Description |
|---|---|---|
| type | string | Type of the variable. |
| value | string | Value of the variable. |
ErrorEnvelope object| Element | Type | Description |
|---|---|---|
| error | Exceptional | - |
ExceptionalReturn object| Element | Type | Description |
|---|---|---|
| code | integer | - |
| errorDetails | (Custom | - |
| message | string | - |
CustomValidationErrorInfo objectErrorInfo object| Element | Type | Description |
|---|---|---|
| message | string | - |
InvalidAuditEventsErrorInfo objectMediaTypeErrorInfo objectParameterErrorInfo objectProxyErrorInfo objectQueryFrontendRawErrorInfo objectRequestBodyErrorInfo object{"filterSegments": [{"uid": "D82a1jdA23a","name": "dev_environment","description": "only includes data of the dev environment","isPublic": false,"owner": "john.doe","version": 1},{"uid": "aa2E2xA01yA","name": "prod_environment","description": "only includes data of the prod environment","isPublic": true,"owner": "john.doe","version": 1}]}
{"error": {"code": 400,"message": "Missing request header","errorDetails": [{"type": "parameter","parameterDescriptor": "Dt-Tenant","message": "is required"}]}}