# Run the worker

Do everything that's due right now: scheduled checks, expiries and lapses.

POST `/api/dev/run-worker`

**cURL**

```shell
curl -X POST 'http://localhost:5200/api/dev/run-worker'
```

**Node.js**

```javascript
const response = await fetch("http://localhost:5200/api/dev/run-worker", {
  method: "POST",
})
const data = await response.json()
```

**Python**

```python
import requests

response = requests.post("http://localhost:5200/api/dev/run-worker")
data = response.json()
```

Response 200 OK

```json
{
  "processed": 1
}
```

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

The same pass the background worker makes every 15 seconds. `processed` is how many claims it handled.

## Authentication

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

## Response

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

- `processed` integer

  How many claims were due and handled.

## Errors

| Status | Kind | When |
| --- | --- | --- |
| 404 | `not_found` | The server is running in production. |

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
