Skip to content

Edit a rule, including enabling / disabling it

PATCH
/conditions/rules/{id}
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.

id
required
string format: uuid
x-tenant-id
required
string format: uuid

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.

Media typeapplication/json
object
offering_variant_id
string format: uuid
nullable
name
string
>= 1 characters
window

ride_hours = the departure’s local start hour through its last minute; day = 07–19 local.

string
Allowed values: ride_hours day
metric
string
Allowed values: pop precip_in temp_f feels_f wind_mph gust_mph thunder vis_mi wave_ft uv
op
string
Allowed values: gt gte lt lte eq
threshold
number
fraction
number
<= 1
outcome

Ordered by precedence, lowest first.

string
Allowed values: watch guest_may_cancel operator_call
copy_key
string
nullable
enabled
boolean

The rule.

Media typeapplication/json
object
id
required
string format: uuid
offering_variant_id

Null = every variant.

string format: uuid
nullable
name
required
string
window
required

ride_hours = the departure’s local start hour through its last minute; day = 07–19 local.

string
Allowed values: ride_hours day
metric
required
string
Allowed values: pop precip_in temp_f feels_f wind_mph gust_mph thunder vis_mi wave_ft uv
op
required
string
Allowed values: gt gte lt lte eq
threshold
required
number
fraction
required

Share of the window’s hours with data that must satisfy the test; 0 = any single hour.

number
<= 1
outcome
required

Ordered by precedence, lowest first.

string
Allowed values: watch guest_may_cancel operator_call
copy_key
string
nullable
enabled
required
boolean
created_at_ms
required
integer format: int64

Example

{
"window": "ride_hours",
"metric": "pop",
"op": "gt",
"outcome": "watch"
}

Missing or invalid session bearer token

Media typeapplication/json
object
reason
required

Stable, machine-readable reason code (e.g. “sold_out”, “processor_not_configured”, “rail_refused”).

string

Example

{
"reason": "sold_out"
}

The session’s effect authority does not cover this operation

Media typeapplication/json
object
reason
required

Stable, machine-readable reason code (e.g. “sold_out”, “processor_not_configured”, “rail_refused”).

string

Example

{
"reason": "sold_out"
}

Expired, consumed, unknown, or unresolvable — indistinguishable by design

Media typeapplication/json
object
reason
required
string

Example generated

{
"reason": "example"
}

Validation failed (see createConditionsRule).

No durable backend is wired for this operation (fail-closed)

Media typeapplication/json
object
reason
required

Stable, machine-readable reason code (e.g. “sold_out”, “processor_not_configured”, “rail_refused”).

string

Example

{
"reason": "sold_out"
}