Operations (sample payloads)

Main operations

Create user

Create a user (work or school account). Sample Input

{
    "display_name": "John Doe",
    "mail_nickname": "johndoe",
    "user_principal_name": "johndoe@contoso.com",
    "account_enabled": true,
    "password_profile": \{
        "password": "P@ssw0rd123!",
        "force_change_password_next_sign_in": true
    \},
    "given_name": "John",
    "surname": "Doe",
    "job_title": "Software Engineer",
    "department": "IT",
    "city": "Seattle",
    "country": "United States",
    "office_location": "Building A",
    "postal_code": "98052",
    "preferred_language": "en-US",
    "state": "Washington",
    "street_address": "123 Main St",
    "mobile_phone": "+1 (555) 123-4567",
    "usage_location": "US",
    "custom_attributes": [
        \{
            "name": "extension_366cf3460d404b83bfab6c4919066267_employeeID",
            "value": "EMP12345"
        \}
    ]
}

Sample Output

\{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users/$entity",
    "id": "48d31887-5fad-4d73-a9f5-3c356e68a038",
    "businessPhones": [
        "+1 (425) 555-0100"
    ],
    "displayName": "John Doe",
    "givenName": "John",
    "jobTitle": "Software Engineer",
    "mail": "johndoe@contoso.com",
    "mobilePhone": "+1 (555) 123-4567",
    "officeLocation": "Building A",
    "preferredLanguage": "en-US",
    "surname": "Doe",
    "userPrincipalName": "johndoe@contoso.com"
\}

Delete user

Deletes a user Sample Input

{
    "user_id": "a1b2c3d4-5e6f-7g8h-9i0j-k1l2m3n4o5p6"
}

Sample Output

{
    "success": true
}

Find B2C application (Beta)

Attempts to find the B2C application automatically Sample Input

{}

Sample Output

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#applications/$entity",
    "id": "a1b2c3d4-e5f6-7g8h-9i0j-1k2l3m4n5o6p",
    "deletedDateTime": null,
    "isFallbackPublicClient": false,
    "appId": "q7r8s9t0-u1v2-w3x4-y5z6-7a8b9c0d1e2f",
    "applicationTemplateId": null,
    "identifierUris": [
        "https://myb2capp.onmicrosoft.com"
    ],
    "createdDateTime": "2023-04-15T10:30:00Z",
    "displayName": "My B2C Application",
    "isDeviceOnlyAuthSupported": false,
    "groupMembershipClaims": "SecurityGroup",
    "optionalClaims": null,
    "orgRestrictions": [],
    "publisherDomain": "myb2capp.onmicrosoft.com",
    "signInAudience": "AzureADandPersonalMicrosoftAccount",
    "tags": [],
    "tokenEncryptionKeyId": null,
    "api": {
        "requestedAccessTokenVersion": 2,
        "acceptMappedClaims": null,
        "knownClientApplications": [],
        "oauth2PermissionScopes": [
            \{
                "adminConsentDescription": "Allow the application to access My B2C Application on behalf of the signed-in user.",
                "adminConsentDisplayName": "Access My B2C Application",
                "id": "e3f4g5h6-i7j8-k9l0-m1n2-o3p4q5r6s7t8",
                "isEnabled": true,
                "type": "User",
                "userConsentDescription": "Allow the application to access My B2C Application on your behalf.",
                "userConsentDisplayName": "Access My B2C Application",
                "value": "user_impersonation"
            \}
        ],
        "preAuthorizedApplications": []
    },
    "appRoles": [],
    "publicClient": {
        "redirectUris": []
    },
    "info": \{
        "termsOfServiceUrl": null,
        "supportUrl": null,
        "privacyStatementUrl": null,
        "marketingUrl": null,
        "logoUrl": null
    \},
    "keyCredentials": [],
    "parentalControlSettings": \{
        "countriesBlockedForMinors": [],
        "legalAgeGroupRule": "Allow"
    \},
    "passwordCredentials": [],
    "requiredResourceAccess": [
        {
            "resourceAppId": "00000003-0000-0000-c000-000000000000",
            "resourceAccess": [
                \{
                    "id": "e1fe6dd8-ba31-4d61-89e7-88639da4683d",
                    "type": "Scope"
                \}
            ]
        }
    ],
    "web": {
        "redirectUris": [
            "https://myb2capp.azurewebsites.net/signin-oidc"
        ],
        "homePageUrl": "https://myb2capp.azurewebsites.net",
        "logoutUrl": "https://myb2capp.azurewebsites.net/signout-oidc",
        "implicitGrantSettings": \{
            "enableIdTokenIssuance": true,
            "enableAccessTokenIssuance": false
        \}
    }
}

