{"openapi":"3.1.0","info":{"title":"Provenance Systems API","version":"1.0.0","summary":"Timestamp SHA-256 fingerprints in Bitcoin via OpenTimestamps.","description":"Send a SHA-256 fingerprint, get an id, then wait for the Bitcoin confirmation – by polling with `?wait=`, or with a webhook.\n\nFingerprints are collected and anchored every full hour (UTC). A Bitcoin confirmation usually follows 1–6 hours after the batch.\nStatus: `queued` (waiting for the hourly batch) → `batched` → `anchoring` (submitted to calendars, waiting for a block; incomplete proof available) → `confirmed`.\n\nFree tier: 10 fingerprints per day per IP address, no key. Plans (Starter: 1000 fingerprints a month for €4.99/month, Pro: 5000 fingerprints a month for €10.99/month, Pro (yearly): 6000 fingerprints a month for €99/year) (final prices; the provider is not a VAT payer) use an API key sent as `Authorization: Bearer <key>`; see `GET /api/v1/plans`. Over the limit: HTTP 429 with `Retry-After` and `X-RateLimit-*` headers. Check the remaining quota at `GET /api/v1/usage`.\nOnly fingerprints are sent – never the data. Biological sequences are fingerprinted by the public rule `provenance-seq-v1`: remove whitespace and digits, convert to upper case, SHA-256 of the ASCII string.\n\nMCP server: `https://provenance.sk/mcp` (Streamable HTTP). Human documentation: https://provenance.sk/agents","contact":{"name":"Provenance Systems s. r. o.","email":"info@provenance.sk","url":"https://provenance.sk"}},"servers":[{"url":"https://provenance.sk"}],"security":[{},{"apiKey":[]}],"paths":{"/api/v1/stamps":{"post":{"operationId":"createStamp","summary":"Timestamp one or more SHA-256 fingerprints","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StampRequest"},"examples":{"single":{"value":{"sha256":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","label":"contract-v3.pdf"}},"batch":{"value":{"hashes":[{"sha256":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","label":"heavy-chain"},"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"],"webhook_url":"https://example.com/hooks/provenance"}}}}}},"responses":{"201":{"description":"Received. A single `sha256` returns one Stamp; `hashes` returns `{ stamps: [...] }`. When `webhook_url` was given, `webhook_secret` is returned once – store it to check signatures.","content":{"application/json":{"schema":{"oneOf":[{"allOf":[{"$ref":"#/components/schemas/Stamp"},{"type":"object","properties":{"webhook_secret":{"type":"string"}}}]},{"type":"object","properties":{"stamps":{"type":"array","items":{"$ref":"#/components/schemas/Stamp"}},"webhook_secret":{"type":"string"}}}]}}}},"400":{"description":"Invalid input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/Error"}}}}}},"401":{"description":"Invalid or revoked API key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/Error"}}}}}},"429":{"description":"Daily limit reached. See Retry-After; the error carries limit, remaining, reset_at and pricing.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/Error"}}}}}}}}},"/api/log/head":{"get":{"summary":"Signed head of the public transparency log","tags":["log"],"responses":{"200":{"description":"tree_size, head hash, last round; signed Ed25519 + ML-DSA-65"}}}},"/api/log/proof/{seq}":{"get":{"summary":"Inclusion proof of a receipt in its hourly round (RFC 6962 audit path) and the round's Bitcoin anchor","tags":["log"],"parameters":[{"name":"seq","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"receipt, round, inclusion"},"404":{"description":"unknown sequence number"}}}},"/keys.json":{"get":{"summary":"Public receipt signing keys (current and past)","tags":["log"],"responses":{"200":{"description":"keys"}}}},"/api/v1/plans":{"get":{"operationId":"getPlans","summary":"Free tier and monthly plans with prices","responses":{"200":{"description":"Plans.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/usage":{"get":{"operationId":"getUsage","summary":"Remaining daily quota","responses":{"200":{"description":"Quota for this API key, or for this IP address on the free tier.","content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"type":"string","description":"free, starter, pro or key"},"period":{"type":"string","enum":["day","month"]},"key_id":{"type":"string"},"limit":{"type":"integer"},"used":{"type":"integer"},"remaining":{"type":"integer"},"resets_at":{"type":"string","format":"date-time"},"pricing":{"type":"string"}}}}}},"401":{"description":"Invalid or revoked API key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/Error"}}}}}}}}},"/api/v1/stamps/{id}":{"get":{"operationId":"getStamp","summary":"Get a stamp; optionally wait for a status change","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{22}$"}},{"name":"wait","in":"query","required":false,"description":"Seconds (0–60) to hold the request until the status changes. Repeat until `confirmed` is true.","schema":{"type":"integer","minimum":0,"maximum":60,"default":0}}],"responses":{"200":{"description":"The stamp.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Stamp"}}}},"404":{"description":"Unknown id.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/Error"}}}}}}}}},"/api/v1/stamps/{id}/proof.ots":{"get":{"operationId":"getProof","summary":"Download the OpenTimestamps proof","description":"Before confirmation the proof is incomplete (it points to calendars); after confirmation it contains the full path to the Bitcoin block header and verifies with any OpenTimestamps client without this service.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Detached .ots proof.","content":{"application/vnd.opentimestamps.v1":{"schema":{"type":"string","format":"binary"}}}},"404":{"description":"Unknown id.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/Error"}}}}}},"409":{"description":"Not yet submitted to calendars.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/Error"}}}}}}}}},"/api/v1/verify/{sha256}":{"get":{"operationId":"verifyHash","summary":"Look up a fingerprint","description":"Finds stamps of this fingerprint – directly, or as an item (file or sequence) inside a timestamped claim.","parameters":[{"name":"sha256","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}}],"responses":{"200":{"description":"Lookup result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Verification"}}}}}}}},"webhooks":{"stampConfirmed":{"post":{"summary":"Sent once the stamp is recorded in a Bitcoin block","description":"Headers: `X-Provenance-Event: stamp.confirmed`, `X-Provenance-Timestamp` (unix seconds), `X-Provenance-Signature: sha256=<hex>` = HMAC-SHA256(webhook_secret, `<timestamp>.<raw body>`). Respond with 2xx. Failed deliveries are retried for about two days.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"event":{"const":"stamp.confirmed"},"delivered_at":{"type":"string","format":"date-time"},"stamp":{"$ref":"#/components/schemas/Stamp"},"proof_ots_base64":{"type":"string","contentEncoding":"base64"}}}}}},"responses":{"200":{"description":"Accepted."}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"Optional. Without it the free tier applies."}},"schemas":{"StampRequest":{"type":"object","properties":{"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","description":"One fingerprint. Use either sha256 or hashes."},"label":{"type":"string","maxLength":200,"description":"Optional label for a single sha256, shown on the public certificate."},"sha512":{"type":"string","pattern":"^[0-9a-f]{128}$","description":"Optional SHA-512 of the same data (dual fingerprint, bound into the proof)."},"hashes":{"type":"array","maxItems":100,"items":{"oneOf":[{"type":"string","pattern":"^[0-9a-f]{64}$","example":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},{"type":"object","required":["sha256"],"properties":{"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"sha512":{"type":"string","pattern":"^[0-9a-f]{128}$"},"label":{"type":"string","maxLength":200}}}]}},"email":{"type":"string","format":"email","description":"Optional. Receives the receipt and the proof by email."},"webhook_url":{"type":"string","format":"uri","description":"Optional public https URL called after confirmation."},"lang":{"type":"string","enum":["en","sk"],"default":"en","description":"Language of emails."}}},"Stamp":{"type":"object","properties":{"id":{"type":"string"},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"status":{"type":"string","enum":["queued","batched","anchoring","confirmed"]},"confirmed":{"type":"boolean"},"next":{"type":"string","description":"What happens next, in plain words."},"label":{"type":["string","null"]},"kind":{"type":"string","enum":["document","creative","research","bio"]},"received_at":{"type":"string","format":"date-time"},"next_batch_at":{"type":["string","null"],"format":"date-time"},"batch":{"type":["object","null"],"properties":{"id":{"type":"integer"},"merkle_root":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"submitted_at":{"type":["string","null"]},"calendars":{"type":"array","items":{"type":"string"}}}},"bitcoin":{"type":["object","null"],"properties":{"block_height":{"type":"integer"},"block_hash":{"type":"string"},"block_time":{"type":"string","format":"date-time"},"explorer_url":{"type":"string"},"confirmations":{"type":"integer"},"final":{"type":"boolean","description":"true after the required number of blocks (default 6)"},"sources":{"type":"array","items":{"type":"string"},"description":"Independent block sources whose headers agreed"}}},"sha512":{"type":["string","null"]},"receipt":{"type":["object","null"],"description":"Instant signed receipt: receipt (seq, commit, received_at, prev, key_id, clock), hash, sig { ed25519, ml_dsa_65 } and opening { sha256, sha512, salt }. Keys: /keys.json. Signature input: \"provenance-receipt-v1\\n\" + canonical JSON of receipt."},"proof_bundle_url":{"type":["string","null"],"description":"Complete offline proof: .ots, Bitcoin block headers with proof-of-work, receipt and its log inclusion proof."},"certificate_pdf_url":{"type":["string","null"],"description":"Two-page PDF certificate for courts and archives (append ?lang=sk for Slovak): fingerprint, Bitcoin block, verification steps; the .ots, proof bundle and receipt are embedded as attachments; the PDF is signed with the service key."},"proof":{"type":"object","properties":{"available":{"type":"boolean"},"complete":{"type":"boolean"},"url":{"type":"string"},"filename":{"type":"string"}}},"certificate_url":{"type":"string"},"status_url":{"type":"string"},"claim_url":{"type":["string","null"]},"webhook":{"type":["object","null"],"properties":{"url":{"type":"string"},"status":{"type":"string","enum":["pending","sent","failed"]},"attempts":{"type":"integer"},"last_error":{"type":["string","null"]}}}}},"Verification":{"type":"object","properties":{"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"found":{"type":"boolean"},"confirmed":{"type":"boolean"},"earliest_bitcoin_proof":{"type":["object","null"],"properties":{"stamp_id":{"type":"string"},"block_height":{"type":"integer"},"block_time":{"type":"string"}}},"stamps":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/Stamp"},{"type":"object","properties":{"matched_via":{"type":"string","enum":["fingerprint","claim_item"]}}}]}}}},"Error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"retryAfter":{"type":"integer"},"limit":{"type":"integer"},"remaining":{"type":"integer"},"reset_at":{"type":"string"},"pricing":{"type":"string"}}}}}}