{"openapi":"3.1.0","info":{"title":"GET /api/v1/public/attestations/{token}","version":"1.0.0","description":"Public attestation viewer (unauthenticated)"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/public/attestations/{token}":{"get":{"tags":["attestations-public"],"summary":"Public attestation viewer (unauthenticated)","description":"Resolve a share token to the attested facts, the signed payload, its hash and signature, and `verified`, recomputed server-side on every request. Returns 404 for unknown, expired or revoked tokens, indistinguishably. Rate-limited per IP and cached for 60 seconds.","operationId":"fetch_public_attestation","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_PublicAttestationResponse_"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"error":"not_found","message":"Resource not found","code":"NOT_FOUND_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too Many Requests - Rate limit exceeded; back off and retry","content":{"application/json":{"example":{"error":"rate_limited","message":"Too many requests. Please slow down.","code":"GEN_005","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"validation_error","message":"Validation failed: amount: Input should be a valid integer","errors":{"amount":"Input should be a valid integer"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}}},"x-fastapi-operation-id":"fetch_public_attestation_api_v1_public_attestations__token__get"}}},"components":{"schemas":{"AttestedFact":{"properties":{"value":{"anyOf":[{"type":"integer"},{"type":"string"}],"title":"Value"},"unit":{"type":"string","title":"Unit","description":"cents, bps, days, months or grade"},"source":{"type":"string","title":"Source","description":"The service and figures the fact was read from"},"as_of":{"type":"string","title":"As Of","description":"ISO date or datetime the source was read at"}},"additionalProperties":false,"type":"object","required":["value","unit","source","as_of"],"title":"AttestedFact","description":"One fact as computed at issue time, with where it came from."},"PublicAttestationResponse":{"properties":{"attestation_id":{"type":"string","title":"Attestation Id"},"business_name":{"type":"string","title":"Business Name"},"grantee_label":{"type":"string","title":"Grantee Label"},"period_start":{"type":"string","format":"date","title":"Period Start"},"period_end":{"type":"string","format":"date","title":"Period End"},"facts":{"additionalProperties":{"$ref":"#/components/schemas/AttestedFact"},"type":"object","title":"Facts"},"issued_at":{"type":"string","format":"date-time","title":"Issued At"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"payload":{"additionalProperties":true,"type":"object","title":"Payload"},"payload_hash":{"type":"string","title":"Payload Hash"},"signature":{"type":"string","title":"Signature"},"signing_key_id":{"type":"string","title":"Signing Key Id"},"verified":{"type":"boolean","title":"Verified"},"verification":{"type":"string","enum":["valid","signature_mismatch","unknown_key"],"title":"Verification"},"cached":{"type":"boolean","title":"Cached","default":false}},"additionalProperties":false,"type":"object","required":["attestation_id","business_name","grantee_label","period_start","period_end","facts","issued_at","expires_at","payload","payload_hash","signature","signing_key_id","verified","verification"],"title":"PublicAttestationResponse","description":"What the holder of a share link sees, with the signature re-checked.\n\n``payload`` is the exact object that was signed; ``verified`` is recomputed\non every request by signing it again with the key named in\n``signing_key_id`` and comparing with ``signature``."},"SuccessEnvelope_PublicAttestationResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/PublicAttestationResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[PublicAttestationResponse]"},"ErrorResponse":{"title":"ErrorResponse","type":"object","description":"Envelope returned by every non-2xx response. Branch on `code` (stable) rather than `message` (human-readable, may change).","required":["error","message","code"],"properties":{"error":{"type":"string","description":"Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`."},"message":{"type":"string","description":"Human-readable explanation, safe to show to end users."},"code":{"type":"string","description":"Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`)."},"request_id":{"type":"string","description":"Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied."},"errors":{"type":"object","additionalProperties":{"type":"string"},"description":"Field-level validation messages keyed by field name. Present on 400/422 validation failures only."}}}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}