> For the documentation index, fetch https://sync.so/docs/llms.txt. Append .md to a page URL for Markdown. Documentation-search MCP: https://sync.so/docs/_mcp/server. # Get Text-to-Speech Job GET https://api.sync.so/v2/tts/jobs/{id} Retrieve a text-to-speech job by id. While the job is PENDING or PROCESSING, the response carries a `Retry-After: 3` header. The header is absent once the job reaches a terminal state (SUCCESS or FAILED). Reference: https://sync.so/docs/api-reference/api/tts-api/get-job ## Authentication - `x-api-key` header (required) — API Key authentication via header ## Servers - `https://api.sync.so` (Default, default) - `https://dev-api.sync.so` (dev) - `http://localhost:3001` (local) ## Request ### Path parameters - `id` (string, required) — The job id returned when the job was submitted. ## Response ### 200 Job retrieved successfully - `id` (string, required) — Unique identifier for the job. - `status` (enum, required) — The current lifecycle status of the job. - Allowed values: `PENDING`, `PROCESSING`, `SUCCESS`, `FAILED` - `createdAt` (datetime, required) — When the job was created. - `url` (string, optional) — The hosted URL of the synthesized audio. Null unless status is SUCCESS. - `duration` (double, optional) — Duration of the synthesized audio in seconds. Null unless status is SUCCESS. - `error` (TtsJobError, optional) — Error detail. Null unless status is FAILED. - `startedAt` (datetime, optional) — When synthesis started. Null until synthesis starts. - `finishedAt` (datetime, optional) — When the job reached a terminal state. Null until the job is SUCCESS or FAILED. ## Errors ### 401 Unauthorized Error Unauthorized - Invalid or missing authentication - `message` (GenerationErrorMessage, required) — A message describing the error. - `statusCode` (double, required) — The type of error that occurred. - `errorCode` (string, optional) — Stable, machine-readable error code (e.g. project_not_found, voice_not_found, concurrency_limit_reached). Branch your error handling on this, not on the message text. The full catalog of codes with messages and suggested fixes is served unauthenticated at GET /v2/errors. - `suggestion` (string, optional) — A suggested fix an agent can act on. - `field` (string, optional) — The request field the error refers to, when the failure is tied to a specific field (e.g. projectId, voiceId, input[].assetId). - `docsUrl` (string, optional) — Link to the documentation page for the failing operation. - `requestId` (string, optional) — Present on unexpected 500 responses. Include it when contacting support so the failing request can be located directly. - `generationId` (string, optional) — Original generation ID when available for an uncertain keyed submission. Poll this ID; do not create another action to bypass IDEMPOTENCY_OUTCOME_UNKNOWN. - `dialogueEditSection` (DialogueEditRetimeFailureSection, optional) — For dialogue_edit_removal_too_large: the section to change, when it can be identified. Create a new dialogue edit preview before submitting again. ### 404 Not Found Error Job not found - `message` (GenerationErrorMessage, required) — A message describing the error. - `statusCode` (double, required) — The type of error that occurred. - `errorCode` (string, optional) — Stable, machine-readable error code (e.g. project_not_found, voice_not_found, concurrency_limit_reached). Branch your error handling on this, not on the message text. The full catalog of codes with messages and suggested fixes is served unauthenticated at GET /v2/errors. - `suggestion` (string, optional) — A suggested fix an agent can act on. - `field` (string, optional) — The request field the error refers to, when the failure is tied to a specific field (e.g. projectId, voiceId, input[].assetId). - `docsUrl` (string, optional) — Link to the documentation page for the failing operation. - `requestId` (string, optional) — Present on unexpected 500 responses. Include it when contacting support so the failing request can be located directly. - `generationId` (string, optional) — Original generation ID when available for an uncertain keyed submission. Poll this ID; do not create another action to bypass IDEMPOTENCY_OUTCOME_UNKNOWN. - `dialogueEditSection` (DialogueEditRetimeFailureSection, optional) — For dialogue_edit_removal_too_large: the section to change, when it can be identified. Create a new dialogue edit preview before submitting again. ## Types ### TtsJobError Error detail for a failed text-to-speech job. - `code` (enum, required) — The machine-readable error code. - Allowed values: `CREATE_FAILED`, `PROVIDER_FAILED`, `PROVIDER_TIMEOUT`, `PROVIDER_RESULT_UNKNOWN`, `UPLOAD_FAILED`, `TIMEOUT`, `UNKNOWN` - `message` (string, required) — A human-readable description of the failure. ### GenerationErrorMessage A message describing the error. ### DialogueEditRetimeFailureSection The dialogue-edit section that removes too much speech to stay in sync. - `slotIndex` (integer, required) — Zero-based index of the section in the preview's `resultSlots`. - `sourceStartMs` (integer, optional) — Start of the section in the source video, in absolute milliseconds. - `sourceDurationMs` (integer, optional) — Length of the section in the source video, in milliseconds. ## Examples **Response** ```json { "id": "6533643b-aceb-4c40-967e-d9ba9baac39e", "status": "SUCCESS", "createdAt": "2024-01-15T09:30:00Z", "url": "https://assets.sync.so/docs/example-tts.mp3", "duration": 2.1, "startedAt": "2024-01-15T09:30:01Z", "finishedAt": "2024-01-15T09:30:04Z" } ``` **SDK Code** ```python import requests url = "https://api.sync.so/v2/tts/jobs/6533643b-aceb-4c40-967e-d9ba9baac39e" headers = {"x-api-key": ""} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.sync.so/v2/tts/jobs/6533643b-aceb-4c40-967e-d9ba9baac39e'; const options = {method: 'GET', headers: {'x-api-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.sync.so/v2/tts/jobs/6533643b-aceb-4c40-967e-d9ba9baac39e" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("x-api-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.sync.so/v2/tts/jobs/6533643b-aceb-4c40-967e-d9ba9baac39e") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["x-api-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.sync.so/v2/tts/jobs/6533643b-aceb-4c40-967e-d9ba9baac39e") .header("x-api-key", "") .asString(); ``` ```php request('GET', 'https://api.sync.so/v2/tts/jobs/6533643b-aceb-4c40-967e-d9ba9baac39e', [ 'headers' => [ 'x-api-key' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.sync.so/v2/tts/jobs/6533643b-aceb-4c40-967e-d9ba9baac39e"); var request = new RestRequest(Method.GET); request.AddHeader("x-api-key", ""); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["x-api-key": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api.sync.so/v2/tts/jobs/6533643b-aceb-4c40-967e-d9ba9baac39e")! 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() ```