List Identities by API - just return ID

Hi,
I want to be able to pull back all users whose lifecycle is ‘prestart’, but only bring back their ‘ID’

  "indices": [
    "identities"
  ],
  "query": {
    "query": "attributes.cloudLifecycleState:prestart"
  }
}

That brings back everything, and this doesn’t make a difference:

{
  "indices": [
    "identities"
  ],
  "query": {
    "query": "attributes.cloudLifecycleState:prestart"
  },
  "_source": [
    "id"
  ]
}

Is there a way to limit the amount of returned info, as that was 600+ lines of code that I don’t need and would rather not have to parse out after retrieving it
Thanks

Hi @phil_awlings ,
could you please try this ?

{
  "indices": [
    "identities"
  ],
  "query": {
    "query": "attributes.cloudLifecycleState:prestart",
    "fields": [
      "id"
    ]
  }
}

Its still the whole identity being returned

This will not only show the IDs but will limit the response to a smaller object:

{
    "indices": [
        "identities"
    ],
    "query": {
        "query": "attributes.cloudLifecycleState:prestart"
    },
    "queryResultFilter": {
        "includes": [
            "id"
        ],
        "excludes": [
            "stacktrace"
        ]
    }
}
4 Likes

Brilliant. Thank you

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.