Skip to Content
We are live but in Staging 🎉
API ReferenceScripts & Versioning

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: SaveScriptDraftCompileScriptDraftTestScriptDraftPublishScriptDraft. 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.

RPCHTTP
CreateScriptPOST /v1/scriptum/scripts
ListScriptsGET /v1/scriptum/scripts
GetScriptGET /v1/scriptum/scripts/{name}
DeleteScriptDELETE /v1/scriptum/scripts/{name}
SaveScriptDraftPOST /v1/scriptum/scripts/{name}/draft
CompileScriptDraftPOST /v1/scriptum/scripts/{name}/draft/compile
TestScriptDraftPOST /v1/scriptum/scripts/{name}/draft/test
PublishScriptDraftPOST /v1/scriptum/scripts/{name}/draft/publish
RollbackScriptPOST /v1/scriptum/scripts/{name}/rollback
ListScriptVersionsGET /v1/scriptum/scripts/{name}/versions
GetScriptVersionGET /v1/scriptum/scripts/{name}/versions/{version}
GetScriptCodeGET /v1/scriptum/scripts/{name}/code/versions/{version} (also …/code)
GetDraftInfoGET /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

FieldTypeNotes
namestringRequired. Unique per tenant; the script’s identity.
descriptionstringOptional human-readable description.
tagsrepeated stringTags for organization and filtering.
from_templatestringOptional template ID to bootstrap from.
labelsrepeated LabelEntryStructured { key, values[] } operational metadata.
envmap<string, string>Optional initial per-script env overlay.
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

{ "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

FieldTypeNotes
page_sizeint32Max scripts per page.
page_tokenstringToken from a previous response.
tagsrepeated stringAll specified tags must match.
labelsrepeated LabelEntryAny matching key+value pair passes.
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

FieldTypeNotes
namestringRequired. Script name to retrieve.
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

FieldTypeNotes
namestring
descriptionstring
tagsrepeated string
active_versionint32Version new threads run (0 if none published).
latest_versionint32Highest version number minted.
draft_statusScriptVersionStatusState of the in-progress draft.
created_at_msint64
updated_at_msint64
statusScriptStatusLifecycle: created / draft / active / disabled / archived.
labelsrepeated LabelEntry
contractScriptContractThe full typed I/O contract.

DeleteScript

Permanently deletes a script and all its versions.

Request

FieldTypeNotes
namestringRequired. Script to delete.
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

FieldTypeNotes
namestringRequired. Script the draft belongs to.
dsl_contentstringScriptum DSL source. Provide this or yaml_content.
yaml_contentstringPre-compiled YAML IR. Provide this or dsl_content.
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

{ "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

FieldTypeNotes
namestringRequired. Script whose draft to compile.
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).

{ "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

FieldTypeNotes
lineint321-based source line.
colint321-based column.
messagestringWhat’s wrong.
hintstringOptional suggested fix.
severitystringe.g. error, warning.
source_linestringThe 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

FieldTypeNotes
namestringRequired. Script whose draft to test.
input_jsonstringInput parameters as a JSON string (your data).
load_envboolLoad tenant env vars into the run.
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

{ "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

FieldTypeNotes
namestringRequired. Script whose compiled draft to publish.
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

FieldTypeNotes
namestringRequired. Script to roll back.
target_versionint32Version to roll back to (0 = previous active).
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

FieldTypeNotes
namestringRequired. Script to list versions for.
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

FieldTypeNotes
namestringRequired. Script name.
versionint32Required. Version number to retrieve.
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

FieldTypeNotes
versionint32
statusScriptVersionStatus
tools_requiredrepeated stringTools this version needs registered.
created_at_msint64
published_at_msint64
contractScriptContractTyped 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

FieldTypeNotes
namestringRequired. Script name.
versionint32Version number (0 = current draft).
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

{ "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

FieldTypeNotes
namestringRequired. Script name.
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

{ "status": "SCRIPT_VERSION_STATUS_COMPILED", "dslContent": "script my_pipeline { ... }", "yamlContent": "steps:\n - ...", "error": "", "toolsRequired": ["http_request"], "updatedAtMs": "1748390400000", "contract": { "inputs": [], "outputs": [], "enums": [] } }

See also