Update the custom properties of a fileStorageContainer

Namespace: microsoft.graph

Update one or multiple custom properties on a fileStorageContainer. Only the value and isSearchable attributes of custom properties can be updated. Only the custom properties specified in the request body are updated. If a custom property specified in the request body doesn't exist on the container, it will be created.

Updating a custom property to a null value deletes the property from the container.

The application calling this API must have read and write permissions to the fileStorageContainer for the respective container type.

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) FileStorageContainer.Selected Not available.
Delegated (personal Microsoft account) Not supported. Not supported.
Application FileStorageContainer.Selected Not available.

In addition to Microsoft Graph permissions, your app also must have the necessary container-type level permission or permissions to call this API. For details about container types, see Container Types. To learn more about container-type level permissions, see SharePoint Embedded Authorization.

HTTP request

PATCH /storage/fileStorage/containers/{containerId}/customProperties

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-Type application/json. Required.

Request body

In the request body, supply the custom properties to be updated and the new values for the relevant fields.

The following properties on custom properties can be modified.

Property Type Description
value String The value of the custom property.
isSearchable Boolean Indicates whether the property is searchable.

Response

If successful, this action returns a 200 OK response code.

Examples

Request

The following example updates the value property of the custom properties clientUniqeId and color. Note that isSearchable for clientUniqueId was set to true before calling this API.

PATCH https://graph.microsoft.com/v1.0/storage/fileStorage/containers/b!ISJs1WRro0y0EWgkUYcktDa0mE8zSlFEqFzqRn70Zwp1CEtDEBZgQICPkRbil_5Z/customProperties
Content-type: application/json

{
  "clientUniqueId": {
    "value": "c5d88310-1fc7-49be-80ca-e7d7a11e638b"
  },
  "color": {
    "value": "green"
  }
}

Response

The following example shows the response.

HTTP/1.1 200 Ok

{
  "clientUniqueId": {
    "value": "c5d88310-1fc7-49be-80ca-e7d7a11e638b",
    "isSearchable": true
  },
  "color": {
    "value": "green",
    "isSearchable": false
  }
}