Configuration as code
Export an environment as one JSON document and apply it to another, atomically.
GET /config/export returns orishare.config/v1: currencies, attribute and event definitions,
segments, counter definitions, tier programs, rewards, campaigns, rules, challenges, webhook
endpoints (without secrets) and the project context. Names are the stable references: reward and
program ids inside rule actions travel as $reward:<name> and $program:<name>.
POST /config/apply with mode: preview returns a per-section diff (create, update,
unchanged) and writes nothing; mode: apply runs everything in one transaction. Unknown
references, invalid rules and immutable changes (currency precision, counter shape, a held tier
level) fail with validation_failed naming the path, and nothing is applied. Applying the same
document twice is a no-op. Publishing rules in production requires the owner or admin role.
orishare --env env_sandbox… config pull > sandbox.json
orishare --env env_prod… config push --file sandbox.json # preview
orishare --env env_prod… config push --file sandbox.json --apply