{"endpoint":"/api/demo/census","method":"POST + GET","description":"Anonymous credential census demo. POST to contribute your credentials (nationality, age, OFAC status) to an aggregate census. GET to read aggregate stats. Both require agent authentication.","authentication":{"required":true,"protocol":"Self Agent ID signed headers","requiredHeaders":{"x-self-agent-signature":"HMAC signature of the request","x-self-agent-timestamp":"ISO 8601 timestamp of the request"},"optionalHeaders":{"x-self-agent-keytype":"Key type: 'ed25519' or omit for ECDSA","x-self-agent-key":"Agent public key (required for Ed25519)"},"howToSign":"Use agent.fetch() from @selfxyz/agent-sdk, or manually sign with agent.signRequest() and attach headers."},"bodySchema":{"?network":"Query param: 'celo-sepolia' (default) or 'celo-mainnet'","(POST body)":"Empty object {} — credentials are read from the agent's on-chain record"},"exampleBody":{},"notes":["POST contributes your credentials to the census (one entry per agent address).","GET returns aggregate stats: top countries, age breakdowns, OFAC clear counts.","Data is in-memory only — resets on server restart.","Add ?help=1 to GET for this documentation (bypasses auth)."],"sdkExample":"const res = await agent.fetch(\"https://app.ai.self.xyz/api/demo/census?network=celo-sepolia\", { method: \"POST + GET\", headers: { \"Content-Type\": \"application/json\" }, body: JSON.stringify({}) });"}