Hendelser

Hendelser i kalenderen som endrer hva en dag trenger.7 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}/events

Read the household's meal events a page at a time, earliest first

Guests, eating out, somebody away, an activity — whatever changes a day's table or dinner time. from and to are inclusive and both optional. ?limit= is 1–100, 50 by default. Each page hands back a nextCursor — give it back as ?cursor= for the next page; null on the last. A cursor nobody handed out is a 400. total is null: no surface counts evenings, and counting them would cost a second pass.

Parametre

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

Svar

200OK
application/jsonPagedMealEventResponse
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/events"

Eksempel på svar

200application/json
{
  "items": [
    {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "householdId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "date": "2026-09-07",
      "eventType": {},
      "servingTime": "string",
      "availableCookingMinutes": 0,
      "notes": "string",
      "participants": [
        {}
      ],
      "createdAt": "2026-09-07T16:30:00Z",
      "updatedAt": "2026-09-07T16:30:00Z"
    }
  ],
  "nextCursor": "string",
  "total": 0
}
POST/api/v1/households/{householdId}/events

Add a meal event for a day: guests, eating out, somebody away, and so on

Adults, and a Junior member for one thing only: her own presence (PersonAbsent/PersonPresent for her own linked person, exactly one participant row, no serving time, cooking minutes, notes or guests, within 14 days). Anything else from a Junior is 403 junior_forbidden. The day's portions on the week's plan are re-derived for the new table. Eating out or travel closes the day and shrinks the week's shopping list on the spot (#1708, ADR-143); guests make the list stale instead, and the week asks before buying more (#340). A guest group's avoids — «nøtter», «melk», in the household's own words — bind the whole table that day as hard allergy constraints: the planner, the candidate gate, the serving notes and the tips all read them (#3109). A blank word, one over 200 characters or more than 20 of them is a 400.

Parametre

NavnHvorTypePåkrevdBeskrivelse
householdIdpathstring (uuid)Påkrevd—

Forespørselskropp

application/jsonPåkrevdCreateMealEventRequest

Svar

201Created
application/jsonMealEventResponse
400Bad Request
application/problem+jsonProblemDetails
401No session, or the session is no longer valid.
application/problem+jsonProblemDetails
403Forbidden
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/events" \
  -H "Content-Type: application/json" \
  -d '{"date":"2026-09-07","eventType":"Guests","servingTime":"string","availableCookingMinutes":0,"notes":"string","guests":[{"guestType":{},"guestCount":0,"dietaryNotes":"string"}],"memberAttendance":[{"householdMemberId":"3fa85f64-5717-4562-b3fc-2c963f66afa6","isPresent":false,"dietaryNotes":"string"}]}'

Eksempel på svar

201application/json
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "householdId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "date": "2026-09-07",
  "eventType": "Guests",
  "servingTime": "string",
  "availableCookingMinutes": 0,
  "notes": "string",
  "participants": [
    {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "householdMemberId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "isPresent": false,
      "guestType": {},
      "guestCount": 0,
      "dietaryNotes": "string",
      "avoids": [
        "string"
      ]
    }
  ],
  "createdAt": "2026-09-07T16:30:00Z",
  "updatedAt": "2026-09-07T16:30:00Z"
}
POST/api/v1/households/{householdId}/events/run

Add a run of identical days — a trip, a weekend away — in one call

Adults only; a Junior member gets 403. One row per day in [from, through], all equal but for the date, written in a single transaction: either the whole run lands or none of it does. At most 31 days (400 beyond that, and 400 when through is before from). The rows come back in date order, and the reading side folds them into one card. Attendance and the week's shopping list are re-derived once for the run, not once per day (#2681, ADR-246).

Parametre

NavnHvorTypePåkrevdBeskrivelse
householdIdpathstring (uuid)Påkrevd—

Forespørselskropp

application/jsonPåkrevdCreateMealEventRunRequest

Svar

201Created
application/jsonMealEventResponse[]
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/events/run" \
  -H "Content-Type: application/json" \
  -d '{"from":"2026-09-07","through":"2026-09-07","eventType":"Guests","servingTime":"string","availableCookingMinutes":0,"notes":"string","guests":[{"guestType":{},"guestCount":0,"dietaryNotes":"string"}],"memberAttendance":[{"householdMemberId":"3fa85f64-5717-4562-b3fc-2c963f66afa6","isPresent":false,"dietaryNotes":"string"}]}'

Eksempel på svar

