A request reference and an idempotency key can answer different questions. For an operation associated with a flexible SMS inbox number, the first may locate one attempt while the second may identify a logical action across retries. A fresh diagnostic reference does not establish that repeating the action cannot create another object.
Confirm the endpoint’s actual support
Read the current contract for key scope, retention, parameter agreement and returned outcomes. Not every API provides the same mechanism. Adding an arbitrary header to a request cannot require a provider to implement duplicate protection.
A retry of the same logical intent normally needs the identity supported by that contract. A genuinely different action needs its own identity. Do not use a single constant key for all customers or infer a universal lifetime from another product’s example.
Retain the relationship between logical action and attempts in your own records. That lets an operator distinguish an ordinary retry from a new instruction without storing private message contents as the tracing mechanism.

A changed payload may describe another intent
When a user changes the resource or other business conditions, determine what the API requires. Do not repeatedly change parameters under the same key until a request succeeds. Conversely, giving an uncertain old action a new key can defeat the mechanism intended to recognise it.
Key handling also needs the correct account boundary. A client-supplied key does not authorise access to another person’s result. Reusing a saved response must follow the service’s actual identity and resource checks.
A key is not necessarily a secret, but it can reveal operational relationships. Keep it out of unnecessary public URLs and screenshots where the system’s handling does not require disclosure. Diagnostic reporting should use the appropriate limited reference.
Resolve uncertain execution through the original object
A client timeout does not prove the server did nothing. Use the supported status query and stable business reference before deciding what can be retried. If the documented idempotency retention has ended, do not assume the old key remains effective forever.
AWS’s discussion of idempotent APIs explains why caller intent matters during retries. Apply the selected provider’s specific contract rather than treating the general pattern as a guarantee offered by every SMS-related endpoint.
Keep the retention rule with client recovery decisions. If the provider no longer recognises a key, another retry may no longer receive the earlier duplicate treatment. Use the original object lookup or verified support path where necessary. Do not present a locally retained key as proof that the remote system will remember it for the same length of time.

Test repeats and new work separately
In isolation, exercise the same key and payload, a changed payload, concurrent attempts and a lost response. Record the expected outcome under the endpoint documentation, including errors and authorisation rather than merely counting final objects.
Include a distinct new action so protection does not accidentally collapse unrelated work. Use harmless fixtures, not real customer transactions or live verification codes. A replayable mock can establish client behaviour without repeatedly calling a production service.
Keep this boundary distinct from deduplicating inbound webhook events. The source of identity and the party making the request differ. A useful implementation preserves both meanings instead of using one unexplained identifier for every integration step.
Reference: AWS: safe retries with idempotent APIs.
