{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nexus/json-schema/nexus-api-user-schema.json",
  "title": "ApiUser",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/nexus-openapi.json#/components/schemas/ApiUser",
  "required": [
    "source",
    "status",
    "userId"
  ],
  "type": "object",
  "properties": {
    "userId": {
      "minLength": 1,
      "type": "string",
      "description": "The userid which is required for login. This value cannot be changed."
    },
    "firstName": {
      "type": [
        "string",
        "null"
      ],
      "description": "The first name of the user."
    },
    "lastName": {
      "type": [
        "string",
        "null"
      ],
      "description": "The last name of the user."
    },
    "emailAddress": {
      "type": [
        "string",
        "null"
      ],
      "description": "The email address associated with the user.",
      "format": "email"
    },
    "source": {
      "minLength": 1,
      "type": "string",
      "description": "The source of the user. When creating user, if the source is \"default\", the local Nexus Security User will be created. If the source is anything but \"default\" (i.e., LDAP or SAML), a local LdapUser (or SamlUser) will be created and have the listed roles assigned to that user."
    },
    "status": {
      "type": "string",
      "description": "The user's status, e.g. active or disabled.",
      "enum": [
        "active",
        "locked",
        "disabled",
        "changepassword"
      ]
    },
    "readOnly": {
      "type": "boolean",
      "description": "Indicates whether the user's properties could be modified by the Nexus Repository Manager. When false only roles are considered during update."
    },
    "roles": {
      "uniqueItems": true,
      "type": "array",
      "description": "The roles which the user has been assigned within Nexus.",
      "items": {
        "type": "string",
        "description": "The roles which the user has been assigned within Nexus."
      }
    },
    "externalRoles": {
      "uniqueItems": true,
      "type": "array",
      "description": "The roles which the user has been assigned in an external source, e.g. LDAP group. These cannot be changed within the Nexus Repository Manager.",
      "items": {
        "type": "string",
        "description": "The roles which the user has been assigned in an external source, e.g. LDAP group. These cannot be changed within the Nexus Repository Manager."
      }
    }
  }
}