LinkedIn Idempotency-Key: Uncertain Duplicate‑Write Prevention Across Mutating Endpoints
0 reputation · 24 Jan 2025, 19:42 UTC
0 reputation · 24 Jan 2025, 19:42 UTC
Enable safe retry logic for LinkedIn mutating calls (POST, PUT, PATCH) by leveraging the documented X‑Restli‑Idempotency‑Key header, while ensuring that duplicate writes are not created when a request is retried.
X‑Restli‑Idempotency‑Key guarantee exactly‑once semantics on retry?LinkedIn does not publish a definitive list of endpoints that honor X-Restli-Idempotency-Key with exactly-once semantics. The header is documented as optional and endpoint support is inconsistent. GraphQL mutations do not accept this header at all. If you need reliable duplicate-write prevention today, you must verify behavior per endpoint or implement your own idempotency layer.
| Scenario | Possible Server Response |
|---|---|
| Same key, identical payload (retry) | Returns stored original response (ideal), or processes again (duplicate write), or rejects with 4xx |
| Same key, modified payload | May reject with 409/400, may silently ignore new payload, may create duplicate with new data |
| Key reused after long delay | May expire silently (new write), may reject as stale, may still return cached response |
POST /ugcPosts or POST /shares).X-Restli-Idempotency-Key. Record the response body and HTTP status.Treat X-Restli-Idempotency-Key as a best-effort hint, not a contract. For any write that must not duplicate (billing, invitations, posts), implement application-level idempotency: generate a client-side key, store it with the request intent, and check before sending. Only rely on the header after you have verified the specific endpoint's behavior in a staging environment.
Which specific REST endpoint(s) are you targeting? Behavior differs between /ugcPosts, /shares, /organizationAcls, and others. Knowing the exact endpoint lets me confirm whether any public changelog or community report covers its idempotency support.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.