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 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"]
}
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new FileStorageContainerType
{
Name = "Test Trial Container",
OwningAppId = Guid.Parse("11335700-9a00-4c00-84dd-0c210f203f00"),
BillingClassification = FileStorageContainerBillingClassification.Trial,
Settings = new FileStorageContainerTypeSettings
{
IsItemVersioningEnabled = true,
IsSharingRestricted = false,
ConsumingTenantOverridables = FileStorageContainerTypeSettingsOverride.IsSearchEnabled | FileStorageContainerTypeSettingsOverride.ItemMajorVersionLimit,
Agent = new FileStorageContainerTypeAgentSettings
{
ChatEmbedAllowedHosts = new List<string>
{
"https://localhost:3000",
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Storage.FileStorage.ContainerTypes.PostAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
"github.com/google/uuid"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewFileStorageContainerType()
name := "Test Trial Container"
requestBody.SetName(&name)
owningAppId := uuid.MustParse("11335700-9a00-4c00-84dd-0c210f203f00")
requestBody.SetOwningAppId(&owningAppId)
billingClassification := graphmodels.TRIAL_FILESTORAGECONTAINERBILLINGCLASSIFICATION
requestBody.SetBillingClassification(&billingClassification)
settings := graphmodels.NewFileStorageContainerTypeSettings()
isItemVersioningEnabled := true
settings.SetIsItemVersioningEnabled(&isItemVersioningEnabled)
isSharingRestricted := false
settings.SetIsSharingRestricted(&isSharingRestricted)
consumingTenantOverridables := graphmodels.ISSEARCHENABLED,ITEMMAJORVERSIONLIMIT_FILESTORAGECONTAINERTYPESETTINGSOVERRIDE
settings.SetConsumingTenantOverridables(&consumingTenantOverridables)
agent := graphmodels.NewFileStorageContainerTypeAgentSettings()
chatEmbedAllowedHosts := []string {
"https://localhost:3000",
}
agent.SetChatEmbedAllowedHosts(chatEmbedAllowedHosts)
settings.SetAgent(agent)
requestBody.SetSettings(settings)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
containerTypes, err := graphClient.Storage().FileStorage().ContainerTypes().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
FileStorageContainerType fileStorageContainerType = new FileStorageContainerType();
fileStorageContainerType.setName("Test Trial Container");
fileStorageContainerType.setOwningAppId(UUID.fromString("11335700-9a00-4c00-84dd-0c210f203f00"));
fileStorageContainerType.setBillingClassification(FileStorageContainerBillingClassification.Trial);
FileStorageContainerTypeSettings settings = new FileStorageContainerTypeSettings();
settings.setIsItemVersioningEnabled(true);
settings.setIsSharingRestricted(false);
settings.setConsumingTenantOverridables(EnumSet.of(FileStorageContainerTypeSettingsOverride.IsSearchEnabled, FileStorageContainerTypeSettingsOverride.ItemMajorVersionLimit));
FileStorageContainerTypeAgentSettings agent = new FileStorageContainerTypeAgentSettings();
LinkedList<String> chatEmbedAllowedHosts = new LinkedList<String>();
chatEmbedAllowedHosts.add("https://localhost:3000");
agent.setChatEmbedAllowedHosts(chatEmbedAllowedHosts);
settings.setAgent(agent);
fileStorageContainerType.setSettings(settings);
FileStorageContainerType result = graphClient.storage().fileStorage().containerTypes().post(fileStorageContainerType);
const options = {
authProvider,
};
const client = Client.init(options);
const fileStorageContainerType = {
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']
}
}
};
await client.api('/storage/fileStorage/containerTypes')
.version('beta')
.post(fileStorageContainerType);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\FileStorageContainerType;
use Microsoft\Graph\Beta\Generated\Models\FileStorageContainerBillingClassification;
use Microsoft\Graph\Beta\Generated\Models\FileStorageContainerTypeSettings;
use Microsoft\Graph\Beta\Generated\Models\FileStorageContainerTypeSettingsOverride;
use Microsoft\Graph\Beta\Generated\Models\FileStorageContainerTypeAgentSettings;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new FileStorageContainerType();
$requestBody->setName('Test Trial Container');
$requestBody->setOwningAppId('11335700-9a00-4c00-84dd-0c210f203f00');
$requestBody->setBillingClassification(new FileStorageContainerBillingClassification('trial'));
$settings = new FileStorageContainerTypeSettings();
$settings->setIsItemVersioningEnabled(true);
$settings->setIsSharingRestricted(false);
$settings->setConsumingTenantOverridables(new FileStorageContainerTypeSettingsOverride('isSearchEnabled,itemMajorVersionLimit'));
$settingsAgent = new FileStorageContainerTypeAgentSettings();
$settingsAgent->setChatEmbedAllowedHosts(['https://localhost:3000', ]);
$settings->setAgent($settingsAgent);
$requestBody->setSettings($settings);
$result = $graphServiceClient->storage()->fileStorage()->containerTypes()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.file_storage_container_type import FileStorageContainerType
from msgraph_beta.generated.models.file_storage_container_billing_classification import FileStorageContainerBillingClassification
from msgraph_beta.generated.models.file_storage_container_type_settings import FileStorageContainerTypeSettings
from msgraph_beta.generated.models.file_storage_container_type_settings_override import FileStorageContainerTypeSettingsOverride
from msgraph_beta.generated.models.file_storage_container_type_agent_settings import FileStorageContainerTypeAgentSettings
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = FileStorageContainerType(
name = "Test Trial Container",
owning_app_id = UUID("11335700-9a00-4c00-84dd-0c210f203f00"),
billing_classification = FileStorageContainerBillingClassification.Trial,
settings = FileStorageContainerTypeSettings(
is_item_versioning_enabled = True,
is_sharing_restricted = False,
consuming_tenant_overridables = FileStorageContainerTypeSettingsOverride.IsSearchEnabled | FileStorageContainerTypeSettingsOverride.ItemMajorVersionLimit,
agent = FileStorageContainerTypeAgentSettings(
chat_embed_allowed_hosts = [
"https://localhost:3000",
],
),
),
)
result = await graph_client.storage.file_storage.container_types.post(request_body)
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"]
}
}
}