Logs
GET /v1/sites/{id}/logs reads what the site's code wrote with console,
and the errors it threw, in the last hour. Newest first.
A site that is files only has no code, so it has no logs.
Ask
| Parameter | Means |
|---|---|
slot |
read a draft's code, not the live code. slot=1 is the first draft. |
limit |
the most lines to return, from 1 to 2000. The default is 200. |
What the answer says
{
"lines": [
{ "time": "2026-09-30T12:00:03Z", "level": "error", "message": "D1_ERROR: no such table: orders" }
],
"from": "2026-09-30T11:00:05Z",
"to": "2026-09-30T12:00:05Z"
}
Lines can arrive some seconds after the request that wrote them. If a line you expect is not there, ask again.
An error in the site's code is the site's to fix. Read the line, change the code, and publish again.