Claim dirty snapshot paths
GET/api/prerender/claim
claimPrerenderSnapshots
Long-polls the prerender work queue and leases up to `limit` dirty snapshot paths. Returns an empty list when nothing becomes dirty within the wait window — the worker simply re-claims. Each unit carries a `dirty_seq` that MUST be quoted back on complete/fail; a completion at a stale value means a write landed mid-render and the path stays queued. Authenticates with the prerender worker token.
Requires authentication using a bearer token — see tokens and scopes.
curl
curl -X GET 'https://neosource.dev/api/prerender/claim' \
-H 'Authorization: Bearer $NEOSOURCE_TOKEN'fetch
fetch("https://neosource.dev/api/prerender/claim", {
method: "GET",
headers: {
Authorization: "Bearer $NEOSOURCE_TOKEN",
},
});Query parameters
limitMaximum units to hand back in one response. Server-capped.
wait_timeout_secsHow long the server may hold the connection open waiting for work before answering with an empty list. Server-capped.
Responses
200Leased work (possibly empty)
application/json
Standard errors
Bodies documented once for the whole API — see standard errors.
- 400Bad Request — one of: invalid_input
- 401Authentication required
- 429Rate limited — retry after the `Retry-After` header
- 500Internal server error
- 503Service temporarily unavailable / at capacity — retry after the `Retry-After` header
- 504Gateway timeout — the request exceeded the server's handling budget
Schemas
Referenced above. Listed here rather than expanded inline, so the same definition is not repeated at every level.
PrerenderOp
What the prerender worker should do with a claimed snapshot path. `Purge` (D5) exists so a repo leaving public visibility can retract its snapshots through the same claim/lease/retry machinery as a render, without the Rust server ever gaining S3 *delete* rights — the worker already owns S3 mutation, and a purge inherits the retry the old fire-and-forget delete never had.
"render""purge"