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

# Check Ingestion Task Status

GET /v1/artifacts/ingest/async/{task_id}

Retrieve the current status and results of an asynchronous ingestion task

Reference: https://docs.privategpt.dev/api-reference/artifacts/get-ingest-async-status-v-1-artifacts-ingest-async-task-id-get

## Request

### Path parameters

- `task_id` (string, required)

## Response

### 200

Successfully retrieved task status and results

- `task_id` (string, required) — Unique identifier of the task being monitored
- `task_status` (string, required) — Current execution status of the task. Common values: PENDING, SUCCESS, FAILURE, REVOKED
- `task_result` (TaskStatusIngestResponseTaskResult, required, nullable) — Task execution result. Contains typed result data on success, error message string on failure, or None for pending/deletion tasks

## Errors

### 401 Unauthorized Error

Unauthorized

- `any`

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional) — detail field.

## Types

### TaskStatusIngestResponseTaskResult

Task execution result. Contains typed result data on success, error message string on failure, or None for pending/deletion tasks

### ValidationError

ValidationError schema.

- `loc` (list of ValidationErrorLocItems, required) — loc field.
- `msg` (string, required) — msg field.
- `type` (string, required) — type field.
- `input` (any, optional) — input field.
- `ctx` (ValidationErrorCtx, optional) — ctx field.

### IngestResponse

Response model for successful document ingestion operations.

- `data` (list of IngestedDoc, required) — List of ingested documents with their metadata and processing information
- `object` ("list", optional, default: list) — Response object type, always 'list' for ingestion responses
- `model` ("private-gpt", optional, default: private-gpt) — Model identifier, always 'private-gpt'

### ValidationErrorLocItems

### ValidationErrorCtx

ctx field.

### IngestedDoc

Represents a document that has been ingested into the system.

- `artifact` (string, required) — Unique identifier for the ingested document artifact.
- `object` ("ingest.document", optional, default: ingest.document) — Type of the object, indicating this is an ingested document.
- `doc_metadata` (map from string to any, optional, nullable) — Metadata associated with the ingested document, such as title, author, and other

## Examples

### Completed ingestion task with results

**Response**

```json
{
  "task_id": "123e4567-e89b-12d3-a456-426614174000",
  "task_status": "SUCCESS",
  "task_result": {
    "data": [
      {
        "artifact": "annual_report",
        "doc_metadata": {
          "department": "finance",
          "file_name": "report.pdf",
          "page_count": 45
        },
        "object": "ingest.document"
      }
    ],
    "model": "private-gpt",
    "object": "list"
  }
}
```

**SDK Code**

```python Completed ingestion task with results
import requests

url = "https://api.example.com/v1/artifacts/ingest/async/task_id"

response = requests.get(url)

print(response.json())
```

```javascript Completed ingestion task with results
const url = 'https://api.example.com/v1/artifacts/ingest/async/task_id';
const options = {method: 'GET'};

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

```go Completed ingestion task with results
package main

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

func main() {

	url := "https://api.example.com/v1/artifacts/ingest/async/task_id"

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

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

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

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

}
```

```ruby Completed ingestion task with results
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v1/artifacts/ingest/async/task_id")

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

request = Net::HTTP::Get.new(url)

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

```java Completed ingestion task with results
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.example.com/v1/artifacts/ingest/async/task_id")
  .asString();
```

```php Completed ingestion task with results
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.example.com/v1/artifacts/ingest/async/task_id');

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

```csharp Completed ingestion task with results
using RestSharp;

var client = new RestClient("https://api.example.com/v1/artifacts/ingest/async/task_id");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift Completed ingestion task with results
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/v1/artifacts/ingest/async/task_id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

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

### Task still in progress

**Response**

```json
{
  "task_id": "456e7890-e89b-12d3-a456-426614174001",
  "task_status": "PENDING",
  "task_result": null
}
```

**SDK Code**

```python Task still in progress
import requests

url = "https://api.example.com/v1/artifacts/ingest/async/task_id"

response = requests.get(url)

print(response.json())
```

```javascript Task still in progress
const url = 'https://api.example.com/v1/artifacts/ingest/async/task_id';
const options = {method: 'GET'};

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

```go Task still in progress
package main

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

func main() {

	url := "https://api.example.com/v1/artifacts/ingest/async/task_id"

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

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

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

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

}
```

```ruby Task still in progress
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v1/artifacts/ingest/async/task_id")

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

request = Net::HTTP::Get.new(url)

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

```java Task still in progress
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.example.com/v1/artifacts/ingest/async/task_id")
  .asString();
```

```php Task still in progress
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.example.com/v1/artifacts/ingest/async/task_id');

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

```csharp Task still in progress
using RestSharp;

var client = new RestClient("https://api.example.com/v1/artifacts/ingest/async/task_id");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift Task still in progress
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/v1/artifacts/ingest/async/task_id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

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

### Failed ingestion task with error

**Response**

```json
{
  "task_id": "789e0123-e89b-12d3-a456-426614174002",
  "task_status": "FAILURE",
  "task_result": "File format not supported or URI inaccessible"
}
```

**SDK Code**

```python Failed ingestion task with error
import requests

url = "https://api.example.com/v1/artifacts/ingest/async/task_id"

response = requests.get(url)

print(response.json())
```

```javascript Failed ingestion task with error
const url = 'https://api.example.com/v1/artifacts/ingest/async/task_id';
const options = {method: 'GET'};

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

```go Failed ingestion task with error
package main

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

func main() {

	url := "https://api.example.com/v1/artifacts/ingest/async/task_id"

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

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

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

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

}
```

```ruby Failed ingestion task with error
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v1/artifacts/ingest/async/task_id")

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

request = Net::HTTP::Get.new(url)

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

```java Failed ingestion task with error
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.example.com/v1/artifacts/ingest/async/task_id")
  .asString();
```

```php Failed ingestion task with error
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.example.com/v1/artifacts/ingest/async/task_id');

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

```csharp Failed ingestion task with error
using RestSharp;

var client = new RestClient("https://api.example.com/v1/artifacts/ingest/async/task_id");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift Failed ingestion task with error
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/v1/artifacts/ingest/async/task_id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

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