API Version
67.0
Requires Chatter
No
Signature
public static ConnectApi.InsurancePolicyBulkOutputRepresentation bulkReinstateInsurancePolicy(ConnectApi.InsurancePolicyBulkFieldMapInputRepresentation insurancePolicyBulkFieldMapInput)
Parameters
insurancePolicyBulkFieldMapInput
- Type: ConnectApi.InsurancePolicyBulkFieldMapInputRepresentation
- Input representation of the request to reinstate policies in bulk.
Return Value
Usage
Use this method to reinstate previously canceled insurance policies in bulk. The JSON input includes a field value map of insurance policy fields and a list of insurance policy IDs. After the request is successfully sent to the message queue, policies are reinstated asynchronously, and you receive either a success or failure notification after the completion of the request.
Example
The Apex example shows how to use the ConnectApi.InsuranceBrokerageFamily.bulkReinstateInsurancePolicy() method to reinstate multiple insurance policies in bulk.
Class Definition
This Apex example shows how to reinstate multiple policies in bulk.
public class BulkReinstateConnectDriver { public static void callBulkReinstateConnectAPI() { List<Object> policies = new List<Object>{ newPolicy('0YTxx00000000mPGAQ', new Map<String, Object>{ 'reinstatementDate' => '2026-01-15' }) // add more entries here, each with its own fieldValueMap }; HttpResponse res = post('/connect/insurance/brokerage/policies/bulk-reinstate', policies); System.debug('Status: ' + res.getStatusCode() + ' ' + res.getStatus()); System.debug('Body: ' + res.getBody()); } private static Map<String, Object> newPolicy(String policyId, Map<String, Object> fieldValueMap) { return new Map<String, Object>{ 'policyId' => policyId, 'fieldValueMap' => fieldValueMap }; } private static HttpResponse post(String resourcePath, List<Object> policies) { HttpRequest req = new HttpRequest(); req.setEndpoint(URL.getOrgDomainUrl().toExternalForm() + '/services/data/v68.0' + resourcePath); req.setMethod('POST'); req.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionId()); req.setHeader('Content-Type', 'application/json'); req.setBody(JSON.serialize(new Map<String, Object>{ 'policies' => policies })); return new Http().send(req); } } // Execute BulkReinstateConnectDriver.callBulkReinstateConnectAPI();