Skip to content

RoleProblem

The problem of a role change that breaks a rule (422, /api/v1/problems/invalid-role); reason says which. Another 422 (a malformed request) has none.

object
type
required

A URI that identifies the problem type, stable for clients to branch on. It is about:blank when the problem means no more than its HTTP status.

string format: uri-reference
title
required

A short summary of the problem type, localized from Accept-Language.

string
status
required

The HTTP status code.

integer
>= 400 <= 599
detail

An explanation of this occurrence, localized from Accept-Language.

string
request_id

The request ID (the X-Request-Id response header), for reporting the problem.

string
field

The member of the request that a 422 is about, by its name in the request: a property of the JSON body by its path (display_name, fields[].name, poll.options[1]), a form field, a query parameter, or a header (Idempotency-Key). detail then says what is wrong with its value without naming it, for the client to show beside that field. Absent when the problem is not about one member.

string
reason

Why a role change is refused. key: not 1 to 64 lowercase ASCII letters, digits, _, and -. key_taken: another role has the key. position: outside 0 to 999. permissions: an unknown permission, or one twice. builtin: admin changes only its badge, and neither admin nor moderator can be deleted. held: users hold the role. missing_permission: the change adds or removes permissions that the viewer’s roles do not grant (missing_permissions). badge_label: a badge label that is not 1 to 32 characters on one line. badge_color: an unknown badge color.

string
Allowed values: key key_taken position permissions builtin held missing_permission badge_label badge_color
missing_permissions

The permissions that the change needs and the viewer lacks, for missing_permission.

Array<string>
Allowed values: manage_reports manage_accounts manage_domains manage_rules manage_settings manage_roles manage_invites view_audit manage_jobs manage_login_recovery manage_custom_emojis manage_webhooks manage_announcements manage_finance view_finance manage_supporters create_custom_emojis manage_oauth_apps manage_service_closure start_voice_rooms manage_errors manage_login_providers create_invites keep_posts_longer create_articles create_events

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"request_id": "example",
"field": "example",
"reason": "key",
"missing_permissions": [
"manage_reports"
]
}

For LLMs and coding agents:llms.txt,llms-full.txt, llms-small.txt

Analytics on this site