{"lexicon":1,"id":"money.atmosphere.membership.listGrants","defs":{"grant":{"type":"object","required":["grantId","memberDid","creatorDid","source","registeredAt"],"properties":{"grantId":{"type":"string","maxLength":128},"memberDid":{"type":"string","format":"did"},"creatorDid":{"type":"string","format":"did"},"program":{"type":"string","format":"at-uri","description":"money.atmosphere.membership.program AT-URI, when the grant is program-scoped."},"tier":{"type":"string","format":"at-uri","description":"money.atmosphere.membership.tier AT-URI, when the grant is tier-scoped."},"source":{"type":"string","knownValues":["comp","migration","free_claim"],"maxLength":32},"registeredAt":{"type":"string","format":"datetime"},"expiresAt":{"type":"string","format":"datetime"},"revokedAt":{"type":"string","format":"datetime","description":"Present only when includeRevoked=true returned a revoked grant."},"reference":{"type":"string","maxLength":256,"description":"Opaque app-local reconciliation id echoed back."}}},"main":{"type":"query","description":"List membership grants the CALLING app registered with money.atmosphere.membership.registerGrant, for reconciliation and revocation (for example: which imported members of a migration batch received grants). Requires registered-app service-auth; an app can never read another app's grants, and this is not a member list — results are scoped to the caller's own private ledger writes. DIDs only, no PII.","parameters":{"type":"params","properties":{"creatorDid":{"type":"string","format":"did","description":"Filter to grants for one creator."},"memberDid":{"type":"string","format":"did","description":"Filter to grants for one member."},"reference":{"type":"string","maxLength":256,"description":"Filter to grants registered with this app-local reference."},"environment":{"type":"string","knownValues":["test","live"],"maxLength":8,"description":"ATM app environment. Defaults to live."},"includeRevoked":{"type":"boolean","default":false,"description":"Include revoked grants (tombstones) in the results."},"limit":{"type":"integer","minimum":1,"maximum":100,"default":50},"cursor":{"type":"string","maxLength":256}}},"output":{"encoding":"application/json","schema":{"type":"object","required":["grants"],"properties":{"grants":{"type":"array","maxLength":100,"items":{"type":"ref","ref":"#grant"}},"cursor":{"type":"string","maxLength":256,"description":"Opaque pagination cursor; absent on the last page."}}}},"errors":[{"name":"AppNotRegistered","description":"Caller is not a registered ATM app."}]}}}