> 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 multiple assets

POST https://api.sync.so/v2/assets/batch
Content-Type: application/json

Retrieve multiple assets by ID. Assets you cannot access are omitted from the response.

Reference: https://sync.so/docs/api-reference/api/assets-api/get-many

## 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

### Body (application/json)

This endpoint expects a BatchGetAssetsRequest.

- `ids` (AssetIds, required) — One asset ID, or a list of 1–100 asset IDs.

## Response

### 200

Matching assets, in the service response order.

- `list of Asset`

## Errors

### 400 Bad Request Error

Bad Request - Invalid input or unsupported model

- `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.
- `billingUrl` (string, optional) — Billing page for resolving a payment, plan, or allowance issue, when applicable.
- `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 or a DUPLICATE_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.
- `lineNumber` (integer, optional) — For batch creation, on dialogue edit refusals only: the 1-based line of the refused record, counting non-empty JSONL lines. With a `rows` body, line N is `rows[N-1]`. Other record errors name the line only in `message`.

### 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.
- `billingUrl` (string, optional) — Billing page for resolving a payment, plan, or allowance issue, when applicable.
- `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 or a DUPLICATE_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.
- `lineNumber` (integer, optional) — For batch creation, on dialogue edit refusals only: the 1-based line of the refused record, counting non-empty JSONL lines. With a `rows` body, line N is `rows[N-1]`. Other record errors name the line only in `message`.

### 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.
- `billingUrl` (string, optional) — Billing page for resolving a payment, plan, or allowance issue, when applicable.
- `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 or a DUPLICATE_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.
- `lineNumber` (integer, optional) — For batch creation, on dialogue edit refusals only: the 1-based line of the refused record, counting non-empty JSONL lines. With a `rows` body, line N is `rows[N-1]`. Other record errors name the line only in `message`.

## Types

### AssetIds

- string
- list of string

### Asset

An asset stored in your organization's media library.

- `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`, `DUB`, `DUB_SOURCE`, `PLATFORM_IMPORT`, `DIALOGUE_EDIT`, `PLUGIN_PREMIERE_FILE`, `PLUGIN_PREMIERE_TIMELINE_SELECTION`, `PLUGIN_RESOLVE_FILE`, `PLUGIN_RESOLVE_TIMELINE_SELECTION`
- `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.
- `proxyPath` (string, optional, nullable) — Stable API proxy path for authenticated media playback.

### GenerationErrorMessage

A message describing the error.

- string
- list of string

### 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

**Request**

```json
{
  "ids": "ids"
}
```

**Response**

```json
[
  {
    "id": "id",
    "createdAt": "2024-01-15T09:30:00Z",
    "updatedAt": "2024-01-15T09:30:00Z",
    "type": "AUDIO",
    "visibility": "USER",
    "name": "name",
    "url": "url",
    "size": 1000000,
    "format": "format",
    "inputType": "UPLOAD",
    "durationSeconds": 1.1,
    "thumbnailUrl": "thumbnailUrl",
    "width": 1,
    "height": 1,
    "projectId": "projectId",
    "proxyPath": "proxyPath"
  },
  {
    "id": "id",
    "createdAt": "2024-01-15T09:30:00Z",
    "updatedAt": "2024-01-15T09:30:00Z",
    "type": "AUDIO",
    "visibility": "USER",
    "name": "name",
    "url": "url",
    "size": 1000000,
    "format": "format",
    "inputType": "UPLOAD",
    "durationSeconds": 1.1,
    "thumbnailUrl": "thumbnailUrl",
    "width": 1,
    "height": 1,
    "projectId": "projectId",
    "proxyPath": "proxyPath"
  }
]
```

**SDK Code**

```python
import requests

url = "https://api.sync.so/v2/assets/batch"

payload = { "ids": "ids" }
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.sync.so/v2/assets/batch';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"ids":"ids"}'
};

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"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.sync.so/v2/assets/batch"

	payload := strings.NewReader("{\n  \"ids\": \"ids\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	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/batch")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"ids\": \"ids\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.sync.so/v2/assets/batch")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"ids\": \"ids\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.sync.so/v2/assets/batch', [
  'body' => '{
  "ids": "ids"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.sync.so/v2/assets/batch");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"ids\": \"ids\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["ids": "ids"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.sync.so/v2/assets/batch")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```