---
schema_version: "1"
id: 5009467e7108326ca1579b05e7a8b72cac2dfdd0cb4272ec61d13d0f5e10ccf8
title: ReinstatePolicy(ReinstatePolicyInput, policyId)
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/insurance_developer_guide/apex_ConnectAPI_InsurancePolicyAdminFamily_ReinstatePolicy_1.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/apex_ConnectAPI_InsurancePolicyAdminFamily_ReinstatePolicy_1.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 0b46bf435e560eb10fc0c00f2cf30355ab1de2761d63166bd2b2dd706cef7937
description: Reinstate a previously canceled insurance policy.
---
# ReinstatePolicy(ReinstatePolicyInput, policyId)

Reinstate a previously canceled insurance policy.

## API Version

65.0

## Requires Chatter

No

## Signature

public static ConnectApi.PolicyOutputRepresentation ReinstatePolicy(ConnectApi.ReinstatePolicyInputRepresentation ReinstatePolicyInput, String policyId)

## Parameters

**ReinstatePolicyInput**

- Type: [ConnectApi.Reinstate​PolicyInput​Representation](https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/apex_connectapi_input_reinstate_policy.htm "Input representation for reinstating an insurance policy.")
- Input representation for reinstating an insurance policy.

**policyId**

- Type: String
- ID of the insurance policy to be reinstated.

## Return Value

Type: [ConnectApi.Policy​Output​Representation](https://developer.salesforce.com/docs/atlas.en-us.insurance_developer_guide.meta/insurance_developer_guide/apex_connectapi_output_policy_output.htm "Output representation of the policy details.")

## Example

Here's an example of how to invoke the Reinstate Policy API by using Apex.

// Create and populate the ReinstatePolicyInputRepresentation object
ConnectApi.ReinstatePolicyInputRepresentation policyInput = new ConnectApi.ReinstatePolicyInputRepresentation();

// Populate fields for InsurancePolicyInputRepresentation
ConnectApi.InsurancePolicyInputRepresentation insurancePolicy = new ConnectApi.InsurancePolicyInputRepresentation();
insurancePolicy.policyName = 'Health Insurance Policy Reinstated';
insurancePolicy.policyNumber = 'HIPE12';

// Create the list that will hold the AdditionalFieldsMapValue wrappers.
List<ConnectApi.AdditionalFieldsMapValue> additionalFieldsValueList = new List<ConnectApi.AdditionalFieldsMapValue>();

// 1. Create the map containing the actual field data for ONE item.
Map<String, Object\> dataForFirstMapValue = new Map<String, Object\>();
dataForFirstMapValue.put('instanceKey', 'AutoSilver'); // Example key/value from your JSON structure
Map<String, Object\> innerFieldsMap = new Map<String, Object\>();
innerFieldsMap.put('Currency\_\_c', '4456'); // Example inner field value
dataForFirstMapValue.put('fields', innerFieldsMap); // Put the inner fields map here

// 2. Create an instance of the AdditionalFieldsMapValue wrapper for this item.
ConnectApi.AdditionalFieldsMapValue firstMapValueWrapper = new ConnectApi.AdditionalFieldsMapValue();

// 3. Assign the map data (created in step 1) to the \*correct property\* on the wrapper instance.
firstMapValueWrapper.additionalFieldsMapValue = dataForFirstMapValue;

// 4. Add the populated wrapper instance to the list.
additionalFieldsValueList.add(firstMapValueWrapper);

// --- End of Populating the First Item ---

// --- If you need more items in the list, repeat steps 1-4 for each ---

// Assign the populated additional object to the policyInput
policyInput.additionalFields = additionalFieldsValueList;


policyInput.insurancePolicy = insurancePolicy;

// Optionally populate InsurancePolicyTransactionInputRepresentation
ConnectApi.InsurancePolicyTransactionInputRepresentation transactionRecord = new ConnectApi.InsurancePolicyTransactionInputRepresentation();
policyInput.transactionRecord = transactionRecord;

// Optionally set the effective date
// policyInput.effectiveDate = '2025-06-01';

try {
    // Call the Connect API directly
    ConnectApi.PolicyOutputRepresentation policyData =
        ConnectApi.InsurancePolicyAdminFamily.reinstatePolicy(policyInput, '0YTxx00000000MbGAI');

    // Output the policy data to the debug log
    System.debug('Policy reinstated successfully: ' + JSON.serializePretty(policyData));
} catch (Exception e) {
    // Log the error
    System.debug('Error while reinstating policy: ' + e.getMessage());
}