Run a TypeScript handler observe-only against a sample or the most recent matching signal
const url = 'http://localhost:11044/api/v1/admin/handlers/dry-run';const options = { method: 'POST', headers: {'X-Embabel-Api-Key': '<X-Embabel-Api-Key>', 'Content-Type': 'application/json'}, body: '{"sample":{"additionalProperty":"example"},"signalType":"example","source":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:11044/api/v1/admin/handlers/dry-run \ --header 'Content-Type: application/json' \ --header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>' \ --data '{ "sample": { "additionalProperty": "example" }, "signalType": "example", "source": "example" }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”The TypeScript source to run and what to run it against. A sample is bound as the signal when given, its typeName and id keys naming it; otherwise the most recent signal of signalType in the caller’s graph is used, and with signalType omitted, *, or no such signal in the graph the handler runs against a cron tick. Observe-only: nothing is saved and nothing external changes
A handler body to run observe-only, and what to run it against.
object
A sample signal to bind INSTEAD of sampling the graph — for an event not yet received.
object
The signal type to sample a real recent event from. Null or ‘*’ means a cron tick.
The TypeScript handler body to run. Nothing is saved, and the run applies no external effects.
Example generated
{ "sample": { "additionalProperty": "example" }, "signalType": "example", "source": "example"}Responses
Section titled “Responses”What the run saw, logged, and how it ended
The outcome of an observe-only handler run: what it saw, what it logged, and how it ended.
object
The failure message when the body threw. Serialized as null otherwise — consumers test for the key.
False when the body threw; error then carries the message.
What the body RETURNED, when it returned something. A handler that ends with return rows and never logs is not silent — this is its result. Absent when the body returned nothing.
The signal the run actually bound, which may differ from the one asked for.
object
Id of the signal bound: the sampled signal’s id, a sample’s id (else sample), or cron for a cron tick.
Simple type name of the signal bound: the sampled signal’s, or for a sample its typeName (else the requested type, else SampleSignal), or CronTick when nothing matching was on record.
Everything the body logged. The brief tells a handler to log every effect, so this IS the feedback surface.
Example generated
{ "error": "example", "ok": true, "output": "example", "ranAgainst": { "signalId": "example", "signalType": "example" }, "stdout": "example"}No authenticated principal
A refusal carrying only a human-readable reason.
object
What went wrong, in the terms the caller can act on.
Example generated
{ "error": "example"}
