---
schema_version: "1"
id: d325080fd8d26b27d2f9fb37ee52dd29c46555cf07c7c9aac9ec0d8f79b7b4d7
title: postInsuranceDeleteMemberPlans(insuranceDeleteMemberPlansInputRepresentation, memberId)
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/insurance_developer_guide/apex_ConnectAPI_InsuranceGroupBenefitsFamily_postInsuranceDeleteMemberPlans.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/apex_ConnectAPI_InsuranceGroupBenefitsFamily_postInsuranceDeleteMemberPlans.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: e4df5773e4dd818dddd9b2694ad29cae5a0d894d724f9d352a7b7ac826f9c56f
description: Delete the specified plans for a group census member.
---
# postInsuranceDeleteMemberPlans(insuranceDeleteMemberPlansInputRepresentation, memberId)

Delete the specified plans for a group census member.

## API Version

65.0

## Requires Chatter

No

## Signature

public static ConnectApi.InsuranceDeleteMemberPlansOutputRepresentation postInsuranceDeleteMemberPlans(ConnectApi.InsuranceDeleteMemberPlansInputRepresentation insuranceDeleteMemberPlansInputRepresentation, String memberId)

## Parameters

**insuranceDeleteMemberPlansInputRepresentation**

- Type: [ConnectApi.InsuranceDeleteMemberPlansInputRepresentation](https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/apex_connectapi_input_insurance_delete_member_plans.htm "Input representation for deleting a member's plans.")
- The input representation containing the list of plans to delete.

**memberId**

- Type: String
- ID of the group census member whose plans are being deleted.

## Return Value

Type: [ConnectApi.InsuranceDeleteMemberPlansOutputRepresentation](https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/apex_connectapi_output_insurance_delete_member_plans.htm "Output representation for the member plan deletion process.")

## Example

Here's an example of how to invoke the Insurance Delete Member Plans API from Apex code.

// Delete Member Plan(s) for a Group Census Member via Connect API (simple version)

// 1) Create the top-level input
ConnectApi.InsuranceDeleteMemberPlansInputRepresentation input = new ConnectApi.InsuranceDeleteMemberPlansInputRepresentation();
// 2) Provide the list of existing Group Census Member Plan record Ids to delete
//    Uses a simple string list wrapper
List<String\> planIdsToDelete = new List<String\>{
    '0rgxx000000003LAAQ',
    '0rgxx000000003UAAQ'
};
input.plans = planIdsToDelete;
// 3) Execute the POST Delete Member Plans API
//  URL param is the Group Census Member Id whose plans you want to delete
String memberId = '0r6xx00000004LGAAY';
try {
    ConnectApi.InsuranceDeleteMemberPlansOutputRepresentation result =
        ConnectApi.InsuranceGroupBenefitsFamily.postInsuranceDeleteMemberPlans(input, memberId);
    System.debug('Delete Member Plans result: ' + JSON.serializePretty(result));
} catch (Exception e) {
    System.debug('Error while deleting member plans: ' + e.getMessage());
}