> For the complete documentation index, see [llms.txt](https://hinkal-team.gitbook.io/hinkal/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hinkal-team.gitbook.io/hinkal/hinkal-api/api-reference/refresh-cache.md).

# Refresh Cache

## Force a resync of the caller's cached chain state

> Clears the enclave's cached encrypted outputs for the caller's address so the next read\
> re-fetches fresh state from chain. Requires an active session — include\
> \`x-hinkal-request-signature: secp256k1\_sign(SHA256("POST /refresh-cache\n" + JSON.stringify(body)))\`\
> in the headers. Works for EVM, Tron, and Solana.<br>

```json
{"openapi":"3.0.3","info":{"title":"Hinkal API","version":"1.0.0"},"tags":[{"name":"Refresh Cache"}],"servers":[{"url":"https://api.hinkal.io","description":"Production"}],"paths":{"/refresh-cache":{"post":{"operationId":"refreshCache","summary":"Force a resync of the caller's cached chain state","description":"Clears the enclave's cached encrypted outputs for the caller's address so the next read\nre-fetches fresh state from chain. Requires an active session — include\n`x-hinkal-request-signature: secp256k1_sign(SHA256(\"POST /refresh-cache\\n\" + JSON.stringify(body)))`\nin the headers. Works for EVM, Tron, and Solana.\n","tags":["Refresh Cache"],"parameters":[{"$ref":"#/components/parameters/XHinkalRequestSignature"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sessionId":{"type":"string","format":"uuid","description":"Session identifier UUID from POST /create-session"},"nonce":{"type":"string","format":"uuid","description":"Per-request UUID. Echoed back in the response."},"chainId":{"type":"integer"}},"required":["sessionId","nonce","chainId"]}}}},"responses":{"200":{"description":"Cache refreshed","headers":{},"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"nonce":{"type":"string","description":"Echoed per-request `nonce` from the request."}},"required":["success","nonce"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"409":{"$ref":"#/components/responses/NonceConflict"},"500":{"$ref":"#/components/responses/ServerError"}}}}},"components":{"parameters":{"XHinkalRequestSignature":{"name":"x-hinkal-request-signature","in":"header","required":true,"schema":{"type":"string"},"description":"Hex-encoded compact secp256k1 signature: `secp256k1_sign(SHA256(binding + \"\\n\" + payload))`, where `binding` is `\"<METHOD> <routePath>\"` (this route's own method and path, e.g. `\"POST /refresh-cache\"` or `\"GET /balance\"`) and `payload` is `JSON.stringify(body)` for POST requests or the raw query string for GET requests. Binding the route into the signed digest stops a signature captured for one endpoint from being replayed against another. See [Authentication](/enclave-api/authentication) for the full signing scheme."}},"responses":{"Unauthorized":{"description":"Invalid signature or reused nonce","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FailedResponse"}}}},"NonceConflict":{"description":"Request `nonce` already consumed. Each `nonce` is single-use; generate a fresh UUID for every request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FailedResponse"}}}},"ServerError":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FailedResponse"}}}}},"schemas":{"FailedResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"string"}},"required":["success","error"]}}}}
```
