/webconsole - groovy-manager
REST API documentation for the Groovy Manager in the /webconsole application.
All endpoints are under the base path /rest/api/groovyManager.
Script CRUD
GET /script/{id}
Load a single Groovy script by its ID.
Path params
| Name | Type | Required |
|---|---|---|
id | string | yes |
Responses
| Status | Description | Content-type |
|---|---|---|
| 200 | GroovyScriptDTO JSON | application/json |
| 500 | Error | application/json |
DELETE /script/{id}
Delete a Groovy script by its ID.
Path params
| Name | Type | Required |
|---|---|---|
id | string | yes |
Responses
| Status | Description | Content-type |
|---|---|---|
| 200 | BasicAjaxResponse (success) | application/json |
| 500 | BasicAjaxResponse (failure) | application/json |
GET /script/{id}/references
Return all service-layer references that point to a given Groovy script (across all registered GroovyReferenceMQService beans).
Path params
| Name | Type | Required |
|---|---|---|
id | string | yes |
Responses
| Status | Description | Content-type |
|---|---|---|
| 200 | List of GroovyReferenceDTO wrapped in BeanResponse | application/json |
| 500 | BasicAjaxResponse | application/json |
POST /save
Create or update a single Groovy script. The service layer compiles the script before saving; UI-layer scripts (those containing org.openiam.ui imports) are pre-compiled in the webconsole JVM.
Request body (application/json): GroovyScriptDTO
Responses
| Status | Description | Content-type |
|---|---|---|
| 200 | BasicAjaxResponse with the saved script's primary key | application/json |
| 500 | BasicAjaxResponse with compilation stack trace if applicable | application/json |
Audit action: SAVE_GROOVY
Search and browsing
GET /search
Search Groovy scripts via OpenSearch.
Query params
| Name | Type | Required | Description |
|---|---|---|---|
from | integer | yes | Pagination offset |
size | integer | yes | Page size |
searchTerm | string | no | Substring search on script name |
fileName | string | no | Exact match on filename (ignored when searchTerm is set) |
path | string | no | Filter by folder path |
Responses
| Status | Description | Content-type |
|---|---|---|
| 200 | Paginated BeanResponse containing GroovyScriptBean list | application/json |
| 500 | Error | application/json |
GET /tree
Return the full folder/script tree as a TreeObjectId structure (used by the file-browser UI). This endpoint is not included in the public OpenAPI spec (@Operation(hidden = true)).
Compilation
GET /compileAll
Compile every referenced Groovy script. UI-layer scripts are compiled in the webconsole JVM; service-layer scripts are compiled in parallel via the backing groovy-manager service using a dedicated thread pool.
Responses
| Status | Description | Content-type |
|---|---|---|
| 200 | GroovyCompilationResponse (success; includes any script-level errors) | application/json |
| 500 | GroovyCompilationResponse (fatal error) | application/json |
Bulk import and export
Added in v2026.5.2 (OE-4025). All three operations are audited.
POST /import
Import Groovy scripts from a .zip archive. The zip must be uploaded as multipart/form-data.
Expected zip structure
Each entry must be at <folder>/<name>_<version>.groovy. Scripts at the root level (no folder) and entries whose filename does not match name_version.groovy are skipped — a warning is written to the audit log and the response still returns success (GROOVY_SCRIPTS_PARTIALLY_IMPORTED).
When a script with the same path + name + version already exists it is updated in-place rather than duplicated.
Form field
| Field | Type | Required | Description |
|---|---|---|---|
groovyScriptsZip | binary | yes | .zip file containing Groovy scripts |
Responses
| Status | Description |
|---|---|
| 200 | All scripts imported (GROOVY_SCRIPTS_IMPORTED) or partially imported with skips (GROOVY_SCRIPTS_PARTIALLY_IMPORTED) |
| 400 | File does not end with .zip |
| 500 | Import failed |
Audit action: IMPORT_GROOVY_SCRIPTS
GET /exportAll
Export every Groovy script as a single .zip download (groovy-scripts.zip). Each entry is stored at <path>/<name>_<version>.groovy. Duplicate entries within the same export are silently skipped with a warning in the audit log.
Response: application/zip — file download
Audit action: EXPORT_GROOVY_SCRIPTS
POST /exportSelected
Export a specific subset of Groovy scripts as groovy-scripts-selected.zip.
Request body (application/json): array of script IDs (strings)
Response: application/zip — file download
Audit action: EXPORT_GROOVY_SCRIPTS
Schema references
| Schema | Description |
|---|---|
BasicAjaxResponse | Generic success/failure envelope with optional error tokens and stack trace |
GroovyCompilationResponse | Extends BasicAjaxResponse; adds per-script compilation error map |
GroovyScriptDTO | Groovy script data transfer object (id, name, path, version, fileContents) |
BeanResponse | Paginated list envelope (list, from, size, totalNumber) |
TreeObjectId | Hierarchical folder/script tree node |