Get application (Beta)

Returns information about an application Sample Input

{
    "object_id": "12345678-1234-1234-1234-1234567890ab"
}

Sample Output

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#applications/$entity",
    "id": "12345678-1234-1234-1234-1234567890ab",
    "deletedDateTime": null,
    "isFallbackPublicClient": false,
    "appId": "87654321-4321-4321-4321-ba0987654321",
    "applicationTemplateId": null,
    "identifierUris": [
        "https://myapp.example.com"
    ],
    "createdDateTime": "2023-05-15T10:30:00Z",
    "displayName": "My Sample Application",
    "isDeviceOnlyAuthSupported": false,
    "groupMembershipClaims": "SecurityGroup",
    "optionalClaims": null,
    "orgRestrictions": [],
    "publisherDomain": "example.com",
    "signInAudience": "AzureADMyOrg",
    "tags": [
        "productivity",
        "internal"
    ],
    "tokenEncryptionKeyId": null,
    "api": {
        "requestedAccessTokenVersion": 2,
        "acceptMappedClaims": null,
        "knownClientApplications": [],
        "oauth2PermissionScopes": [
            \{
                "adminConsentDescription": "Allow the application to access My Sample Application on behalf of the signed-in user.",
                "adminConsentDisplayName": "Access My Sample Application",
                "id": "abcdef01-2345-6789-0123-456789abcdef",
                "isEnabled": true,
                "type": "User",
                "userConsentDescription": "Allow the application to access My Sample Application on your behalf.",
                "userConsentDisplayName": "Access My Sample Application",
                "value": "user_impersonation"
            \}
        ],
        "preAuthorizedApplications": []
    },
    "appRoles": [],
    "publicClient": {
        "redirectUris": []
    },
    "info": \{
        "termsOfServiceUrl": "https://example.com/terms",
        "supportUrl": "https://example.com/support",
        "privacyStatementUrl": "https://example.com/privacy",
        "marketingUrl": null,
        "logoUrl": null
    \},
    "keyCredentials": [],
    "parentalControlSettings": \{
        "countriesBlockedForMinors": [],
        "legalAgeGroupRule": "Allow"
    \},
    "passwordCredentials": [],
    "requiredResourceAccess": [
        {
            "resourceAppId": "00000003-0000-0000-c000-000000000000",
            "resourceAccess": [
                \{
                    "id": "e1fe6dd8-ba31-4d61-89e7-88639da4683d",
                    "type": "Scope"
                \}
            ]
        }
    ],
    "web": {
        "redirectUris": [
            "https://myapp.example.com/auth"
        ],
        "homePageUrl": "https://myapp.example.com",
        "logoutUrl": "https://myapp.example.com/logout",
        "implicitGrantSettings": \{
            "enableIdTokenIssuance": true,
            "enableAccessTokenIssuance": false
        \}
    }
}

Get application extension properties (Beta)

Returns extension properties of an application Sample Input Sample Output

Get user

Returns information about a user. Sample Input

{
    "user_id": "12345678-1234-1234-1234-123456789012"
}

Sample Output

\{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users/$entity",
    "businessPhones": [
        "+1 (555) 123-4567"
    ],
    "displayName": "John Doe",
    "givenName": "John",
    "jobTitle": "Software Engineer",
    "mail": "john.doe@example.com",
    "mobilePhone": "+1 (555) 987-6543",
    "officeLocation": "Building A, Floor 3",
    "preferredLanguage": "en-US",
    "surname": "Doe",
    "userPrincipalName": "john.doe@example.com",
    "id": "12345678-1234-1234-1234-123456789012"
\}

Get user custom attributes (Beta)

Returns custom attributes for a user. Sample Input

\{
    "user_id": "12345678-1234-1234-1234-123456789012",
    "attributes": [
        "extension_366cf3460d404b83bfab6c4919066267_customAddr",
        "extension_366cf3460d404b83bfab6c4919066267_employeeNumber"
    ]
\}

Sample Output

\{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#users('12345678-1234-1234-1234-123456789012')?$select=id,extension_366cf3460d404b83bfab6c4919066267_customAddr,extension_366cf3460d404b83bfab6c4919066267_employeeNumber",
    "id": "12345678-1234-1234-1234-123456789012",
    "extension_366cf3460d404b83bfab6c4919066267_customAddr": "123 Main St, Anytown, USA",
    "extension_366cf3460d404b83bfab6c4919066267_employeeNumber": "E12345"
\}

