/compile-jobsScope collections:compileRecords the intent to compile and returns immediately. The job advances on the server whether or not the caller stays connected, which is the difference between this and /v1/collections/compile. Submitting the same document set again returns the job that already exists rather than starting a second compile. A selection larger than one compile can carry is partitioned server-side into parts and answered with COMPILE_CORPUS_ACCEPTED and a corpusId instead of a jobId; each part is an ordinary compile job with its own id, state and event stream.
curl -sS -X POST https://tavonel.com/api/compile-jobs \
-H "Authorization: Bearer $TAVONEL_API_KEY" \
-H "content-type: application/json" \
-d '{ "documentIds": [ "<documentIds>" ] }'import os
import requests
body = {
"documentIds": ["<documentIds>"]
}
response = requests.request(
"POST",
"https://tavonel.com/api/compile-jobs",
headers={"Authorization": "Bearer " + os.environ["TAVONEL_API_KEY"]},
json=body,
timeout=30,
)
response.raise_for_status()
print(response.json())const response = await fetch("https://tavonel.com/api/compile-jobs", {
method: "POST",
headers: { authorization: `Bearer ${process.env.TAVONEL_API_KEY}`, "content-type": "application/json" },
body: JSON.stringify({ "documentIds": [ "<documentIds>" ] }),
});
if (!response.ok) throw new Error(`${response.status} ${(await response.json()).code}`);
console.log(await response.json());{
"documentIds": [
"<documentIds>"
]
}| Status | Response |
|---|---|
202 | Accepted. A single job returns { code: COMPILE_JOB_ACCEPTED, jobId, state, documentsTotal }; a partitioned selection returns { code: COMPILE_CORPUS_ACCEPTED, corpusId, batchCount, parts } instead, and each part is an ordinary compile job with its own id. Location names whichever resource was created. |
400 | DOCUMENT_IDS_REQUIRED — The request carried no document id array. DOCUMENT_SET_EMPTY — Nothing was selected to compile. DOCUMENT_SET_UNQUALIFIED — A value in documentIds was not a document id. CORPUS_TOO_LARGE — More documents than one run carries. SPLIT_PART_LIMIT_EXCEEDED — Partitioning the selection would make more parts than a run holds. INVALID_JSON — The body was not parseable JSON. |
401 | AUTH_REQUIRED — No credential was presented, or the bearer token is not a key TAVONEL issued. This is what an unauthenticated request to any scoped route returns. |
402 | STUDIO_SUBSCRIPTION_REQUIRED — The operation needs the higher plan tier — activation, rollback and retrieval-index rebuild are the three. TRIAL_WORLD_LIMIT_REACHED — The free evaluation's compiled-World count is spent. GPU_CREDITS_REQUIRED — The workspace has no processing balance left to reserve against. |
403 | API_SCOPE_REQUIRED — The key authenticated and does not carry the scope this operation requires. The request was refused rather than answered with less. PILOT_ACCESS_REQUIRED — The credential is valid and the workspace it names is not admitted to TAVONEL. |
409 | COMPILE_JOB_SLOT_CONFLICT — A part of this corpus is already held by a job over a different document set. Retrying does not clear it. SOURCE_VERSION_AMBIGUOUS — Two source versions carry the same identity and the request did not say which. |
415 | METADATA_ONLY_ENDPOINT — Document bytes were POSTed to a route that accepts only metadata. Bytes go direct to storage, never through the application server. |
429 | API_RATE_LIMITED — The key has used its per-minute allowance for this scope. The window is a fixed clock minute per key and scope; the allowances are on /docs/billing-and-limits. WORKSPACE_CONCURRENCY_LIMIT — The workspace already has as many compiles in flight as it may. COMPILE_JOB_WORKSPACE_LIMIT_REACHED — The workspace is at its compile-job ceiling. |
503 | COMPILE_JOB_STORE_NOT_CONFIGURED — The durable job store is not configured. COMPILE_JOB_STORE_WRITE_FAILED — The durable job store could not be written, so the intent was not recorded. COMPILE_JOB_RPC_UNDEFINED — The job store is missing a procedure this build expects — a deployment mismatch. |