> 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. # Get Download URL GET https://api.sarvam.ai/doc-ai/v1/job/{job_id}/download-url Creates a download URL for a completed job's output. Download the output using the returned `method`, `url` and `headers` before `expires_at`. Requesting a download URL before the job reaches a terminal status returns `409`. Reference: https://docs.sarvam.ai/api-reference/doc-ai/job/download-url ## Authentication - `api-subscription-key` header (required) — API Key authentication via header ## Request ### Path parameters - `job_id` (string, required) — The unique identifier of the job ## Response ### 200 OK - `method` (string, required) — HTTP method to use for the download (e.g. `GET`). - `url` (string, required) — Presigned URL to download the job output from. - `expires_at` (string, required) — Timestamp after which the download URL is no longer valid. - `headers` (map from string to string, optional) — Headers that must be sent with the download request. ## Errors ### 404 Not Found Error Job not found - `type` (string, optional, default: about:blank) — A URI reference to human-readable documentation for the error. - `title` (string, optional) — A short, human-readable summary of the problem type. - `status` (integer, optional) — HTTP status code. - `detail` (string, optional) — A human-readable explanation specific to this occurrence of the problem. - `instance` (string, optional) — A URI reference that identifies the specific occurrence of the problem. - `errors` (list of DocAIErrorDetail, optional, nullable) — Optional list of individual error details. ### 409 Conflict Error Download requested before the job reached a terminal status - `type` (string, optional, default: about:blank) — A URI reference to human-readable documentation for the error. - `title` (string, optional) — A short, human-readable summary of the problem type. - `status` (integer, optional) — HTTP status code. - `detail` (string, optional) — A human-readable explanation specific to this occurrence of the problem. - `instance` (string, optional) — A URI reference that identifies the specific occurrence of the problem. - `errors` (list of DocAIErrorDetail, optional, nullable) — Optional list of individual error details. ## Types ### DocAIErrorDetail - `location` (string, optional) — Where the error occurred, e.g. 'body.items[3].tags' or 'path.thing-id'. - `message` (string, optional) — Error message text. - `value` (any, optional) — The value at the given location. ## Examples **Response** ```json { "method": "string", "url": "string", "expires_at": "string", "headers": {} } ``` **SDK Code** ```python import requests url = "https://api.sarvam.ai/doc-ai/v1/job/job_id/download-url" headers = {"api-subscription-key": ""} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.sarvam.ai/doc-ai/v1/job/job_id/download-url'; const options = {method: 'GET', 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/doc-ai/v1/job/job_id/download-url" req, _ := http.NewRequest("GET", 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/doc-ai/v1/job/job_id/download-url") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.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.get("https://api.sarvam.ai/doc-ai/v1/job/job_id/download-url") .header("api-subscription-key", "") .asString(); ``` ```php request('GET', 'https://api.sarvam.ai/doc-ai/v1/job/job_id/download-url', [ 'headers' => [ 'api-subscription-key' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.sarvam.ai/doc-ai/v1/job/job_id/download-url"); var request = new RestRequest(Method.GET); 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/doc-ai/v1/job/job_id/download-url")! 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() ```