{"lexicon":1,"id":"money.atmosphere.membership.createProgram","defs":{"main":{"type":"procedure","description":"Create a portable money.atmosphere.membership.program record in the creator's repo. Requires registered-app service auth. When creatorDid differs from the calling app, the app must hold a LIVE recipient approval covering subscription payments. ATM writes to the creator's repo only while it holds a live membership-write OAuth grant; otherwise it returns MembershipCreatorAuthorizationRequired without fabricating a record.","input":{"encoding":"application/json","schema":{"type":"object","required":["creatorDid","environment","title"],"properties":{"creatorDid":{"type":"string","format":"did","description":"Creator/project DID that will own the membership program."},"environment":{"type":"string","knownValues":["test","live"],"maxLength":16},"title":{"type":"string","minLength":1,"maxGraphemes":100,"maxLength":1000},"description":{"type":"string","maxGraphemes":1000,"maxLength":10000},"product":{"type":"ref","ref":"com.atproto.repo.strongRef","description":"Optional money.atmosphere.product (kind=membership) in the creator's repo."}}}},"output":{"encoding":"application/json","schema":{"type":"object","required":["program"],"properties":{"program":{"type":"ref","ref":"com.atproto.repo.strongRef"}}}},"errors":[{"name":"AppEnvironmentNotConfigured","description":"The app environment is not configured in ATM."},{"name":"NotAuthorized","description":"The calling app is not authorized to create memberships for this creator."},{"name":"MembershipCreatorAuthorizationRequired","description":"ATM holds no live grant to write membership records to the creator's repo; the creator must sign in to ATM (or re-authorize) to grant membership-write access."},{"name":"InvalidMembershipEntitlement","description":"A supplied Product is not a valid kind=membership Product in the creator's repo."},{"name":"WriteFailed","description":"ATM could not write the membership program record."}]}}}