# Timing Security

To ensure secure and time-sensitive request handling, all **SIGNED** endpoints require a timestamp header and may optionally use a validity window.

## **Required Header**

* **`X-CH-TS`**: The UNIX timestamp (in milliseconds) representing the exact moment the request is sent.\
  Example: `1528394129373`

## **Optional Parameter**

* **`recvWindow`** *(query parameter)*:\
  Defines the duration (in milliseconds) for which the request remains valid after the timestamp.
  * Default: `5000` (if not specified)
  * Recommended: `5000` or less for better precision

## **Server Validation Logic**

The server validates your request timestamp using the following logic:

```javascript
javascriptCopyEditif (timestamp < (serverTime + 1000) && (serverTime - timestamp) <= recvWindow) {
  // Accept the request
} else {
  // Reject the request
}
```

> ⏱️ **Note:** If the server detects that your timestamp is more than **1 second ahead** of the server time, the request will be **rejected** — even if it falls within `recvWindow`.

***

## **Why it matters:**

Accurate timing is critical for trading. Network latency and instability can affect request delivery times. Using `recvWindow` helps ensure that requests are **processed within a defined time window**, improving reliability and preventing stale or potentially risky operations.


---

# 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://docs.coinlocally.com/introduction/timing-security.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.
