Orishare
API reference
GET
/config/export

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Query Parameters

schema?string

Send orishare.config/v2 (recommended, what /config/apply and config.apply_document take). The v1 default is kept for older clients and answers 409 config_format_required once the environment holds v2-only configuration.

Default"orishare.config/v1"

Value in

  • "orishare.config/v1"
  • "orishare.config/v2"
legacy_only?string
Default"false"

Value in

  • "true"
  • "false"

Header Parameters

X-Orishare-Environment?string

Required for selected-environment authorization branches; API keys use their bound environment.

Length1 <= length
X-Orishare-Audit-Reason?string

Required for staff authorization. Records the reason for staff access.

Length1 <= length

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/config/export"
{  "schema": "orishare.config/v1",  "exported_at": "string",  "source": {    "environment_id": "string",    "runtime_class": "string"  },  "currencies": [],  "attribute_definitions": [],  "event_definitions": [],  "segments": [],  "counter_definitions": [],  "tier_programs": [],  "rewards": [],  "campaigns": [],  "rules": [],  "challenges": [],  "webhook_endpoints": [],  "context": null}
POST
/config/apply

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Header Parameters

X-Orishare-Environment?string

Required for selected-environment authorization branches; API keys use their bound environment.

Length1 <= length
X-Orishare-Audit-Reason?string

Required for staff authorization. Records the reason for staff access.

Length1 <= length

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/config/apply" \  -H "Content-Type: application/json" \  -d '{    "document": {      "schema": "orishare.config/v1"    },    "mode": "preview",    "publish": false  }'
{  "mode": "preview",  "applied": true,  "diff": {    "property1": {      "create": [        "string"      ],      "update": [        "string"      ],      "unchanged": [        "string"      ]    },    "property2": {      "create": [        "string"      ],      "update": [        "string"      ],      "unchanged": [        "string"      ]    }  },  "changes": 0,  "published_rules": [    "string"  ],  "notes": [    "string"  ],  "revision": "string"}