An AI agent publishes a Post. The request times out before the response arrives. Did the provider receive it?
The agent cannot safely assume either answer. Retrying with a new request may create a duplicate. Giving up may leave a requested Post unpublished. Idempotency gives the client a third option: retry the same logical operation and receive the original result.
What idempotency means
An idempotency key identifies one intended write. The client sends that key with the request and keeps it when retrying the same action. The server stores the relationship between the key, request, and result.
If the first request completed, a retry returns the saved result. If the request is still running, the server can return or expose the same operation. It does not start a second publish simply because the network response was lost.
Why agents make this more important
Human-operated interfaces often hide retries inside one browser session. Agents run in environments where retries are explicit:
- A tool host retries after a transport failure.
- A workflow restarts from a checkpoint.
- A scheduler polls, times out, and tries the write again.
- A user repeats the instruction because the first answer was unclear.
- Two workers receive the same queued task.
An agent may also generate a fresh UUID for each call. That is correct for new work and dangerous for a blind retry. The key should identify the user’s logical instruction, not each HTTP attempt.
A safe retry sequence
- Create one idempotency key for the logical publish request.
- Send the Post content, Destination, media, timing, and confirmation with that key.
- If the client receives a timeout, retain the key and request body.
- Check the stable Post or operation ID when one was returned.
- Retry with the same key and the same semantic request.
- Treat a key reused with different content as an error.
logical request: publish release update to LinkedIn
idempotency key: launch-2026-08-24-linkedin
attempt 1 -> response lost
attempt 2 -> same key, same request
result -> original Post and publication stateWhat good documentation should answer
“Supports idempotency” is not enough. Check:
- Which write operations accept a key?
- Is the key scoped to an Account, Workspace, or endpoint?
- What happens when the body changes?
- How long are completed keys retained?
- Are failed requests cached or retryable?
- Does a replay return the same resource and status?
- How does idempotency interact with partial multi-Destination success?
The last question matters for social publishing. If three Destinations succeed and one fails, retrying the group must not republish the completed three.
Idempotency does not replace confirmation
Idempotency prevents accidental duplicate execution. It does not prove that the user intended the first execution.
A safe publish path needs both:
- Confirmation answers: “Should this exact public action happen?”
- Idempotency answers: “If we repeat the request, is it still the same action?”
It also needs concurrency control. An idempotency key should not let an agent publish version 1 after a person edited the Post to version 2. ETags or another version check protect that boundary.
The practical standard
Any social publishing API intended for agents should document idempotency for publishing, scheduling, retries, and other consequential writes. The client should make the key part of its workflow state, not generate it at the final network boundary.
Read the OpenPMM idempotency reference or apply the full social publishing API checklist. OpenPMM exposes this publishing contract through hosted MCP, the API, and the CLI.