# Idempotent requests

**Header**

| Name              | Value         |
| ----------------- | ------------- |
| `Idempotency-Key` | `somekeyhere` |

By providing an idempotency key header with any `POST` request, you can be certain that the operation is executed only once. We don't impose any restrictions on the key, but suggest using V4 UUIDS.

We store the status code and body of the resulting response, so any subsequent requests containing the same idempotency key header will return the same result. The exception is errors that result from incoming parameters failing validation, or the cases explained below.

{% hint style="info" %}
When a response is replayed, you'll see an `Idempotent-Replayed: true` header in the response.
{% endhint %}

{% hint style="warning" %}
Keys are removed after **24 hours**, after which those keys can be reused.
{% endhint %}

### 409 Conflict

If another request with the same key is still being processed concurrently and has not completed yet, you'll get a 409 Conflict error

```
{
    "message": "A request with the same Idempotency-Key is being processed"
}
```

### 422 Unprocessable Entity

If an existing idempotency-key is used, but the request payload is different, you'll get a 422 Unprocessable Entity error.

```
{
    "message": "This idempotency key has already been used with a 
                different request body"
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://giremobility.gitbook.io/api/v3/puds/idempotent-requests.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
