Namespace: microsoft.graph
Create a new accessPackageCatalog object.
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) |
EntitlementManagement.ReadWrite.All |
Not available. |
Delegated (personal Microsoft account) |
Not supported. |
Not supported. |
Application |
EntitlementManagement.ReadWrite.All |
Not available. |
HTTP request
POST /identityGovernance/entitlementManagement/catalogs
Request body
In the request body, supply a JSON representation of the accessPackageCatalog object.
You can specify the following properties when creating an accessPackageCatalog.
Property |
Type |
Description |
displayName |
String |
The display name of the access package catalog. |
description |
String |
The description of the access package catalog. |
state |
accessPackageCatalogState |
Has the value published if the access packages are available for management. The possible values are: unpublished and published . |
isExternallyVisible |
Boolean |
Whether the access packages in this catalog can be requested by users outside of the tenant. |
Response
If successful, this method returns a 200-series response code and a new accessPackageCatalog object in the response body.
Examples
Request
POST https://graph.microsoft.com/v1.0/identityGovernance/entitlementManagement/catalogs
Content-Type: application/json
{
"displayName": "sales",
"description": "for employees working with sales and outside sales partners",
"state": "published",
"isExternallyVisible": true
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new AccessPackageCatalog
{
DisplayName = "sales",
Description = "for employees working with sales and outside sales partners",
State = AccessPackageCatalogState.Published,
IsExternallyVisible = true,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.IdentityGovernance.EntitlementManagement.Catalogs.PostAsync(requestBody);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
mgc identity-governance entitlement-management catalogs create --body '{\
"displayName": "sales",\
"description": "for employees working with sales and outside sales partners",\
"state": "published",\
"isExternallyVisible": true\
}\
'
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewAccessPackageCatalog()
displayName := "sales"
requestBody.SetDisplayName(&displayName)
description := "for employees working with sales and outside sales partners"
requestBody.SetDescription(&description)
state := graphmodels.PUBLISHED_ACCESSPACKAGECATALOGSTATE
requestBody.SetState(&state)
isExternallyVisible := true
requestBody.SetIsExternallyVisible(&isExternallyVisible)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
catalogs, err := graphClient.IdentityGovernance().EntitlementManagement().Catalogs().Post(context.Background(), requestBody, nil)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
AccessPackageCatalog accessPackageCatalog = new AccessPackageCatalog();
accessPackageCatalog.setDisplayName("sales");
accessPackageCatalog.setDescription("for employees working with sales and outside sales partners");
accessPackageCatalog.setState(AccessPackageCatalogState.Published);
accessPackageCatalog.setIsExternallyVisible(true);
AccessPackageCatalog result = graphClient.identityGovernance().entitlementManagement().catalogs().post(accessPackageCatalog);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
const options = {
authProvider,
};
const client = Client.init(options);
const accessPackageCatalog = {
displayName: 'sales',
description: 'for employees working with sales and outside sales partners',
state: 'published',
isExternallyVisible: true
};
await client.api('/identityGovernance/entitlementManagement/catalogs')
.post(accessPackageCatalog);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\AccessPackageCatalog;
use Microsoft\Graph\Generated\Models\AccessPackageCatalogState;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new AccessPackageCatalog();
$requestBody->setDisplayName('sales');
$requestBody->setDescription('for employees working with sales and outside sales partners');
$requestBody->setState(new AccessPackageCatalogState('published'));
$requestBody->setIsExternallyVisible(true);
$result = $graphServiceClient->identityGovernance()->entitlementManagement()->catalogs()->post($requestBody)->wait();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
Import-Module Microsoft.Graph.Identity.Governance
$params = @{
displayName = "sales"
description = "for employees working with sales and outside sales partners"
state = "published"
isExternallyVisible = $true
}
New-MgEntitlementManagementCatalog -BodyParameter $params
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.access_package_catalog import AccessPackageCatalog
from msgraph.generated.models.access_package_catalog_state import AccessPackageCatalogState
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = AccessPackageCatalog(
display_name = "sales",
description = "for employees working with sales and outside sales partners",
state = AccessPackageCatalogState.Published,
is_externally_visible = True,
)
result = await graph_client.identity_governance.entitlement_management.catalogs.post(request_body)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
Response
Note: The response object shown here might be shortened for readability.
HTTP/1.1 201 Created
Content-Type: application/json
{
"id": "b1bf99ed-99ed-b1bf-ed99-bfb1ed99bfb1",
"displayName": "sales",
"description": "for employees working with sales and outside sales partners",
"catalogType": "userManaged",
"state": "published",
"isExternallyVisible": true,
"createdDateTime": "2021-11-10T01:08:30.9134953Z",
"modifiedDateTime": "2021-11-10T01:08:30.9134953Z"
}