neosourceDocs
Search docs

Append a chunk of log bytes for an in-flight job

POST/api/jobs/{job_id}/logs

appendJobLogChunk

The declared `offset` must equal the job's current `log_offset` (append CAS). A mismatch returns 409 with the server's current offset in the `x-neosource-log-next-offset` header so the writer can re-sync and resend the unpersisted remainder instead of dropping bytes.

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

curl

curl -X POST 'https://neosource.dev/api/jobs/JOB_ID/logs' \
  -H 'Authorization: Bearer $NEOSOURCE_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"offset":0,"bytes_b64":"string"}'

fetch

fetch("https://neosource.dev/api/jobs/JOB_ID/logs", {
  method: "POST",
  headers: {
    Authorization: "Bearer $NEOSOURCE_TOKEN",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"offset":0,"bytes_b64":"string"}),
});

Path parameters

job_idrequired

string

Request bodyrequired

application/json

LogChunkRequest

object

bytes_b64required

string

Base64-encoded chunk bytes.

offsetrequired

integerint64

Byte offset this chunk starts at. Must equal the current `log_offset` for the job; out-of-order writes return 409.

Responses

204Chunk persisted

413The job's log reached its size cap (ADR 0029). The prefix that fit was persisted and a truncation marker appended; every later append for this job returns 413. The x-neosource-log-next-offset header carries the final offset. Stop posting.

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