Skip to main content

Overview

This API implements idempotency for specific endpoints to prevent duplicate request processing. Idempotency ensures that making the same request multiple times has the same effect as making it once, which is crucial for operations like creating entities or sending invitations.

How It Works

A replay answers with the status code of the first response: 201 for a create, 200 for an update. Only a successful response is stored. A request that fails, with any 4xx or 5xx, is not, so a retry with the same key runs again.

What a key is scoped to

A cached response is keyed on your organization, the HTTP method, the full path and your key. The path includes the version segment and any ids in it. The query string is not part of the path. What that means in practice:
  • The same UUID sent to two different endpoints does not collide. Reusing a key across operations is still bad practice, but it will not replay the wrong response body.
  • A key is private to your organization. Two customers sending the same UUID never see each other’s response.
  • The ids in the path count. The same UUID sent to /v2/upstream/policies/{a}/transactions and then to /v2/upstream/policies/{b}/transactions is two separate requests, and both are processed. Use a fresh key per operation anyway.
  • Retry with exactly the same path. A trailing slash or a change in letter case makes it a different path, and the retry is processed as a new request.

What counts as the same request

The first response is stored with a fingerprint of the request that produced it: the body, the query string and any uploaded files. A retry with the same key to the same path has to send the same request. If anything in it differs, the API answers 400 Bad Request and processes nothing, rather than replaying the first response for a request you did not send. Formatting doesn’t count. JSON keys and query parameters can come in any order, the JSON can be indented or not, and a request with no body matches whether or not it carries Content-Type: application/json.

Supported Endpoints

Every endpoint that accepts a key advertises an idempotency-key parameter on its reference page. The current set: Agency (/v2/downstream/*) — every write:
  • POST /v2/downstream/entities
  • POST /v2/downstream/producers
  • POST /v2/downstream/producers/{producerId}/entities
  • POST /v2/downstream/contacts
  • POST /v2/downstream/compliance-configs
  • POST /v2/downstream/corporate-registration-filings
  • POST /v2/downstream/documents
  • POST /v2/downstream/surplus-lines-filings
  • PUT /v2/downstream/surplus-lines-filings/{filingId}/policy-document
  • POST /v2/downstream/surplus-lines-filings/{filingId}/checklist-item/file-documents
  • POST /v2/downstream/surplus-lines-filings/{filingId}/escalation/messages
Carrier (/v1/* and /v2/upstream/*):
  • POST /v1/downstream-entity-associations/add and POST /v2/upstream/downstream-entity-associations/add
  • POST /v1/downstream-entity-associations/invite and POST /v2/upstream/downstream-entity-associations/invite
  • POST /v1/policies and POST /v2/upstream/policies
  • POST /v1/policies/upload and POST /v2/upstream/policies/upload
  • POST /v1/policies/{policyId}/transactions and POST /v2/upstream/policies/{policyId}/transactions
  • POST /v2/upstream/file-documents (v2 only; the v1 upload does not accept a key)
  • POST /v2/upstream/surplus-lines-filings (v2 only, no v1 route)
  • PUT /v2/upstream/surplus-lines-filings/{filingId}/policy-document (v2 only, no v1 route)
  • POST /v2/upstream/surplus-lines-filings/{filingId}/checklist-item/file-documents (v2 only, no v1 route)
  • POST /v2/upstream/surplus-lines-filings/{filingId}/escalation/messages (v2 only, no v1 route)
  • POST /v2/upstream/diligent-effort-requests (v2 only, no v1 route)
  • POST /v2/upstream/appointment-requests (v2 only, no v1 route)
  • POST /v2/upstream/appointment-requests/{appointmentRequestId}/cancel (v2 only, no v1 route)
  • POST /v2/upstream/termination-requests (v2 only, no v1 route)
  • POST /v2/upstream/termination-requests/{terminationRequestId}/cancel (v2 only, no v1 route)
  • POST /v2/upstream/contacts (v2 only, no v1 route)
  • PATCH /v2/upstream/downstream-entity-associations/{downstreamEntityAssociationId} (v2 only, no v1 route)
  • POST /v2/upstream/downstream-entity-associations/{downstreamEntityAssociationId}/executed-producer-agreement (v2 only, no v1 route)
No other carrier write on v2 supports idempotency keys. On v1 the two deprecated dangerously- association endpoints also accept one; both are absent from v2. Sending one to an endpoint that does not accept it is harmless — the header is ignored — but the request is not protected against a retry.

Headers

Include one of these headers in your requests to enable idempotency:

Usage Guidelines

When to Use Idempotency Keys

Creating new entities or resources
Sending invitations or notifications
Any operation that should not be duplicated
Network retry scenarios
User interface double-click prevention

Behavior

Error Handling

Example Usage

Request with Idempotency Key

A key belongs to one request. Sending the same key to the same path with a different body, query string or file within the hour is refused with 400 Bad Request, and the second request is not processed. Use a fresh key for each distinct operation and reuse one only when retrying the identical request. The check applies once the first response is stored: two requests sent at the same moment with one key are both processed, so wait for the first answer before you retry.

Generating UUIDs

Use any UUID v4 generator:

Best Practices

Generate Unique Keys

Use a fresh UUID for each logical operation

Client-Side Generation

Generate UUIDs on the client side before making requests

Retry Logic

Use the same idempotency key when retrying failed requests

Key Management

Don’t reuse keys across different operations

Testing

Include both scenarios in your tests:
  • Requests with idempotency keys
  • Requests without idempotency keys

Postman Variables

You can use Postman’s built-in variable for testing:
This generates a new UUID for each request, or create a collection variable for consistent testing.
This implementation ensures reliable API operations and prevents duplicate processing in distributed systems and unreliable network conditions.