{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/stackit/main/json-schema/stackit-update-user-payload-schema.json",
  "title": "UpdateUserPayload",
  "x-generated": "2026-10-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/stackit-mongodb-flex-openapi.yml#/components/schemas/UpdateUserPayload",
  "properties": {
    "database": {
      "maxLength": 63,
      "minLength": 3,
      "pattern": "^[A-Za-z_][A-Za-z0-9-_]{1,61}[A-Za-z0-9_]$",
      "type": "string"
    },
    "roles": {
      "description": "The roles defined for a user. Currently only one role in the list is supported, therefore only the first role from this list is used. The *roles* attribute can contain the following values: 'read', 'readWrite', 'readAnyDatabase', 'readWriteAnyDatabase', 'stackitAdmin'. **The 'readAnyDatabase', 'readWriteAnyDatabase' and 'stackitAdmin' roles will always be created in the admin database.**",
      "items": {
        "$ref": "#/$defs/user.role"
      },
      "type": "array"
    }
  },
  "required": [
    "database",
    "roles"
  ],
  "type": "object",
  "$defs": {
    "user.role": {
      "description": "The user role for the instance. The valid values for this attribute are: 'read', 'readWrite', 'readAnyDatabase', 'readWriteAnyDatabase', 'stackitAdmin'.",
      "type": "string"
    }
  }
}