201application/json
[
  {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "householdId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "date": "2026-09-07",
    "eventType": "Guests",
    "servingTime": "string",
    "availableCookingMinutes": 0,
    "notes": "string",
    "participants": [
      {}
    ],
    "createdAt": "2026-09-07T16:30:00Z",
    "updatedAt": "2026-09-07T16:30:00Z"
  }
]
PATCH/api/v1/households/{householdId}/events/run

Rewrite a whole run: move it, change it, or shorten it, in one call

Adults only; a Junior member gets 403. days[i] is written on ids[i] — a full replacement, as the single-day PATCH is — and every id past the end of days is removed, which is how «Endre» shortens a trip. days is never longer than ids: a run cannot be extended (400, #2639/ADR-232). One transaction, so an id that is not this household's answers 404 with nothing written (#2681, ADR-246).

Parametre

NavnHvorTypePåkrevdBeskrivelse
householdIdpathstring (uuid)Påkrevd—

Forespørselskropp

application/jsonPåkrevdUpdateMealEventRunRequest

Svar

200OK
application/jsonMealEventResponse[]
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/events/run" \
  -H "Content-Type: application/json" \
  -d '{"ids":["3fa85f64-5717-4562-b3fc-2c963f66afa6"],"days":[{"date":"2026-09-07","eventType":{},"servingTime":"string","availableCookingMinutes":0,"notes":"string","guests":[{}],"memberAttendance":[{}]}]}'

Eksempel på svar

200application/json
[
  {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "householdId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "date": "2026-09-07",
    "eventType": "Guests",
    "servingTime": "string",
    "availableCookingMinutes": 0,
    "notes": "string",
    "participants": [
      {}
    ],
    "createdAt": "2026-09-07T16:30:00Z",
    "updatedAt": "2026-09-07T16:30:00Z"
  }
]
DELETE/api/v1/households/{householdId}/events/run

Remove a whole run and give its days back their usual table

Adults only; a Junior member gets 403. Two ways to say which days: repeat ids in the query (ids=…&ids=…) to remove exactly those rows, or give type with from and through and let the span be resolved. ids is a query parameter and not a body — unlike the run PATCH, which carries ids[] in its request — because a DELETE with a body is awkward in most HTTP clients (#2737). With ids there is nothing to resolve and no 409: an id that is not this household's answers 404 with nothing written, in one transaction, the same rule the PATCH keeps (#2681, ADR-246). Without ids the span is resolved to exactly one run with the identity the reading side groups by — same kind, serving time, cooking minutes, notes and party, on days with no hole between them. No run covering exactly those days is 404; more than one run inside them is 409 and nothing is removed, because a single «Fjern» must not take away something the reader never saw named. Neither ids nor a whole span is 400.

Parametre

NavnHvorTypePåkrevdBeskrivelse
householdIdpathstring (uuid)Påkrevd—
typequeryMealEventType——
fromquerystring (date)——
throughquerystring (date)——
idsquerystring (uuid)[]——

Svar

204No Content
400Bad Request
application/problem+jsonProblemDetails
401No session, or the session is no longer valid.
application/problem+jsonProblemDetails
404Not Found
application/problem+jsonProblemDetails
409Conflict
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.

Problemkoder

`code` i problemkroppen er den du forgreiner på. `detail` er engelsk, skrevet for loggen.

run_not_unique
— De dagene rommer mer enn én slik oppføring. Fjern dem én om gangen.

Eksempel

curl -b "bryti_session=…" \
  -X DELETE \
  "https://bryti.app/api/v1/households/3fa85f64-5717-4562-b3fc-2c963f66afa6/events/run"
PATCH/api/v1/households/{householdId}/events/{eventId}

Replace a meal event's date, type, time, notes and participants

Adults only; a Junior member gets 403. A full replacement despite the PATCH verb: every field is written and the participant list is rebuilt from the request — a guest group's avoids included, so leaving them out takes them away (#3109).

Parametre

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

Forespørselskropp

application/jsonPåkrevdUpdateMealEventRequest

Svar

200OK
application/jsonMealEventResponse
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/events/3fa85f64-5717-4562-b3fc-2c963f66afa6" \
  -H "Content-Type: application/json" \
  -d '{"date":"2026-09-07","eventType":"Guests","servingTime":"string","availableCookingMinutes":0,"notes":"string","guests":[{"guestType":{},"guestCount":0,"dietaryNotes":"string"}],"memberAttendance":[{"householdMemberId":"3fa85f64-5717-4562-b3fc-2c963f66afa6","isPresent":false,"dietaryNotes":"string"}]}'

Eksempel på svar

200application/json
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "householdId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "date": "2026-09-07",
  "eventType": "Guests",
  "servingTime": "string",
  "availableCookingMinutes": 0,
  "notes": "string",
  "participants": [
    {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "householdMemberId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "isPresent": false,
      "guestType": {},
      "guestCount": 0,
      "dietaryNotes": "string",
      "avoids": [
        "string"
      ]
    }
  ],
  "createdAt": "2026-09-07T16:30:00Z",
  "updatedAt": "2026-09-07T16:30:00Z"
}
DELETE/api/v1/households/{householdId}/events/{eventId}

Remove a meal event and give the day back its usual table

Adults, and a Junior member for her own presence only — an event of exactly the shape she may write (PersonAbsent/PersonPresent, her own linked person as the one participant, nothing else on it, within 14 days). Anything else from a Junior is 403 junior_forbidden.

Parametre

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

Svar

204No Content
401No session, or the session is no longer valid.
application/problem+jsonProblemDetails
403Forbidden
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/events/3fa85f64-5717-4562-b3fc-2c963f66afa6"

Skjema

CreateMealEventRequest

FeltTypePåkrevd
datestring (date)Påkrevd
eventTypeMealEventTypePåkrevd
servingTimestring | nullPåkrevd
availableCookingMinutesinteger (int32) | nullPåkrevd
notesstring | nullPåkrevd
guestsGuestGroupRequest[] | nullPåkrevd
memberAttendanceMemberAttendanceRequest[] | nullPåkrevd

CreateMealEventRunRequest

FeltTypePåkrevd
fromstring (date)Påkrevd
throughstring (date)Påkrevd
eventTypeMealEventTypePåkrevd
servingTimestring | nullPåkrevd
availableCookingMinutesinteger (int32) | nullPåkrevd
notesstring | nullPåkrevd
guestsGuestGroupRequest[] | nullPåkrevd
memberAttendanceMemberAttendanceRequest[] | nullPåkrevd

GuestGroupRequest

FeltTypePåkrevd
guestTypeGuestTypePåkrevd
guestCountinteger (int32)Påkrevd
dietaryNotesstring | nullPåkrevd
avoidsstring[] | null—

GuestType

Type

Verdier

AdultChildBaby

eller null

MealEventParticipantResponse

FeltTypePåkrevd
idstring (uuid)Påkrevd
householdMemberIdstring (uuid) | nullPåkrevd
isPresentbooleanPåkrevd
guestTypeGuestType | nullPåkrevd
guestCountinteger (int32)Påkrevd
dietaryNotesstring | nullPåkrevd
avoidsstring[]Påkrevd

MealEventResponse

FeltTypePåkrevd
idstring (uuid)Påkrevd
householdIdstring (uuid)Påkrevd
datestring (date)Påkrevd
eventTypeMealEventTypePåkrevd
servingTimestring | nullPåkrevd
availableCookingMinutesinteger (int32) | nullPåkrevd
notesstring | nullPåkrevd
participantsMealEventParticipantResponse[]Påkrevd
createdAtstring (date-time)Påkrevd
updatedAtstring (date-time)Påkrevd

MealEventType

Type

Verdier

GuestsEatingOutPersonAbsentPersonPresentActivityCelebrationTravelCustom

MemberAttendanceRequest

FeltTypePåkrevd
householdMemberIdstring (uuid)Påkrevd
isPresentbooleanPåkrevd
dietaryNotesstring | nullPåkrevd

PagedMealEventResponse

FeltTypePåkrevd
itemsMealEventResponse[]Påkrevd
nextCursorstring | nullPåkrevd
totalinteger (int32) | nullPåkrevd

ProblemDetails

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

UpdateMealEventRequest

FeltTypePåkrevd
datestring (date)Påkrevd
eventTypeMealEventTypePåkrevd
servingTimestring | nullPåkrevd
availableCookingMinutesinteger (int32) | nullPåkrevd
notesstring | nullPåkrevd
guestsGuestGroupRequest[] | nullPåkrevd
memberAttendanceMemberAttendanceRequest[] | nullPåkrevd

UpdateMealEventRunRequest

FeltTypePåkrevd
idsstring (uuid)[]Påkrevd
daysUpdateMealEventRequest[]Påkrevd