---
title: Manage scripts over REST
description: Advanced Identity Cloud provides the /scripts endpoint to manage scripts using REST calls.
component: pingoneaic
page_id: pingoneaic:am-scripting:manage-scripts-rest
canonical_url: https://docs.pingidentity.com/pingoneaic/am-scripting/manage-scripts-rest.html
keywords: ["Scripts", "REST"]
---

# Manage scripts over REST

Advanced Identity Cloud provides the `/scripts` endpoint to manage scripts using REST calls.

Scripts are represented in JSON using standard JSON objects and values.

Each script is identified by a system-generated *universally unique identifier* (UUID), which must be specified when reading or updating existing scripts. Renaming a script doesn't affect the UUID.

```json
{
  "_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"
}
```

The values for the fields shown in the example are explained below:

* `_id`

  The UUID that Advanced Identity Cloud generates for the script.

* `name`

  The name provided for the script.

* `description`

  An optional text string to help identify the script.

* `script`

  The source code of the script. The source code is in UTF-8 format and encoded into Base64.

  For example, the following script:

  ```javascript
  var a = 123;
  var b = 456;
  ```

  becomes `dmFyIGEgPSAxMjM7IA0KdmFyIGIgPSA0NTY7` when encoded into Base64.

* `default`

  Whether the script is a default script (`true`) that applies to all realms, or custom (`false`).

* `language`

  The language the script is written in: `JAVASCRIPT`.

