Integrations & Automation

Idempotency Key

An idempotency key is a unique value a client sends with a request so that retrying the same request does not perform the action twice.

Updated Sep 27, 2026
TL;DR

The retry safety net that stops a timed-out API call from charging a card twice, or publishing the same post twice.

Key Points

  • ✓Generate one unique key per action and reuse it for every retry of that action
  • ✓Same key and same request: the server replays the first response instead of acting again
  • ✓Same key with a different request body is an error
  • ✓Especially useful for AI agents and scripts that retry after timeouts

An idempotency key is a unique value a client sends with a request so that retrying the request does not perform the action twice. Payment APIs popularized it: Stripe accepts an idempotency key so a network error never charges a card twice. 1 The IETF is standardizing it as the Idempotency-Key HTTP header. 2

The problem it solves

You send a request to publish a post. The connection drops before the answer arrives. Did it work? Without an idempotency key, the safe-looking retry can publish the same post twice. With a key, the server recognizes the retry and returns the original result.

How to use one

  1. Create a new random key (for example a UUID) for each action, such as “publish this post”.
  2. Send it in the Idempotency-Key header.
  3. If you need to retry, send the exact same request with the same key.
  4. Never reuse a key for a different action.

Why it matters for AI agents

Autonomous agents retry on their own when a tool call times out. Without idempotency, an agent that retries after a slow response can post the same update twice. With it, retries are harmless.

Idempotency keys in Publora

The create-post endpoint of the Publora API accepts an optional Idempotency-Key header. The same key with the same body replays the original response, including the same post ID, so no second post is created. The same key with a different body returns 422 IDEMPOTENCY_KEY_CONFLICT, and a retry while the first request is still running returns 409 IDEMPOTENCY_IN_FLIGHT. 3

Publora and Idempotency Key

The Publora API and MCP server publish and schedule posts to 10 networks from your own code or from AI assistants like Claude, ChatGPT and Cursor.

See the Publora API →

Related Terms

  • API Key

    An API key is a secret string that identifies the app or person calling an API. It is sent with every request so the service knows who is asking.

  • API Rate Limit

    An API rate limit caps how many requests a client can make in a set period. Requests over the limit are rejected, usually with HTTP 429 Too Many Requests.

  • Autonomous Agent

    An AI system that independently understands objectives, makes decisions, and executes social media marketing tasks without constant human oversight or manual workflow setup.

  • Publishing API

    A programmatic interface that enables automated creation, uploading, and scheduling of content across social media platforms without manual intervention.

  • Webhook

    Automated HTTP callbacks that send real-time data between applications when specific events occur, enabling instant integration without constant polling.

Last updated: