Docs API reference
Named conditions
A meaning given a name once — "between_talks", "doors_open" — that any rule on any block can then refer to by key. Change what it means here and every screen using it follows. Conditions are built from SENSORS (the clock, the date, a data value, the live session); GET /named-conditions/sensors lists them with their operators, so you never have to guess. This is configuration, not content: a named condition says what something *means*, never what a screen shows.
Every call needs an API key in the Authorization header. New to the API? Start with
the API overview.
- GET List named conditions /named-conditions
- POST Create or replace a named condition /named-conditions
- GET List the sensors a condition can read /named-conditions/sensors
- GET Get a named condition /named-conditions/{key}
- PUT Create or replace a named condition /named-conditions/{key}
- DELETE Delete a named condition /named-conditions/{key}
List named conditions
/named-conditions rulesEvery named condition in the workspace, by key.
Parameters
limitinteger queryPage size, 1–200.
1–200. Default
50cursorstring queryThe
next_cursorof the previous page.
Responses
- 200 A page of named conditions.
- 401 Missing or invalid API key.
- 403 The key lacks the scope, or the role is read-only.
Response fields (200)
itemsobject[] required8 fields in
itemskeystring requiredLowercase letters, digits and underscores. THE ADDRESS: rules store the key, so renaming means moving every reference.
labelstring requiredWhat a person calls it. Defaults to the key.
descriptionstringWhat it means, in one line.
matchstring requiredHow the top-level entries combine. Default
all.One of
all,anywhenobject[] requiredAt least one entry.
reads_asstring read-onlyThe whole thing as a sentence.
created_atinteger read-onlyupdated_atinteger read-only
next_cursorstring or null requiredPass as
cursorfor the next page;nullon the last page.
curl "https://www.wunderframe.com/api/v1/named-conditions?limit=50" \
-H "Authorization: Bearer $WUNDERFRAME_API_KEY"{
"items": [
{
"key": "friday_evening",
"label": "Friday evening",
"description": "After six, at the end of the week.",
"match": "all",
"when": [
{
"id": "c1",
"sensor": "clock",
"op": "after",
"value": {
"time": "18:00"
}
},
{
"id": "g1",
"all": "any",
"when": [
{
"id": "c2",
"sensor": "weekday",
"op": "in",
"value": {
"days": [
5
]
}
},
{
"id": "c3",
"sensor": "weekday",
"op": "in",
"value": {
"days": [
6
]
}
}
]
}
],
"reads_as": "the time is from 18:00 and (the weekday is Fri or the weekday is Sat)"
}
],
"next_cursor": null
}Error example
{
"error": {
"code": "unauthorized",
"message": "Missing or invalid API key."
}
}Create or replace a named condition
/named-conditions rulesAn upsert by key, the same as PUT /named-conditions/{key} — posting an existing key updates that one rather than making a second with the same name.
Request body required
keystring requiredLowercase letters, digits and underscores. THE ADDRESS: rules store the key, so renaming means moving every reference.
labelstring requiredWhat a person calls it. Defaults to the key.
descriptionstringWhat it means, in one line.
matchstring requiredHow the top-level entries combine. Default
all.One of
all,anywhenobject[] requiredAt least one entry.
Responses
- 200 The saved named condition.
- 400 The request is invalid —
details.fieldnames the field when there is one. - 401 Missing or invalid API key.
- 403 The key lacks the scope, or the role is read-only.
Response fields (200)
keystring requiredLowercase letters, digits and underscores. THE ADDRESS: rules store the key, so renaming means moving every reference.
labelstring requiredWhat a person calls it. Defaults to the key.
descriptionstringWhat it means, in one line.
matchstring requiredHow the top-level entries combine. Default
all.One of
all,anywhenobject[] requiredAt least one entry.
reads_asstring read-onlyThe whole thing as a sentence.
created_atinteger read-onlyupdated_atinteger read-only
curl -X POST "https://www.wunderframe.com/api/v1/named-conditions" \
-H "Authorization: Bearer $WUNDERFRAME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"key": "friday_evening",
"label": "Friday evening",
"match": "all",
"when": [
{
"id": "c1",
"sensor": "clock",
"op": "after",
"value": {
"time": "18:00"
}
},
{
"id": "g1",
"all": "any",
"when": [
{
"id": "c2",
"sensor": "weekday",
"op": "in",
"value": {
"days": [
5
]
}
},
{
"id": "c3",
"sensor": "weekday",
"op": "in",
"value": {
"days": [
6
]
}
}
]
}
]
}'{
"key": "friday_evening",
"label": "Friday evening",
"description": "After six, at the end of the week.",
"match": "all",
"when": [
{
"id": "c1",
"sensor": "clock",
"op": "after",
"value": {
"time": "18:00"
}
},
{
"id": "g1",
"all": "any",
"when": [
{
"id": "c2",
"sensor": "weekday",
"op": "in",
"value": {
"days": [
5
]
}
},
{
"id": "c3",
"sensor": "weekday",
"op": "in",
"value": {
"days": [
6
]
}
}
]
}
],
"reads_as": "the time is from 18:00 and (the weekday is Fri or the weekday is Sat)"
}Error example
{
"error": {
"code": "invalid",
"message": "The request is invalid — `details.field` names the field when there is one."
}
}List the sensors a condition can read
/named-conditions/sensors rulesWhat sensor, property and op may be, generated from the sensors this deployment actually has — so it cannot drift from what the evaluator accepts. Each reading carries a ready-made example you can paste into when.
Responses
- 200 The sensor vocabulary.
- 401 Missing or invalid API key.
- 403 The key lacks the scope, or the role is read-only.
Response fields (200)
sensorsobject[]3 fields in
sensorssensorstringlabelstringreadingsobject[]One per reading the sensor offers, each with its own operators and a ready-made example.
4 fields in
readingspropertystringlabelstringopsobject[]2 fields in
opsopstringlabelstring
exampleobjectOne reading, compared.
sensorandopmust come from/named-conditions/sensors.5 fields in
exampleidstringAny stable string. Generated if you leave it out.
sensorstring requiredWhat to read, e.g.
clock,weekday,session,field,trait.propertystringWHICH reading, for a sensor that has several (the session's
statusvs itsstart). Omit for a sensor with one.opstring requiredThe comparison, e.g.
after,is,in.valueobjectOperator-specific, e.g.
{ "time": "18:00" }.
curl "https://www.wunderframe.com/api/v1/named-conditions/sensors" \
-H "Authorization: Bearer $WUNDERFRAME_API_KEY"{
"sensors": [
{
"sensor": "session",
"label": "The live session",
"readings": [
{
"property": "status",
"label": "where it is",
"ops": [
{
"op": "is",
"label": "is"
},
{
"op": "is_not",
"label": "is not"
}
],
"example": {
"sensor": "session",
"property": "status",
"op": "is",
"value": {
"status": "live"
}
}
}
]
}
]
}Error example
{
"error": {
"code": "unauthorized",
"message": "Missing or invalid API key."
}
}Get a named condition
/named-conditions/{key} rulesParameters
keystring required pathThe named condition’s key.
Responses
- 200 The named condition.
- 401 Missing or invalid API key.
- 403 The key lacks the scope, or the role is read-only.
- 404 Not found in this workspace.
Response fields (200)
keystring requiredLowercase letters, digits and underscores. THE ADDRESS: rules store the key, so renaming means moving every reference.
labelstring requiredWhat a person calls it. Defaults to the key.
descriptionstringWhat it means, in one line.
matchstring requiredHow the top-level entries combine. Default
all.One of
all,anywhenobject[] requiredAt least one entry.
reads_asstring read-onlyThe whole thing as a sentence.
created_atinteger read-onlyupdated_atinteger read-only
curl "https://www.wunderframe.com/api/v1/named-conditions/friday_evening" \
-H "Authorization: Bearer $WUNDERFRAME_API_KEY"{
"key": "friday_evening",
"label": "Friday evening",
"description": "After six, at the end of the week.",
"match": "all",
"when": [
{
"id": "c1",
"sensor": "clock",
"op": "after",
"value": {
"time": "18:00"
}
},
{
"id": "g1",
"all": "any",
"when": [
{
"id": "c2",
"sensor": "weekday",
"op": "in",
"value": {
"days": [
5
]
}
},
{
"id": "c3",
"sensor": "weekday",
"op": "in",
"value": {
"days": [
6
]
}
}
]
}
],
"reads_as": "the time is from 18:00 and (the weekday is Fri or the weekday is Sat)"
}Error example
{
"error": {
"code": "unauthorized",
"message": "Missing or invalid API key."
}
}Create or replace a named condition
/named-conditions/{key} rulesIdempotent by key, so a system can sync its own vocabulary by replaying the same calls. A key in the body must match the path.
Parameters
keystring required pathThe named condition’s key.
Request body required
keystring requiredLowercase letters, digits and underscores. THE ADDRESS: rules store the key, so renaming means moving every reference.
labelstring requiredWhat a person calls it. Defaults to the key.
descriptionstringWhat it means, in one line.
matchstring requiredHow the top-level entries combine. Default
all.One of
all,anywhenobject[] requiredAt least one entry.
Responses
- 200 The saved named condition.
- 400 The request is invalid —
details.fieldnames the field when there is one. - 401 Missing or invalid API key.
- 403 The key lacks the scope, or the role is read-only.
Response fields (200)
keystring requiredLowercase letters, digits and underscores. THE ADDRESS: rules store the key, so renaming means moving every reference.
labelstring requiredWhat a person calls it. Defaults to the key.
descriptionstringWhat it means, in one line.
matchstring requiredHow the top-level entries combine. Default
all.One of
all,anywhenobject[] requiredAt least one entry.
reads_asstring read-onlyThe whole thing as a sentence.
created_atinteger read-onlyupdated_atinteger read-only
curl -X PUT "https://www.wunderframe.com/api/v1/named-conditions/friday_evening" \
-H "Authorization: Bearer $WUNDERFRAME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"label": "Friday evening",
"match": "all",
"when": [
{
"id": "c1",
"sensor": "clock",
"op": "after",
"value": {
"time": "18:00"
}
},
{
"id": "g1",
"all": "any",
"when": [
{
"id": "c2",
"sensor": "weekday",
"op": "in",
"value": {
"days": [
5
]
}
},
{
"id": "c3",
"sensor": "weekday",
"op": "in",
"value": {
"days": [
6
]
}
}
]
}
]
}'{
"key": "friday_evening",
"label": "Friday evening",
"description": "After six, at the end of the week.",
"match": "all",
"when": [
{
"id": "c1",
"sensor": "clock",
"op": "after",
"value": {
"time": "18:00"
}
},
{
"id": "g1",
"all": "any",
"when": [
{
"id": "c2",
"sensor": "weekday",
"op": "in",
"value": {
"days": [
5
]
}
},
{
"id": "c3",
"sensor": "weekday",
"op": "in",
"value": {
"days": [
6
]
}
}
]
}
],
"reads_as": "the time is from 18:00 and (the weekday is Fri or the weekday is Sat)"
}Error example
{
"error": {
"code": "invalid",
"message": "The request is invalid — `details.field` names the field when there is one."
}
}Delete a named condition
/named-conditions/{key} rulesA rule still referring to it simply stops holding — it never starts holding instead, so this cannot make a screen change by itself.
Parameters
keystring required pathThe named condition’s key.
Responses
- 204 Deleted.
- 401 Missing or invalid API key.
- 403 The key lacks the scope, or the role is read-only.
- 404 Not found in this workspace.
curl -X DELETE "https://www.wunderframe.com/api/v1/named-conditions/friday_evening" \
-H "Authorization: Bearer $WUNDERFRAME_API_KEY"204 — no body.
Error example
{
"error": {
"code": "unauthorized",
"message": "Missing or invalid API key."
}
}