Regler

Husholdningens regler for måltidene, som ukeplanen tar hensyn til.6 operasjoner

Hoder på hvert svar

Hvert svar på denne siden har disse hodene.
X-Trace-Id
— The W3C trace id of this request — the same id in the log and in the traceId of a problem. Quote it when reporting.
Server-Timing
— Where the time went: total, db;dur=…;desc="N queries", and every step the handler named (ADR-163).
X-Diagnostics
— Only when the request asked with X-Diagnostics: 1 or ?diagnostics=1: the same breakdown as one JSON object, with the trace id (ADR-163).

Operasjoner

GET/api/v1/households/{householdId}/rules

List the household's meal rules

Parametre

NavnHvorTypePåkrevdBeskrivelse
householdIdpathstring (uuid)Påkrevd—

Svar

200OK
application/jsonMealRuleResponse[]
401No session, or the session is no longer valid.
application/problem+jsonProblemDetails
426The build named in X-App-Version is below its platform's version floor (ADR-070). Problem type app-version-unsupported; the only way forward is the store. Callers without the header are never turned away.
application/problem+jsonProblemDetails
429Too many calls in the window; Retry-After says how long.
application/problem+jsonProblemDetails
Hoder
Retry-After
— Seconds to wait when a rate limit answered, or an HTTP date when the household's AI is paused. Absent when the household's AI quota for the period is used up — that resets by itself.

Eksempel

curl -b "bryti_session=…" \
  "https://bryti.app/api/v1/households/3fa85f64-5717-4562-b3fc-2c963f66afa6/rules"

Eksempel på svar

200application/json
[
  {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "householdId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "kind": "CategoryFrequency",
    "strength": "Hard",
    "scope": "Permanent",
    "startDate": "2026-09-07",
    "endDate": "2026-09-07",
    "source": "UserDeclared",
    "payload": {},
    "createdAt": "2026-09-07T16:30:00Z",
    "updatedAt": "2026-09-07T16:30:00Z"
  }
]
POST/api/v1/households/{householdId}/rules

Add a meal rule

Adults only; a Junior member gets 403. payload is a union on kind: CategoryFrequency, CategoryExcludedDays, CategoryOnDay, MaximumActiveCookingTime, DinnerTimeOnWeekday, PriceClassOnDays or RepeatAfterDays.

Parametre

NavnHvorTypePåkrevdBeskrivelse
householdIdpathstring (uuid)Påkrevd—

Forespørselskropp

application/jsonPåkrevdCreateMealRuleRequest

Svar

201Created
application/jsonMealRuleResponse
400Bad Request
application/problem+jsonProblemDetails
401No session, or the session is no longer valid.
application/problem+jsonProblemDetails
404Not Found
application/problem+jsonProblemDetails
426The build named in X-App-Version is below its platform's version floor (ADR-070). Problem type app-version-unsupported; the only way forward is the store. Callers without the header are never turned away.
application/problem+jsonProblemDetails
429Too many calls in the window; Retry-After says how long.
application/problem+jsonProblemDetails
Hoder
Retry-After
— Seconds to wait when a rate limit answered, or an HTTP date when the household's AI is paused. Absent when the household's AI quota for the period is used up — that resets by itself.

Eksempel

curl -b "bryti_session=…" \
  -X POST \
  "https://bryti.app/api/v1/households/3fa85f64-5717-4562-b3fc-2c963f66afa6/rules" \
  -H "Content-Type: application/json" \
  -d '{"payload":{},"strength":"Hard","scope":"Permanent","startDate":"2026-09-07","endDate":"2026-09-07"}'

Eksempel på svar

201application/json
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "householdId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "kind": "CategoryFrequency",
  "strength": "Hard",
  "scope": "Permanent",
  "startDate": "2026-09-07",
  "endDate": "2026-09-07",
  "source": "UserDeclared",
  "payload": {},
  "createdAt": "2026-09-07T16:30:00Z",
  "updatedAt": "2026-09-07T16:30:00Z"
}
GET/api/v1/households/{householdId}/rules/defaults

Get the national-guideline default rules and whether they apply right now

Defaults for the household's country (source Helsedirektoratet), with synthetic ids and never stored. Active while the household has no frequency rules of its own.

Parametre

NavnHvorTypePåkrevdBeskrivelse
householdIdpathstring (uuid)Påkrevd—

Svar

200OK
application/jsonDefaultRulesResponse
401No session, or the session is no longer valid.
application/problem+jsonProblemDetails
404Not Found
application/problem+jsonProblemDetails
426The build named in X-App-Version is below its platform's version floor (ADR-070). Problem type app-version-unsupported; the only way forward is the store. Callers without the header are never turned away.
application/problem+jsonProblemDetails
429Too many calls in the window; Retry-After says how long.
application/problem+jsonProblemDetails
Hoder
Retry-After
— Seconds to wait when a rate limit answered, or an HTTP date when the household's AI is paused. Absent when the household's AI quota for the period is used up — that resets by itself.

Eksempel

