Get a User by a user_id and tenant_id

GET /users/{userId}

Operation id: UserService_GetUser

Description

Permission Level: Read

Tags: UserService

Parameters

Path parameters

NameTypeRequiredDescription
userIdstringYesuser_id of the user to get details, Required: true

Query parameters

NameTypeRequiredDescription
domainstringNodomain of the user to fetch, Required: false
fieldMaskstringNoFieldMask to control what fields are to be returned, if empty assumes everything, Required: false Valid path names are names of each field in the UserResponse proto
identifierstringNoDEPRECATED - Use userId for your identifier regardless of identifier type. The identifier value used to retrieve the User. Required: false
identifierTypestringNoSpecifies the types of identifiers available to retrieve an User. Default: USER_ID, Required: false - USER_ID: DEFAULT VALUE: Searches for user based on the user_id field. - PLATFORM_USER_ID: Searches for the user based on the phenixUserId field.
scopestringNoscope of the user to fetch, Required: false
tenantIdstringNotenant of the user, Required: false

Security

  • Authorization (apiKey)
    • Bearer token

Responses

200 — A successful response.

Content type: application/json

default — An unexpected error response.

Content type: application/json

Response models

200 — A successful response.

Content type: application/json

Schema

PropertyTypeRequiredDescription
userIdstringNo
tenantIdstringNo
firstNamestringNo
lastNamestringNo
emailstringNo
locationstringNo
sitestringNo
departmentsstringNo
attributesarrayNo
workspacesarrayNo
userStatusstringNo
creationTimestring (date-time)No
lastUpdatedstring (date-time)No
batchIdstringNo
notificationPreferencesarrayNoUser notification preferences for different subsystems and scopes. If not present for a given subsystem/scope, it is assumed all notifications modes are enabled.
contactNumberstringNo
uniqueUserIdstringNoRandomly generated string at the time of creation. Should be used to reference a unique user by other services as user_id may contain PII.
claimsobjectNo
enabledScopesobjectNoScopes and status (enable, disable) for a user. Scope is optional. Typically applications will always pass their scope, but it is optional for admin purposes.
addressesarrayNo
contactNumbersarrayNo
rolesarrayNoThe user's roles. Includes nested roles. Flat list. Read only.
defaultLocalestringNo
primarySitestringNo
selectedDepartmentsarrayNo
licensesarrayNo
middleNamestringNoMiddle name of the user.
preferredNamestringNoPreferred Name of the user.
isClientbooleanNo
assignedRolesarrayNo
inheritedRolesarrayNo
siteMappingarrayNo
primarySelectedDepartmentsarrayNoThe selected departments that the user is assigned to. This is to support UI for getting the details part of the graphQL query. In V3, we can remove the existing selected_departments field and use this one instead.
userStatusLastUpdatedstring (date-time)No
{
  "type": "object",
  "properties": {
    "userId": {
      "type": "string"
    },
    "tenantId": {
      "type": "string"
    },
    "firstName": {
      "type": "string"
    },
    "lastName": {
      "type": "string"
    },
    "email": {
      "type": "string"
    },
    "location": {
      "type": "string"
    },
    "site": {
      "type": "string"
    },
    "departments": {
      "type": "string"
    },
    "attributes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "scope": {
            "type": "string"
          },
          "fieldName": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "domain": {
            "type": "string"
          }
        }
      }
    },
    "workspaces": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "tenantId": {
            "type": "string",
            "description": "The ID of the tenant. Required: false. Defaults to the tenant of the user making the call."
          },
          "name": {
            "type": "string"
          },
          "workspaceType": {
            "type": "string"
          },
          "userIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    },
    "userStatus": {
      "type": "string"
    },
    "creationTime": {
      "type": "string",
      "format": "date-time"
    },
    "lastUpdated": {
      "type": "string",
      "format": "date-time"
    },
    "batchId": {
      "type": "string"
    },
    "notificationPreferences": {
      "type": "array",
      "description": "User notification preferences for different subsystems and scopes. If not present for a given subsystem/scope, it is assumed all notifications modes are enabled.",
      "items": {
        "type": "object",
        "properties": {
          "scope": {
            "type": "string"
          },
          "subSystem": {
            "type": "string"
          },
          "allowedTypes": {
            "type": "array",
            "description": "Notification Types allowed for given sub_system and scope.",
            "items": {
              "type": "string",
              "description": "Enum with all possible values for the notification type.",
              "enum": [
                "EMAIL",
                "SMS",
                "DEVICE"
              ],
              "default": "EMAIL"
            }
          }
        }
      }
    },
    "contactNumber": {
      "type": "string"
    },
    "uniqueUserId": {
      "type": "string",
      "description": "Randomly generated string at the time of creation. Should be used to reference a unique user by other services as user_id may contain PII."
    },
    "claims": {
      "type": "object"
    },
    "enabledScopes": {
      "type": "object",
      "description": "Scopes and status (enable, disable) for a user. Scope is optional. Typically applications will always pass their scope, but it is optional for admin purposes."
    },
    "addresses": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "UNRECOGNIZED_ADDRESS",
              "HOME_ADDRESS",
              "OFFICE_ADDRESS"
            ],
            "default": "UNRECOGNIZED_ADDRESS"
          },
          "address": {
            "type": "string"
          }
        }
      }
    },
    "contactNumbers": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "UNRECOGNIZED_PHONE",
              "HOME_PHONE",
              "OFFICE_PHONE",
              "MOBILE_PHONE"
            ],
            "default": "UNRECOGNIZED_PHONE"
          },
          "phoneNumber": {
            "type": "string"
          }
        }
      }
    },
    "roles": {
      "type": "array",
      "description": "The user's roles. Includes nested roles. Flat list. Read only.",
      "items": {
        "type": "object",
        "properties": {
          "tenantId": {
            "type": "string",
            "description": "The ID of the tenant. Required: false. Defaults to the tenant of the user making the call."
          },
          "domain": {
            "type": "string",
            "description": "The platform domain. Required: true. (e.g. ZPA, Reflexis, WFC)\nDefaults to the domain in the request."
          },
          "scope": {
            "type": "string",
            "description": "Some more general scoping for the data (like a particular app in the domain). Required: false."
          },
          "roleId": {
            "type": "string",
            "description": "The role ID. Required: true."
          },
          "userIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    },
    "defaultLocale": {
      "type": "string"
    },
    "primarySite": {
      "type": "string"
    },
    "selectedDepartments": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "licenses": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string"
          },
          "value": {
            "type": "boolean"
          },
          "lastUpdated": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    },
    "middleName": {
      "type": "string",
      "description": "Middle name of the user."
    },
    "preferredName": {
      "type": "string",
      "description": "Preferred Name of the user."
    },
    "isClient": {
      "type": "boolean"
    },
    "assignedRoles": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "tenantId": {
            "type": "string",
            "description": "The ID of the tenant. Required: false. Defaults to the tenant of the user making the call."
          },
          "domain": {
            "type": "string",
            "description": "The platform domain. Required: true. (e.g. ZPA, Reflexis, WFC)\nDefaults to the domain in the request."
          },
          "scope": {
            "type": "string",
            "description": "Some more general scoping for the data (like a particular app in the domain). Required: false."
          },
          "roleId": {
            "type": "string",
            "description": "The role ID. Required: true."
          },
          "userIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    },
    "inheritedRoles": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "tenantId": {
            "type": "string",
            "description": "The ID of the tenant. Required: false. Defaults to the tenant of the user making the call."
          },
          "domain": {
            "type": "string",
            "description": "The platform domain. Required: true. (e.g. ZPA, Reflexis, WFC)\nDefaults to the domain in the request."
          },
          "scope": {
            "type": "string",
            "description": "Some more general scoping for the data (like a particular app in the domain). Required: false."
          },
          "roleId": {
            "type": "string",
            "description": "The role ID. Required: true."
          },
          "userIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    },
    "siteMapping": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "site": {
            "type": "object",
            "properties": {
              "tenantId": {
                "type": "string"
              },
              "siteName": {
                "type": "string"
              }
            }
          },
          "isPrimary": {
            "type": "boolean"
          },
          "defaultDepartments": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "Protobuf created to represent a Department.\nUsing this name because UniqueDepartmentProto is already used for another use case."
            }
          },
          "defaultRoles": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "availableDepartments": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "Protobuf created to represent a Department.\nUsing this name because UniqueDepartmentProto is already used for another use case."
            }
          },
          "availableRoles": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "persistentDepartments": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "Protobuf created to represent a Department.\nUsing this name because UniqueDepartmentProto is already used for another use case."
            }
          },
          "persistentRoles": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      }
    },
    "primarySelectedDepartments": {
      "type": "array",
      "description": "The selected departments that the user is assigned to. This is to support UI for getting the details part of the graphQL query.\nIn V3, we can remove the existing selected_departments field and use this one instead.",
      "items": {
        "type": "object",
        "description": "Protobuf created to represent a Department.\nUsing this name because UniqueDepartmentProto is already used for another use case.",
        "properties": {
          "tenantId": {
            "type": "string"
          },
          "departmentName": {
            "type": "string"
          }
        }
      }
    },
    "userStatusLastUpdated": {
      "type": "string",
      "format": "date-time"
    }
  }
}

default — An unexpected error response.

Content type: application/json

Schema

PropertyTypeRequiredDescription
codeinteger (int32)No
messagestringNo
detailsarrayNo
{
  "type": "object",
  "properties": {
    "code": {
      "type": "integer",
      "format": "int32"
    },
    "message": {
      "type": "string"
    },
    "details": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "@type": {
            "type": "string"
          }
        }
      }
    }
  }
}