* `context`

  The context type of the script.

  **Supported context values**

  | Legacy                                      | Next-generation                                        | Used by                                                                                                                                      |
  | ------------------------------------------- | ------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
  | AUTHENTICATION\_CLIENT\_SIDE                | *Not available*                                        | Client-side authentication                                                                                                                   |
  | AUTHENTICATION\_SERVER\_SIDE                | *Not available*                                        | Server-side authentication                                                                                                                   |
  | AUTHENTICATION\_TREE\_DECISION\_NODE        | SCRIPTED\_DECISION\_NODE                               | [Scripted Decision node](https://docs.pingidentity.com/auth-node-ref/latest/scripted-decision.html)                                          |
  |                                             | DEVICE\_MATCH\_NODE                                    | [Device Match node](https://docs.pingidentity.com/auth-node-ref/latest/device-match.html)                                                    |
  | *Not available*                             | CACHE\_LOADER                                          | [Cache manager](cache-manager.html)                                                                                                          |
  | CONFIG\_PROVIDER\_NODE                      | CONFIG\_PROVIDER\_NODE\_NEXT\_GEN                      | [Configuration Provider node](https://docs.pingidentity.com/auth-node-ref/latest/config-provider.html)                                       |
  | *Not available*                             | LIBRARY                                                | [Library scripts](library-scripts.html)                                                                                                      |
  | *Not available*                             | NODE\_DESIGNER                                         | [Custom nodes](../journeys/node-designer.html)                                                                                               |
  | OAUTH2\_ACCESS\_TOKEN\_MODIFICATION         | OAUTH2\_ACCESS\_TOKEN\_MODIFICATION\_NEXT\_GEN         | [Access token modification](../am-oauth2/plugins-access-token-modifier.html)                                                                 |
  | OAUTH2\_AUTHORIZE\_ENDPOINT\_DATA\_PROVIDER | OAUTH2\_AUTHORIZE\_ENDPOINT\_DATA\_PROVIDER\_NEXT\_GEN | [Authorize endpoint data provider](../am-oauth2/plugins-auth-endpoint-data-provider.html)                                                    |
  | *Not available*                             | OAUTH2\_DYNAMIC\_CLIENT\_REGISTRATION                  | [Customize dynamic client registration](../am-oidc1/dynamic-client-registration-script.html)                                                 |
  | OAUTH2\_EVALUATE\_SCOPE                     | OAUTH2\_EVALUATE\_SCOPE\_NEXT\_GEN                     | [Scope evaluation](../am-oauth2/plugins-scope-evaluator.html)                                                                                |
  | OAUTH2\_MAY\_ACT                            | OAUTH2\_MAY\_ACT\_NEXT\_GEN                            | [Token exchange](../am-oauth2/token-exchange.html)                                                                                           |
  | OAUTH2\_SCRIPTED\_JWT\_ISSUER               | OAUTH2\_SCRIPTED\_JWT\_ISSUER\_NEXT\_GEN               | Trusted JWT issuer                                                                                                                           |
  | OAUTH2\_VALIDATE\_SCOPE                     | OAUTH2\_VALIDATE\_SCOPE\_NEXT\_GEN                     | [Scope validation](../am-oauth2/plugins-scope-validator.html)                                                                                |
  | OIDC\_CLAIMS                                | OIDC\_CLAIMS\_NEXT\_GEN                                | [OIDC claims](../am-oauth2/plugins-user-info-claims.html)                                                                                    |
  | *Not available*                             | PINGONE\_VERIFY\_COMPLETION\_DECISION\_NODE            | [PingOne Verify Completion Decision node](https://docs.pingidentity.com/auth-node-ref/latestpingone/pingone-verify-completion-decision.html) |
  | POLICY\_CONDITION                           | POLICY\_CONDITION\_NEXT\_GEN                           | [Scripted policy conditions](../am-authorization/scripted-policy-condition.html)                                                             |
  | SAML2\_IDP\_ADAPTER                         | SAML2\_IDP\_ADAPTER\_NEXTGEN                           | [IdP adapter](../am-saml2/custom-idp-adapter.html)                                                                                           |
  | SAML2\_IDP\_ATTRIBUTE\_MAPPER               | SAML2\_IDP\_ATTRIBUTE\_MAPPER\_NEXT\_GEN               | [IdP attribute mapper](../am-saml2/custom-idp-attribute-mapper.html)                                                                         |
  | *Not available*                             | SAML2\_NAMEID\_MAPPER                                  | [NameID mapper](../am-saml2/custom-nameid-mapper.html)                                                                                       |
  | *Not available*                             | SAML2\_SP\_ACCOUNT\_MAPPER                             | [SP adapter](../am-saml2/custom-sp-adapter.html)                                                                                             |
  | SAML2\_SP\_ADAPTER                          | SAML2\_SP\_ADAPTER\_NEXTGEN                            | [SP adapter](../am-saml2/custom-sp-adapter.html)                                                                                             |
  | SOCIAL\_IDP\_PROFILE\_TRANSFORMATION        | SOCIAL\_IDP\_PROFILE\_TRANSFORMATION\_NEXT\_GEN        | [Social authentication](../am-authentication/social-authentication.html)                                                                     |
  |                                             | SOCIAL\_PROVIDER\_HANDLER\_NODE                        | [Social Provider Handler node](https://docs.pingidentity.com/auth-node-ref/latest/social-provider-handler.html)                              |
  |                                             | OIDC\_NODE                                             | [OIDC ID Token Validator node](https://docs.pingidentity.com/auth-node-ref/latest/oidc-idtoken-validator.html)                               |

* `createdBy`

  A string containing the universal identifier DN of the subject that created the script, or `null` when not used in Advanced Identity Cloud.

* `creationDate`

  An integer containing the creation date and time, in ISO 8601 format, or `0` when not used in Advanced Identity Cloud.

* `lastModifiedBy`

  A string containing the universal identifier DN of the subject that most recently updated the resource type, or `null` when not used in Advanced Identity Cloud.

  If the script has not been modified since it was created, this property will have the same value as `createdBy`.

* `lastModifiedDate`

  A string containing the last modified date and time, in ISO 8601 format, or `0` when not used in Advanced Identity Cloud.

  If the script has not been modified since it was created, this property will have the same value as `creationDate`.

* `evaluatorVersion`

  A number representing the script engine version: `1.0` for legacy or `2.0` for next-generation. Refer to [Next-generation scripts](next-generation-scripts.html) for details.

  When invalid or unspecified, the value defaults to `1.0` for all script types except [library scripts](library-scripts.html), which are always `2.0` (next-generation).
