Scripts API
6 operations. Back to the API overview. Examples use synthetic data.
List scripts
GET /admin/v1/scripts
Needs the permission: config:history.
Response 200
| Field | Type | Presence | Description |
|---|---|---|---|
limits | map of integer | optional | - |
scripts | any | optional | - |
{
"limits": {
"example": 1
},
"scripts": {}
}Other responses
401Authentication required403Not permitted404Not Found503Unavailable (nothing was changed)
curl --request GET \
--header "Authorization: Bearer $ID_TOKEN" \
"https://YOUR-CONSOLE-HOST/admin/v1/scripts"Get script
GET /admin/v1/scripts/{id}
Needs the permissions: config:history, payload:read.
Parameters
| Name | In | Type | Presence | Description |
|---|---|---|---|---|
id | path | string | required | - |
Response 200
| Field | Type | Presence | Description |
|---|---|---|---|
limits | map of integer | optional | - |
samples | any | optional | - |
samples_visible | boolean | optional | - |
script | object (ScriptSummary) | optional | - |
script.active | object (ActiveJSON) | optional | - |
script.description | string | optional | - |
script.draft | object (ScriptCode) | optional | Code is one script version: what runs. |
script.draft_sha256 | string | optional | - |
script.id | string | optional | - |
script.pending | boolean | optional | Pending: the draft differs from the active version. |
script.routes | array of string | optional | - |
script.samples | integer | optional | - |
script.version | integer | optional | - |
{
"limits": {
"example": 1
},
"samples": {},
"samples_visible": true,
"script": {
"active": {
"activated_at": "2026-01-15T14:30:00Z",
"activated_by": "example",
"code": {
"dialect": "example",
"format": "example",
"kind": "example",
"language": "example",
"limits": {
"memory_mb": 1,
"time_ms": 1
},
"output": "example",
"source": "example"
},
"draft_version": 1,
"samples_passed": 1,
"sha256": "example"
},
"description": "example",
"draft": {
"dialect": "example",
"format": "example",
"kind": "example",
"language": "example",
"limits": {
"memory_mb": 1,
"time_ms": 1
},
"output": "example",
"source": "example"
},
"draft_sha256": "example",
"id": "example-id",
"pending": true,
"routes": [
"example"
],
"samples": 1,
"version": 1
}
}Other responses
401Authentication required403Not permitted404Not Found503Unavailable (nothing was changed)
curl --request GET \
--header "Authorization: Bearer $ID_TOKEN" \
"https://YOUR-CONSOLE-HOST/admin/v1/scripts/example-id"Put script
PUT /admin/v1/scripts/{id}
Needs the permission: config:write.
Parameters
| Name | In | Type | Presence | Description |
|---|---|---|---|---|
id | path | string | required | - |
Request body
| Field | Type | Presence | Description |
|---|---|---|---|
description | string | optional | - |
draft | object (ScriptCode) | optional | Code is one script version: what runs. |
draft.dialect | string | optional | - |
draft.format | string | optional | - |
draft.kind | string | optional | - |
draft.language | string | optional | - |
draft.limits | object (ScriptLimits) | optional | Limits are a script's resource limits; zero values take the defaults. |
draft.output | string | optional | Output, for a transform of a json or xml message, converts it: the script builds the result in the global output (hl7v2 or fhir) and the converted message continues through the destination's own pipeline in that format. Empty: the message stays in its format. |
draft.source | string | optional | - |
reason | string | optional | - |
samples | array of object (SampleIn) | optional | - |
samples.[]expect | string | optional | - |
samples.[]message | string | optional | - |
samples.[]name | string | optional | - |
samples.[]output | string | optional | - |
samples.[]previous | string | optional | Previous names the stored sample a renamed one keeps its masked message and output from (default: Name). |
version | integer | optional | - |
{
"description": "example",
"draft": {
"dialect": "example",
"format": "example",
"kind": "example",
"language": "example",
"limits": {
"memory_mb": 1,
"time_ms": 1
},
"output": "example",
"source": "example"
},
"reason": "Example text",
"samples": [
{
"expect": "example",
"message": "Example text",
"name": "example-name",
"output": "example",
"previous": "example"
}
],
"version": 1
}Response 200
{}Other responses
401Authentication required403Not permitted404Not Found503Unavailable (nothing was changed)
curl --request PUT \
--header "Authorization: Bearer $ID_TOKEN" \
--header "Content-Type: application/json" \
--data '{"description":"example","draft":{"dialect":"example","format":"example","kind":"example","language":"example","limits":{"memory_mb":1,"time_ms":1},"output":"example","source":"example"},"reason":"Example text","samples":[{"expect":"example","message":"Example text","name":"example-name","output":"example","previous":"example"}],"version":1}' \
"https://YOUR-CONSOLE-HOST/admin/v1/scripts/example-id"Activate script
POST /admin/v1/scripts/{id}/activate
With customer SSO, requires a recent sign-in (re-authentication).
Needs the permissions: payload:read, scripts:activate.
Parameters
| Name | In | Type | Presence | Description |
|---|---|---|---|---|
id | path | string | required | - |
Request body
| Field | Type | Presence | Description |
|---|---|---|---|
reason | string | optional | - |
version | integer | optional | - |
{
"reason": "Example text",
"version": 1
}Response 200
{}Other responses
401Authentication required403Not permitted404Not Found503Unavailable (nothing was changed)
curl --request POST \
--header "Authorization: Bearer $ID_TOKEN" \
--header "Content-Type: application/json" \
--data '{"reason":"Example text","version":1}' \
"https://YOUR-CONSOLE-HOST/admin/v1/scripts/example-id/activate"Delete script
POST /admin/v1/scripts/{id}/delete
Needs the permission: config:write.
Parameters
| Name | In | Type | Presence | Description |
|---|---|---|---|---|
id | path | string | required | - |
Request body
| Field | Type | Presence | Description |
|---|---|---|---|
reason | string | optional | - |
version | integer | optional | - |
{
"reason": "Example text",
"version": 1
}Response 200
{}Other responses
401Authentication required403Not permitted404Not Found503Unavailable (nothing was changed)
curl --request POST \
--header "Authorization: Bearer $ID_TOKEN" \
--header "Content-Type: application/json" \
--data '{"reason":"Example text","version":1}' \
"https://YOUR-CONSOLE-HOST/admin/v1/scripts/example-id/delete"Test script
POST /admin/v1/scripts/{id}/test
Needs the permissions: config:write, payload:read.
Parameters
| Name | In | Type | Presence | Description |
|---|---|---|---|---|
id | path | string | required | - |
Request body
| Field | Type | Presence | Description |
|---|---|---|---|
draft | object (ScriptCode) | optional | Draft is a candidate to test instead of the saved draft (the editor's unsaved text). |
draft.dialect | string | optional | - |
draft.format | string | optional | - |
draft.kind | string | optional | - |
draft.language | string | optional | - |
draft.limits | object (ScriptLimits) | optional | Limits are a script's resource limits; zero values take the defaults. |
draft.output | string | optional | Output, for a transform of a json or xml message, converts it: the script builds the result in the global output (hl7v2 or fhir) and the converted message continues through the destination's own pipeline in that format. Empty: the message stays in its format. |
draft.source | string | optional | - |
message | string | optional | Message, when set, is one pasted message to run instead of the samples (payload:read). |
{
"draft": {
"dialect": "example",
"format": "example",
"kind": "example",
"language": "example",
"limits": {
"memory_mb": 1,
"time_ms": 1
},
"output": "example",
"source": "example"
},
"message": "Example text"
}Response 200
| Field | Type | Presence | Description |
|---|---|---|---|
compile_error | string | optional | - |
compile_line | integer | optional | - |
compiled | boolean | optional | - |
content_shown | boolean | optional | - |
passed | integer | optional | - |
results | array of object (SampleResult) | optional | - |
results.[]changed | boolean | optional | - |
results.[]duration_ms | integer | optional | - |
results.[]expect | string | optional | - |
results.[]failure | object (FailureJSON) | optional | - |
results.[]input | string | optional | Input and Output: payload:read only. |
results.[]logs | array of object (LogJSON) | optional | - |
results.[]lookups | array of object (ScriptLookupUse) | optional | - |
results.[]name | string | optional | - |
results.[]outcome | string | optional | - |
results.[]output | string | optional | - |
results.[]output_matched | boolean | optional | - |
results.[]passed | boolean | optional | - |
results.[]problem | string | optional | why it did not pass (no values) |
sha256 | string | optional | - |
total | integer | optional | - |
{
"compile_error": "Example text",
"compile_line": 1,
"compiled": true,
"content_shown": true,
"passed": 1,
"results": [
{
"changed": true,
"duration_ms": 1,
"expect": "example",
"failure": {
"class": "example",
"detail": "example",
"limit": "example",
"line": 1,
"reason": "Example text"
},
"input": "example",
"logs": [
{
"level": "example",
"text": "example"
}
],
"lookups": [
{
"count": 1,
"id": "example-id",
"kind": "example"
}
],
"name": "example-name",
"outcome": "example",
"output": "example",
"output_matched": true,
"passed": true,
"problem": "example"
}
],
"sha256": "example",
"total": 1
}Other responses
401Authentication required403Not permitted404Not Found503Unavailable (nothing was changed)
curl --request POST \
--header "Authorization: Bearer $ID_TOKEN" \
--header "Content-Type: application/json" \
--data '{"draft":{"dialect":"example","format":"example","kind":"example","language":"example","limits":{"memory_mb":1,"time_ms":1},"output":"example","source":"example"},"message":"Example text"}' \
"https://YOUR-CONSOLE-HOST/admin/v1/scripts/example-id/test"Something unclear or missing? Ask Help in the Velacent Bridge console; answers link to the right screen. How support works.