# Move the clock forward

Advance the server's clock, so time-based states can be reached by hand.

POST `/api/dev/clock`

**cURL**

```shell
curl -X POST 'http://localhost:5200/api/dev/clock' \
  -H 'content-type: application/json' \
  -d '{
  "advanceMs": 604800000
}'
```

**Node.js**

```javascript
const response = await fetch("http://localhost:5200/api/dev/clock", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({ advanceMs: 604800000 }),
})
const data = await response.json()
```

**Python**

```python
import requests

response = requests.post(
    "http://localhost:5200/api/dev/clock",
    json={"advanceMs": 604800000},
)
data = response.json()
```

Response 200 OK

```json
{
  "now": "2026-11-17T09:30:04.211Z"
}
```

> **Development only**
>
> This route answers `not_found` when the server runs in production. It's here for building and testing against a local server.

A code expires after 7 days and an at-risk claim lapses after 7 more. This skips the wait. The clock only moves forward, and it resets when the server restarts.

Moving the clock doesn't run anything. Follow it with Run the worker to act on what's now due.

## Authentication

No credential needed. [How sessions work](https://www.prufy.dev/docs/authentication.md).

## Body

JSON, with `content-type: application/json`.

- `advanceMs` integer required

  How far to move the clock forward, in milliseconds. At most 366 days.

  - 0 to 31,622,400,000

## Response

`200 OK`, with every field below present. Times are ISO 8601 strings in UTC.

- `now` string

  The server's time after the move.

## Errors

| Status | Kind | When |
| --- | --- | --- |
| 400 | `bad_request` | The body isn't JSON, or doesn't match the shape below. `message` names the first field to fix, and `fields` lists each one with its path. |
| 404 | `not_found` | The server is running in production. |
| 413 | `payload_too_large` | The body is over 16 KB. No route takes anything near that. |

Any route can also answer `500` with `internal_error`. Every error has the same shape, described in [Errors](https://www.prufy.dev/docs/errors.md).

---

Every page of these docs, as a list: https://www.prufy.dev/llms.txt
