| title | Update custom properties of a fileStorageContainer |
|---|---|
| description | Update the custom properties of a fileStorageContainer. |
| author | tonchan-msft |
| ms.localizationpriority | medium |
| ms.subservice | onedrive |
| doc_type | apiPageType |
| ms.date | 09/26/2024 |
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.
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.
[!INCLUDE permissions-table]
[!INCLUDE app-permissions]
PATCH /storage/fileStorage/containers/{containerId}/customProperties| Name | Description |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
| Content-Type | application/json. Required. |
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. |
If successful, this action returns a 200 OK response code.
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"
}
}[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
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
}
}