List applications (Beta)

Returns a list of applications. Sample Input

{
    "select": [
        "displayName",
        "appId",
        "signInAudience"
    ],
    "filter": [
        \{
            "name": "displayName",
            "value": "Marketing App"
        \}
    ],
    "condition": "and",
    "order_by": "displayName",
    "sort_order": "asc",
    "limit": 5
}

Sample Output

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#applications(displayName,appId,signInAudience)",
    "@odata.nextLink": "https://graph.microsoft.com/beta/applications?$select=displayName,appId,signInAudience&$filter=displayName eq 'Marketing App'&$orderby=displayName&$top=5&$skiptoken=X'12345678'",
    "value": [
        \{
            "@odata.context": "https://graph.microsoft.com/beta/$metadata#applications/$entity",
            "id": "00000000-0000-0000-0000-000000000001",
            "displayName": "Marketing App",
            "appId": "11111111-1111-1111-1111-111111111111",
            "signInAudience": "AzureADMyOrg"
        \},
        \{
            "@odata.context": "https://graph.microsoft.com/beta/$metadata#applications/$entity",
            "id": "00000000-0000-0000-0000-000000000002",
            "displayName": "Marketing App - Dev",
            "appId": "22222222-2222-2222-2222-222222222222",
            "signInAudience": "AzureADMultipleOrgs"
        \},
        \{
            "@odata.context": "https://graph.microsoft.com/beta/$metadata#applications/$entity",
            "id": "00000000-0000-0000-0000-000000000003",
            "displayName": "Marketing App - Test",
            "appId": "33333333-3333-3333-3333-333333333333",
            "signInAudience": "AzureADandPersonalMicrosoftAccount"
        \}
    ]
}

List group members

Returns a list of group members Sample Input

{
    "group_id": "12345678-1234-1234-1234-123456789012",
    "select": [
        "displayName",
        "mail",
        "userPrincipalName"
    ],
    "filter": [
        \{
            "name": "jobTitle",
            "value": "Software Engineer"
        \}
    ],
    "condition": "and",
    "order_by": "displayName",
    "sort_order": "asc",
    "limit": 5
}

Sample Output

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users(displayName,mail,userPrincipalName)",
    "@odata.nextLink": "https://graph.microsoft.com/v1.0/groups/12345678-1234-1234-1234-123456789012/members?$skiptoken=X%274453707402000100000035536572766963652E437265617465644174203E20323032322D30352D30315430303A30303A30305A20414E442053657276696365 2E437265617465644174203C3D20323032322D30352D33315430303A30303A30305A%27",
    "value": [
        \{
            "displayName": "Alice Johnson",
            "mail": "alice.johnson@example.com",
            "userPrincipalName": "alice.johnson@example.com"
        \},
        \{
            "displayName": "Bob Smith",
            "mail": "bob.smith@example.com",
            "userPrincipalName": "bob.smith@example.com"
        \},
        \{
            "displayName": "Charlie Brown",
            "mail": "charlie.brown@example.com",
            "userPrincipalName": "charlie.brown@example.com"
        \},
        \{
            "displayName": "Diana Prince",
            "mail": "diana.prince@example.com",
            "userPrincipalName": "diana.prince@example.com"
        \},
        \{
            "displayName": "Ethan Hunt",
            "mail": "ethan.hunt@example.com",
            "userPrincipalName": "ethan.hunt@example.com"
        \}
    ]
}

List groups

Returns a list of groups Sample Input

{
    "select": [
        "displayName",
        "mail",
        "securityEnabled"
    ],
    "filter": [
        \{
            "name": "mailEnabled",
            "value": true
        \},
        \{
            "name": "displayName",
            "value": "Marketing"
        \}
    ],
    "condition": "and",
    "order_by": "displayName",
    "sort_order": "asc",
    "limit": 5
}

