---
title: "Rate how clean a toilet is"
method: POST
path: "/api/v1/toilets/{id}/ratings"
---

# Rate how clean a toilet is

`POST /api/v1/toilets/{id}/ratings`

## Request

- Base URL: `https://wcway.com`
- URL: `https://wcway.com/api/v1/toilets/{id}/ratings`
- Auth: none required

For the web page of this site only. It needs a Turnstile token unless an account is signed in. A rating needs no confirmation. Each person has one rating per toilet, and the latest rating counts. The answer holds the new average and count. One address adds one new rater per toilet per day.

## Path parameters

- `id` string, required

## Request body

- object
  - `device_id` string: Random number that the browser makes once and keeps. The server stores only its hash. A signed-in account needs none.
  - `rating` integer, required: 1 is dirty. 5 is spotless.
  - `turnstile_token` string: Cloudflare Turnstile token from the page of this site. A signed-in account needs none.

## Response `201`

The rating is saved and counted.

- object
  - `id` string, required
  - `rating` integer, required
  - `cleanliness` object, required
    - `average` number, required
    - `count` integer, required

## Other responses

- `400`: The body is invalid.
- `403`: The request came from another origin, or the Turnstile check failed.
- `404`: No toilet has this id.
- `429`: Rate limit reached. Wait Retry-After seconds.
- `503`: Contributions are off.

---

[API](https://skmtc.dev/wcway/apis/wcway-api.md) · [All operations](https://skmtc.dev/wcway/apis/wcway-api/llms.txt) · [OpenAPI document](https://skmtc.dev/wcway/apis/wcway-api/revisions/34f42e2ca0e8?raw)
