Skip to main content
Circle APIs support idempotent requests, so making the same request multiple times produces the same result. This lets you safely retry API calls if something goes wrong.

Idempotency keys

Certain endpoints require you to generate an idempotency key to identify the request. For endpoints that require an idempotency key, each request must have a unique key. The server uses this key to identify a specific request. When a request is made with the same idempotency key, the server returns the original response instead of executing the operation again. For endpoints that require it, the idempotency key must be in UUID version 4 format. The following example demonstrates how to generate an idempotency key in Node.js:
import crypto from "crypto";

function generateIdempotencyKey(): string {
  return crypto.randomUUID();
}

const idempotencyKey: string = generateIdempotencyKey();
console.log(idempotencyKey); // e.g. "f47ac10b-58cc-4372-a567-0e02b2c3d479"