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.
POST /applications/{application ObjectId}/extensionProperties
POST /applications(appId='{appId}')/extensionProperties
Request headers
Name
Description
Authorization
Bearer {token}. Required.
Content-Type
application/json. Required.
Request body
In the request body, provide an extensionProperty object with the following properties.
Property
Type
Description
dataType
String
Specifies the data type of the value the extension property can hold. Following values are supported. Not nullable.
Binary - 256 bytes maximum
Boolean
DateTime - Must be specified in ISO 8601 format. Will be stored in UTC.
Integer - 32-bit value.
LargeInteger - 64-bit value.
String - 256 characters maximum
name
String
Name of the extension property. Not nullable.
isMultiValued
Boolean
Defines the directory extension as a multi-valued property. When true, the directory extension property can store a collection of objects of the dataType; for example, a collection of integers. The default value is false.
targetObjects
String collection
The Microsoft Graph resources that can use the extension property. All values must be in PascalCase. The following values are supported. Not nullable.
User
Group
AdministrativeUnit
Application
Device
Organization
Response
If successful, this method returns a 201 Created response code and a new extensionProperty object in the response body.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new ExtensionProperty
{
Name = "jobGroup",
DataType = "String",
IsMultiValued = true,
TargetObjects = new List<string>
{
"User",
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Applications["{application-id}"].ExtensionProperties.PostAsync(requestBody);
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ExtensionProperty();
$requestBody->setName('jobGroup');
$requestBody->setDataType('String');
$requestBody->setIsMultiValued(true);
$requestBody->setTargetObjects(['User', ]);
$result = $graphServiceClient->applications()->byApplicationId('application-id')->extensionProperties()->post($requestBody)->wait();
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(credentials, scopes)
request_body = ExtensionProperty(
name = "jobGroup",
data_type = "String",
is_multi_valued = True,
target_objects = [
"User",
],
)
result = await graph_client.applications.by_application_id('application-id').extension_properties.post(request_body)