Edit

Share via


Create fileStorageContainerType

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.

Create a new fileStorageContainerType in the owning tenant. The number of container types in a tenant is limited.

Important

  • The tenant must own the application that is assigned as the owner of the fileStorageContainerType (owningAppId).
  • The registration of a container type in a newly created tenant can fail if the tenant isn't yet fully ready. You might need to wait at least an hour before you can register a container type in a new tenant.

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

Note: Either the SharePoint Embedded admin role or the Global admin role is required to call this API.

HTTP request

POST /storage/fileStorage/containerTypes

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 a JSON representation of the fileStorageContainerType object.

You can specify the following properties when you create a fileStorageContainerType.

Property Type Description
billingClassification fileStorageContainerBillingClassification The billing type. The possible values are: standard, trial, directToCustomer, unknownFutureValue. The default value is standard. Optional.
name String The name of the fileStorageContainerType. Required.
owningAppId Guid ID of the application that owns the fileStorageContainerType. Required.
settings fileStorageContainerTypeSettings The settings of the fileStorageContainerType. Optional.

Response

If successful, this method returns a 201 Created response code and a fileStorageContainerType object in the response body.

Examples

Request

The following example shows how to create a trial fileStorageContainerType.

POST https://graph.microsoft.com/beta/storage/fileStorage/containerTypes
Content-Type: application/json

{
  "name": "Test Trial Container",
  "owningAppId": "11335700-9a00-4c00-84dd-0c210f203f00",
  "billingClassification": "trial",
  "settings": {
    "isItemVersioningEnabled": true,
    "isSharingRestricted": false,
    "consumingTenantOverridables": "isSearchEnabled,itemMajorVersionLimit",
    "agent": {
      "chatEmbedAllowedHosts": ["https://localhost:3000"]
    }
  }
}

Response

The following example shows the response.

Note: The response object shown here might be shortened for readability.

HTTP/1.1 201 Created
Content-Type: application/json

{
  "@odata.type": "#microsoft.graph.fileStorageContainerType",
  "id": "de988700-d700-020e-0a00-0831f3042f00",
  "name": "Test Trial Container",
  "owningAppId": "11335700-9a00-4c00-84dd-0c210f203f00",
  "billingClassification": "trial",
  "billingStatus": "valid",
  "createdDateTime": "01/20/2025",
  "expirationDateTime": "02/20/2025",
  "etag": "RVRhZw==",
  "settings": {
    "urlTemplate": "",
    "isDiscoverabilityEnabled": true,
    "isSearchEnabled": true,
    "isItemVersioningEnabled": true,
    "itemMajorVersionLimit": 50,
    "maxStoragePerContainerInBytes": 104857600,
    "isSharingRestricted": false,
    "consumingTenantOverridables": "isSearchEnabled,itemMajorVersionLimit",
    "agent": {
      "chatEmbedAllowedHosts": ["https://localhost:3000"]
    }
  }
}