> This page is for version v1.3 (default).
> For other versions, use one of these documentation indexes:
> - v1.3 (default): https://docs.twelvelabs.io/v1.3/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.twelvelabs.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.twelvelabs.io/_mcp/server.

# Request presigned URLs for the remaining chunks

POST https://api.twelvelabs.io/v1.3/assets/multipart-uploads/{upload_id}/presigned-urls
Content-Type: application/json

This method generates new presigned URLs for specific chunks that require uploading. Use this endpoint in the following situations:
- Your initial URLs have expired (URLs expire after one hour).
- The initial set of presigned URLs does not include URLs for all chunks.
- You need to retry failed chunk uploads with new URLs.
To specify which chunks need URLs, use the `start` and `count` parameters. For example, to generate URLs for chunks 21 to 30, use `start=21` and `count=10`.
The response will provide new URLs, each with a fresh expiration time of one hour.


Reference: https://docs.twelvelabs.io/api-reference/upload-files/multipart-uploads/get-additional-presigned-urls

## Authentication

- `x-api-key` header (required) — Your API key. You can find your API key on the API Keys page.

## Request

### Path parameters

- `upload_id` (string, required) — The unique identifier of the upload session.

### Body (application/json)

This endpoint expects a RequestAdditionalPresignedURLsRequest.

- `start` (integer, required) — The index of the first chunk number to generate URLs for. Chunks are numbered from 1.
- `count` (integer, required) — The number of presigned URLs to generate starting from the index. You can request a maximum of 50 URLs in a single API call.

## Response

### 200

Additional presigned URLs have been successfully generated.

- `upload_id` (string, optional) — The unique identifier of the upload session associated with these URLs.
- `start_index` (integer, optional) — The index of the first chunk number in this set of URLs. Matches the start value from your request.
- `count` (integer, optional) — The number of new URLs created. Matches the count value from your request.
- `upload_urls` (list of PresignedURLChunk, optional) — An array of additional presigned URLs for uploading chunks.
- `generated_at` (string, optional) — The date and time, in the RFC 3339 format ("YYYY-MM-DDTHH:mm:ssZ"), when these URLs were created. URLs remain valid for 1 hour from this time.
- `expires_at` (string, optional) — A string representing the date and time, in RFC 3339 format ("YYYY-MM-DDTHH:mm:ssZ"), when the resource will expire.

## Errors

### 400 Bad Request Error

The request has failed.

- `code` (string, optional) — A string representing the code associated with the error. See the [Error codes](/v1.3/api-reference/error-codes) page for details.
- `message` (string, optional) — A human-readable string describing the error, intended to be suitable for display in a user interface.

### 403 Forbidden Error

The request has failed.

- `code` (string, optional) — A string representing the code associated with the error. See the [Error codes](/v1.3/api-reference/error-codes) page for details.
- `message` (string, optional) — A human-readable string describing the error, intended to be suitable for display in a user interface.

### 404 Not Found Error

Upload not found.

- `any`

### 500 Internal Server Error

The request has failed.

- `code` (string, optional) — A string representing the code associated with the error. See the [Error codes](/v1.3/api-reference/error-codes) page for details.
- `message` (string, optional) — A human-readable string describing the error, intended to be suitable for display in a user interface.

## Types

### PresignedURLChunk

- `chunk_index` (integer, optional) — The index of this chunk.
- `url` (string, optional) — The presigned URL for uploading this chunk. Each URL can only be used once and expires after 1 hour.
- `expires_at` (string, optional) — A string representing the date and time, in RFC 3339 format ("YYYY-MM-DDTHH:mm:ssZ"), when the resource will expire.

## Examples

**Request**

```json
{
  "start": 21,
  "count": 10
}
```

**Response**

