neosourceDocs
Search docs

Finish a job and release its lease

POST/api/runners/leases/{lease_id}/complete

completeJob

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

curl

curl -X POST 'https://neosource.dev/api/runners/leases/LEASE_ID/complete' \
  -H 'Authorization: Bearer $NEOSOURCE_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"status":"string"}'

fetch

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

Path parameters

lease_idrequired

string

Request bodyrequired

application/json

CompleteJobRequest

object

compile_cache
one of
  • null

  • CompileCacheReportDto

    object

    What the job's compiler cache reported at job end, straight from its own accounting (`sccache --show-stats --stats-format=json`). Absent means "this job said nothing about a compile cache" — which is the majority of jobs, since most compile nothing. Never read it as a cold cache.

    compilationsrequired

    integerint64

    Compilations actually performed — the count `compile_ms` aggregates over, and therefore the divisor for the mean compile.

    compile_msrequired

    integerint64

    hitsrequired

    integerint64

    missesrequired

    integerint64

    read_hit_msrequired

    integerint64

    TOTAL ms across all hits / all compilations, not per-request means.

    requestsrequired

    integerint64

error_message

string | null

exit_code

integer | nullint32

outputs

object

The job's evaluated `outputs:` block (empty for failed jobs and workflows without `outputs:`). Persisted on the job row so a later claim of a dependent job carries `needs.<job>.outputs.*`.

additional properties

string

statusrequired

WorkflowRunJobStatus

string

Lifecycle of an individual job inside a run. Distinct from the run-level status because `needs:` ordering means some jobs are `Waiting` while others are `Running`. The serde `snake_case` strings are the wire vocabulary the API emits (pinned by the `enum_wire_consistency` tests).

"waiting""ready""running""cancelling""succeeded""failed""cancelled""skipped"

Responses

204Completed

Standard errors

Bodies documented once for the whole API — see standard errors.

  • 400Bad Request — one of: invalid_input
  • 401Authentication required
  • 403Forbidden — one of: forbidden
  • 404Not Found — one of: not_found
  • 409Conflict — one of: conflict
  • 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