Edit a rule, including enabling / disabling it
const url = 'https://quikstik-core.fly.dev/conditions/rules/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'PATCH', headers: { 'x-tenant-id': '2489E9AD-2EE2-8E00-8EC9-32D5F69181C0', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"offering_variant_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","name":"example","window":"ride_hours","metric":"pop","op":"gt","threshold":1,"fraction":1,"outcome":"watch","copy_key":"example","enabled":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://quikstik-core.fly.dev/conditions/rules/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'x-tenant-id: 2489E9AD-2EE2-8E00-8EC9-32D5F69181C0' \ --data '{ "offering_variant_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "window": "ride_hours", "metric": "pop", "op": "gt", "threshold": 1, "fraction": 1, "outcome": "watch", "copy_key": "example", "enabled": true }'Partial, absolute-value update. offering_variant_id and copy_key accept an explicit
null to clear. The merged rule is validated.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”Tenant identifier (UUID).
Authn/authz semantics are intentionally TBD for this contract slice; this header exists to keep the contract explicitly multi-tenant from day 0.
Request Bodyrequired
Section titled “Request Bodyrequired”object
ride_hours = the departure’s local start hour through its last minute; day = 07–19 local.
Ordered by precedence, lowest first.
Responses
Section titled “Responses”The rule.
object
Null = every variant.
ride_hours = the departure’s local start hour through its last minute; day = 07–19 local.
Share of the window’s hours with data that must satisfy the test; 0 = any single hour.
Ordered by precedence, lowest first.
Example
{ "window": "ride_hours", "metric": "pop", "op": "gt", "outcome": "watch"}Missing or invalid session bearer token
object
Stable, machine-readable reason code (e.g. “sold_out”, “processor_not_configured”, “rail_refused”).
Example
{ "reason": "sold_out"}The session’s effect authority does not cover this operation
object
Stable, machine-readable reason code (e.g. “sold_out”, “processor_not_configured”, “rail_refused”).
Example
{ "reason": "sold_out"}Expired, consumed, unknown, or unresolvable — indistinguishable by design
object
Example generated
{ "reason": "example"}Validation failed (see createConditionsRule).
No durable backend is wired for this operation (fail-closed)
object
Stable, machine-readable reason code (e.g. “sold_out”, “processor_not_configured”, “rail_refused”).
Example
{ "reason": "sold_out"}