> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.markup.ai/developer-reference/api-reference/style-agent/get-style-agent-batch/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.markup.ai/_mcp/server. # Get Style Agent Batch GET https://api.markup.ai/style-agent/batch/{batch_id} Live report for a batch: status, per-status counts, and per-document workflow ids + status. Fetch a document's full result by its `workflow_id` from `GET /style-agent/workflows/{workflow_id}`. This report is the authoritative view of a batch's progress and completion; the optional completion webhook is a best-effort notification on top of it. Reference: https://docs.markup.ai/developer-reference/api-reference/style-agent/get-style-agent-batch ## Authentication - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. ## Request ### Path parameters - `batch_id` (string, required) ### Query parameters - `item_limit` (integer, optional, default: 100) - `item_offset` (integer, optional, default: 0) ## Response ### 200 Successful Response - `batch_id` (string, required) - `status` (enum, required) — Lifecycle of a style-agent batch (see design-docs/style-agent-batch-checking.md). A batch is ``running`` while any item is non-terminal; it becomes ``completed`` (and ``sealed``) once every item reaches a terminal state. - Allowed values: `running`, `completed` - `sealed` (boolean, required) - `created_at` (datetime, required) - `updated_at` (datetime, required) - `item_count` (integer, required) - `counts` (BatchCounts, required) - `items` (list of BatchItemResponse, required) ## Errors ### 401 Unauthorized Error Authentication failed or no valid API key provided. - `detail` (string, required) — A description of the error that occurred. - `status` (integer, required) — The HTTP status code generated by the server for this issue - `request_id` (string, required) — A unique ID associated with the HTTP request. ### 403 Forbidden Error Forbidden - `detail` (string, required) — A description of the error that occurred. - `status` (integer, required) — The HTTP status code generated by the server for this issue - `request_id` (string, required) — A unique ID associated with the HTTP request. ### 404 Not Found Error Batch not found - `any` ### 422 Unprocessable Entity Error Validation Error - `detail` (list of ValidationError, optional) ### 500 Internal Server Error Internal Server Error - `detail` (string, required) — A description of the error that occurred. - `status` (integer, required) — The HTTP status code generated by the server for this issue - `request_id` (string, required) — A unique ID associated with the HTTP request. ## Types ### BatchCounts - `total` (integer, optional, default: 0) - `pending` (integer, optional, default: 0) - `running` (integer, optional, default: 0) - `completed` (integer, optional, default: 0) - `failed` (integer, optional, default: 0) ### BatchItemResponse Per-item entry in a batch response (no full result — fetch by workflow_id, D5). - `item_id` (string, required) - `workflow_id` (string, required) - `status` (enum, required) — Per-document status within a batch, cached from the child workflow. - Allowed values: `pending`, `running`, `completed`, `failed` - `document_ref` (string, optional, nullable) - `error_category` (enum, optional, nullable) — Why a batch item failed (D7): a bad request vs. a processing/system fault. - Allowed values: `input`, `processing` ### ValidationError - `loc` (list of ValidationErrorLocItems, required) - `msg` (string, required) - `type` (string, required) ### ValidationErrorLocItems ## Examples **Response** ```json { "batch_id": "string", "status": "running", "sealed": true, "created_at": "2024-01-15T09:30:00Z", "updated_at": "2024-01-15T09:30:00Z", "item_count": 1, "counts": { "total": 0, "pending": 0, "running": 0, "completed": 0, "failed": 0 }, "items": [ { "item_id": "string", "workflow_id": "string", "status": "pending", "document_ref": "string", "error_category": "input" } ] } ``` **SDK Code** ```python import requests url = "https://api.markup.ai/style-agent/batch/batch_id" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.markup.ai/style-agent/batch/batch_id'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.markup.ai/style-agent/batch/batch_id" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.markup.ai/style-agent/batch/batch_id") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.markup.ai/style-agent/batch/batch_id") .header("Authorization", "Bearer ") .asString(); ``` ```php request('GET', 'https://api.markup.ai/style-agent/batch/batch_id', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.markup.ai/style-agent/batch/batch_id"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.markup.ai/style-agent/batch/batch_id")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```