---
schema_version: "1"
id: 607e21f7834ed06a6938d6af9c51faa0e02ff928f616e3f76f2f450735e61022
title: CancelPolicy(CancelPolicyInput, policyId)
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/insurance_developer_guide/apex_ConnectAPI_InsurancePolicyAdminFamily_CancelPolicy_1.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/apex_ConnectAPI_InsurancePolicyAdminFamily_CancelPolicy_1.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 71fd05fb4174c244c65758df29abea68d982842e35a2674ca81c14fd25071e17
description: Cancel an insurance policy version. The API takes the effective date of cancellation from the input JSON. You can advance the cancellation date within the policy term, but you can’t postpone the cancellation.
---
# CancelPolicy(CancelPolicyInput, policyId)

Cancel an insurance policy version. The API takes the effective date of cancellation from the input JSON. You can advance the cancellation date within the policy term, but you can’t postpone the cancellation.

## API Version

63.0

## Requires Chatter

No

## Signature

public static ConnectApi.CancelPolicyOutputRepresentation CancelPolicy(ConnectApi.CancelPolicyInputRepresentation CancelPolicyInput, String policyId)

## Parameters

**CancelPolicyInput**

- Type: [ConnectApi.CancelPolicyInputRepresentation](https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/apex_connectapi_input_cancel_policy.htm "Input representation of the request to cancel a policy.")
- Description

**policyId**

- Type: String
- Input representation of the request to cancel a policy.

## Return Value

Type: [ConnectApi.CancelPolicyOutputRepresentation](https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/apex_connectapi_output_cancel_policy_output.htm "Output representation details of cancel policy, such as impacted policy versions and refund associated with the cancellation.")

## Usage

Send the cancellation effective date and transaction record in the request to cancel a policy.