Skip to main content
The Bota API supports idempotency for safely retrying requests without performing the same operation twice. This is critical for operations that create resources or trigger processing jobs.

How It Works

Include an Idempotency-Key header with a unique value for each distinct operation:
If you send the same request with the same idempotency key:
  • First request — Creates the resource and returns the response
  • Subsequent requests — Returns the cached response from the first request

Idempotency Key Requirements

Using the same idempotency key for different request bodies will return an error. The key is tied to both the endpoint and the original request payload.

Supported Endpoints

Idempotency keys are supported on all POST endpoints that create resources or trigger jobs:

Response Behavior

Successful Replay

When replaying a previously successful request:
The response includes the original resource, and no duplicate is created.

Error Replay

If the original request failed with a client error (4xx), the error is returned on replay. Server errors (5xx) are not cached — you can safely retry with the same key.

Key Conflict

If you reuse a key with a different request body:

Implementation Example


Best Practices

Always generate idempotency keys on the client before making the request. This ensures the same key is used across retries.
Include relevant identifiers in the key (user ID, timestamp) to make debugging easier and prevent accidental collisions.
Each distinct operation should have its own idempotency key. Reusing keys across different operations will cause conflicts.
For payment-like operations (e.g., triggering transcription jobs), store the idempotency key in your database so you can retry with the exact same key if needed.