API based SQL queries

Hi all,

I understood purpose of primitive operators. Please give me few complex examples of API based requests using primitive operators.

Thanks

Hello @kanusha9

We can use the primitive operators in the api calls for various end points in the filter parameter . Remember , the attributes that are available for filtering will vary for various end point .

Example : The following is a response of Get All identities

[
    {
        "alias": "Amelia Lily",
        "emailAddress": "[email protected]",
        "isManager": false,
        "managerRef": {
            "type": "IDENTITY",
            "id": "88230898cb1448089fd4f6b7e7038858",
            "name": "Charlotte Rose"
        },
        "lastRefresh": "2025-04-20T20:36:53.870Z",
        "lifecycleState": {
            "stateName": "active",
            "manuallyUpdated": false
        },
        "processingState": null,
        "identityStatus": "UNREGISTERED",
        "attributes": {
            "country": "United States",
            "employeetype": "Employee",
            "firstname": "Amelia",
            "cloudStatus": "UNREGISTERED",
            "orgName": "Content Marketing Manager",
            "city": "New York",
            "displayName": "Amelia Lily",
            "lastSyncDate": "73ad8395281785baca1dd22bc29155408946c2b9f3ff2d5fdf79b62da480e15d",
            "title": "Content Marketing Manager",
            "identityState": "ACTIVE",
            "lastname": "Lily",
            "uid": "Amelia Lily",
            "cloudAuthoritativeSource": "22db3cab9811446d9ef8a6fecd912b29",
            "phone": "ENHISECQQQ9",
            "internalCloudStatus": "UNREGISTERED",
            "cloudLifecycleState": "active",
            "identificationNumber": "ENHISECQQQ9",
            "location": "New York",
            "department": "Marketing",
            "email": "[email protected]",
            "startDate": "10/12/22"
        },
        "id": "0630209a08ff435082036c211c4c4b2e",
        "name": "Amelia Lily",
        "created": "2024-12-03T09:26:24.866Z",
        "modified": "2025-04-21T06:07:51.788Z"
    },
    {
        "alias": "Amelia White",
        "emailAddress": "[email protected]",
        "isManager": false,
        "managerRef": {
            "type": "IDENTITY",
            "id": "f0094611513e4cc28d284a02de9084cc",
            "name": "sidharth.tarlapally"
        },
        "lastRefresh": "2025-04-20T20:36:53.829Z",
        "lifecycleState": null,
        "processingState": null,
        "identityStatus": "UNREGISTERED",
        "attributes": {
            "firstname": "Amelia",
            "cloudStatus": "UNREGISTERED",
            "endDate": "2025-10-01T06:30:00Z",
            "displayName": "Amelia White",
            "lastSyncDate": "87bdc8f974c0c72674f30e82b95af90f5567e807801b59863d391d79279b4b83",
            "identityState": "ACTIVE",
            "lastname": "White",
            "uid": "Amelia White",
            "cloudAuthoritativeSource": "6bce5a96f4f940118e993df1b9dff55e",
            "internalCloudStatus": "UNREGISTERED",
            "email": "[email protected]",
            "startDate": "2025-04-01T06:30:00Z"
        },
        "id": "0a19a872f98344bd8dd296edff84db54",
        "name": "Amelia White",
        "created": "2025-03-20T16:01:16.438Z",
        "modified": "2025-04-21T06:07:55.732Z"
    }
]

To get an identity from all identities whose name is “Amelia Lily” : we use eq primitive operator
{{baseUrl}}/identities?filters=name eq "Amelia Lily"
The response for the above end point will be , identities matching the filter criteria:

Here in the above example , we were able to filter the name but if we try to filter attributes such as emailAddress it wont support :

This way we use primitive operators in APIs’ . The complex examples depends on the requirement . The following are few :

  • List uncorrelated accounts in a particular source
    {{baseUrl}}/accounts?filters=uncorrelated eq true&filters=sourceId eq "bbb006e850ea4da9bb877a254374d665"

  • List sources on the tenant which are not of type “Web Services”
    {{baseUrl}}/sources?filters=type ne "Web Services"

  • List all access profiles which are requestable
    {{baseUrl}}/access-profiles?filters=requestable eq true

  • To filter an attribute which is a null value
    {{baseUrl}}/resource?filters=attributeName isnull

There is no documentation which explains which attributes can be used in the filters . id can be used in every resource .

Hope this helps

1 Like

Hi @Anusha,

In SailPoint, API based request using primitive operators can be used at multiple places.

Simplest example is your “search” api where you can use multiple primitive operators to search on available indices.

along with it, We can use query parameters with some of the api to filter or pagination.

Looking for more complex examples using Query json

1 Like