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

# Query scripts

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

```bash
$ curl \
--header "Authorization: Bearer <access-token>" \
--header "Accept-API-Version: resource=1.1" \
'https://<tenant-env-fqdn>/am/json/realms/root/realms/alpha/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": "null",
      "creationDate": 0,
      "lastModifiedBy": "null",
      "lastModifiedDate": 0,
      "evaluatorVersion": "1.0"
    },
    {
      "_id": "aeb22d32-100c-46c0-ac51-af571889e5b9",
      "name": "MyJavaScript",
      "description": "An example script",
      "script": "dmFyIGEgPSAxMjM7CnZhciBiID0gNDU2Ow==",
      "default": false,
      "language": "JAVASCRIPT",
      "context": "POLICY_CONDITION",
      "createdBy": "null",
      "creationDate": 0,
      "lastModifiedBy": "null",
      "lastModifiedDate": 0,
      "evaluatorVersion": "1.0"
    },
  ],
  "resultCount": 2,
  "pagedResultsCookie": null,
  "totalPagedResultsPolicy": "NONE",
  "totalPagedResults": -1,
  "remainingPagedResults": -1
}
```

|   |                                                                                                                                                                                                                                                                    |
| - | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|   | You can't read, update, or delete the default scripts prefixed `ForgeRock Internal` (UUIDs: `234ba0b-58a1-4cfd-9567-09edde980745` and `1f389a3d-21cf-417c-a6d3-42ea620071f0`). These scripts appear in the query but aren't accessible in Advanced Identity Cloud. |

**Supported \_queryFilter fields and operators**

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