{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/clarafintech/main/json-schema/clarafintech-update-user-request-v3-schema.json",
  "title": "UpdateUserRequestV3",
  "x-generated": "2026-10-08",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/clarafintech-openapi.json#/components/schemas/UpdateUserRequestV3",
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "format": "email"
    },
    "name": {
      "type": "string"
    },
    "lastName": {
      "type": "string"
    },
    "lada": {
      "type": "string",
      "description": "Must be provided together with mobilePhone when changing phone fields."
    },
    "mobilePhone": {
      "type": "string",
      "description": "Must be provided together with lada when changing phone fields."
    },
    "role": {
      "$ref": "#/$defs/UserRole"
    },
    "locationUuid": {
      "type": "string",
      "format": "uuid"
    },
    "erpId": {
      "type": "string"
    },
    "taxIdentifier": {
      "type": "string",
      "description": "Tax identifier. Documented country lengths: MX 11 or 13, CO 7-10, BR 11."
    },
    "managerUuid": {
      "type": "string",
      "format": "uuid"
    },
    "groupsToAdd": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid"
      }
    },
    "groupsToRemove": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid"
      }
    },
    "cleanGroups": {
      "type": "boolean",
      "default": false
    }
  },
  "additionalProperties": false,
  "$defs": {
    "UserRole": {
      "type": "string",
      "enum": [
        "EMPLOYEE",
        "MANAGER",
        "COMPANY_OWNER",
        "BOOKKEEPER"
      ]
    }
  }
}