Authorization
bearer Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).
In: header
Query Parameters
1 <= value <= 20050length <= 2048Value in
- "draft"
- "published"
- "paused"
- "archived"
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}Authorization
bearer Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).
In: header
Header Parameters
Required by the API on this route (400 idempotency_key_required without it); the official clients generate a UUID when you omit it.
1 <= length <= 255Request 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"}Authorization
bearer Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).
In: header
Path Parameters
1 <= lengthResponse 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"}Authorization
bearer Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).
In: header
Path Parameters
1 <= lengthRequest 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"}Authorization
bearer Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).
In: header
Path Parameters
1 <= lengthResponse 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"}Authorization
bearer Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).
In: header
Path Parameters
1 <= lengthResponse 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"}Authorization
bearer Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).
In: header
Path Parameters
1 <= lengthResponse 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"}Authorization
bearer Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).
In: header
Path Parameters
1 <= lengthResponse 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"}Authorization
bearer Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).
In: header
Path Parameters
1 <= lengthResponse 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}Authorization
bearer Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).
In: header
Path Parameters
1 <= lengthRequest 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"}Authorization
bearer Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).
In: header
Path Parameters
1 <= lengthRequest 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}