Sample Output

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#groups(displayName,mail,securityEnabled)",
    "@odata.nextLink": "https://graph.microsoft.com/v1.0/groups?$skiptoken=X'12345678'",
    "value": [
        \{
            "displayName": "Marketing Team",
            "mail": "marketing@contoso.com",
            "securityEnabled": false
        \},
        \{
            "displayName": "Marketing Analytics",
            "mail": "marketinganalytics@contoso.com",
            "securityEnabled": true
        \},
        \{
            "displayName": "Marketing Communications",
            "mail": "marcomm@contoso.com",
            "securityEnabled": false
        \},
        \{
            "displayName": "Marketing Events",
            "mail": "events@contoso.com",
            "securityEnabled": false
        \},
        \{
            "displayName": "Marketing Strategy",
            "mail": "strategy@contoso.com",
            "securityEnabled": true
        \}
    ]
}

List users

Returns a list of users. Sample Input Sample Output

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users(displayName,mail,jobTitle)",
    "@odata.nextLink": "https://graph.microsoft.com/v1.0/users?$select=displayName,mail,jobTitle&$filter=jobTitle eq 'Software Engineer'&$orderby=displayName&$top=5&$skiptoken=X%274453707402000100000035536572766963652E437265617465436F6E74616374000000000000000000%27",
    "value": [
        \{
            "displayName": "Alice Johnson",
            "mail": "alice.johnson@example.com",
            "jobTitle": "Software Engineer"
        \},
        \{
            "displayName": "Bob Smith",
            "mail": "bob.smith@example.com",
            "jobTitle": "Software Engineer"
        \},
        \{
            "displayName": "Charlie Brown",
            "mail": "charlie.brown@example.com",
            "jobTitle": "Software Engineer"
        \},
        \{
            "displayName": "Diana Lee",
            "mail": "diana.lee@example.com",
            "jobTitle": "Software Engineer"
        \},
        \{
            "displayName": "Ethan Davis",
            "mail": "ethan.davis@example.com",
            "jobTitle": "Software Engineer"
        \}
    ]
}

Raw HTTP request (advanced)

Perform a raw HTTP request with some pre-configuration and processing by the connector, such as authentication. Sample Input

{
    "method": "GET",
    "url": {
        "endpoint": "/users"
    },
    "headers": [
        \{
            "key": "Accept",
            "value": "application/json"
        \}
    ],
    "query_parameters": [
        \{
            "key": "filter",
            "value": "displayName eq 'John Doe'"
        \}
    ],
    "body": {
        "none": null
    },
    "include_raw_body": false,
    "parse_response": "true"
}

Sample Output

{
    "response": {
        "status_code": 200,
        "headers": \{
            "Content-Type": "application/json",
            "Cache-Control": "no-cache"
        \},
        "body": {
            "value": [
                \{
                    "id": "12345678-1234-1234-1234-123456789012",
                    "displayName": "John Doe",
                    "userPrincipalName": "johndoe@example.com",
                    "mail": "johndoe@example.com",
                    "jobTitle": "Software Engineer",
                    "department": "IT"
                \}
            ]
        }
    }
}

Update user

Updates a user. Only the properties that you specify are changed. Sample Input Sample Output

{
    "success": true
}

DDL operations

List application attributes (DDL)

Sample Input

{}

Sample Output

[
    \{
        "name": "displayName",
        "type": "Edm.String",
        "nullable": false,
        "maxLength": 256
    \},
    \{
        "name": "appId",
        "type": "Edm.String",
        "nullable": false
    \},
    \{
        "name": "signInAudience",
        "type": "Edm.String",
        "nullable": false
    \},
    \{
        "name": "createdDateTime",
        "type": "Edm.DateTimeOffset",
        "nullable": false
    \},
    \{
        "name": "description",
        "type": "Edm.String",
        "nullable": true,
        "maxLength": 1024
    \},
    \{
        "name": "identifierUris",
        "type": "Collection(Edm.String)",
        "nullable": true
    \},
    \{
        "name": "publisherDomain",
        "type": "Edm.String",
        "nullable": true
    \},
    \{
        "name": "tags",
        "type": "Collection(Edm.String)",
        "nullable": true
    \}
]

List custom attributes (DDL)

Sample Input

{}

Sample Output

[
    \{
        "id": "extension_a3b1b1b1a1a1_customAttribute1",
        "name": "customAttribute1",
        "dataType": "String",
        "targetObjects": [
            "User"
        ]
    \},
    \{
        "id": "extension_a3b1b1b1a1a1_customAttribute2",
        "name": "customAttribute2",
        "dataType": "Integer",
        "targetObjects": [
            "User",
            "Group"
        ]
    \},
    \{
        "id": "extension_a3b1b1b1a1a1_customAttribute3",
        "name": "customAttribute3",
        "dataType": "Boolean",
        "targetObjects": [
            "User"
        ]
    \}
]

