---
title: Script scope
description: Scripts are provided with the following scope:
component: pingoneaic
page_id: pingoneaic:idm-scripting:filter-script-scope
canonical_url: https://docs.pingidentity.com/pingoneaic/idm-scripting/filter-script-scope.html
---

# Script scope

Scripts are provided with the following scope:

```json
{
  "openidm": openidm-functions object,
  "request": resource-request object,
  "response": resource-response object,
  "exception": exception object
}
```

* openidm

  [openidm-functions object](scripting-func-engine.html)

  Provides access to IDM resources.

* request

  resource-request object

  The resource-request context, which has one or more parent contexts. Provided in the scope of all scripts. For more information about the request context, refer to [Request context chain](request-context.html).

* response

  resource-response object

  The response to the resource-request. Only provided in the scope of the `"onResponse"` script.

* exception

  exception object

  The exception value that was thrown as a result of processing the request. Only provided in the scope of the `"onFailure"` script. An exception object is defined as:

  ```json
  {
    "code": integer,
    "reason": string,
    "message": string,
    "detail": string
  }
  ```

* code

  integer

  The numeric HTTP code of the exception.

* reason

  string

  The short reason phrase of the exception.

* message

  string

  A brief message describing the exception.

* detail

  (optional), string

  A detailed description of the exception, in structured JSON format, suitable for programmatic evaluation.
