neosourceDocs
Search docs

Report a snapshot rendered or purged

POST/api/prerender/complete

completePrerenderSnapshot

Completes a claimed unit. The delete is CONDITIONAL on `dirty_seq`: if a write re-dirtied the path while it was rendering, the row survives and is immediately re-claimable, and the response says so (`redirtied`) rather than pretending the path is clean. Authenticates with the prerender worker token.

Requires authentication using a bearer token — see tokens and scopes.

curl

curl -X POST 'https://neosource.dev/api/prerender/complete' \
  -H 'Authorization: Bearer $NEOSOURCE_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"snapshot_path":"string","dirty_seq":0}'

fetch

fetch("https://neosource.dev/api/prerender/complete", {
  method: "POST",
  headers: {
    Authorization: "Bearer $NEOSOURCE_TOKEN",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"snapshot_path":"string","dirty_seq":0}),
});

Request bodyrequired

application/json

CompleteSnapshotRequest

object

Report a snapshot rendered (or purged) successfully.

dirty_seqrequired

integerint64

The value handed out with the claim, quoted back verbatim.

snapshot_pathrequired

string

Responses

200Completion outcome

application/json

CompleteSnapshotResponse

object

outcomerequired

SnapshotCompletionOutcome

string

What the conditional delete actually did (D3) — reported back so a worker can log the re-dirty case instead of assuming its upload settled the path.

"removed""redirtied""missing"

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