# Idempotency

> Use Idempotency-Key so a retried request never creates something twice.

Source: https://daster.io/docs/api/idempotency/ · Last updated: 2026-11-21

Send an `Idempotency-Key` header on requests that create something or start an operation. If the response is lost, send the **exact same request with the same key** again: DASTER returns the stored result instead of doing the work twice.

```http
POST /v1/projects
Content-Type: application/json
X-Daster-Csrf: <csrf>
Idempotency-Key: create-acme-app-2026-11-01

{ "organizationId": "…", "name": "acme-app", "region": "ap-south-1", "type": "app" }
```

## Rules

- A key is 1 to 128 letters, digits, underscores or hyphens.
- The same key with the same request returns the stored result, even after the work finished.
- The same key with a different request answers `409 idempotency_conflict`.
- A replay checks your current access again.
- After a timeout, do not make a new key: retry the original request.

## Where it is required

- Creating organizations, invitations and projects.
- Creating, rotating and revoking project keys.
- Creating Backend Cloud, databases and hosted services; deploying, restarting, Run now, invoking a function and deleting a service.
- Adding and checking custom domains, and domain orders.
- Push sends and templates, App email templates and keys.

Billing changes accept the header (or `idempotencyKey` in the body). Without one the server makes a random key, so a retried request is not deduplicated: always send one.

## Secrets in replays

A secret appears only in the first successful response. Replaying the request returns the same resource with the secret empty (for project keys, `value: null` and `replayed: true`). If you lost the first response, create a new key and revoke the old one.
