Edit

Share via


Update fileStorageContainerTypeRegistration

Namespace: microsoft.graph

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.

Update the properties of a fileStorageContainerTypeRegistration object.

Note

  • The settings in the fileStorageContainerType control which settings can be updated.
  • The updated settings change the behavior of new fileStorageContainer objects, but existing containers might require their settings to be updated directly. Some settings can't be updated at all, for example, changing the storage capability.
  • Agent-related settings have additional restrictions when overriding them in a consuming tenant. An override for agent.chatEmbedAllowedHosts must be a subset of the value defined in the owning container type. For example, if the owning container type sets agent.chatEmbedAllowedHosts to ["https://contoso.com", "https://localhost:5000"], an override can be either ["https://contoso.com"], ["https://localhost:5000"], or even []. However, the setting cannot be overridden to ["https://fabrikam.com"]. Learn more about SharePoint Embedded agent

ETag is used for optimistic concurrency control. It must match the value from Create, Get or the previous Update.

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

Note:

  • When delegated tokens are used, either the SharePoint Embedded admin role or the Global admin role is required.
  • If the FileStorageContainerTypeReg.Selected permission is used, changes are limited to registrations owned by the application that makes the call.

HTTP request

PATCH /storage/fileStorage/containerTypeRegistrations/{fileStorageContainerTypeRegistrationId}

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 only the values for properties to update. Existing properties that aren't included in the request body maintain their previous values or are recalculated based on changes to other property values.

The following table specifies the properties that can be updated.

Property Type Description
settings fileStorageContainerTypeRegistrationSettings fileStorageContainerTypeRegistration settings. The subset that can be updated depends on the overridable settings in the fileStorageContainerTypeSettings. Optional.
applicationPermissionGrants fileStorageContainerTypeAppPermissionGrant collection define the access privileges of applications on containers of a specific fileStorageContainerType. Optional.
etag String Used for optimistic concurrency control. Must match the value returned from a Create or Get request. Required.

Response

If successful, this method returns a 200 OK response code and an updated fileStorageContainerTypeRegistration object in the response body.

Examples

Example 1: Update a fileStorageContainerTypeRegistration setting

The following example shows how to update a fileStorageContainerTypeRegistration where the owning fileStorageContainerType marked isSearchEnabled as an overridable setting. The sharingCapability property can always be overridden.

Request

The following example shows a request.

PATCH https://graph.microsoft.com/beta/storage/fileStorage/containerTypeRegistrations/de988700-d700-020e-0a00-0831f3042f00
Content-Type: application/json

{
  "settings": {
    "sharingCapability": "externalUserAndGuestSharing",
    "isSearchEnabled": false
  },
  "applicationPermissionGrants": [
    {
      "appId": "33225700-9a00-4c00-84dd-0c210f203f01",
      "delegatedPermissions": ["full"],
      "applicationPermissions": ["none"]
    }
  ],
  "etag": "RVRhZw=="
}

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

{
  "@odata.type": "#microsoft.graph.fileStorageContainerTypeRegistration",
  "id": "de988700-d700-020e-0a00-0831f3042f00",
  "name": "Container Type Name",
  "owningAppId": "11335700-9a00-4c00-84dd-0c210f203f00",
  "billingClassification": "trial",
  "billingStatus": "valid",
  "registredDateTime": "01/20/2025",
  "expirationDateTime": "02/20/2025",
  "etag": "RVRhZyArIDE=",
  "settings": {
    "sharingCapability": "externalUserAndGuestSharing",
    "urlTemplate": "https://app.contoso.com/redirect?tenant={tenant-id}&drive={drive-id}&folder={folder-id}&item={item-id}",
    "isDiscoverabilityEnabled": true,
    "isSearchEnabled": false,
    "isItemVersioningEnabled": true,
    "itemMajorVersionLimit": 50,
    "maxStoragePerContainerInBytes": 104857600,
    "isSharingRestricted": false
  },
  "applicationPermissionGrants": [
    {
      "appId": "33225700-9a00-4c00-84dd-0c210f203f01",
      "delegatedPermissions": ["full"],
      "applicationPermissions": ["none"]
    }
  ]
}

Example 2: Update a fileStorageContainerTypeRegistration without ETag

The following example shows how to update a fileStorageContainerTypeRegistration without an etag that results in a 400 Bad Request.

Request

The following example shows a request.

PATCH https://graph.microsoft.com/beta/storage/fileStorage/containerTypeRegistrations/de988700-d700-020e-0a00-0831f3042f00
Content-Type: application/json

{
  "settings": {
    "sharingCapability": "externalUserAndGuestSharing"
  },
  "applicationPermissionGrants": [
    {
      "appId": "33225700-9a00-4c00-84dd-0c210f203f01",
      "delegatedPermissions": ["full"],
      "applicationPermissions": ["none"]
    }
  ]
}

Response

The following example shows the response.

HTTP/1.1 400 Bad Request

Example 3: Update a non-overridable fileStorageContainerTypeRegistration setting

The following example shows how to update a fileStorageContainerTypeRegistration setting that isn't overridable in the fileStorageContainerType. In this example, the urlTemplate property isn't overridable.

Request

The following example shows a request.

PATCH https://graph.microsoft.com/beta/storage/fileStorage/containerTypeRegistrations/de988700-d700-020e-0a00-0831f3042f00
Content-Type: application/json

{
  "settings": {
    "urlTemplate": "https://fabrikam.example.com/{0}"
  },
  "applicationPermissionGrants": [
    {
      "appId": "33225700-9a00-4c00-84dd-0c210f203f01",
      "delegatedPermissions": ["full"],
      "applicationPermissions": ["none"]
    }
  ]
}

Response

The following example shows the response.

HTTP/1.1 400 Bad Request