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.
Remove a user or group from the accepted-senders list of the specified group.
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) |
Group.ReadWrite.All |
Not available. |
Delegated (personal Microsoft account) |
Not supported. |
Not supported. |
Application |
Not supported. |
Not supported. |
HTTP request
DELETE /groups/{id}/acceptedSenders/$ref?$id={id}
Request body
Don't supply a request body for this method.
Response
If successful, this method returns 204 No Content
response code. It doesn't return anything in the response body.
Examples
Example 1: Remove a user from the accepted-senders list for the group.
Request
DELETE https://graph.microsoft.com/beta/groups/{id}/acceptedSenders/$ref?$id=https://graph.microsoft.com/beta/users/{user-id}
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.Groups["{group-id}"].AcceptedSenders.Ref.DeleteAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Id = "https://graph.microsoft.com/beta/users/{user-id}";
});
mgc-beta groups accepted-senders ref delete --group-id {group-id}
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphgroups "github.com/microsoftgraph/msgraph-beta-sdk-go/groups"
//other-imports
)
requestId := "https://graph.microsoft.com/beta/users/{user-id}"
requestParameters := &graphgroups.ItemAcceptedSenders$refRequestBuilderDeleteQueryParameters{
Id: &requestId,
}
configuration := &graphgroups.ItemAcceptedSenders$refRequestBuilderDeleteRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.Groups().ByGroupId("group-id").AcceptedSenders().Ref().Delete(context.Background(), configuration)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
graphClient.groups().byGroupId("{group-id}").acceptedSenders().ref().delete(requestConfiguration -> {
requestConfiguration.queryParameters.id = "https://graph.microsoft.com/beta/users/{user-id}";
});
const options = {
authProvider,
};
const client = Client.init(options);
await client.api('/groups/{id}/acceptedSenders/$ref')
.version('beta')
.delete();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Groups\Item\AcceptedSenders\Ref\RefRequestBuilderDeleteRequestConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new RefRequestBuilderDeleteRequestConfiguration();
$queryParameters = RefRequestBuilderDeleteRequestConfiguration::createQueryParameters();
$queryParameters->id = "https://graph.microsoft.com/beta/users/{user-id}";
$requestConfiguration->queryParameters = $queryParameters;
$graphServiceClient->groups()->byGroupId('group-id')->acceptedSenders()->ref()->delete($requestConfiguration)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.groups.item.accepted_senders.ref.ref_request_builder import RefRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
query_params = RefRequestBuilder.RefRequestBuilderDeleteQueryParameters(
id = "https://graph.microsoft.com/beta/users/{user-id}",
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
await graph_client.groups.by_group_id('group-id').accepted_senders.ref.delete(request_configuration = request_configuration)
Response
The following example shows the response.
HTTP/1.1 204 No Content
Example 2: Remove a group from the accepted-senders list for the group.
Request
DELETE https://graph.microsoft.com/beta/groups/{id}/acceptedSenders/$ref?$id=https://graph.microsoft.com/beta/groups/{other-group-id}
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.Groups["{group-id}"].AcceptedSenders.Ref.DeleteAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Id = "https://graph.microsoft.com/beta/groups/{other-group-id}";
});
mgc-beta groups accepted-senders ref delete --group-id {group-id}
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphgroups "github.com/microsoftgraph/msgraph-beta-sdk-go/groups"
//other-imports
)
requestId := "https://graph.microsoft.com/beta/groups/{other-group-id}"
requestParameters := &graphgroups.ItemAcceptedSenders$refRequestBuilderDeleteQueryParameters{
Id: &requestId,
}
configuration := &graphgroups.ItemAcceptedSenders$refRequestBuilderDeleteRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.Groups().ByGroupId("group-id").AcceptedSenders().Ref().Delete(context.Background(), configuration)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
graphClient.groups().byGroupId("{group-id}").acceptedSenders().ref().delete(requestConfiguration -> {
requestConfiguration.queryParameters.id = "https://graph.microsoft.com/beta/groups/{other-group-id}";
});
const options = {
authProvider,
};
const client = Client.init(options);
await client.api('/groups/{id}/acceptedSenders/$ref')
.version('beta')
.delete();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Groups\Item\AcceptedSenders\Ref\RefRequestBuilderDeleteRequestConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new RefRequestBuilderDeleteRequestConfiguration();
$queryParameters = RefRequestBuilderDeleteRequestConfiguration::createQueryParameters();
$queryParameters->id = "https://graph.microsoft.com/beta/groups/{other-group-id}";
$requestConfiguration->queryParameters = $queryParameters;
$graphServiceClient->groups()->byGroupId('group-id')->acceptedSenders()->ref()->delete($requestConfiguration)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.groups.item.accepted_senders.ref.ref_request_builder import RefRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
query_params = RefRequestBuilder.RefRequestBuilderDeleteQueryParameters(
id = "https://graph.microsoft.com/beta/groups/{other-group-id}",
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
await graph_client.groups.by_group_id('group-id').accepted_senders.ref.delete(request_configuration = request_configuration)
Response
The following example shows the response.
HTTP/1.1 204 No Content