> 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 Asset GET https://api.sync.so/v2/assets/{id} Retrieve a specific asset by ID. Reference: https://sync.so/docs/api-reference/api/assets-api/get ## 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) — A unique identifier for an asset. ## Response ### 200 Asset retrieved successfully - `id` (string, required) — A unique identifier for an asset. - `createdAt` (datetime, required) — The date and time the asset was created. - `updatedAt` (datetime, required) — The date and time the asset was last updated. - `type` (enum, required) — The type of asset file. - Allowed values: `AUDIO`, `VIDEO`, `IMAGE` - `visibility` (enum, required) — Visibility scope for the asset. - Allowed values: `USER`, `ORGANIZATION` - `name` (string, optional) — The filename of the asset. - `url` (string, optional) — The URL to access the asset media. - `size` (long, optional) — File size in bytes. - `format` (string, optional) — File format/extension (e.g., "mp4", "wav"). - `inputType` (enum, optional) — The source type of the asset. - Allowed values: `UPLOAD`, `URL`, `RECORD`, `TTS`, `EXTRACT`, `PLATFORM_IMPORT` - `durationSeconds` (double, optional) — Duration of the media in seconds (for audio/video). - `thumbnailUrl` (string, optional) — URL to the asset's thumbnail image. - `width` (integer, optional) — Width in pixels (for video/image). - `height` (integer, optional) — Height in pixels (for video/image). - `projectId` (string, optional) — The id of the project this asset is attached to, or null when it belongs to no project. ## 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. ### 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. ### 500 Internal Server Error Internal Server Error - An unexpected failure on our side. The body carries errorCode internal_error and a requestId; include the requestId when contacting support. - `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. ## Types ### GenerationErrorMessage A message describing the error. ## Examples **Response** ```json { "id": "550e8400-e29b-41d4-a716-446655440000", "createdAt": "2024-01-15T09:30:00Z", "updatedAt": "2024-01-15T09:30:00Z", "type": "VIDEO", "visibility": "ORGANIZATION", "name": "example-video.mp4", "url": "https://assets.sync.so/example-video.mp4", "size": 10485760, "format": "mp4", "inputType": "UPLOAD", "durationSeconds": 30.5, "thumbnailUrl": "https://assets.sync.so/thumb-example.jpg", "width": 1920, "height": 1080 } ``` **SDK Code** ```python import requests url = "https://api.sync.so/v2/assets/550e8400-e29b-41d4-a716-446655440000" headers = {"x-api-key": ""} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.sync.so/v2/assets/550e8400-e29b-41d4-a716-446655440000'; 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/assets/550e8400-e29b-41d4-a716-446655440000" 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/assets/550e8400-e29b-41d4-a716-446655440000") 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/assets/550e8400-e29b-41d4-a716-446655440000") .header("x-api-key", "") .asString(); ``` ```php request('GET', 'https://api.sync.so/v2/assets/550e8400-e29b-41d4-a716-446655440000', [ 'headers' => [ 'x-api-key' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.sync.so/v2/assets/550e8400-e29b-41d4-a716-446655440000"); 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/assets/550e8400-e29b-41d4-a716-446655440000")! 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() ```