Idempotent Requests

Understand Risk Modeler support for idempotency


RMS APIs support idempotency, which allows you to safely retry service requests that might have failed due to connection issues, without accidentally performing the same operation twice. This behavior is useful when duplicate requests are sent either unintentionally or due to a timeout from network error, but no response is received.

Idempotency provides a way to reconcile failed requests with a server by allowing users to retry API requests safely. A method is idempotent if it guarantees similar results when you send an identical request multiple times. You can retry them several times without changing the result.

  • Risk Modeler services using the GET, PUT, and DELETE methods are idempotent by default.
  • Risk Modeler services using the POST method are not idempotent.

Sending idempotency keys in GET, PUT, and DELETE requests have no effect.

Sending idempotency keys

The Risk Modeler API guarantees idempotency for safely retrying POST requests without accidentally performing the same operation twice. Consequently, POST requests accept idempotency keys.

To perform an idempotent request, you must provide an additional X-RMS-RequestId in the request header. Including this unique key in the header makes the POST request idempotent by prompting the API to keep records to prevent duplicate operations.

When you include the key in your request, make it is sufficiently unique. To avoid any duplication, use Universally Unique Identifier (UUID) for the X-RMS-RequestId parameter.

The X-RMS-RequestId key expires after 24 hours. By using the idempotency key, you can safely retry requests if the second request occurs within 24 hours from when the server first receives the key.

In case of a bad request (error code 400), fix the inputs in the request and add a new idempotent key for the new request. If you get a 409 error, it means that the request processing is not finished yet. In this case, wait for some time and retry.

Idempotency for POST requests

The following Risk Modeler services accept Idempotency keys:

  • /riskmodeler/v1/accounts
  • /riskmodeler/v2/accounts
  • /riskmodeler/v2/accounts/{id}/convertcurrency
  • /riskmodeler/v2/accounts/{id}/copy
  • /riskmodeler/v2/accounts/{id}/geohaz
  • /riskmodeler/v2/accounts/{id}/process
Aggregate Portfolio
  • /riskmodeler/v2/aggregate-portfolios/{id}/process
  • /riskmodeler/v2/aggregate-portfolios/{id}/convert-currency
  • /riskmodeler/v2/aggregate-portfolios/{id}/process
Analysis Group
  • /riskmodeler/v2/analysis-groups
  • /riskmodeler/v1/branches
  • /riskmodeler/v1/cedants
  • /riskmodeler/v2/exports
  • /riskmodeler/v1/imports
  • /riskmodeler/v2/analyses/{id}/pate
  • /riskmodeler/v2/portfolios/{id}/process
  • /riskmodeler/v2/portfolios/{id}/convert-currency
  • /riskmodeler/v2/portfolios/{id}/copy
  • /riskmodeler/v1/lobs
  • /riskmodeler/v1/locations/{id}/buildingattribute
  • /riskmodeler/v1/locations/{id}/coverage
  • /riskmodeler/v1/locations/{id}/locationwsdetail
  • /riskmodeler/v1/locations
  • /riskmodeler/v1/locations/{id}/locationbidetail
  • /riskmodeler/v1/locations/{id}/locationeqdetail
  • /riskmodeler/v1/locations/{id}/locationfldetail
  • /riskmodeler/v1/locations/{id}/locationfrdetail
  • /riskmodeler/v1/locations/{id}/locationtodetail
  • /riskmodeler/v1/locations/{id}/locationtrdetail
  • /riskmodeler/v1/locations/{id}/locationwcdetail
  • /riskmodeler/v1/locations/{id}/locationcondition
  • /riskmodeler/v1/locations/{id}/cession
  • /riskmodeler/v1/policies
  • /riskmodeler/v1/policies/{id}/coverage
  • /riskmodeler/v1/policies/{id}/cession
  • /riskmodeler/v1/polices/{id}/policycondition
  • /riskmodeler/v1/portfolios
  • /riskmodeler/v2/portfolios/{id}/geohaz
  • /riskmodeler/v1/producers
Step Policy
  • /riskmodeler/v1/steppolicies
  • /riskmodeler/v1/treaties
  • /riskmodeler/v1/treaties/{id}/lob
  • /riskmodeler/v1/treaties/{id}/lossoccurrences
  • /riskmodeler/v1/treaties/{id}/convert-currency
  • /riskmodeler/v1/underwriters
  • /riskmodeler/v1/globaledit
  • /riskmodeler/v1/uploads/{uploadId}/edm
  • /riskmodeler/v1/uploads/{uploadId}/rdm