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

# Retrieve a video indexing task

GET https://api.twelvelabs.io/v1.3/tasks/{task_id}

This method will be removed in a future version.This method retrieves a video indexing task.

Reference: https://docs.twelvelabs.io/api-reference/videos/tasks/retrieve

## Authentication

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

## Request

### Path parameters

- `task_id` (string, required) — The unique identifier of the video indexing task to retrieve.

## Response

### 200

The specified video indexing task has successfully been retrieved.

- `_id` (string, optional) — A string representing the unique identifier of the task. It is assigned by the platform when a new task is created.
- `video_id` (string, optional) — A string representing the unique identifier of the video associated with the specified video indexing task.
- `created_at` (string, optional) — A string indicating the date and time, in the RFC RFC 3339 format ("YYYY-MM-DDTHH:mm:ssZ"), that the task was created.
- `updated_at` (string, optional) — A string indicating the date and time, in the RFC RFC 3339 format ("YYYY-MM-DDTHH:mm:ssZ"), that the task object was last updated. The platform updates this field every time the video indexing task transitions to a different state.
- `status` (string, optional) — A string indicating the status of the video indexing task. See the [Task object](/v1.3/api-reference/upload-content/tasks/the-task-object) page for a list of possible statuses.
- `index_id` (string, optional) — A string representing the unique identifier of the index to which the video must be uploaded.
- `system_metadata` (TasksTaskIdGetResponsesContentApplicationJsonSchemaSystemMetadata, optional) — System-generated metadata about the video.
- `hls` (HLSObject, optional) — The platform returns this object only for the videos that you uploaded with the `enable_video_stream` parameter set to `true`.

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

## Types

### TasksTaskIdGetResponsesContentApplicationJsonSchemaSystemMetadata

System-generated metadata about the video.

- `duration` (double, optional)
- `filename` (string, optional)
- `height` (integer, optional)
- `width` (integer, optional)

### HLSObject

The platform returns this object only for the videos that you uploaded with the `enable_video_stream` parameter set to `true`.

- `video_url` (string, optional) — A string representing the URL of the video. You can then use this URL to access the stream over the HLS protocol.
- `thumbnail_urls` (list of string, optional) — An array containing the URL of the thumbnail.
- `status` (enum, optional) — A string representing the encoding status of the video file from its original format to a streamable format. **Values**: - `PROCESSING`: Video is currently being encoded and is not yet ready for streaming - `COMPLETE`: Encoding has successfully finished and the video is ready for streaming - `CANCELED`: Encoding was manually canceled before completion - `ERROR`: An error occurred during the encoding process
  - Allowed values: `PROCESSING`, `COMPLETE`, `CANCELED`, `ERROR`
- `updated_at` (string, optional) — A string indicating the date and time, in the RFC 3339 format ("YYYY-MM-DDTHH:mm:ssZ"), that the encoding status was last updated.

## Examples

**Response**

```json
{
  "_id": "61e1789761c43d6d9b7362f3",
  "video_id": "61e1789761c43d6d9b7362f3",
  "created_at": "2022-01-14T13:20:22.986Z",
  "updated_at": "2022-01-17T08:35:21.639Z",
  "status": "ready",
  "index_id": "61e165b061c43d6d9b73627b",
  "hls": {
    "video_url": "https://d2cp8xx7n5vxnu.cloudfront.net/6298aa0b535db125bf6e1d10/64902a28fb01304dd47be3cb/stream/c924f34a-144e-41df-bf2a-c693703fa134.m3u8",
    "thumbnail_urls": [
      "https://d2cp8xx7n5vxnu.cloudfront.net/6298aa0b535db125bf6e1d10/64902a28fb01304dd47be3cb/thumbnails/c924f34a-144e-41df-bf2a-c693703fa134.0000001.jpg"
    ],
    "status": "COMPLETE",
    "updated_at": "2024-01-16T07:59:40.879Z"
  },
  "metadata": {
    "duration": 4334.0297,
    "filename": "WPK3hvTr8PU.mp4",
    "height": 360,
    "width": 544
  }
}
```

**SDK Code**

```python tasks_retrieve_example
import requests

url = "https://api.twelvelabs.io/v1.3/tasks/6298d673f1090f1100476d4c"

headers = {"x-api-key": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript tasks_retrieve_example
const url = 'https://api.twelvelabs.io/v1.3/tasks/6298d673f1090f1100476d4c';
const options = {method: 'GET', headers: {'x-api-key': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go tasks_retrieve_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.twelvelabs.io/v1.3/tasks/6298d673f1090f1100476d4c"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-api-key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby tasks_retrieve_example
require 'uri'
require 'net/http'

url = URI("https://api.twelvelabs.io/v1.3/tasks/6298d673f1090f1100476d4c")

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

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<apiKey>'

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

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

HttpResponse<String> response = Unirest.get("https://api.twelvelabs.io/v1.3/tasks/6298d673f1090f1100476d4c")
  .header("x-api-key", "<apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.twelvelabs.io/v1.3/tasks/6298d673f1090f1100476d4c', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp tasks_retrieve_example
using RestSharp;

var client = new RestClient("https://api.twelvelabs.io/v1.3/tasks/6298d673f1090f1100476d4c");
var request = new RestRequest(Method.GET);
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift tasks_retrieve_example
import Foundation

let headers = ["x-api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.twelvelabs.io/v1.3/tasks/6298d673f1090f1100476d4c")! 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()
```