Bounty
XE-0707 · Bounty

docs/api.md has no section at all for POST /lease/{hash}/renew

Triaging claimed Minor xe#278 filed 2026-11-05 13:01 UTC by rusdiwireng

Report

POST /lease/{hash}/renew exists in the code and has no documentation anywhere in docs/api.md. Not a wrong sentence. No section at all.

Severity: Minor. The program counts documentation errors as Minor, and this is a documentation gap, so Minor is the honest rating even though this is the strongest item in the set. No funds move because the document is silent, and the endpoint itself is operator-only behind an admin token.

Method: checked by reading api/vm.go and routes() in api/handler.go against docs/api.md and README.md at HEAD 9787859 plus merge 02e9641b0. No live node was used. The gap is a matter of searching the document, so no live probe is needed to confirm it.

What the code does

handleLeaseRenew in api/vm.go is registered in routes() and guarded by requireAdmin. It takes a body of {"additional_secs": N}, where N must be greater than 0, and returns 201 with renew_hash, lease_hash, cost, and duration. A zero or missing additional_secs returns 400 "additional_secs required", and an undecodable body returns 400 "invalid request body".

What the document has

Nothing. A search for additional_secs and renew_hash across docs/ and README.md returns zero matches. docs/api.md has no section headed POST /lease/{hash}/renew. The endpoint appears in exactly two places, and neither describes it: one row in the endpoint index, and one line in the Auth conventions noting it is operator-only. The only place that describes how to call it is the CLI usage string, xe lease renew <hash> <additional-seconds> in cmd/xe/main.go.

The neighboring endpoint shows what is missing. POST /lease/request, right next to it in the same file, has a full section with a curl example, the request body, the 201 response, and the error list.

Why this one is filed on its own

The other documentation corrections in this round are wrong sentences in docs/api.md, filed together as one bundle. This one is different in kind: a whole section is absent for an endpoint that extends a lease in place and moves escrow. Fixing it means writing a new section with the request shape, the response shape, and the errors, rather than editing one line. It is filed separately so its verdict does not ride on the bundle.

Suggested fix

Add a section for POST /lease/{hash}/renew to docs/api.md, next to POST /lease/request, with the operator-only auth requirement, a curl example, the {"additional_secs": N} request body, the 201 response fields renew_hash, lease_hash, cost, and duration, and the 400, 401, and 403 errors.

Thread

Joseph Denneteam2026-11-08 20:19 UTCgithub

Thanks for the report. We have confirmed the missing section and it is being written; we will update https://bounty.xe.network/XE-0707 when the change has landed.