Orishare
Api
GET
/rules
AuthorizationBearer <token>

Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).

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

Response Body

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",      "name": "string",      "campaign_id": "string",      "status": "draft",      "priority": 0,      "active_version": {        "id": "string",        "number": 0,        "definition": null,        "created_at": "string"      },      "draft_definition": null,      "version": 0,      "created_at": "string",      "updated_at": "string"    }  ],  "next_cursor": "string",  "has_more": true}
POST
/rules
AuthorizationBearer <token>

Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).

In: header

Header Parameters

Idempotency-Key?string

Required by the API on this route (400 idempotency_key_required without it); the official clients generate a UUID when you omit it.

Length1 <= length <= 255

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

curl -X POST "https://example.com/rules" \  -H "Content-Type: application/json" \  -d '{    "name": "Purchase earns points",    "definition": {      "schema": "orishare.rule/v1",      "trigger": {        "event": "content.purchased"      },      "limits": [        {          "id": "per_content",          "scope": [            "customer",            "event.properties.content_id"          ],          "max": 1        }      ],      "actions": [        {          "type": "points.award",          "currency": "points",          "amount": 100        }      ]    }  }'
{  "id": "string",  "name": "string",  "campaign_id": "string",  "status": "draft",  "priority": 0,  "active_version": {    "id": "string",    "number": 0,    "definition": null,    "created_at": "string"  },  "draft_definition": null,  "version": 0,  "created_at": "string",  "updated_at": "string"}
GET
/rules/{id}
AuthorizationBearer <token>

Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).

In: header

Path Parameters

id*string
Length1 <= length

Response Body

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",  "name": "string",  "campaign_id": "string",  "status": "draft",  "priority": 0,  "active_version": {    "id": "string",    "number": 0,    "definition": null,    "created_at": "string"  },  "draft_definition": null,  "version": 0,  "created_at": "string",  "updated_at": "string"}
PATCH
/rules/{id}
AuthorizationBearer <token>

Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).

In: header

Path Parameters

id*string
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

curl -X PATCH "https://example.com/rules/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": "string",  "name": "string",  "campaign_id": "string",  "status": "draft",  "priority": 0,  "active_version": {    "id": "string",    "number": 0,    "definition": null,    "created_at": "string"  },  "draft_definition": null,  "version": 0,  "created_at": "string",  "updated_at": "string"}
POST
/rules/{id}/publish
AuthorizationBearer <token>

Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).

In: header

Path Parameters

id*string
Length1 <= length

Response Body

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",  "name": "string",  "campaign_id": "string",  "status": "draft",  "priority": 0,  "active_version": {    "id": "string",    "number": 0,    "definition": null,    "created_at": "string"  },  "draft_definition": null,  "version": 0,  "created_at": "string",  "updated_at": "string"}
POST
/rules/{id}/pause
AuthorizationBearer <token>

Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).

In: header

Path Parameters

id*string
Length1 <= length

Response Body

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",  "name": "string",  "campaign_id": "string",  "status": "draft",  "priority": 0,  "active_version": {    "id": "string",    "number": 0,    "definition": null,    "created_at": "string"  },  "draft_definition": null,  "version": 0,  "created_at": "string",  "updated_at": "string"}
POST
/rules/{id}/resume
AuthorizationBearer <token>

Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).

In: header

Path Parameters

id*string
Length1 <= length

Response Body

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",  "name": "string",  "campaign_id": "string",  "status": "draft",  "priority": 0,  "active_version": {    "id": "string",    "number": 0,    "definition": null,    "created_at": "string"  },  "draft_definition": null,  "version": 0,  "created_at": "string",  "updated_at": "string"}
POST
/rules/{id}/archive
AuthorizationBearer <token>

Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).

In: header

Path Parameters

id*string
Length1 <= length

Response Body

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",  "name": "string",  "campaign_id": "string",  "status": "draft",  "priority": 0,  "active_version": {    "id": "string",    "number": 0,    "definition": null,    "created_at": "string"  },  "draft_definition": null,  "version": 0,  "created_at": "string",  "updated_at": "string"}
GET
/rules/{id}/versions
AuthorizationBearer <token>

Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).

In: header

Path Parameters

id*string
Length1 <= length

Response Body

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": "string"    }  ],  "next_cursor": "string",  "has_more": true}
POST
/rules/{id}/rollback
AuthorizationBearer <token>

Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).

In: header

Path Parameters

id*string
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

curl -X POST "https://example.com/rules/string/rollback" \  -H "Content-Type: application/json" \  -d '{    "number": 1  }'
{  "id": "string",  "name": "string",  "campaign_id": "string",  "status": "draft",  "priority": 0,  "active_version": {    "id": "string",    "number": 0,    "definition": null,    "created_at": "string"  },  "draft_definition": null,  "version": 0,  "created_at": "string",  "updated_at": "string"}
POST
/rules/{id}/simulate
AuthorizationBearer <token>

Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).

In: header

Path Parameters

id*string
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

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