curl -b "bryti_session=…" \
  "https://bryti.app/api/v1/households/3fa85f64-5717-4562-b3fc-2c963f66afa6/rules/defaults"

Eksempel på svar

200application/json
{
  "active": false,
  "source": "string",
  "rules": [
    {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "householdId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "kind": {},
      "strength": {},
      "scope": {},
      "startDate": "2026-09-07",
      "endDate": "2026-09-07",
      "source": {},
      "payload": {},
      "createdAt": "2026-09-07T16:30:00Z",
      "updatedAt": "2026-09-07T16:30:00Z"
    }
  ]
}
POST/api/v1/households/{householdId}/rules/parse

Turn a sentence into rule suggestions without saving anything

Adults only; a Junior member gets 403. «Fisk to ganger i uken, men ikke fredag» comes back as proposals, each with the CreateMealRuleRequest that files it — nothing is stored until the household POSTs it (#418). An empty sentence, or one with no rule in it, answers an empty list. Costs one chat turn of credits; 429 with code quota_exceeded when the household's AI allowance is used up.

Parametre

NavnHvorTypePåkrevdBeskrivelse
householdIdpathstring (uuid)Påkrevd—

Forespørselskropp

application/jsonPåkrevdParseRulesRequest

Svar

200OK
application/jsonParseRulesResponse
400Bad Request
application/problem+jsonProblemDetails
401No session, or the session is no longer valid.
application/problem+jsonProblemDetails
404Not Found
application/problem+jsonProblemDetails
426The build named in X-App-Version is below its platform's version floor (ADR-070). Problem type app-version-unsupported; the only way forward is the store. Callers without the header are never turned away.
application/problem+jsonProblemDetails
429Too Many Requests
application/problem+jsonProblemDetails
Hoder
Retry-After
— Seconds to wait when a rate limit answered, or an HTTP date when the household's AI is paused. Absent when the household's AI quota for the period is used up — that resets by itself.

Eksempel

curl -b "bryti_session=…" \
  -X POST \
  "https://bryti.app/api/v1/households/3fa85f64-5717-4562-b3fc-2c963f66afa6/rules/parse" \
  -H "Content-Type: application/json" \
  -d '{"text":"string"}'

Eksempel på svar

200application/json
{
  "proposals": [
    {
      "summary": "string",
      "request": {}
    }
  ],
  "leftoverDinners": {
    "summary": "string",
    "enabled": false,
    "askedEveryDays": 0
  },
  "unheard": [
    "string"
  ]
}
PATCH/api/v1/households/{householdId}/rules/{ruleId}

Replace a meal rule's payload, strength, scope and dates

Adults only; a Junior member gets 403. A full replacement despite the PATCH verb: every field is written.

Parametre

NavnHvorTypePåkrevdBeskrivelse
householdIdpathstring (uuid)Påkrevd—
ruleIdpathstring (uuid)Påkrevd—

Forespørselskropp

application/jsonPåkrevdUpdateMealRuleRequest

Svar

200OK
application/jsonMealRuleResponse
400Bad Request
application/problem+jsonProblemDetails
401No session, or the session is no longer valid.
application/problem+jsonProblemDetails
404Not Found
application/problem+jsonProblemDetails
426The build named in X-App-Version is below its platform's version floor (ADR-070). Problem type app-version-unsupported; the only way forward is the store. Callers without the header are never turned away.
application/problem+jsonProblemDetails
429Too many calls in the window; Retry-After says how long.
application/problem+jsonProblemDetails
Hoder
Retry-After
— Seconds to wait when a rate limit answered, or an HTTP date when the household's AI is paused. Absent when the household's AI quota for the period is used up — that resets by itself.

Eksempel

curl -b "bryti_session=…" \
  -X PATCH \
  "https://bryti.app/api/v1/households/3fa85f64-5717-4562-b3fc-2c963f66afa6/rules/3fa85f64-5717-4562-b3fc-2c963f66afa6" \
  -H "Content-Type: application/json" \
  -d '{"payload":{},"strength":"Hard","scope":"Permanent","startDate":"2026-09-07","endDate":"2026-09-07"}'

Eksempel på svar

200application/json
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "householdId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "kind": "CategoryFrequency",
  "strength": "Hard",
  "scope": "Permanent",
  "startDate": "2026-09-07",
  "endDate": "2026-09-07",
  "source": "UserDeclared",
  "payload": {},
  "createdAt": "2026-09-07T16:30:00Z",
  "updatedAt": "2026-09-07T16:30:00Z"
}
DELETE/api/v1/households/{householdId}/rules/{ruleId}

Remove a meal rule

Adults only; a Junior member gets 403.

Parametre

NavnHvorTypePåkrevdBeskrivelse
householdIdpathstring (uuid)Påkrevd—
ruleIdpathstring (uuid)Påkrevd—

Svar

204No Content
401No session, or the session is no longer valid.
application/problem+jsonProblemDetails
404Not Found
application/problem+jsonProblemDetails
426The build named in X-App-Version is below its platform's version floor (ADR-070). Problem type app-version-unsupported; the only way forward is the store. Callers without the header are never turned away.
application/problem+jsonProblemDetails
429Too many calls in the window; Retry-After says how long.
application/problem+jsonProblemDetails
Hoder
Retry-After
— Seconds to wait when a rate limit answered, or an HTTP date when the household's AI is paused. Absent when the household's AI quota for the period is used up — that resets by itself.

