Create batch-jobs.mdx - #699
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
jhcipar
left a comment
There was a problem hiding this comment.
Reviewing against the current batch API implementation - a few spots where the doc contract and the API differ. Posting these as discussion points; happy to move the API toward the documented contract where it makes sense.
| ```json | ||
| { | ||
| "name": "nightly-embeddings-2026-07-09", | ||
| "requests": [ |
There was a problem hiding this comment.
The doc shows create accepting {"name", "requests": [...]} and returning a rich object with status: "OPEN". Currently the API accepts a bare array of job inputs and returns only {id, status: "DRAFT"}. We can update the API to match this contract if needed (accept a name at create, return the full summary).
There was a problem hiding this comment.
@Promptless work on the above comment. Reference - Update the create batch request and response to match the actual API.
The current doc shows the create endpoint accepting {"name": "...", "requests": [...]} and returning a rich object with status: "OPEN". The actual API accepts a bare array of job inputs and returns only {"id": "<batch_id>", "status": "DRAFT"}. Update the request body, code example, and response example to reflect this.
| A batch moves through the following states: | ||
|
|
||
| ``` | ||
| OPEN → FINALIZED → RUNNING → COMPLETED |
There was a problem hiding this comment.
Same thing as previous comment - open -> draft.
There was a problem hiding this comment.
@Promptless Replace OPEN with DRAFT everywhere in the file.
The state diagram currently reads OPEN → FINALIZED → RUNNING → COMPLETED. Change it to DRAFT → FINALIZED → RUNNING → COMPLETED. Also update any references to "open batches" to "draft batches."
| "completedAt": "2026-07-09T09:15:10Z" | ||
| } | ||
| ], | ||
| "nextCursor": "cursor_xyz" |
There was a problem hiding this comment.
The current pagination setup uses offsets/limits - eg it returns {requests, total, offset, limit, hasMore}.
There was a problem hiding this comment.
@Promptless work on the above comment - The current doc shows "nextCursor": "cursor_xyz" in the list response. The actual API returns {"requests": [...], "total": , "offset": , "limit": , "hasMore": true|false}. Update the response example and any description of how to paginate.
| | `POST` | `/v2/{endpoint_id}/batch/{id}/cancel` | Cancel a batch | | ||
| | `GET` | `/v2/{endpoint_id}/batch/{id}/requests` | Paginated child request list | | ||
|
|
||
| For full request and response schemas, see the [API reference](/api-reference/endpoint/batch). |
There was a problem hiding this comment.
Just checking that this link is meant to be broken right now.
| | Limit | Value | | ||
| |-------|-------| | ||
| | Queued items per endpoint | 50,000 | | ||
| | Open (draft) batches per user | 100 | |
There was a problem hiding this comment.
Currently we enforce this: 10 active batches per endpoint, 5,000 requests per batch, 50,000 queued per endpoint - but am adding something in beta to have it be configurable per user/org, so maybe a "contact sales" or something lever there.
There was a problem hiding this comment.
@Promptless work on the above comment - Replace the current limits with:
Active batches per endpoint: 10
Requests per batch: 5,000
Queued requests per endpoint: 50,000
Add a note below the table: "Limits are configurable for enterprise accounts. Contact sales for custom limits.
| ] | ||
| } | ||
| ``` | ||
| Each call accepts up to 100 requests in a single array. You can call this |
There was a problem hiding this comment.
Currently we don't limit requests per call, we just have a 10 MiB body limit.
There was a problem hiding this comment.
@Promptless The doc currently states "Each call accepts up to 100 requests in a single array." Remove this. Replace with: "Request body size is limited to 10 MiB per call."
|
Thanks for the review request — we're looking into the new |
|
Update: we've reviewed all five requested changes to |
- Rename batch state OPEN -> DRAFT throughout (diagram, lifecycle, API table)
- Fix create request to a bare array of job inputs; response is {id, status: DRAFT}
- Fix results pagination to offset/limit/total/hasMore (was nextCursor)
- Update limits table (10 active batches/endpoint, 5,000 requests/batch, 50,000 queued/endpoint) + enterprise note
- Replace per-call request count with 10 MiB body-size limit
|
Done — |
|
Done — the create batch request is now a bare JSON array of job inputs (the |
|
Done — the results/list response now returns One follow-up: the page doesn't yet state a default or maximum for |
|
Done — the limits table now reads:
and a note has been added below it: "Limits are configurable for enterprise accounts. Contact sales for custom limits." Pushed to |
|
Done — removed "Each call accepts up to 100 requests in a single array." and replaced it with "Request body size is limited to 10 MiB per call." Pushed to |
|
One heads-up while applying the review changes: the page links to |
| ```json | ||
| { | ||
| "id": "batch_01j9abc123", | ||
| "status": "RUNNING", |
There was a problem hiding this comment.
The poll response example doesn't match what the API currently returns. GET /v2/{endpoint_id}/batch/{batch_id} returns:
id,endpointId,statusrequestTotal,requestInProgress,requestCompleted,requestFailedfailureCode,failedAt,failedWorkerIds(on failure)createdAtas epoch millis (int64), plusnameif set
There's no itemCount, queuedCount, inProgressCount, completedCount, failedCount, progress, or finalizedAt.
Also, batch status today is DRAFT, FINALIZED, FAILED, or CANCELLED — there's no RUNNING state, so "status": "RUNNING" in the example doesn't reflect the API; an executing batch shows FINALIZED and progress is inferred from the request counts. Happy to add richer states/fields to the API if we'd rather keep the documented contract — otherwise the example should be updated, e.g.:
{
"id": "batch_01j9abc123",
"endpointId": "abc123xyz",
"status": "FINALIZED",
"requestTotal": 1000,
"requestInProgress": 8,
"requestCompleted": 244,
"requestFailed": 6,
"createdAt": 1783584000000
}There was a problem hiding this comment.
@Promptless Replace the poll response example with the correct shape:
json
{
"id": "batch_01j9abc123",
"endpointId": "abc123xyz",
"status": "FINALIZED",
"requestTotal": 1000,
"requestInProgress": 8,
"requestCompleted": 244,
"requestFailed": 6,
"createdAt": 1783584000000
}
Remove RUNNING and COMPLETED from the batch state list. The actual states are DRAFT, FINALIZED, FAILED, and CANCELLED. A batch that is actively processing shows as FINALIZED — progress is tracked via requestTotal, requestInProgress, requestCompleted, and requestFailed.
Update any explanatory text around polling/monitoring to reflect that you infer progress from the request count fields, not from a RUNNING status or a progress field.
|
Thanks for the detailed corrections! I'm applying these to |
|
@Promptless remove all mention of the 24 hour SLA in the doc |
|
Thanks for the request! We're on it — researching the batch jobs feature and drafting a new |
|
Quick update: we found the 24-hour SLA referenced in three places in the batch jobs page (the frontmatter description, the comparison table, and a known-limitations bullet). Preparing the edits to remove all of them now. |
|
Done — I removed every mention of the 24-hour SLA from the batch jobs page:
This also keeps the page consistent with the batch state model documented on the same page, which doesn't commit to a guaranteed completion time. The changes are on the |
|
@Promptless Revert the recent changes made to the 24-hour SLA. Add it back to the doc pages. |
|
Thanks — we're on it. We'll track down the recent change to the 24-hour SLA language, verify the prior wording, and restore it to the affected doc page(s). We'll follow up here once the change is ready. |
|
Update: we found the change. The 24-hour SLA wording was removed from |
Reverts commit f48c595 at PR author @lavanya-gunreddi's request (PR #699 comment 5357223965). Restores the 24-hour SLA wording in the frontmatter description, the batch-vs-/run comparison table's Latency cell, and the known-limitations scheduling bullet.
|
Done — the 24-hour SLA wording has been restored on the batch jobs page ( |
|
@Promptless remove all mention of the 24 hour SLA in the doc |
|
Thanks for the request — we're on it. We're researching the relevant details and drafting a new |
|
Got it — we'll also remove all mention of the 24 hour SLA from the doc as part of this update. |
|
Research is done. The 24 hour SLA is mentioned in three places on this page (the frontmatter description, the comparison-table latency cell, and a known-limitations bullet). We're updating all three now and will follow up when the change is ready. |
|
Done — we removed every mention of the 24-hour SLA from the batch jobs page:
The change is pushed to the |
No description provided.