{"openapi":"3.1.0","info":{"title":"CheckThisFile Integrity API","version":"1.0.0","description":"Hash-only registration, separate from review certificates. Unit: one newly committed version. Permanent identity: organization from key + company + source + documentReference + version. Identical normalized declarations replay with applied=0; any changed declaration returns 409. No Idempotency-Key required or cache expiry. Version integers are monotonic within a document; the highest accepted version wins, including revoked heads. Late historical versions remain superseded. previousVersion is a declared lower version number and may not have arrived yet; it is not a validated chain of revisions. All writes are synchronous SQLite IMMEDIATE transactions, single writer. A lost response must be reconciled through lookup. Only technical per-minute limits apply to this API; reads and exports are not blocked by legacy monthly HTTP quota or subscription expiry. New writes have their own monthly registration allowance. No automatic excess charges, purchases or upgrades. Files are never received; size, MIME and generatedAt are declarations. receivedAt is our clock, not independent timestamping. References must be opaque and private; public evidence contains their SHA-256 commitment, not their values. Evidence and state are retained while this service operates, including after subscription cancellation. Export and maintain independent copies. No SLA or perpetual hosting guarantee."},"servers":[{"url":"https://checkthisfile.com"}],"x-integrity-allowances":{"basic":{"monthlyRecords":1000},"integration":{"monthlyRecords":25000},"business":{"monthlyRecords":250000}},"paths":{"/api/v1/integrity/companies":{"get":{"operationId":"listAuthorizedIntegrityCompanies","summary":"List companies explicitly authorized for this key","tags":["Integrity"],"security":[{"bearerAuth":[]}],"x-scope":"integrity:read","parameters":[],"responses":{"200":{"description":"Result; reading alone is not a file comparison","content":{"application/json":{"schema":{"type":"object","required":["data","error","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Company"}},"error":{"type":"null"},"meta":{"type":"object"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid/revoked/expired key; no cookie fallback","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or role denied; writes may be administratively disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found or company not authorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"VERSION_CONFLICT / RESERVATION_CONFLICT / invalid signature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Technical rate or registration quota limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds before retry"}}},"503":{"description":"Temporarily unavailable; ambiguous writes must be reconciled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds before retry"}}}}},"post":{"operationId":"createIntegrityCompany","summary":"Create opaque company identity; owner/admin only, does not grant access automatically","tags":["Integrity"],"security":[{"bearerAuth":[]}],"x-scope":"integrity:admin","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["reference"],"properties":{"reference":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"}}}}}},"responses":{"200":{"description":"Result; reading alone is not a file comparison","content":{"application/json":{"schema":{"type":"object","required":["data","error","meta"],"properties":{"data":{"$ref":"#/components/schemas/Company"},"error":{"type":"null"},"meta":{"type":"object"}}}}}},"201":{"description":"Company identity, including an identical existing reference","content":{"application/json":{"schema":{"type":"object","required":["data","error","meta"],"properties":{"data":{"$ref":"#/components/schemas/Company"},"error":{"type":"null"},"meta":{"type":"object"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid/revoked/expired key; no cookie fallback","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or role denied; writes may be administratively disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found or company not authorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"VERSION_CONFLICT / RESERVATION_CONFLICT / invalid signature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Technical rate or registration quota limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds before retry"}}},"503":{"description":"Temporarily unavailable; ambiguous writes must be reconciled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds before retry"}}}}}},"/api/v1/integrity/companies/{companyId}/access":{"post":{"operationId":"grantIntegrityCompanyKey","summary":"Grant or withdraw company access for an organization key; owner/admin only","tags":["Integrity"],"security":[{"bearerAuth":[]}],"x-scope":"integrity:admin","parameters":[{"name":"companyId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["keyId","enabled"],"properties":{"keyId":{"type":"string"},"enabled":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Result; reading alone is not a file comparison","content":{"application/json":{"schema":{"type":"object","required":["data","error","meta"],"properties":{"data":{"type":"object"},"error":{"type":"null"},"meta":{"type":"object"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid/revoked/expired key; no cookie fallback","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or role denied; writes may be administratively disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found or company not authorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"VERSION_CONFLICT / RESERVATION_CONFLICT / invalid signature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Technical rate or registration quota limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds before retry"}}},"503":{"description":"Temporarily unavailable; ambiguous writes must be reconciled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds before retry"}}}}}},"/api/v1/integrity/companies/{companyId}/webhooks":{"post":{"operationId":"grantIntegrityCompanyWebhook","summary":"Authorize company events for a trusted organization webhook destination","tags":["Integrity"],"security":[{"bearerAuth":[]}],"x-scope":"integrity:admin","parameters":[{"name":"companyId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["webhookId","enabled"],"properties":{"webhookId":{"type":"string"},"enabled":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Result; reading alone is not a file comparison","content":{"application/json":{"schema":{"type":"object","required":["data","error","meta"],"properties":{"data":{"type":"object"},"error":{"type":"null"},"meta":{"type":"object"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid/revoked/expired key; no cookie fallback","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or role denied; writes may be administratively disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found or company not authorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"VERSION_CONFLICT / RESERVATION_CONFLICT / invalid signature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Technical rate or registration quota limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds before retry"}}},"503":{"description":"Temporarily unavailable; ambiguous writes must be reconciled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds before retry"}}}}}},"/api/v1/integrity/reservations":{"post":{"operationId":"reserveIntegrityLink","summary":"Reserve or renew a stable random verification URL before closing PDF bytes; no registration consumption","tags":["Integrity"],"security":[{"bearerAuth":[]}],"x-scope":"integrity:write","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reference"}}}},"responses":{"200":{"description":"Result; reading alone is not a file comparison","content":{"application/json":{"schema":{"type":"object","required":["data","error","meta"],"properties":{"data":{"$ref":"#/components/schemas/Reservation"},"error":{"type":"null"},"meta":{"type":"object"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid/revoked/expired key; no cookie fallback","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or role denied; writes may be administratively disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found or company not authorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"VERSION_CONFLICT / RESERVATION_CONFLICT / invalid signature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Technical rate or registration quota limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds before retry"}}},"503":{"description":"Temporarily unavailable; ambiguous writes must be reconciled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds before retry"}}}}}},"/api/v1/integrity/records":{"post":{"operationId":"registerIntegrityVersion","summary":"Register final bytes by declared SHA-256, without receiving or analyzing the document","tags":["Integrity"],"security":[{"bearerAuth":[]}],"x-scope":"integrity:write","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegistrationInput"}}}},"responses":{"200":{"description":"Result; reading alone is not a file comparison","content":{"application/json":{"schema":{"type":"object","required":["data","error","meta"],"properties":{"data":{"$ref":"#/components/schemas/Registration"},"error":{"type":"null"},"meta":{"type":"object"}}}}}},"201":{"description":"New version committed with consumption applied=1, record+event atomic","content":{"application/json":{"schema":{"type":"object","required":["data","error","meta"],"properties":{"data":{"$ref":"#/components/schemas/Registration"},"error":{"type":"null"},"meta":{"type":"object"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid/revoked/expired key; no cookie fallback","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or role denied; writes may be administratively disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found or company not authorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"VERSION_CONFLICT / RESERVATION_CONFLICT / invalid signature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Technical rate or registration quota limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds before retry"}}},"503":{"description":"Temporarily unavailable; ambiguous writes must be reconciled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds before retry"}}}}}},"/api/v1/integrity/lookup":{"get":{"operationId":"lookupIntegrityBySource","summary":"Recover committed record after timeout using stable source references","tags":["Integrity"],"security":[{"bearerAuth":[]}],"x-scope":"integrity:read","parameters":[{"name":"companyReference","in":"query","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"}},{"name":"source","in":"query","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"}},{"name":"documentReference","in":"query","required":true,"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"}},{"name":"version","in":"query","required":true,"schema":{"type":"integer","minimum":1,"maximum":2147483647}}],"responses":{"200":{"description":"Result; reading alone is not a file comparison","content":{"application/json":{"schema":{"type":"object","required":["data","error","meta"],"properties":{"data":{"$ref":"#/components/schemas/Record"},"error":{"type":"null"},"meta":{"type":"object"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid/revoked/expired key; no cookie fallback","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or role denied; writes may be administratively disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found or company not authorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"VERSION_CONFLICT / RESERVATION_CONFLICT / invalid signature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Technical rate or registration quota limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds before retry"}}},"503":{"description":"Temporarily unavailable; ambiguous writes must be reconciled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds before retry"}}}}}},"/api/v1/integrity/records/{publicId}":{"get":{"operationId":"getIntegrityRecord","summary":"Read a record belonging to an authorized company","tags":["Integrity"],"security":[{"bearerAuth":[]}],"x-scope":"integrity:read","parameters":[{"name":"publicId","in":"path","required":true,"schema":{"type":"string","pattern":"^ctfi_[A-Za-z0-9_-]{32}$"}}],"responses":{"200":{"description":"Result; reading alone is not a file comparison","content":{"application/json":{"schema":{"type":"object","required":["data","error","meta"],"properties":{"data":{"$ref":"#/components/schemas/Record"},"error":{"type":"null"},"meta":{"type":"object"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid/revoked/expired key; no cookie fallback","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or role denied; writes may be administratively disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found or company not authorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"VERSION_CONFLICT / RESERVATION_CONFLICT / invalid signature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Technical rate or registration quota limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds before retry"}}},"503":{"description":"Temporarily unavailable; ambiguous writes must be reconciled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds before retry"}}}}}},"/api/v1/integrity/records/{publicId}/evidence":{"get":{"operationId":"exportIntegrityReceipt","summary":"Export private signed receipt, private references and dated signed status","tags":["Integrity"],"security":[{"bearerAuth":[]}],"x-scope":"integrity:read","parameters":[{"name":"publicId","in":"path","required":true,"schema":{"type":"string","pattern":"^ctfi_[A-Za-z0-9_-]{32}$"}}],"responses":{"200":{"description":"Raw signed envelope, not the REST data/error/meta wrapper. Download stays available after plan expiry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Evidence"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid/revoked/expired key; no cookie fallback","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or role denied; writes may be administratively disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found or company not authorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"VERSION_CONFLICT / RESERVATION_CONFLICT / invalid signature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Technical rate or registration quota limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds before retry"}}},"503":{"description":"Temporarily unavailable; ambiguous writes must be reconciled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds before retry"}}}}}},"/api/v1/integrity/records/{publicId}/revoke":{"post":{"operationId":"revokeIntegrityRecord","summary":"Irreversibly revoke with private reason; retains historical signature, owner/admin only","tags":["Integrity"],"security":[{"bearerAuth":[]}],"x-scope":"integrity:revoke","parameters":[{"name":"publicId","in":"path","required":true,"schema":{"type":"string","pattern":"^ctfi_[A-Za-z0-9_-]{32}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["reason"],"properties":{"reason":{"type":"string","minLength":10,"maxLength":500}}}}}},"responses":{"200":{"description":"Result; reading alone is not a file comparison","content":{"application/json":{"schema":{"type":"object","required":["data","error","meta"],"properties":{"data":{"$ref":"#/components/schemas/Record"},"error":{"type":"null"},"meta":{"type":"object"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid/revoked/expired key; no cookie fallback","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or role denied; writes may be administratively disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found or company not authorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"VERSION_CONFLICT / RESERVATION_CONFLICT / invalid signature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Technical rate or registration quota limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds before retry"}}},"503":{"description":"Temporarily unavailable; ambiguous writes must be reconciled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds before retry"}}}}}},"/api/v1/integrity/changes":{"get":{"operationId":"reconcileIntegrityChanges","summary":"Immutable ordered event feed for one authorized company; persist cursor after local commit","tags":["Integrity"],"security":[{"bearerAuth":[]}],"x-scope":"integrity:read","parameters":[{"name":"companyReference","in":"query","required":true,"schema":{"type":"string"}},{"name":"after","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":100}}],"responses":{"200":{"description":"Result; reading alone is not a file comparison","content":{"application/json":{"schema":{"type":"object","required":["data","error","meta"],"properties":{"data":{"$ref":"#/components/schemas/Changes"},"error":{"type":"null"},"meta":{"type":"object"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid/revoked/expired key; no cookie fallback","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or role denied; writes may be administratively disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found or company not authorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"VERSION_CONFLICT / RESERVATION_CONFLICT / invalid signature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Technical rate or registration quota limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds before retry"}}},"503":{"description":"Temporarily unavailable; ambiguous writes must be reconciled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds before retry"}}}}}},"/api/v1/integrity/usage":{"get":{"operationId":"getIntegrityUsage","summary":"Organization quota and company contribution; company quota is shared by organization","tags":["Integrity"],"security":[{"bearerAuth":[]}],"x-scope":"integrity:read","parameters":[{"name":"companyReference","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Result; reading alone is not a file comparison","content":{"application/json":{"schema":{"type":"object","required":["data","error","meta"],"properties":{"data":{"type":"object","required":["organization","company"],"properties":{"organization":{"$ref":"#/components/schemas/Usage"},"company":{"$ref":"#/components/schemas/Usage"}}},"error":{"type":"null"},"meta":{"type":"object"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid/revoked/expired key; no cookie fallback","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or role denied; writes may be administratively disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found or company not authorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"VERSION_CONFLICT / RESERVATION_CONFLICT / invalid signature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Technical rate or registration quota limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds before retry"}}},"503":{"description":"Temporarily unavailable; ambiguous writes must be reconciled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds before retry"}}}}}},"/api/public/integrity/{publicId}":{"get":{"operationId":"comparePublicIntegrityHash","summary":"Public free check: exact hash, signature and current status are separate; no file uploaded","tags":["Integrity"],"security":[],"x-scope":null,"parameters":[{"name":"publicId","in":"path","required":true,"schema":{"type":"string","pattern":"^ctfi_[A-Za-z0-9_-]{32}$"}},{"name":"sha256","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-fA-F0-9]{64}$"}}],"responses":{"200":{"description":"Result; reading alone is not a file comparison","content":{"application/json":{"schema":{"type":"object","required":["data","error","meta"],"properties":{"data":{"$ref":"#/components/schemas/PublicDecision"},"error":{"type":"null"},"meta":{"type":"object"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid/revoked/expired key; no cookie fallback","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or role denied; writes may be administratively disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Record not found; data contains the public decision, not an integrity claim","content":{"application/json":{"schema":{"type":"object","required":["data","error","meta"],"properties":{"data":{"$ref":"#/components/schemas/PublicDecision"},"error":{"type":"null"},"meta":{"type":"object"}}}}}},"409":{"description":"VERSION_CONFLICT / RESERVATION_CONFLICT / invalid signature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Technical rate or registration quota limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds before retry"}}},"503":{"description":"Temporarily unavailable; ambiguous writes must be reconciled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds before retry"}}}}}},"/api/public/integrity/{publicId}/evidence":{"get":{"operationId":"downloadPublicIntegrityEvidence","summary":"Download the immutable signed public receipt; contains no private references","tags":["Integrity"],"security":[],"x-scope":null,"parameters":[{"name":"publicId","in":"path","required":true,"schema":{"type":"string","pattern":"^ctfi_[A-Za-z0-9_-]{32}$"}}],"responses":{"200":{"description":"Raw payload+signature. No private references or current-status observation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Evidence"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid/revoked/expired key; no cookie fallback","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or role denied; writes may be administratively disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found or company not authorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"VERSION_CONFLICT / RESERVATION_CONFLICT / invalid signature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Technical rate or registration quota limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds before retry"}}},"503":{"description":"Temporarily unavailable; ambiguous writes must be reconciled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds before retry"}}}}}},"/api/v1/integrity/mcp":{"post":{"summary":"Integrity MCP Streamable HTTP; JSON-RPC only, no SSE or batch; scoped API keys, not OAuth","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"JSON-RPC response","content":{"application/json":{"schema":{"type":"object"}}}},"202":{"description":"Notification accepted"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid/revoked/expired key; no cookie fallback","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or role denied; writes may be administratively disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found or company not authorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"VERSION_CONFLICT / RESERVATION_CONFLICT / invalid signature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Technical rate or registration quota limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds before retry"}}},"503":{"description":"Temporarily unavailable; ambiguous writes must be reconciled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds before retry"}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Server-only scoped API key. Company grants are additional. Never place a key in a browser or PDF."}},"schemas":{"Reference":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"companyReference":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"},"source":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"},"documentReference":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"},"version":{"type":"integer","minimum":1,"maximum":2147483647}},"required":["companyReference","source","documentReference","version"],"additionalProperties":false},"RegistrationInput":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"companyReference":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"},"source":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"},"documentReference":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"},"version":{"type":"integer","minimum":1,"maximum":2147483647},"sha256":{"type":"string","pattern":"^[a-fA-F0-9]{64}$"},"sizeBytes":{"type":"integer","minimum":0,"maximum":9007199254740991},"mimeType":{"type":"string","maxLength":127,"pattern":"^[a-z0-9][a-z0-9!#$&^_.+-]*\\/[a-z0-9][a-z0-9!#$&^_.+-]*$"},"generatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"previousVersion":{"default":null,"anyOf":[{"type":"integer","minimum":1,"maximum":2147483647},{"type":"null"}]},"reservationId":{"type":"string","pattern":"^ctfi_[A-Za-z0-9_-]{32}$"}},"required":["companyReference","source","documentReference","version","sha256","sizeBytes","mimeType","generatedAt"],"additionalProperties":false},"Company":{"type":"object","required":["id","reference"],"properties":{"id":{"type":"string"},"reference":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"},"createdAt":{"type":"string","format":"date-time"}}},"Consumption":{"type":"object","required":["applied","unit"],"properties":{"applied":{"type":"integer","enum":[0,1]},"unit":{"const":"new_integrity_version"},"billable":{"type":"integer","enum":[0,1]}}},"Usage":{"type":"object","required":["plan","period","used","quota","remaining","resetsAt","unit","billingExempt","automaticCharges","retention","documentStored"],"properties":{"plan":{"enum":["basic","integration","business"]},"period":{"type":"string"},"used":{"type":"integer"},"quota":{"type":["integer","null"]},"remaining":{"type":["integer","null"]},"resetsAt":{"type":"string","format":"date-time"},"unit":{"const":"new_integrity_version"},"billingExempt":{"type":"boolean"},"automaticCharges":{"const":false},"retention":{"const":"while_service_operates"},"documentStored":{"const":false}}},"Record":{"type":"object","required":["id","publicId","sha256","companyReference","source","documentReference","version","previousVersion","sizeBytes","mimeType","generatedAt","receivedAt","status","verificationUrl","evidenceUrl","consumption","usage","companyUsage"],"properties":{"id":{"type":"string"},"publicId":{"type":"string","pattern":"^ctfi_[A-Za-z0-9_-]{32}$"},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"companyReference":{"type":"string"},"source":{"type":"string"},"documentReference":{"type":"string"},"version":{"type":"integer"},"previousVersion":{"type":["integer","null"]},"sizeBytes":{"type":"integer"},"mimeType":{"type":"string"},"generatedAt":{"type":"string","format":"date-time"},"receivedAt":{"type":"string","format":"date-time"},"status":{"enum":["current","superseded","revoked"]},"verificationUrl":{"type":"string","format":"uri"},"evidenceUrl":{"type":"string","format":"uri"},"consumption":{"$ref":"#/components/schemas/Consumption"},"usage":{"$ref":"#/components/schemas/Usage"},"companyUsage":{"type":"object","required":["used"],"properties":{"used":{"type":"integer"}}}}},"Registration":{"allOf":[{"$ref":"#/components/schemas/Record"},{"type":"object","required":["replayed"],"properties":{"replayed":{"type":"boolean"}}}]},"Reservation":{"type":"object","required":["publicId","expiresAt","verificationUrl","status","consumption"],"properties":{"publicId":{"type":"string","pattern":"^ctfi_[A-Za-z0-9_-]{32}$"},"expiresAt":{"type":"string","format":"date-time"},"verificationUrl":{"type":"string"},"status":{"enum":["pending","current","superseded","revoked"]},"consumption":{"$ref":"#/components/schemas/Consumption"}}},"Signature":{"type":"object","required":["algorithm","keyId","signatureBase64url","publicKeyFingerprint","publicKeyJwk"],"properties":{"algorithm":{"const":"Ed25519"},"keyId":{"type":"string"},"signatureBase64url":{"type":"string"},"publicKeyFingerprint":{"type":"string"},"publicKeyJwk":{"type":"object"}}},"Evidence":{"type":"object","required":["payload","signature"],"properties":{"payload":{"$ref":"https://checkthisfile.com/schemas/integrity-v1.json"},"signature":{"$ref":"#/components/schemas/Signature"},"privateReferences":{"$ref":"#/components/schemas/Reference"},"observation":{"type":"object","required":["payload","signature"],"properties":{"payload":{"$ref":"https://checkthisfile.com/schemas/integrity-status-v1.json"},"signature":{"$ref":"#/components/schemas/Signature"}}},"verification":{"type":"object"}}},"PublicDecision":{"type":"object","required":["publicId","status","signatureValid","hashMatches","current","verified","checkedAt","reason","documentUploaded","evidence"],"properties":{"publicId":{"type":"string","pattern":"^ctfi_[A-Za-z0-9_-]{32}$"},"status":{"enum":["current","superseded","revoked","pending","not_found"]},"signatureValid":{"type":["boolean","null"]},"hashMatches":{"type":["boolean","null"]},"current":{"type":"boolean"},"verified":{"type":"boolean","description":"True only after matching hash, trusted signature and current record. No claim of human review."},"checkedAt":{"type":"string","format":"date-time"},"reason":{"enum":["MATCH_CURRENT","MATCH_HISTORICAL","HASH_MISMATCH","RECORD_REVOKED","SIGNATURE_INVALID","FILE_NOT_COMPARED","REGISTRATION_PENDING","RECORD_NOT_FOUND"]},"documentUploaded":{"const":false},"evidence":{"anyOf":[{"$ref":"#/components/schemas/Evidence"},{"type":"null"}]}}},"Changes":{"type":"object","required":["events","nextCursor","hasMore"],"properties":{"events":{"type":"array","items":{"type":"object","required":["sequence","id","type","occurredAt","publicId","recordId","companyReference","source","documentReference","version","status"],"properties":{"sequence":{"type":"integer"},"id":{"type":"string"},"type":{"enum":["integrity.registered","integrity.superseded","integrity.revoked"]},"occurredAt":{"type":"string","format":"date-time"},"publicId":{"type":"string","pattern":"^ctfi_[A-Za-z0-9_-]{32}$"},"recordId":{"type":"string"},"companyReference":{"type":"string"},"source":{"type":"string"},"documentReference":{"type":"string"},"version":{"type":"integer"},"status":{"enum":["current","superseded","revoked"]}}}},"nextCursor":{"type":"integer"},"hasMore":{"type":"boolean"}}},"Error":{"type":"object","required":["data","error","meta"],"properties":{"data":{"type":"null"},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}},"meta":{"type":"object"}}}}}}