Eksempel

curl -b "bryti_session=…" \
  -X DELETE \
  "https://bryti.app/api/v1/households/3fa85f64-5717-4562-b3fc-2c963f66afa6/rules/3fa85f64-5717-4562-b3fc-2c963f66afa6"

Skjema

CreateMealRuleRequest

FeltTypePåkrevd
payloadMealRulePayloadDtoPåkrevd
strengthRuleStrengthPåkrevd
scopeRuleScopePåkrevd
startDatestring (date) | nullPåkrevd
endDatestring (date) | nullPåkrevd

DefaultRulesResponse

FeltTypePåkrevd
activebooleanPåkrevd
sourcestringPåkrevd
rulesMealRuleResponse[]Påkrevd

MealCategory

Type

Verdier

FishMeatPoultryVegetarianVeganSoupPastaTacoLeftoversOther

MealRuleKind

Type

Verdier

CategoryFrequencyCategoryExcludedDaysCategoryOnDayMaximumActiveCookingTimeDinnerTimeOnWeekdayPriceClassOnDaysRepeatAfterDays

MealRulePayloadDto

Type

MealRulePayloadDtoCategoryExcludedDaysRulePayload

FeltTypePåkrevd
kind"CategoryExcludedDays"—
categoryMealCategoryPåkrevd
excludedWeekdaysWeekday[]Påkrevd

MealRulePayloadDtoCategoryFrequencyRulePayload

FeltTypePåkrevd
kind"CategoryFrequency"—
categoryMealCategoryPåkrevd
minimumPerWeekinteger (int32)Påkrevd
maximumPerWeekinteger (int32)Påkrevd

MealRulePayloadDtoCategoryOnDayRulePayload

FeltTypePåkrevd
kind"CategoryOnDay"—
categoryMealCategoryPåkrevd
weekdayWeekday | nullPåkrevd
specificDatestring (date) | nullPåkrevd

MealRulePayloadDtoDinnerTimeOnWeekdayRulePayload

FeltTypePåkrevd
kind"DinnerTimeOnWeekday"—
timestringPåkrevd
weekdaysWeekday[]Påkrevd

MealRulePayloadDtoMaximumActiveCookingTimeRulePayload

FeltTypePåkrevd
kind"MaximumActiveCookingTime"—
minutesinteger (int32)Påkrevd
weekdaysWeekday[]Påkrevd
specificDatestring (date) | nullPåkrevd

MealRulePayloadDtoPriceClassOnDaysRulePayload

FeltTypePåkrevd
kind"PriceClassOnDays"—
ceilingPriceCeilingPåkrevd
weekdaysWeekday[]Påkrevd

MealRulePayloadDtoRepeatAfterDaysRulePayload

FeltTypePåkrevd
kind"RepeatAfterDays"—
daysinteger (int32)Påkrevd

MealRuleResponse

FeltTypePåkrevd
idstring (uuid)Påkrevd
householdIdstring (uuid)Påkrevd
kindMealRuleKindPåkrevd
strengthRuleStrengthPåkrevd
scopeRuleScopePåkrevd
startDatestring (date) | nullPåkrevd
endDatestring (date) | nullPåkrevd
sourceRuleSourcePåkrevd
payloadMealRulePayloadDtoPåkrevd
createdAtstring (date-time)Påkrevd
updatedAtstring (date-time)Påkrevd

ParsedLeftoverDinners

FeltTypePåkrevd
summarystringPåkrevd
enabledbooleanPåkrevd
askedEveryDaysinteger (int32) | nullPåkrevd

ParsedRuleProposal

FeltTypePåkrevd
summarystringPåkrevd
requestCreateMealRuleRequestPåkrevd

ParseRulesRequest

FeltTypePåkrevd
textstringPåkrevd

ParseRulesResponse

FeltTypePåkrevd
proposalsParsedRuleProposal[]Påkrevd
leftoverDinnersParsedLeftoverDinners | nullPåkrevd
unheardstring[]Påkrevd

PriceCeiling

Type

Verdier

CheapCheapOrMid

ProblemDetails

FeltTypePåkrevd
typestring | null—
titlestring | null—
statusinteger (int32) | null—
detailstring | null—
instancestring | null—
codestring | null—

RuleScope

Type

Verdier

PermanentDateRangeSpecificDate

RuleSource

Type

Verdier

UserDeclaredSystemDefaultLearned

RuleStrength

Type

Verdier

HardSoft

UpdateMealRuleRequest

FeltTypePåkrevd
payloadMealRulePayloadDtoPåkrevd
strengthRuleStrengthPåkrevd
scopeRuleScopePåkrevd
startDatestring (date) | nullPåkrevd
endDatestring (date) | nullPåkrevd

Weekday

Type

Verdier

SundayMondayTuesdayWednesdayThursdayFridaySaturday