Preferanser

Hva husholdningen liker, og hva den ikke liker.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

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

List the household's food likes and dislikes, declared and learned

Parametre

NavnHvorTypePåkrevdBeskrivelse
householdIdpathstring (uuid)Påkrevd—

Svar

200OK
application/jsonFoodPreferenceResponse[]
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/preferences"

Eksempel på svar

200application/json
[
  {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "householdId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "householdMemberId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "subjectType": "Ingredient",
    "subject": "string",
    "sentiment": "Like",
    "source": "UserDeclared",
    "confidence": 0,
    "createdAt": "2026-09-07T16:30:00Z",
    "updatedAt": "2026-09-07T16:30:00Z"
  }
]
POST/api/v1/households/{householdId}/preferences

Declare a like or dislike for the whole household or one person

Adults only; a Junior member gets 403. householdMemberId null means the whole household. 404 when the person is not in this household. Preferences made here carry source UserDeclared; learned ones come from Bryti.

Parametre

NavnHvorTypePåkrevdBeskrivelse
householdIdpathstring (uuid)Påkrevd—

Forespørselskropp

application/jsonPåkrevdCreateFoodPreferenceRequest

Svar

201Created
application/jsonFoodPreferenceResponse
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/preferences" \
  -H "Content-Type: application/json" \
  -d '{"householdMemberId":"3fa85f64-5717-4562-b3fc-2c963f66afa6","subjectType":"Ingredient","subject":"string","sentiment":"Like"}'

Eksempel på svar

201application/json
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "householdId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "householdMemberId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "subjectType": "Ingredient",
  "subject": "string",
  "sentiment": "Like",
  "source": "UserDeclared",
  "confidence": 0,
  "createdAt": "2026-09-07T16:30:00Z",
  "updatedAt": "2026-09-07T16:30:00Z"
}
PATCH/api/v1/households/{householdId}/preferences/{preferenceId}

Change a preference's subject, subject type or sentiment

Adults only; a Junior member gets 403. The person it belongs to cannot be changed here — delete it and add a new one.

Parametre

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

Forespørselskropp

application/jsonPåkrevdUpdateFoodPreferenceRequest

Svar

200OK
application/jsonFoodPreferenceResponse
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/preferences/3fa85f64-5717-4562-b3fc-2c963f66afa6" \
  -H "Content-Type: application/json" \
  -d '{"subjectType":"Ingredient","subject":"string","sentiment":"Like"}'

Eksempel på svar

200application/json
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "householdId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "householdMemberId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "subjectType": "Ingredient",
  "subject": "string",
  "sentiment": "Like",
  "source": "UserDeclared",
  "confidence": 0,
  "createdAt": "2026-09-07T16:30:00Z",
  "updatedAt": "2026-09-07T16:30:00Z"
}
DELETE/api/v1/households/{householdId}/preferences/{preferenceId}

Remove a food preference

Adults only; a Junior member gets 403.

Parametre

NavnHvorTypePåkrevdBeskrivelse
householdIdpathstring (uuid)Påkrevd—
preferenceIdpathstring (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/preferences/3fa85f64-5717-4562-b3fc-2c963f66afa6"

Skjema

CreateFoodPreferenceRequest

FeltTypePåkrevd
householdMemberIdstring (uuid) | nullPåkrevd
subjectTypePreferenceSubjectTypePåkrevd
subjectstringPåkrevd
sentimentPreferenceSentimentPåkrevd

FoodPreferenceResponse

FeltTypePåkrevd
idstring (uuid)Påkrevd
householdIdstring (uuid)Påkrevd
householdMemberIdstring (uuid) | nullPåkrevd
subjectTypePreferenceSubjectTypePåkrevd
subjectstringPåkrevd
sentimentPreferenceSentimentPåkrevd
sourcePreferenceSourcePåkrevd
confidencenumber (double)Påkrevd
createdAtstring (date-time)Påkrevd
updatedAtstring (date-time)Påkrevd

PreferenceSentiment

Type

Verdier

LikeDislikeStrongDislike

PreferenceSource

Type

Verdier

UserDeclaredLearned

PreferenceSubjectType

Type

Verdier

IngredientCategoryDishTexturePreparationTaste

ProblemDetails

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

UpdateFoodPreferenceRequest

FeltTypePåkrevd
subjectTypePreferenceSubjectTypePåkrevd
subjectstringPåkrevd
sentimentPreferenceSentimentPåkrevd