---
title: Query scripts
description: To list all the scripts in a realm, as well as any global scripts, perform an HTTP GET to the /json{/realm}/scripts endpoint with a _queryFilter parameter set to true.
component: pingam
version: 8.1
page_id: pingam:am-scripting:rest-api-scripts-query
canonical_url: https://docs.pingidentity.com/pingam/8.1/am-scripting/rest-api-scripts-query.html
keywords: ["Scripts", "Query"]
page_aliases: ["scripting-guide:rest-api-scripts-query.adoc"]
---

# Query scripts

To list all the scripts in a realm, as well as any global scripts, perform an HTTP GET to the `/json{/realm}/scripts` endpoint with a `_queryFilter` parameter set to `true`.

|   |                                                                                                                     |
| - | ------------------------------------------------------------------------------------------------------------------- |
|   | If the realm is not specified in the URL, AM returns scripts in the top level realm, as well as any global scripts. |

The `iPlanetDirectoryPro` header is required and should contain the SSO token of an administrative user, such as `amAdmin`, who has access to perform the operation.

```bash
$ curl \
--header "Cookie: amlbcookie=01; iPlanetDirectoryPro: AQIC5wM…​TU3OQ*" \
--header "Accept-API-Version: resource=1.1" \
https://am.example.com:8443/am/json/realms/root/realms/myrealm/scripts?_queryFilter=true
{
  "result": [
    {
      "_id": "01e1a3c0-038b-4c16-956a-6c9d89328cff",
      "name": "Authentication Tree Decision Node Script",
      "description": "Default global script for a scripted decision node",
      "script": "LyoKICAtIERhdGE…​",
      "default": true,
      "language": "JAVASCRIPT",
      "context": "AUTHENTICATION_TREE_DECISION_NODE",
      "createdBy": "id=dsameuser,ou=user,ou=am-config",
      "creationDate": 1433147666269,
      "lastModifiedBy": "id=dsameuser,ou=user,ou=am-config",
      "lastModifiedDate": 1433147666269,
      "evaluatorVersion": "1.0"
    },
    {
      "_id": "5e854779-6ec1-4c39-aeba-0477e0986646",
      "name": "Config Provider Node Script",
      "description": "Script to provide values for a config provider node",
      "script": "LyoKICogQ29weX…​",
      "default": true,
      "language": "JAVASCRIPT",
      "context": "CONFIG_PROVIDER_NODE",
      "createdBy": "id=dsameuser,ou=user,ou=am-config",
      "creationDate": 1433147666269,
      "lastModifiedBy": "id=dsameuser,ou=user,ou=am-config",
      "lastModifiedDate": 1433147666269,
      "evaluatorVersion": "1.0"
    },
  …​
  ],
  "resultCount": 20,
  "pagedResultsCookie": null,
  "totalPagedResultsPolicy": "NONE",
  "totalPagedResults": -1,
  "remainingPagedResults": 23
}
```

**Supported \_queryFilter fields and operators**

| Field         | Supported operators                                |
| ------------- | -------------------------------------------------- |
| `_id`         | Equals (`eq`), Contains (`co`), Starts with (`sw`) |
| `name`        | Equals (`eq`), Contains (`co`), Starts with (`sw`) |
| `default`     | Equals (`eq`)                                      |
| `description` | Equals (`eq`), Contains (`co`), Starts with (`sw`) |
| `global`      | Equals (`eq`)                                      |
| `script`      | Equals (`eq`), Contains (`co`), Starts with (`sw`) |
| `language`    | Equals (`eq`), Contains (`co`), Starts with (`sw`) |
| `context`     | Equals (`eq`), Contains (`co`), Starts with (`sw`) |
