/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

NameTypeRequired
idstringyes

Responses

StatusDescriptionContent-type
200GroovyScriptDTO JSONapplication/json
500Errorapplication/json

DELETE /script/{id}

Delete a Groovy script by its ID.

Path params

NameTypeRequired
idstringyes

Responses

StatusDescriptionContent-type
200BasicAjaxResponse (success)application/json
500BasicAjaxResponse (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

NameTypeRequired
idstringyes

Responses

StatusDescriptionContent-type
200List of GroovyReferenceDTO wrapped in BeanResponseapplication/json
500BasicAjaxResponseapplication/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

StatusDescriptionContent-type
200BasicAjaxResponse with the saved script's primary keyapplication/json
500BasicAjaxResponse with compilation stack trace if applicableapplication/json

Audit action: SAVE_GROOVY


Search and browsing

GET /search

Search Groovy scripts via OpenSearch.

Query params

NameTypeRequiredDescription
fromintegeryesPagination offset
sizeintegeryesPage size
searchTermstringnoSubstring search on script name
fileNamestringnoExact match on filename (ignored when searchTerm is set)
pathstringnoFilter by folder path

Responses

StatusDescriptionContent-type
200Paginated BeanResponse containing GroovyScriptBean listapplication/json
500Errorapplication/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

StatusDescriptionContent-type
200GroovyCompilationResponse (success; includes any script-level errors)application/json
500GroovyCompilationResponse (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

FieldTypeRequiredDescription
groovyScriptsZipbinaryyes.zip file containing Groovy scripts

Responses

StatusDescription
200All scripts imported (GROOVY_SCRIPTS_IMPORTED) or partially imported with skips (GROOVY_SCRIPTS_PARTIALLY_IMPORTED)
400File does not end with .zip
500Import 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

SchemaDescription
BasicAjaxResponseGeneric success/failure envelope with optional error tokens and stack trace
GroovyCompilationResponseExtends BasicAjaxResponse; adds per-script compilation error map
GroovyScriptDTOGroovy script data transfer object (id, name, path, version, fileContents)
BeanResponsePaginated list envelope (list, from, size, totalNumber)
TreeObjectIdHierarchical folder/script tree node