Private preview. Daggry is not publicly released.Roadmap
Skip to content

HTTP API ​

Reference

The daggry CLI does all its work through an HTTP API, and a tool of your own can call the same routes. This page lists the tenant API: the routes that a tenant client calls, their request and response fields, the status codes and the run states. Read it if you write a client or a script that starts or watches runs. If you use the CLI, the CLI reference is enough.

Conventions ​

Every call follows these conventions.

  • Every call is POST <base-url><path> with the request as a JSON body and content-type: application/json.
  • A 2xx answer carries the response as JSON.
  • A request refuses unknown fields. A response can gain fields, so a client ignores the ones it does not know.
  • Byte fields are lowercase hexadecimal strings.
  • A digest is a 64-digit lowercase hexadecimal string. Run ids and artifact ids are strings.

Every call carries your tenant token in the Authorization: Bearer <tenant-token> header. The control plane stores only the SHA-256 hash of the token, and a token reaches one tenant only.

A raw call looks like this. The values are illustrative.

text
POST <DAGGRY_URL>/v1/status
authorization: Bearer <tenant-token>
content-type: application/json

{"run":"<run-id>"}
json
{"state":"running","attempts":[],"waiting_for":null}

Status codes ​

The table lists the status codes.

StatusMeaning
200The call succeeded. The body is the response.
400A well-formed request that the control plane refuses. The body is the reason as text.
401A missing or malformed credential, or a wrong token. The body is unauthenticated.
500A server fault. The body is empty.

A client treats any 4xx as a refusal. It treats a 5xx as a failure that it can retry. A run of another tenant reads as unknown run.

Routes ​

The first table lists the routes, which all take the tenant token. The second table lists the fields of each body.

PathRequest bodyResponse bodyUsed by
/v1/runrun requestrun responsedaggry run
/v1/statusstatus requeststatus reportdaggry status
/v1/approveapprove requestaccepteddaggry approve
/v1/logslogs requestlog entriesdaggry logs
/v1/chainnonelog entriesdaggry verify
/v1/blobblob requestblob responsedaggry verify
/v1/seal-keyseal-key requestseal-key responsedaggry verify

Each body has these fields.

BodyFields
run requestworkflow (string, the workflow text), workspace (string), item (string, what names the work item)
run responserun (the run id)
status requestrun
status reportstate (a state), attempts (array of {job, n, state}, where n is a number), waiting_for (a reason or null)
approve requestrun, unfreeze (string path or null)
acceptedno fields
logs requestrun
log entriesentries (array of log entries). The /v1/chain call answers with your whole chain.
blob requestdigest
blob responsebytes (hex)
seal-key requestkey_id
seal-key responsekey_id, public_key (64 hexadecimal digits, an Ed25519 public key of 32 bytes)

A client accepts a status report with waiting_for missing as null.

States and reasons ​

A run and an attempt share one set of seven states, written in lowercase.

StateMeaning
queuedThe run is accepted and no job has started.
runningA job is running. A run never reads queued again.
waitingA person is needed. waiting_for names the reason.
parkedA limit is reached, and the work waits for it to reset.
succeededTerminal. The run finished.
failedTerminal. The run failed.
stoppedTerminal. A person stopped the run.

The table lists the values of waiting_for.

waiting_forMeaning
approvalA person must approve the sealed plan.
input-neededA person must review the latest sealed change.

Next steps ​

The list names the pages to read next.

Sponsored by