Skip to main content

What is Done?

Done gives you a REST API to create candidates — on-chain-style commitments backed by programmable fulfillment conditions. When the condition is met, the candidate is confirmed. If it isn’t, the candidate fails. Use cases include:
  • Delivery guarantees — candidate confirms when a file is downloaded or a job finishes
  • Multi-party agreements — candidate confirms only after all signatories submit their approval event
  • SLA enforcement — candidate fails if no activity is recorded within an activity window
  • Conditional payments — trigger fulfillment from any event your system can emit

Core concepts

Schemas

A schema is a reusable contract template. It defines the price, time windows, and the fulfillment condition. Create one schema and mint as many candidates from it as you need.
{
  "contract": {
    "price": 100.00,
    "activity_window": 3600,
    "review_window": 86400,
    "timeout_outcome": "fail",
    "fulfillment_condition": {
      "op": "AND",
      "conditions": [
        { "event": "signed_by_buyer" },
        { "event": "signed_by_seller" }
      ]
    }
  }
}

Candidates

A candidate is an instance of a schema. It captures a snapshot of the contract at creation time and maintains its own event log. The contract on a candidate never changes — schema updates do not affect existing candidates. Candidates are state machines:
StateMeaning
OPENAccepting events. Fulfillment condition is evaluated on every event.
PENDINGCondition was satisfied or activity window elapsed. Waiting for the review window.
CONFIRMEDCandidate confirmed. Terminal.
FAILEDCandidate failed. Terminal.

Events

You push events to a candidate via POST /v1/events with a candidate_alias in the body. Each event has a type string — this is the value the fulfillment condition matches against. When the full set of submitted event types satisfies the condition, the candidate atomically transitions to PENDING with scheduled_outcome = CONFIRMED.

API base URL

https://api.donehq.dev
All endpoints are versioned under /v1.

Next steps

Quickstart

Create a schema, mint a candidate, and submit an event in under 5 minutes.

Authentication

Generate an API token and learn how to authenticate requests.

Candidate lifecycle

Understand the candidate lifecycle and how transitions are triggered.

Fulfillment conditions

Learn the boolean expression tree that controls when a candidate resolves.