List group attributes (DDL)

Note that DDL operations can only be called directly by Connectors API, or when using CustomJS in the Embedded solution editor for e.g. DDL-dependent data mapping


Sample Input

{}

Sample Output

[
    \{
        "name": "id",
        "type": "Edm.String",
        "description": "The unique identifier for the group"
    \},
    \{
        "name": "displayName",
        "type": "Edm.String",
        "description": "The display name for the group"
    \},
    \{
        "name": "description",
        "type": "Edm.String",
        "description": "An optional description for the group"
    \},
    \{
        "name": "mailNickname",
        "type": "Edm.String",
        "description": "The mail alias for the group"
    \},
    \{
        "name": "mailEnabled",
        "type": "Edm.Boolean",
        "description": "Specifies whether the group is mail-enabled"
    \},
    \{
        "name": "securityEnabled",
        "type": "Edm.Boolean",
        "description": "Specifies whether the group is a security group"
    \},
    \{
        "name": "createdDateTime",
        "type": "Edm.DateTimeOffset",
        "description": "The date and time when the group was created"
    \},
    \{
        "name": "visibility",
        "type": "Edm.String",
        "description": "Specifies the visibility of the group"
    \}
]

List groups (DDL)

Note that DDL operations can only be called directly by Connectors API, or when using CustomJS in the Embedded solution editor for e.g. DDL-dependent data mapping


Sample Input

{}

Sample Output

[
    \{
        "id": "00000000-0000-0000-0000-000000000000",
        "deletedDateTime": null,
        "classification": null,
        "createdDateTime": "2023-05-15T10:30:00Z",
        "creationOptions": [],
        "description": "A group for marketing team members",
        "displayName": "Marketing Team",
        "expirationDateTime": null,
        "groupTypes": [
            "Unified"
        ],
        "isAssignableToRole": false,
        "mail": "marketing@contoso.com",
        "mailEnabled": true,
        "mailNickname": "marketing",
        "membershipRule": null,
        "membershipRuleProcessingState": null,
        "onPremisesDomainName": null,
        "onPremisesLastSyncDateTime": null,
        "onPremisesNetBiosName": null,
        "onPremisesSamAccountName": null,
        "onPremisesSecurityIdentifier": null,
        "onPremisesSyncEnabled": null,
        "preferredDataLocation": null,
        "preferredLanguage": null,
        "proxyAddresses": [
            "SMTP:marketing@contoso.com"
        ],
        "renewedDateTime": "2023-05-15T10:30:00Z",
        "resourceBehaviorOptions": [],
        "resourceProvisioningOptions": [],
        "securityEnabled": false,
        "securityIdentifier": "S-1-12-1-1234567890-123456789-1234567890-1234567",
        "theme": null,
        "visibility": "Public",
        "onPremisesProvisioningErrors": []
    \},
    \{
        "id": "11111111-1111-1111-1111-111111111111",
        "deletedDateTime": null,
        "classification": "Confidential",
        "createdDateTime": "2023-05-10T14:45:00Z",
        "creationOptions": [],
        "description": "A group for IT department staff",
        "displayName": "IT Department",
        "expirationDateTime": null,
        "groupTypes": [
            "Unified"
        ],
        "isAssignableToRole": true,
        "mail": "it@contoso.com",
        "mailEnabled": true,
        "mailNickname": "itdept",
        "membershipRule": null,
        "membershipRuleProcessingState": null,
        "onPremisesDomainName": null,
        "onPremisesLastSyncDateTime": null,
        "onPremisesNetBiosName": null,
        "onPremisesSamAccountName": null,
        "onPremisesSecurityIdentifier": null,
        "onPremisesSyncEnabled": null,
        "preferredDataLocation": null,
        "preferredLanguage": "en-US",
        "proxyAddresses": [
            "SMTP:it@contoso.com"
        ],
        "renewedDateTime": "2023-05-10T14:45:00Z",
        "resourceBehaviorOptions": [],
        "resourceProvisioningOptions": [],
        "securityEnabled": true,
        "securityIdentifier": "S-1-12-1-2345678901-234567890-2345678901-2345678",
        "theme": null,
        "visibility": "Private",
        "onPremisesProvisioningErrors": []
    \}
]

List user attributes (DDL)

Note that DDL operations can only be called directly by Connectors API, or when using CustomJS in the Embedded solution editor for e.g. DDL-dependent data mapping


Sample Input

{}

Sample Output

Was this page helpful?