```json
{
  "upload_id": "507f1f77bcf86cd799439011",
  "start_index": 21,
  "count": 10,
  "upload_urls": [
    {
      "chunk_index": 21,
      "url": "https://s3.amazonaws.com/twelvelabs-uploads/507f1f77bcf86cd799439011/chunk21?X-Amz-Signature=abcdef1234567890",
      "expires_at": "2024-06-15T15:45:00Z"
    },
    {
      "chunk_index": 22,
      "url": "https://s3.amazonaws.com/twelvelabs-uploads/507f1f77bcf86cd799439011/chunk22?X-Amz-Signature=abcdef1234567891",
      "expires_at": "2024-06-15T15:45:00Z"
    },
    {
      "chunk_index": 23,
      "url": "https://s3.amazonaws.com/twelvelabs-uploads/507f1f77bcf86cd799439011/chunk23?X-Amz-Signature=abcdef1234567892",
      "expires_at": "2024-06-15T15:45:00Z"
    },
    {
      "chunk_index": 24,
      "url": "https://s3.amazonaws.com/twelvelabs-uploads/507f1f77bcf86cd799439011/chunk24?X-Amz-Signature=abcdef1234567893",
      "expires_at": "2024-06-15T15:45:00Z"
    },
    {
      "chunk_index": 25,
      "url": "https://s3.amazonaws.com/twelvelabs-uploads/507f1f77bcf86cd799439011/chunk25?X-Amz-Signature=abcdef1234567894",
      "expires_at": "2024-06-15T15:45:00Z"
    },
    {
      "chunk_index": 26,
      "url": "https://s3.amazonaws.com/twelvelabs-uploads/507f1f77bcf86cd799439011/chunk26?X-Amz-Signature=abcdef1234567895",
      "expires_at": "2024-06-15T15:45:00Z"
    },
    {
      "chunk_index": 27,
      "url": "https://s3.amazonaws.com/twelvelabs-uploads/507f1f77bcf86cd799439011/chunk27?X-Amz-Signature=abcdef1234567896",
      "expires_at": "2024-06-15T15:45:00Z"
    },
    {
      "chunk_index": 28,
      "url": "https://s3.amazonaws.com/twelvelabs-uploads/507f1f77bcf86cd799439011/chunk28?X-Amz-Signature=abcdef1234567897",
      "expires_at": "2024-06-15T15:45:00Z"
    },
    {
      "chunk_index": 29,
      "url": "https://s3.amazonaws.com/twelvelabs-uploads/507f1f77bcf86cd799439011/chunk29?X-Amz-Signature=abcdef1234567898",
      "expires_at": "2024-06-15T15:45:00Z"
    },
    {
      "chunk_index": 30,
      "url": "https://s3.amazonaws.com/twelvelabs-uploads/507f1f77bcf86cd799439011/chunk30?X-Amz-Signature=abcdef1234567899",
      "expires_at": "2024-06-15T15:45:00Z"
    }
  ],
  "generated_at": "2024-06-15T14:45:00Z",
  "expires_at": "2024-06-15T15:45:00Z"
}
```

**SDK Code**

```python
import requests

url = "https://api.twelvelabs.io/v1.3/assets/multipart-uploads/507f1f77bcf86cd799439011/presigned-urls"

payload = {
    "start": 21,
    "count": 10
}
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.twelvelabs.io/v1.3/assets/multipart-uploads/507f1f77bcf86cd799439011/presigned-urls';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"start":21,"count":10}'
};

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.twelvelabs.io/v1.3/assets/multipart-uploads/507f1f77bcf86cd799439011/presigned-urls"

	payload := strings.NewReader("{\n  \"start\": 21,\n  \"count\": 10\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.twelvelabs.io/v1.3/assets/multipart-uploads/507f1f77bcf86cd799439011/presigned-urls")

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  \"start\": 21,\n  \"count\": 10\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.twelvelabs.io/v1.3/assets/multipart-uploads/507f1f77bcf86cd799439011/presigned-urls")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"start\": 21,\n  \"count\": 10\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.twelvelabs.io/v1.3/assets/multipart-uploads/507f1f77bcf86cd799439011/presigned-urls', [
  'body' => '{
  "start": 21,
  "count": 10
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.twelvelabs.io/v1.3/assets/multipart-uploads/507f1f77bcf86cd799439011/presigned-urls");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"start\": 21,\n  \"count\": 10\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

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

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.twelvelabs.io/v1.3/assets/multipart-uploads/507f1f77bcf86cd799439011/presigned-urls")! 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()
```