Scripts & Versioning — API Reference
Package: dodil.scriptum.v1 · Service: ScriptumService
A script is a named, org-scoped definition. Creating one (CreateScript) makes metadata only — no executable content. Content is attached and matured through the draft lifecycle: SaveScriptDraft → CompileScriptDraft → TestScriptDraft → PublishScriptDraft. Publishing mints an immutable, numbered version; the active version is what new threads run. The typed I/O surface of a script lives in its ScriptContract.
gRPC reaches every method at dodil.scriptum.v1.ScriptumService/<Method>; the HTTP gateway mirrors each one under /v1/scriptum. HTTP bodies are pbjson (camelCase); gRPC -d uses proto snake_case; int64 fields are JSON strings.
| RPC | HTTP |
|---|---|
CreateScript | POST /v1/scriptum/scripts |
ListScripts | GET /v1/scriptum/scripts |
GetScript | GET /v1/scriptum/scripts/{name} |
DeleteScript | DELETE /v1/scriptum/scripts/{name} |
SaveScriptDraft | POST /v1/scriptum/scripts/{name}/draft |
CompileScriptDraft | POST /v1/scriptum/scripts/{name}/draft/compile |
TestScriptDraft | POST /v1/scriptum/scripts/{name}/draft/test |
PublishScriptDraft | POST /v1/scriptum/scripts/{name}/draft/publish |
RollbackScript | POST /v1/scriptum/scripts/{name}/rollback |
ListScriptVersions | GET /v1/scriptum/scripts/{name}/versions |
GetScriptVersion | GET /v1/scriptum/scripts/{name}/versions/{version} |
GetScriptCode | GET /v1/scriptum/scripts/{name}/code/versions/{version} (also …/code) |
GetDraftInfo | GET /v1/scriptum/scripts/{name}/draft |
CreateScript
Creates the script definition — metadata only, no content. Optionally bootstrap from a template with fromTemplate (creates the script and auto-saves the template DSL as a draft), and seed a per-script env overlay with env.
Request
| Field | Type | Notes |
|---|---|---|
name | string | Required. Unique per tenant; the script’s identity. |
description | string | Optional human-readable description. |
tags | repeated string | Tags for organization and filtering. |
from_template | string | Optional template ID to bootstrap from. |
labels | repeated LabelEntry | Structured { key, values[] } operational metadata. |
env | map<string, string> | Optional initial per-script env overlay. |
HTTP
curl -sS -X POST "https://api.dev.dodil.io/v1/scriptum/scripts" \
-H "Authorization: Bearer $DODIL_TOKEN" \
-H "x-organization-name: $DODIL_ORG" \
-H "Content-Type: application/json" \
-d '{
"name": "my-etl-pipeline",
"description": "ETL pipeline that ingests CSV files and writes to S3",
"tags": ["etl"],
"fromTemplate": "hello_world"
}'Response
HTTP
{
"name": "my-etl-pipeline",
"createdAtMs": "1748390400000"
}Next: attach content with SaveScriptDraft.
ListScripts
Cursor-paginated list for the tenant. Filter by tags (all must match) and/or labels (any matching key+value pair passes).
Request
| Field | Type | Notes |
|---|---|---|
page_size | int32 | Max scripts per page. |
page_token | string | Token from a previous response. |
tags | repeated string | All specified tags must match. |
labels | repeated LabelEntry | Any matching key+value pair passes. |
HTTP
curl -sS "https://api.dev.dodil.io/v1/scriptum/scripts?pageSize=20&tags=etl" \
-H "Authorization: Bearer $DODIL_TOKEN" \
-H "x-organization-name: $DODIL_ORG"Response
ListScriptsResponse { repeated Script scripts = 1; string next_page_token = 2; } — each entry is a full Script. nextPageToken is empty when there are no more pages.
GetScript
Fetch one script by name, including its active version, latest version, draft status, and typed ScriptContract.
Request
| Field | Type | Notes |
|---|---|---|
name | string | Required. Script name to retrieve. |
HTTP
curl -sS "https://api.dev.dodil.io/v1/scriptum/scripts/my-etl-pipeline" \
-H "Authorization: Bearer $DODIL_TOKEN" \
-H "x-organization-name: $DODIL_ORG"Response
Returns a Script directly (no wrapper).
The Script type
| Field | Type | Notes |
|---|---|---|
name | string | |
description | string | |
tags | repeated string | |
active_version | int32 | Version new threads run (0 if none published). |
latest_version | int32 | Highest version number minted. |
draft_status | ScriptVersionStatus | State of the in-progress draft. |
created_at_ms | int64 | |
updated_at_ms | int64 | |
status | ScriptStatus | Lifecycle: created / draft / active / disabled / archived. |
labels | repeated LabelEntry | |
contract | ScriptContract | The full typed I/O contract. |
DeleteScript
Permanently deletes a script and all its versions.
Request
| Field | Type | Notes |
|---|---|---|
name | string | Required. Script to delete. |
HTTP
curl -sS -X DELETE "https://api.dev.dodil.io/v1/scriptum/scripts/my-etl-pipeline" \
-H "Authorization: Bearer $DODIL_TOKEN" \
-H "x-organization-name: $DODIL_ORG"Response
Empty (DeleteScriptResponse {}).
The draft lifecycle
A script has exactly one mutable draft at a time. The flow is: save source → compile to IR → test against a thread → publish as a numbered version.
SaveScriptDraft
Saves a draft. Provide either dsl_content (Scriptum DSL source — see the Language reference) or yaml_content (pre-compiled YAML IR).
Request
| Field | Type | Notes |
|---|---|---|
name | string | Required. Script the draft belongs to. |
dsl_content | string | Scriptum DSL source. Provide this or yaml_content. |
yaml_content | string | Pre-compiled YAML IR. Provide this or dsl_content. |
HTTP
curl -sS -X POST "https://api.dev.dodil.io/v1/scriptum/scripts/my-etl-pipeline/draft" \
-H "Authorization: Bearer $DODIL_TOKEN" \
-H "x-organization-name: $DODIL_ORG" \
-H "Content-Type: application/json" \
-d '{
"dslContent": "script my_pipeline {\n do fetch_data with http_request ...\n}"
}'Response
HTTP
{
"status": "SCRIPT_VERSION_STATUS_DRAFT",
"updatedAtMs": "1748390400000"
}CompileScriptDraft
Compiles the current draft (DSL → YAML IR). Returns success, the required tools, structured diagnostics, and on success the AST (ast_json) and IR (ir_yaml).
Request
| Field | Type | Notes |
|---|---|---|
name | string | Required. Script whose draft to compile. |
HTTP
curl -sS -X POST "https://api.dev.dodil.io/v1/scriptum/scripts/my-etl-pipeline/draft/compile" \
-H "Authorization: Bearer $DODIL_TOKEN" \
-H "x-organization-name: $DODIL_ORG" \
-H "Content-Type: application/json" \
-d '{}'Response
The response carries a list of CompileDiagnostic entries — populated whether or not the compile succeeds (warnings can accompany a success).
HTTP
{
"success": false,
"error": "type error in step fetch_data",
"toolsRequired": ["http_request"],
"diagnostics": [
{
"line": 12,
"col": 5,
"message": "unknown field 'ur' on http_request input",
"hint": "did you mean 'url'?",
"severity": "error",
"sourceLine": " do fetch_data with http_request(ur: input.source)"
}
],
"astJson": "",
"irYaml": ""
}CompileDiagnostic
| Field | Type | Notes |
|---|---|---|
line | int32 | 1-based source line. |
col | int32 | 1-based column. |
message | string | What’s wrong. |
hint | string | Optional suggested fix. |
severity | string | e.g. error, warning. |
source_line | string | The offending source line, for inline display. |
TestScriptDraft
Runs the current draft as a one-off thread without changing the draft status. Returns the thread_id so you can watch/fetch results via the Threads & Results APIs.
Request
| Field | Type | Notes |
|---|---|---|
name | string | Required. Script whose draft to test. |
input_json | string | Input parameters as a JSON string (your data). |
load_env | bool | Load tenant env vars into the run. |
HTTP
curl -sS -X POST "https://api.dev.dodil.io/v1/scriptum/scripts/my-etl-pipeline/draft/test" \
-H "Authorization: Bearer $DODIL_TOKEN" \
-H "x-organization-name: $DODIL_ORG" \
-H "Content-Type: application/json" \
-d '{
"inputJson": "{\"source\": \"data.csv\"}",
"loadEnv": true
}'Response
HTTP
{
"threadId": "thr_abc123",
"status": "THREAD_STATUS_RUNNING"
}PublishScriptDraft
Publishes the compiled draft as a new active version. The previous active version is superseded. Returns the new version number.
Request
| Field | Type | Notes |
|---|---|---|
name | string | Required. Script whose compiled draft to publish. |
HTTP
curl -sS -X POST "https://api.dev.dodil.io/v1/scriptum/scripts/my-etl-pipeline/draft/publish" \
-H "Authorization: Bearer $DODIL_TOKEN" \
-H "x-organization-name: $DODIL_ORG" \
-H "Content-Type: application/json" \
-d '{}'Response
PublishScriptDraftResponse { int32 version = 1; } — e.g. { "version": 4 }.
RollbackScript
Rolls the active pointer back to a previous version. Use target_version = 0 to roll back to the previous active version.
Request
| Field | Type | Notes |
|---|---|---|
name | string | Required. Script to roll back. |
target_version | int32 | Version to roll back to (0 = previous active). |
HTTP
curl -sS -X POST "https://api.dev.dodil.io/v1/scriptum/scripts/my-etl-pipeline/rollback" \
-H "Authorization: Bearer $DODIL_TOKEN" \
-H "x-organization-name: $DODIL_ORG" \
-H "Content-Type: application/json" \
-d '{ "targetVersion": 2 }'Response
RollbackScriptResponse { int32 active_version = 1; } — the version now active.
ListScriptVersions
Lists all versions of a script, with status and timestamps.
Request
| Field | Type | Notes |
|---|---|---|
name | string | Required. Script to list versions for. |
HTTP
curl -sS "https://api.dev.dodil.io/v1/scriptum/scripts/my-etl-pipeline/versions" \
-H "Authorization: Bearer $DODIL_TOKEN" \
-H "x-organization-name: $DODIL_ORG"Response
ListScriptVersionsResponse { repeated ScriptVersion versions = 1; } — each is a ScriptVersion.
GetScriptVersion
Gets one version by number.
Request
| Field | Type | Notes |
|---|---|---|
name | string | Required. Script name. |
version | int32 | Required. Version number to retrieve. |
HTTP
curl -sS "https://api.dev.dodil.io/v1/scriptum/scripts/my-etl-pipeline/versions/3" \
-H "Authorization: Bearer $DODIL_TOKEN" \
-H "x-organization-name: $DODIL_ORG"Response
Returns a ScriptVersion directly.
The ScriptVersion type
| Field | Type | Notes |
|---|---|---|
version | int32 | |
status | ScriptVersionStatus | |
tools_required | repeated string | Tools this version needs registered. |
created_at_ms | int64 | |
published_at_ms | int64 | |
contract | ScriptContract | Typed I/O contract for this version. |
GetScriptCode
Returns the source (dsl_content) and compiled IR (yaml_content) for a version. Use version = 0 for the current draft. The HTTP binding has two forms: …/code/versions/{version} and …/code (defaults to the draft).
Request
| Field | Type | Notes |
|---|---|---|
name | string | Required. Script name. |
version | int32 | Version number (0 = current draft). |
HTTP
curl -sS "https://api.dev.dodil.io/v1/scriptum/scripts/my-etl-pipeline/code/versions/1" \
-H "Authorization: Bearer $DODIL_TOKEN" \
-H "x-organization-name: $DODIL_ORG"Response
HTTP
{
"version": 1,
"dslContent": "script my_pipeline { ... }",
"yamlContent": "steps:\n - ...",
"status": "SCRIPT_VERSION_STATUS_ACTIVE",
"createdAtMs": "1748390400000"
}GetDraftInfo
Returns the current draft’s status, source, compiled YAML, last compile error, required tools, and typed ScriptContract.
Request
| Field | Type | Notes |
|---|---|---|
name | string | Required. Script name. |
HTTP
curl -sS "https://api.dev.dodil.io/v1/scriptum/scripts/my-etl-pipeline/draft" \
-H "Authorization: Bearer $DODIL_TOKEN" \
-H "x-organization-name: $DODIL_ORG"Response
HTTP
{
"status": "SCRIPT_VERSION_STATUS_COMPILED",
"dslContent": "script my_pipeline { ... }",
"yamlContent": "steps:\n - ...",
"error": "",
"toolsRequired": ["http_request"],
"updatedAtMs": "1748390400000",
"contract": { "inputs": [], "outputs": [], "enums": [] }
}See also
- API Reference — conventions, endpoints, auth
- Threads & Results — run a published version
- ScriptContract Appendix —
ScriptContract,ScriptStatus,ScriptVersionStatus - Core Concepts — script, version, draft
- Scriptum Language — the DSL you save as
dsl_content