> For clean Markdown of any page, append `.md` to the page URL. > For a complete documentation index, see https://docs.sarvam.ai/llms.txt. > For full documentation content in one file, see https://docs.sarvam.ai/llms-full.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.sarvam.ai/_mcp/server. # Start Job POST https://api.sarvam.ai/translate/document/jobs/{job_id}/start Start the translation pipeline after the file has been uploaded to the signed `upload_url`. Idempotent. Reference: https://docs.sarvam.ai/api-reference/translate-document/start-doc-translation ## Authentication - `api-subscription-key` header (required) — API Key authentication via header ## Request ### Path parameters - `job_id` (string, required) — The `job_id` returned by POST /translate/document/jobs. ## Response ### 200 Job started. - `job_id` (string, required) - `job_state` (enum, required) — Aggregate job state returned by GET /jobs/\{job\_id}/live-status. - Allowed values: `Accepted`, `Running`, `Completed`, `PartiallyCompleted`, `Failed` - `num_pages` (integer, optional) — Number of pages in the source document. Present for PDF jobs; omitted for Office formats. - `warnings` (list of string, optional) — Server warnings (e.g. filename overridden from content detection). Omitted when empty. ## Errors ### 400 Bad Request Error Bad Request — Validation error (invalid or missing field). - `error` (Sarvam_Model_API_ErrorDetails, required) — Error details ### 401 Unauthorized Error Unauthorized. Send a valid `api-subscription-key`. - `error` (Sarvam_Model_API_ErrorDetails, required) — Error details ### 402 Payment Required Error Payment Required — Insufficient credits to complete this operation. - `error` (Sarvam_Model_API_ErrorDetails, required) — Error details ### 404 Not Found Error Not Found — No job exists for this job_id. - `error` (Sarvam_Model_API_ErrorDetails, required) — Error details ### 500 Internal Server Error Internal Server Error - `error` (Sarvam_Model_API_ErrorDetails, required) — Error details ## Types ### Sarvam_Model_API_ErrorDetails - `request_id` (string, required, nullable) - `message` (string, required) — Message describing the error - `code` (enum, required) — Error code for the specific error that has occurred. Refer to the error code documentation for more details. - Allowed values: `invalid_request_error`, `internal_server_error`, `unprocessable_entity_error`, `insufficient_quota_error`, `invalid_api_key_error`, `authentication_error`, `not_found_error`, `rate_limit_exceeded_error`, `model_call_error`, `gateway_timeout_error`, `billing_service_unavailable_error` ## Examples **Response** ```json { "job_id": "550e8400-e29b-41d4-a716-446655440000", "job_state": "Running", "num_pages": 42 } ``` **SDK Code** ```python import requests url = "https://api.sarvam.ai/translate/document/jobs/550e8400-e29b-41d4-a716-446655440000/start" headers = {"api-subscription-key": ""} response = requests.post(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.sarvam.ai/translate/document/jobs/550e8400-e29b-41d4-a716-446655440000/start'; const options = {method: 'POST', headers: {'api-subscription-key': ''}}; 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.sarvam.ai/translate/document/jobs/550e8400-e29b-41d4-a716-446655440000/start" req, _ := http.NewRequest("POST", url, nil) req.Header.Add("api-subscription-key", "") 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.sarvam.ai/translate/document/jobs/550e8400-e29b-41d4-a716-446655440000/start") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["api-subscription-key"] = '' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.sarvam.ai/translate/document/jobs/550e8400-e29b-41d4-a716-446655440000/start") .header("api-subscription-key", "") .asString(); ``` ```php request('POST', 'https://api.sarvam.ai/translate/document/jobs/550e8400-e29b-41d4-a716-446655440000/start', [ 'headers' => [ 'api-subscription-key' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.sarvam.ai/translate/document/jobs/550e8400-e29b-41d4-a716-446655440000/start"); var request = new RestRequest(Method.POST); request.AddHeader("api-subscription-key", ""); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["api-subscription-key": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api.sarvam.ai/translate/document/jobs/550e8400-e29b-41d4-a716-446655440000/start")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" 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() ```