Orishare
API reference
GET
/capabilities

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

Response Body

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/capabilities"
{  "schema_supported": [    "string"  ],  "execution_supported": [    "string"  ],  "program_schemas": [    "string"  ],  "state_schemas": [    "string"  ],  "feature_versions": {    "property1": "string",    "property2": "string"  }}
GET
/rules

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Query Parameters

limit?integer
Range1 <= value <= 200
Default50
cursor?string
Lengthlength <= 2048
status?string

Value in

  • "draft"
  • "published"
  • "paused"
  • "archived"
campaign_id?string

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

curl -X GET "https://example.com/rules"
{  "data": [    {      "id": "string",      "key": "string",      "name": "string",      "campaign_id": "string",      "status": "draft",      "priority": 0,      "active_version": {        "id": "string",        "number": 0,        "definition": null,        "created_at": "2019-08-24T14:15:22Z"      },      "draft_definition": null,      "version": 0,      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z"    }  ],  "next_cursor": "string",  "has_more": true}
POST
/rules

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Header Parameters

Idempotency-Key*string

Required. Official clients generate a UUID when omitted by the caller.

Length1 <= length <= 255
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

curl -X POST "https://example.com/rules" \  -H "Idempotency-Key: string" \  -H "Content-Type: application/json" \  -d '{    "name": "Purchase points",    "definition": {      "schema": "orishare.rule/v1",      "trigger": {        "event": "purchase"      },      "actions": [        {          "type": "points.award",          "currency": "points",          "amount": 10        }      ]    }  }'
{  "id": "string",  "key": "string",  "name": "string",  "campaign_id": "string",  "status": "draft",  "priority": 0,  "active_version": {    "id": "string",    "number": 0,    "definition": null,    "created_at": "2019-08-24T14:15:22Z"  },  "draft_definition": null,  "version": 0,  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
GET
/rules/{id}

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

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

curl -X GET "https://example.com/rules/string"
{  "id": "string",  "key": "string",  "name": "string",  "campaign_id": "string",  "status": "draft",  "priority": 0,  "active_version": {    "id": "string",    "number": 0,    "definition": null,    "created_at": "2019-08-24T14:15:22Z"  },  "draft_definition": null,  "version": 0,  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
PATCH
/rules/{id}

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

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
If-Match?string

Optional legacy revision. Missing or malformed values follow the existing route parser.

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

curl -X PATCH "https://example.com/rules/string" \  -H "Content-Type: application/json" \  -d '{    "name": "Updated rule"  }'
{  "id": "string",  "key": "string",  "name": "string",  "campaign_id": "string",  "status": "draft",  "priority": 0,  "active_version": {    "id": "string",    "number": 0,    "definition": null,    "created_at": "2019-08-24T14:15:22Z"  },  "draft_definition": null,  "version": 0,  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
POST
/rules/{id}/publish

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

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
If-Match?string

Optional legacy revision. Missing or malformed values follow the existing route parser.

Response Body

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/rules/string/publish"
{  "id": "string",  "key": "string",  "name": "string",  "campaign_id": "string",  "status": "draft",  "priority": 0,  "active_version": {    "id": "string",    "number": 0,    "definition": null,    "created_at": "2019-08-24T14:15:22Z"  },  "draft_definition": null,  "version": 0,  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
POST
/rules/{id}/pause

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

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
If-Match?string

Optional legacy revision. Missing or malformed values follow the existing route parser.

Response Body

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/rules/string/pause"
{  "id": "string",  "key": "string",  "name": "string",  "campaign_id": "string",  "status": "draft",  "priority": 0,  "active_version": {    "id": "string",    "number": 0,    "definition": null,    "created_at": "2019-08-24T14:15:22Z"  },  "draft_definition": null,  "version": 0,  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
POST
/rules/{id}/resume

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

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
If-Match?string

Optional legacy revision. Missing or malformed values follow the existing route parser.

Response Body

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/rules/string/resume"
{  "id": "string",  "key": "string",  "name": "string",  "campaign_id": "string",  "status": "draft",  "priority": 0,  "active_version": {    "id": "string",    "number": 0,    "definition": null,    "created_at": "2019-08-24T14:15:22Z"  },  "draft_definition": null,  "version": 0,  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
POST
/rules/{id}/archive

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

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
If-Match?string

Optional legacy revision. Missing or malformed values follow the existing route parser.

Response Body

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/rules/string/archive"
{  "id": "string",  "key": "string",  "name": "string",  "campaign_id": "string",  "status": "draft",  "priority": 0,  "active_version": {    "id": "string",    "number": 0,    "definition": null,    "created_at": "2019-08-24T14:15:22Z"  },  "draft_definition": null,  "version": 0,  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
GET
/rules/{id}/versions

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

Query Parameters

limit?integer
Range1 <= value <= 200
Default50
cursor?string
Lengthlength <= 2048

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

curl -X GET "https://example.com/rules/string/versions"
{  "data": [    {      "id": "string",      "rule_id": "string",      "number": 0,      "definition": null,      "created_by": "string",      "created_at": "2019-08-24T14:15:22Z"    }  ],  "next_cursor": "string",  "has_more": true}
POST
/rules/{id}/rollback

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

Header Parameters

Idempotency-Key*string

Required. Official clients generate a UUID when omitted by the caller.

Length1 <= length <= 255
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

curl -X POST "https://example.com/rules/string/rollback" \  -H "Idempotency-Key: string" \  -H "Content-Type: application/json" \  -d '{    "number": 1  }'
{  "id": "string",  "key": "string",  "name": "string",  "campaign_id": "string",  "status": "draft",  "priority": 0,  "active_version": {    "id": "string",    "number": 0,    "definition": null,    "created_at": "2019-08-24T14:15:22Z"  },  "draft_definition": null,  "version": 0,  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
POST
/rules/{id}/simulate

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

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

curl -X POST "https://example.com/rules/string/simulate" \  -H "Content-Type: application/json" \  -d '{    "event": {      "name": "purchase"    },    "customer_id": "cust_00000000000000000000000000000042"  }'
{  "simulated": true,  "plan": [    null  ],  "trace": null}