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

HTTP API ​

Reference

The daggry CLI calls an HTTP API, and a tool of your own can call the same routes. This page lists the routes, 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.

Two routes add to the evidence trail: /v1/run seals a run lock and the work item, and /v1/approve seals an approval bound to a digest. Three routes serve the trail so that a client can verify it: /v1/chain, /v1/blob and /v1/seal-key.

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), objective (string, the objective as text). At least one of item and objective.
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), trigger (the name of the trigger that started the run, absent for a run a client started)
approve requestrun, unfreeze (string path or null)
acceptedno fields
logs requestrun
log entriesentries (array of log entries). The /v1/chain call answers with your tenant's whole evidence trail.
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.

movingThe run is working
  • queued: accepted, no job has started
  • running: a job is running
pausedThe run waits
  • waiting: a person is needed, for an approval or an answer
  • parked: a limit is reached and the work waits for it to reset
endedThe run is over
  • succeeded
  • failed
  • stopped: a person stopped it, or nobody answered for 14 days
The seven states of a run, in three groups. A run is queued, then running. It pauses as waiting when a person is needed, or as parked when a limit is reached, and continues from there. It ends as succeeded, failed or stopped.

The diagram groups the seven states: two while the run works, two while it waits and three once it has ended.

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, for example by removing the label that started it or by closing the issue, or nobody answered for 14 days.

The table lists the values of waiting_for.

waiting_forMeaning
approvalThe run is at a checkpoint. An approver's yes continues it.
answerA persona asked a question on the issue. The next reply from a person continues the step.

Next steps ​

The list names the pages to read next.

Sponsored by