Update educationUser
Namespace: microsoft.graph
Update the properties of an educationUser object.
This API is available in the following national cloud deployments.
Global service | US Government L4 | US Government L5 (DOD) | China operated by 21Vianet |
---|---|---|---|
✅ | ❌ | ❌ | ❌ |
Permissions
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
Permission type | Least privileged permissions | Higher privileged permissions |
---|---|---|
Delegated (work or school account) | Not supported. | Not supported. |
Delegated (personal Microsoft account) | Not supported. | Not supported. |
Application | EduRoster.ReadWrite.All | Not available. |
HTTP request
PATCH /education/me
PATCH /education/users/{id}
Request headers
Header | Value |
---|---|
Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
Content-Type | application/json |
Request body
In the request body, supply the values for relevant fields that should be updated. Existing properties that aren't included in the request body maintains their previous values or be recalculated based on changes to other property values. For best performance, don't include existing values that haven't changed.
Property | Type | Description |
---|---|---|
accountEnabled | Boolean | True if the account is enabled; otherwise, false. This property is required when a user is created. Supports $filter. |
assignedLicenses | assignedLicense collection | The licenses that are assigned to the user. Not nullable. |
assignedPlans | assignedPlan collection | The plans that are assigned to the user. Read-only. Not nullable. |
businessPhones | String collection | The telephone numbers for the user. Note: Although this is a string collection, only one number can be set for this property. |
createdBy | identitySet | Entity who created the user. |
department | String | The name for the department in which the user works. Supports $filter. |
displayName | String | The name displayed in the address book for the user. This is usually the combination of the user's first name, middle initial, and last name. This property is required when a user is created and it can't be cleared during updates. Supports $filter and $orderby. |
externalSource | educationExternalSource | Where this user was created from. Possible values are: sis , manual . |
externalSourceDetail | String | The name of the external source from which this resource was generated from. |
givenName | String | The given name (first name) of the user. Supports $filter. |
String | The SMTP address for the user; for example, "jeff@contoso.com". Read-Only. Supports $filter. | |
mailingAddress | physicalAddress | Mail address of user. |
mailNickname | String | The mail alias for the user. This property must be specified when a user is created. Supports $filter. |
middleName | String | The middle name of user. |
mobilePhone | String | The primary cellular telephone number for the user. |
onPremisesInfo | educationOnPremisesInfo | Additional information used to associate the AAD user with its Active Directory counterpart. |
passwordPolicies | String | Specifies password policies for the user. This value is an enumeration with one possible value being "DisableStrongPassword", which allows weaker passwords than the default policy to be specified. "DisablePasswordExpiration" can also be specified. The two can be specified together; for example: "DisablePasswordExpiration, DisableStrongPassword". |
passwordProfile | passwordProfile | Specifies the password profile for the user. The profile contains the user's password. This property is required when a user is created. The password in the profile must satisfy minimum requirements as specified by the passwordPolicies property. By default, a strong password is required. |
preferredLanguage | String | The preferred language for the user. Should follow ISO 639-1 Code; for example, "en-US". |
primaryRole | educationUserRole | Default role for a user. The user's role might be different in an individual class. Possible values are: student , teacher , none , unknownFutureValue . |
provisionedPlans | provisionedPlan collection | The plans that are provisioned for the user. Read-only. Not nullable. |
residenceAddress | physicalAddress | Address where user lives. |
student | educationStudent | If the primary role is student, this block contains student specific data. |
surname | String | The user's surname (family name or last name). Supports $filter. |
teacher | educationTeacher | If the primary role is teacher, this block contains teacher specific data. |
usageLocation | String | A two-letter country code (ISO standard 3166). Required for users who will be assigned licenses due to a legal requirement to check for availability of services in countries or regions. Examples include: "US", "JP", and "GB". Not nullable. Supports $filter. |
userPrincipalName | String | The user principal name (UPN) of the user. |
userType | String | A string value that can be used to classify user types in your directory, such as "Member" and "Guest". Supports $filter. |
Response
If successful, this method returns a 200 OK
response code and updated educationUser object in the response body.
Example
Request
The following example shows a request.
PATCH https://graph.microsoft.com/v1.0/education/users/{user-id}
Content-type: application/json
{
"displayName": "Rogelio Cazares",
"givenName": "Rogelio",
"middleName": "Fernando",
"surname": "Cazares",
}
Response
The following example shows the response. Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-type: application/json
{
"id": "13020",
"displayName": "Rogelio Cazares",
"givenName": "Rogelio",
"middleName": "Fernando",
"surname": "Cazares",
"mail": "rogelioC@contoso.com",
"mobilePhone": "+1 (253) 555-0101",
"createdBy": {
"user": {
"displayName": "Susana Rocha",
"id": "14012",
}
},
"externalSource": "sis",
"mailingAddress": {
"city": "Los Angeles",
"countryOrRegion": "United States",
"postalCode": "98055",
"state": "CA",
"street": "12345 Main St."
},
"primaryRole": "string",
"residenceAddress": {
"city": "Los Angeles",
"countryOrRegion": "United States",
"postalCode": "98055",
"state": "CA",
"street": "12345 Main St."
},
"student": {
"primaryRole": "student",
"externalId": "13005",
"birthDate": "2001-01-01T00:00:00Z"
}
}