Middagsforslag

Middagene Bryti foreslår for en dag.4 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

POST/api/v1/households/{householdId}/candidates/generate

Put a day's new dinner suggestions in the planning queue

Adults only; a Junior member gets 403. Answers 202 with the run's id (ADR-289): the model call is a background job, GET plans/runs/{jobId} says where it stands, and GET candidates for the day has the suggestions once it is done. Costs credits and replaces the day's current candidates, except one a plan entry still points at. A run that ends in candidate_pool_in_plan — somebody planned the week over these very candidates while they were being replaced (#533) — says so on its status; read the day again and ask once more.

Parametre

NavnHvorTypePåkrevdBeskrivelse
householdIdpathstring (uuid)Påkrevd—

Forespørselskropp

application/jsonPåkrevdGenerateCandidatesRequest

Svar

202Accepted
application/jsonPlanRunAccepted
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/candidates/generate" \
  -H "Content-Type: application/json" \
  -d '{"date":"2026-09-07","category":"Fish"}'

Eksempel på svar

202application/json
{
  "jobId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "weekStart": "2026-09-07"
}
GET/api/v1/households/{householdId}/candidates

List the candidates generated for one day

date is required. What is missing from the pantry is recomputed on every read — no model call, no write. price is each dish's estimated kroner per portion and class (#3226), from the household's receipts, the store catalogue or the table.

Parametre

NavnHvorTypePåkrevdBeskrivelse
householdIdpathstring (uuid)Påkrevd—
datequerystring (date)Påkrevd—

Svar

200OK
application/jsonMealCandidateResponse[]
400The request could not be read as the route needs it: a body that is not the documented shape (a required field left out, a null where none is allowed, a value too long for its field), a parameter that does not parse, or a NUL character anywhere (#3540, #3541, #3543). Code validation_failed or value_too_long.
application/problem+jsonProblemDetails
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/candidates?date=2026-09-07"

Eksempel på svar

200application/json
[
  {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "householdId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "targetDate": "2026-09-07",
    "category": "Fish",
    "content": {
      "title": "string",
      "rationale": "string",
      "ingredients": [
        {}
      ],
      "steps": [
        "string"
      ],
      "activeMinutes": 0,
      "totalMinutes": 0,
      "portions": 0,
      "tags": [
        "string"
      ],
      "leftoverPotential": "string",
      "confidence": 0,
      "assumptions": [
        "string"
      ],
      "safetyWarnings": [
        "string"
      ]
    },
    "scores": {
      "key": 0
    },
    "createdAt": "2026-09-07T16:30:00Z"
  }
]
GET/api/v1/households/{householdId}/candidates/range

List the candidates for every day in a window of at most 92 days

One round-trip for a whole week (#1017); ordered by date, then by when each candidate was created. from and to are both required and the window may cover at most 92 days — a calendar read, not a page (#2977, ADR-292). A day's hand is a dozen dishes with their ingredients on each, so the window is what bounds the answer: three years of it was 2.4 MB.

Parametre

NavnHvorTypePåkrevdBeskrivelse
householdIdpathstring (uuid)Påkrevd—
fromquerystring (date)Påkrevd—
toquerystring (date)Påkrevd—

Svar

200OK
application/jsonMealCandidateResponse[]
400Bad Request
application/problem+jsonProblemDetails
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/candidates/range?from=2026-09-07&to=2026-09-07"

Eksempel på svar

200application/json
[
  {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "householdId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "targetDate": "2026-09-07",
    "category": "Fish",
    "content": {
      "title": "string",
      "rationale": "string",
      "ingredients": [
        {}
      ],
      "steps": [
        "string"
      ],
      "activeMinutes": 0,
      "totalMinutes": 0,
      "portions": 0,
      "tags": [
        "string"
      ],
      "leftoverPotential": "string",
      "confidence": 0,
      "assumptions": [
        "string"
      ],
      "safetyWarnings": [
        "string"
      ]
    },
    "scores": {
      "key": 0
    },
    "createdAt": "2026-09-07T16:30:00Z"
  }
]
GET/api/v1/households/{householdId}/candidates/use-up

Read the use-up section for one day: the swaps that would use what is running out, as the day's Swap panel shows them.

The bundle is the same as the week's (ADR-173): what remains after the planned use this week and next, and the fewest changes that would use it. This is the day's slice of it. Read-only; applying goes through the home use-up endpoints.

Parametre

NavnHvorTypePåkrevdBeskrivelse
householdIdpathstring (uuid)Påkrevd—
datequerystring (date)Påkrevd—

Svar

200OK
application/jsonHomeUseUpBundleQuestion
400The request could not be read as the route needs it: a body that is not the documented shape (a required field left out, a null where none is allowed, a value too long for its field), a parameter that does not parse, or a NUL character anywhere (#3540, #3541, #3543). Code validation_failed or value_too_long.
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=…" \
  "https://bryti.app/api/v1/households/3fa85f64-5717-4562-b3fc-2c963f66afa6/candidates/use-up?date=2026-09-07"

Eksempel på svar

200application/json
{
  "bundleId": "string",
  "changes": [
    {
      "id": "string",
      "day": "2026-09-07",
      "kind": {},
      "recipeId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "title": "string",
      "uses": [
        {}
      ],
      "handsBack": [
        {}
      ],
      "activeMinutes": 0,
      "shoppingDelta": 0
    }
  ],
  "coveredCount": 0,
  "urgentCount": 0,
  "notDinner": [
    {
      "foodKey": "string",
      "displayName": "string",
      "reason": {}
    }
  ]
}

Skjema

CandidateContent

FeltTypePåkrevd
titlestringPåkrevd
rationalestringPåkrevd
ingredientsCandidateIngredient[]Påkrevd
stepsstring[]Påkrevd
activeMinutesinteger (int32)Påkrevd
totalMinutesinteger (int32)Påkrevd
portionsinteger (int32)Påkrevd
tagsstring[]Påkrevd
leftoverPotentialstringPåkrevd
confidencenumber (double)Påkrevd
assumptionsstring[]Påkrevd
safetyWarningsstring[]Påkrevd
nutritionCandidateNutrition | null—
timersCandidateStepTimer[] | null—
sectionsCandidateSection[] | null—

CandidateIngredient

FeltTypePåkrevd
foodKeystringPåkrevd
displayNamestringPåkrevd
quantitynumber (double)Påkrevd
unitstringPåkrevd
isOptionalbooleanPåkrevd
missingbooleanPåkrevd
displayQuantitynumber (double) | null—
displayUnitstring | null—

CandidateNutrition

FeltTypePåkrevd
kcalPerPortioninteger (int32)Påkrevd
proteinGramsnumber (double)Påkrevd
fibreGramsnumber (double)Påkrevd
addedSugarGramsnumber (double)Påkrevd
saltGramsnumber (double)Påkrevd
fruitVegPortionsnumber (double)Påkrevd
coveragenumber (double)Påkrevd

CandidatePrice

FeltTypePåkrevd
classPriceClassPåkrevd
perPortionNoknumber (double) | nullPåkrevd
sourcePriceSourcePåkrevd
coveragenumber (double)Påkrevd

CandidateSection

FeltTypePåkrevd
namestring | nullPåkrevd
kindRecipeSectionKindPåkrevd
ingredientsCandidateIngredient[]Påkrevd
stepsstring[]Påkrevd
timersCandidateStepTimer[] | nullPåkrevd
sourceRecipeIdstring (uuid) | nullPåkrevd
sourceRecipeTitlestring | nullPåkrevd

CandidateStepTimer

FeltTypePåkrevd
stepinteger (int32)Påkrevd
minutesinteger (int32)Påkrevd
namestringPåkrevd

GenerateCandidatesRequest

FeltTypePåkrevd
datestring (date)Påkrevd
categoryMealCategory | nullPåkrevd

HomeUseUpBundleQuestion

FeltTypePåkrevd
bundleIdstringPåkrevd
changesHomeUseUpChange[]Påkrevd
coveredCountinteger (int32)Påkrevd
urgentCountinteger (int32)Påkrevd
notDinnerHomeUseUpFood[]Påkrevd
nextWeekHomeUseUpNextWeek | null—

HomeUseUpChange

FeltTypePåkrevd
idstringPåkrevd
daystring (date)Påkrevd
kindHomeUseUpChangeKindPåkrevd
recipeIdstring (uuid) | nullPåkrevd
titlestringPåkrevd
usesHomeUseUpUse[]Påkrevd
handsBackHomeUseUpUse[]Påkrevd
activeMinutesinteger (int32)Påkrevd
shoppingDeltainteger (int32)Påkrevd

HomeUseUpChangeKind

Type

Verdier

SwapDishAdaptIngredientFillOpenDay

HomeUseUpFood

FeltTypePåkrevd
foodKeystringPåkrevd
displayNamestringPåkrevd
reasonHomeUseUpFoodReason—

HomeUseUpFoodReason

Type

Verdier

BreadFoodNoRecipeLeftoversNoChangeInTime

Standard "BreadFood"

HomeUseUpNextWeek

FeltTypePåkrevd
changeCountinteger (int32)Påkrevd
foodNamesstring[]Påkrevd

HomeUseUpUse

FeltTypePåkrevd
foodKeystringPåkrevd
displayNamestringPåkrevd
quantitynumber (double) | nullPåkrevd
unitstring | nullPåkrevd
usesMostOfItboolean—

MealCandidateResponse

FeltTypePåkrevd
idstring (uuid)Påkrevd
householdIdstring (uuid)Påkrevd
targetDatestring (date)Påkrevd
categoryMealCategoryPåkrevd
contentCandidateContentPåkrevd
scoresmapPåkrevd
createdAtstring (date-time)Påkrevd
recipeIdstring (uuid) | null—
imageUrlstring | null—
priceCandidatePrice | null—

MealCategory

Type

Verdier

FishMeatPoultryVegetarianVeganSoupPastaTacoLeftoversOther

PlanRunAccepted

FeltTypePåkrevd
jobIdstring (uuid)Påkrevd
weekStartstring (date)Påkrevd

PriceClass

Type

Verdier

CheapMidExpensive

PriceSource

Type

Verdier

ObservedCatalogueTableUnknown

ProblemDetails

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

RecipeSectionKind

Type

Verdier

OwnLinkedUnresolved