Skip to main content

Invalid preference

typehttps://docs.frem.sh/reference/api/errors/invalid-preference
HTTP status400 Bad Request

What it means

The preference value in the request body is not one of the accepted values.

These are Forgejo-native notification settings, so the accepted set is fixed and matches Forgejo’s own vocabulary exactly:

ValueEffect
enabledReceive all notification mail (Forgejo’s default).
onmentionReceive mail only when explicitly mentioned.
andyourownReceive mail for your own actions as well.
disabledReceive no notification mail.

Matching is case-sensitive: onmention is valid, onMention and ONMENTION are not.

What to do

Send one of the four values above, spelled in lower case.

curl -X PATCH \
  -H "Authorization: Bearer $FREMFORGE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"preference":"onmention"}' \
  https://frem.sh/_app/api/v1/orgs/<org>/members/<login>/forgejo-mail

Response shape

All fremforge API errors are RFC 9457 problem+json:

{
  "type": "https://docs.frem.sh/reference/api/errors/invalid-preference",
  "title": "Bad Request",
  "status": 400,
  "detail": "preference must be one of: enabled, onmention, andyourown, disabled."
}

Branch on type, not on title or detail - those are human-readable and may be reworded.