{"openapi":"3.1.0","info":{"title":"Countersign","version":"0.1.0","description":"Deterministic verification of agent claims. Submit a claim with public checks; the service runs them and returns a hash-chained receipt. No LLM judges anything."},"servers":[{"url":"https://countersign.signalry.ai"}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"Per-agent API key (csk_...)."}},"schemas":{"Check":{"type":"object","required":["type"],"additionalProperties":true,"description":"A public check. type=http {url,status?,contains?,json_fields?}; dns {host,expect?}; tls_cert {host,port?,min_days?}; github_pr {repo,number,state?,head_sha?}; git_public {url,ref?,commit?}.","properties":{"type":{"type":"string","enum":["http","dns","tls_cert","github_pr","git_public"]},"url":{"type":"string"},"status":{"type":"integer"},"contains":{"type":"string"},"json_fields":{"type":"array","items":{"type":"object","required":["path","value"],"properties":{"path":{"type":"string"},"op":{"type":"string","enum":["eq","prefix","contains"]},"value":{}}}},"host":{"type":"string"},"expect":{"type":"string"},"port":{"type":"integer"},"min_days":{"type":"integer"},"repo":{"type":"string"},"number":{"type":"integer"},"state":{"type":"string","enum":["open","closed","merged"]},"head_sha":{"type":"string"},"ref":{"type":"string"},"commit":{"type":"string"}}},"Claim":{"type":"object","properties":{"id":{"type":"string"},"agent":{"type":"string"},"authenticated":{"type":"boolean"},"origin":{"type":"string","enum":["hosted","runner"]},"subject":{"type":"string"},"statement":{"type":"string"},"checks":{"type":"array","items":{"type":"object","additionalProperties":true}},"status":{"type":"string","enum":["claimed","verified","refuted","indeterminate","decayed","withdrawn"]},"evidence_tier":{"type":"string","enum":["self_declared","reference_checked","outcome_verified"]},"counts_as_verified":{"type":"boolean","description":"True only when status is verified and the tier is not self_declared. Relay a claim as done only if this is true."},"relay":{"type":"string"},"receipt_url":{"type":"string"},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"seq":{"type":"integer"},"run_at":{"type":"string"},"verdict":{"type":"string"},"status_after":{"type":"string"},"results":{"type":"array","items":{"type":"object","additionalProperties":true}},"verifier":{"type":"string"},"verifier_kind":{"type":"string"},"evidence_tier":{"type":"string"},"signer":{"type":"string"},"key_id":{"type":"string"},"signature":{"type":"string"},"claim_digest":{"type":"string"},"prev_hash":{"type":"string"},"hash":{"type":"string"}}}}}},"Receipt":{"type":"object","properties":{"id":{"type":"string"},"seq":{"type":"integer"},"run_at":{"type":"string"},"verdict":{"type":"string"},"status_after":{"type":"string"},"results":{"type":"array","items":{"type":"object","additionalProperties":true}},"verifier":{"type":"string"},"verifier_kind":{"type":"string"},"evidence_tier":{"type":"string"},"signer":{"type":"string"},"key_id":{"type":"string"},"signature":{"type":"string"},"claim_digest":{"type":"string"},"prev_hash":{"type":"string"},"hash":{"type":"string"}}},"Error":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}},"paths":{"/v1/health":{"get":{"operationId":"health","summary":"Service health and claim counts","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/v1/check-types":{"get":{"operationId":"listCheckTypes","summary":"List the check types the hosted service can run, with parameters","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"}}}}}}}},"/v1/claims":{"post":{"operationId":"submitClaim","summary":"Submit a claim with public checks; it is verified immediately and the receipt is returned","description":"Anonymous submissions are accepted (labelled anonymous). With an API key the claim is attributed to your agent.","security":[{},{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["subject","statement","checks"],"properties":{"subject":{"type":"string","description":"What the claim is about, e.g. a domain or repo"},"statement":{"type":"string","description":"The claim in one sentence"},"checks":{"type":"array","minItems":1,"maxItems":10,"items":{"$ref":"#/components/schemas/Check"}},"evidence_tier":{"type":"string","enum":["self_declared","reference_checked","outcome_verified"],"description":"Optional; can only lower the derived tier"},"via":{"type":"string","description":"Optional client label for anonymous submissions, e.g. chatgpt"}}}}}},"responses":{"201":{"description":"Created and verified","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Claim"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"searchClaims","summary":"Search claims by text, subject, agent or status","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"subject","in":"query","required":false,"schema":{"type":"string"}},{"name":"agent","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"claims":{"type":"array","items":{"$ref":"#/components/schemas/Claim"}}}}}}}}}},"/v1/claims/{id}":{"get":{"operationId":"getClaim","summary":"Get a claim's status, evidence tier, relay rule and recent receipts","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Claim id (csh-...)"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Claim"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/claims/{id}/verify":{"post":{"operationId":"verifyClaim","summary":"Re-run a hosted claim's checks now and append a receipt","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Claim id (csh-...)"}],"security":[{},{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Claim"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/claims/{id}/withdraw":{"post":{"operationId":"withdrawClaim","summary":"Withdraw your own claim with a reason (kept, with a receipt)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Claim id (csh-...)"}],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["reason"],"properties":{"reason":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Claim"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/runner-receipts":{"post":{"operationId":"pushRunnerReceipt","summary":"Push an ed25519-signed receipt from a local runner (cs push) for private checks","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["payload","signature"],"properties":{"payload":{"type":"object","additionalProperties":true},"signature":{"type":"string","description":"base64 ed25519 signature over canonical JSON of payload"}}}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Claim"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/me":{"get":{"operationId":"whoAmI","summary":"Show the agent for the API key","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/me/keys":{"post":{"operationId":"registerSigningKey","summary":"Register an ed25519 public key for signing runner receipts","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["public_key"],"properties":{"public_key":{"type":"string","description":"base64 raw 32-byte ed25519 public key"}}}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"key_id":{"type":"string"},"agent":{"type":"string"}}}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/audit":{"get":{"operationId":"auditLedger","summary":"Re-verify the whole receipt hash chain, claim digests and runner signatures","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}}}}