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

# Ingest Content Asynchronously

POST /v1/artifacts/ingest/async
Content-Type: application/json

Initiate asynchronous ingestion of content from multiple sources

Reference: https://docs.privategpt.dev/api-reference/artifacts/ingest-content-async-v-1-artifacts-ingest-async-post

## Request

### Body (application/json)

This endpoint expects an IngestAsyncBody.

- `ingest_body` (IngestBody, required) — Document ingestion parameters including artifact, collection, input data, and optional metadata
- `callback` (Callback, optional, nullable) — Optional callback configuration for receiving asynchronous task notifications
- `nodes` (list of BaseNode, optional, nullable) — Parsed nodes produced by parse_task, consumed by store_vectors_task.

## Response

### 200

Successfully initiated ingestion task

- `task_id` (string, required) — Unique identifier for the asynchronous task, used to track progress and retrieve results

## Errors

### 401 Unauthorized Error

Unauthorized

- `any`

## Types

### IngestBody

Request body for ingesting content into the system for AI context.

- `artifact` (string, required) — Unique identifier for the text being ingested within the collection
- `input` (IngestBodyInput, required) — Raw input data to be processed and ingested into the system. Can be a file (base64), URI, or plain text
- `collection` (string, optional, default: pgpt_collection) — Collection name to group related documents for better organization and filtering
- `metadata` (map from string to any, optional, nullable) — Optional metadata dictionary containing additional document information. If provided, must include 'file_name' with a valid file extension

### Callback

Callback configuration for asynchronous task notifications.

- `amqp` (AMQP, required) — AMQP (Advanced Message Queuing Protocol) configuration for task status notifications
- `properties` (map from string to any, optional, nullable) — Additional properties and metadata to include with callback notifications

### BaseNode

Base node Object. Generic abstract interface for retrievable nodes

- `id_` (string, optional) — Unique ID of the node.
- `embedding` (list of double, optional, nullable) — Embedding of the node.
- `extra_info` (map from string to any, optional) — A flat dictionary of metadata fields
- `excluded_embed_metadata_keys` (list of string, optional) — Metadata keys that are excluded from text for the embed model.
- `excluded_llm_metadata_keys` (list of string, optional) — Metadata keys that are excluded from text for the LLM.
- `relationships` (map from string to BaseNodeRelationships, optional) — A mapping of relationships to other node information.
- `metadata_template` (string, optional, default: {key}: {value}) — Template for how metadata is formatted, with \{key} and \{value} placeholders.
- `metadata_seperator` (string, optional, default: 
) — Separator between metadata fields when converting to string.
- `class_name` (string, optional, default: base_component) — class name field.

### IngestBodyInput

Raw input data to be processed and ingested into the system. Can be a file (base64), URI, or plain text

- `type`: `file` (FileArtifact)
  - `value` (string, required) — Base64 encoded file content
- `type`: `text` (TextArtifact)
  - `value` (string, required) — Plain text content
- `type`: `uri` (UriArtifact)
  - `value` (string, required) — URI to download from

### AMQP

AMQP configuration for message queue notifications.

- `exchange` (string, required) — AMQP exchange name where task notifications will be published
- `routing_key_done` (string, optional, nullable) — Routing key used when publishing task completion notifications
- `routing_key_progress` (string, optional, nullable) — Routing key used when publishing task progress update notifications
- `routing_key_error` (string, optional, nullable) — Routing key used when publishing task error notifications

### BaseNodeRelationships

### RelatedNodeInfo

RelatedNodeInfo schema.

- `node_id` (string, required) — node id field.
- `node_type` (RelatedNodeInfoNodeType, optional, nullable) — node type field.
- `metadata` (map from string to any, optional) — metadata field.
- `hash` (string, optional, nullable) — hash field.
- `class_name` (string, optional, default: RelatedNodeInfo) — class name field.

### RelatedNodeInfoNodeType

node type field.

## Examples

### Artifacts_ingest_content_async_v1_artifacts_ingest_async_post_example

**Response**

```json
{
  "task_id": "123e4567-e89b-12d3-a456-426614174000"
}
```

**SDK Code**

```python Artifacts_ingest_content_async_v1_artifacts_ingest_async_post_example
import requests

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

response = requests.post(url)

print(response.json())
```

```javascript Artifacts_ingest_content_async_v1_artifacts_ingest_async_post_example
const url = 'https://api.example.com/v1/artifacts/ingest/async';
const options = {method: 'POST'};

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

```go Artifacts_ingest_content_async_v1_artifacts_ingest_async_post_example
package main

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

func main() {

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

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

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

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

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

}
```

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

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

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

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

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

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

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

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

$client = new \GuzzleHttp\Client();

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

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

```csharp Artifacts_ingest_content_async_v1_artifacts_ingest_async_post_example
using RestSharp;

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

```swift Artifacts_ingest_content_async_v1_artifacts_ingest_async_post_example
import Foundation

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

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

### Async file ingestion

**Request**

```json
{
  "ingest_body": {
    "artifact": "quarterly_report",
    "input": {
      "type": "file",
      "value": "JVBERi0xLjQKJaqrrK0KMS..."
    },
    "collection": "financial_docs",
    "metadata": {
      "file_name": "Q3_Report.pdf"
    }
  },
  "callback": {
    "amqp": {
      "exchange": "ingestion_events",
      "routing_key_done": "ingest.completed",
      "routing_key_progress": "ingest.progress",
      "routing_key_error": "ingest.failed"
    }
  }
}
```

**Response**

```json
{
  "task_id": "123e4567-e89b-12d3-a456-426614174000"
}
```

**SDK Code**

```python Async file ingestion
import requests

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

payload = {
    "ingest_body": {
        "artifact": "quarterly_report",
        "input": {
            "type": "file",
            "value": "JVBERi0xLjQKJaqrrK0KMS..."
        },
        "collection": "financial_docs",
        "metadata": { "file_name": "Q3_Report.pdf" }
    },
    "callback": { "amqp": {
            "exchange": "ingestion_events",
            "routing_key_done": "ingest.completed",
            "routing_key_progress": "ingest.progress",
            "routing_key_error": "ingest.failed"
        } }
}
headers = {"Content-Type": "application/json"}

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

print(response.json())
```

```javascript Async file ingestion
const url = 'https://api.example.com/v1/artifacts/ingest/async';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"ingest_body":{"artifact":"quarterly_report","input":{"type":"file","value":"JVBERi0xLjQKJaqrrK0KMS..."},"collection":"financial_docs","metadata":{"file_name":"Q3_Report.pdf"}},"callback":{"amqp":{"exchange":"ingestion_events","routing_key_done":"ingest.completed","routing_key_progress":"ingest.progress","routing_key_error":"ingest.failed"}}}'
};

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

```go Async file ingestion
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"ingest_body\": {\n    \"artifact\": \"quarterly_report\",\n    \"input\": {\n      \"type\": \"file\",\n      \"value\": \"JVBERi0xLjQKJaqrrK0KMS...\"\n    },\n    \"collection\": \"financial_docs\",\n    \"metadata\": {\n      \"file_name\": \"Q3_Report.pdf\"\n    }\n  },\n  \"callback\": {\n    \"amqp\": {\n      \"exchange\": \"ingestion_events\",\n      \"routing_key_done\": \"ingest.completed\",\n      \"routing_key_progress\": \"ingest.progress\",\n      \"routing_key_error\": \"ingest.failed\"\n    }\n  }\n}")

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

	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 Async file ingestion
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"ingest_body\": {\n    \"artifact\": \"quarterly_report\",\n    \"input\": {\n      \"type\": \"file\",\n      \"value\": \"JVBERi0xLjQKJaqrrK0KMS...\"\n    },\n    \"collection\": \"financial_docs\",\n    \"metadata\": {\n      \"file_name\": \"Q3_Report.pdf\"\n    }\n  },\n  \"callback\": {\n    \"amqp\": {\n      \"exchange\": \"ingestion_events\",\n      \"routing_key_done\": \"ingest.completed\",\n      \"routing_key_progress\": \"ingest.progress\",\n      \"routing_key_error\": \"ingest.failed\"\n    }\n  }\n}"

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

```java Async file ingestion
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.example.com/v1/artifacts/ingest/async")
  .header("Content-Type", "application/json")
  .body("{\n  \"ingest_body\": {\n    \"artifact\": \"quarterly_report\",\n    \"input\": {\n      \"type\": \"file\",\n      \"value\": \"JVBERi0xLjQKJaqrrK0KMS...\"\n    },\n    \"collection\": \"financial_docs\",\n    \"metadata\": {\n      \"file_name\": \"Q3_Report.pdf\"\n    }\n  },\n  \"callback\": {\n    \"amqp\": {\n      \"exchange\": \"ingestion_events\",\n      \"routing_key_done\": \"ingest.completed\",\n      \"routing_key_progress\": \"ingest.progress\",\n      \"routing_key_error\": \"ingest.failed\"\n    }\n  }\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.example.com/v1/artifacts/ingest/async', [
  'body' => '{
  "ingest_body": {
    "artifact": "quarterly_report",
    "input": {
      "type": "file",
      "value": "JVBERi0xLjQKJaqrrK0KMS..."
    },
    "collection": "financial_docs",
    "metadata": {
      "file_name": "Q3_Report.pdf"
    }
  },
  "callback": {
    "amqp": {
      "exchange": "ingestion_events",
      "routing_key_done": "ingest.completed",
      "routing_key_progress": "ingest.progress",
      "routing_key_error": "ingest.failed"
    }
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Async file ingestion
using RestSharp;

var client = new RestClient("https://api.example.com/v1/artifacts/ingest/async");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"ingest_body\": {\n    \"artifact\": \"quarterly_report\",\n    \"input\": {\n      \"type\": \"file\",\n      \"value\": \"JVBERi0xLjQKJaqrrK0KMS...\"\n    },\n    \"collection\": \"financial_docs\",\n    \"metadata\": {\n      \"file_name\": \"Q3_Report.pdf\"\n    }\n  },\n  \"callback\": {\n    \"amqp\": {\n      \"exchange\": \"ingestion_events\",\n      \"routing_key_done\": \"ingest.completed\",\n      \"routing_key_progress\": \"ingest.progress\",\n      \"routing_key_error\": \"ingest.failed\"\n    }\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Async file ingestion
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "ingest_body": [
    "artifact": "quarterly_report",
    "input": [
      "type": "file",
      "value": "JVBERi0xLjQKJaqrrK0KMS..."
    ],
    "collection": "financial_docs",
    "metadata": ["file_name": "Q3_Report.pdf"]
  ],
  "callback": ["amqp": [
      "exchange": "ingestion_events",
      "routing_key_done": "ingest.completed",
      "routing_key_progress": "ingest.progress",
      "routing_key_error": "ingest.failed"
    ]]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/v1/artifacts/ingest/async")! 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()
```

### Async URI ingestion

**Request**

```json
{
  "ingest_body": {
    "artifact": "annual_report_2023",
    "input": {
      "type": "uri",
      "value": "s3://company-docs/annual-2023.pdf"
    },
    "collection": "financial_reports",
    "metadata": {
      "year": "2023"
    }
  },
  "callback": {
    "amqp": {
      "exchange": "ingestion_events",
      "routing_key_done": "ingest.completed",
      "routing_key_progress": "ingest.progress",
      "routing_key_error": "ingest.failed"
    }
  }
}
```

**Response**

```json
{
  "task_id": "123e4567-e89b-12d3-a456-426614174000"
}
```

**SDK Code**

```python Async URI ingestion
import requests

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

payload = {
    "ingest_body": {
        "artifact": "annual_report_2023",
        "input": {
            "type": "uri",
            "value": "s3://company-docs/annual-2023.pdf"
        },
        "collection": "financial_reports",
        "metadata": { "year": "2023" }
    },
    "callback": { "amqp": {
            "exchange": "ingestion_events",
            "routing_key_done": "ingest.completed",
            "routing_key_progress": "ingest.progress",
            "routing_key_error": "ingest.failed"
        } }
}
headers = {"Content-Type": "application/json"}

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

print(response.json())
```

```javascript Async URI ingestion
const url = 'https://api.example.com/v1/artifacts/ingest/async';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"ingest_body":{"artifact":"annual_report_2023","input":{"type":"uri","value":"s3://company-docs/annual-2023.pdf"},"collection":"financial_reports","metadata":{"year":"2023"}},"callback":{"amqp":{"exchange":"ingestion_events","routing_key_done":"ingest.completed","routing_key_progress":"ingest.progress","routing_key_error":"ingest.failed"}}}'
};

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

```go Async URI ingestion
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"ingest_body\": {\n    \"artifact\": \"annual_report_2023\",\n    \"input\": {\n      \"type\": \"uri\",\n      \"value\": \"s3://company-docs/annual-2023.pdf\"\n    },\n    \"collection\": \"financial_reports\",\n    \"metadata\": {\n      \"year\": \"2023\"\n    }\n  },\n  \"callback\": {\n    \"amqp\": {\n      \"exchange\": \"ingestion_events\",\n      \"routing_key_done\": \"ingest.completed\",\n      \"routing_key_progress\": \"ingest.progress\",\n      \"routing_key_error\": \"ingest.failed\"\n    }\n  }\n}")

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

	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 Async URI ingestion
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"ingest_body\": {\n    \"artifact\": \"annual_report_2023\",\n    \"input\": {\n      \"type\": \"uri\",\n      \"value\": \"s3://company-docs/annual-2023.pdf\"\n    },\n    \"collection\": \"financial_reports\",\n    \"metadata\": {\n      \"year\": \"2023\"\n    }\n  },\n  \"callback\": {\n    \"amqp\": {\n      \"exchange\": \"ingestion_events\",\n      \"routing_key_done\": \"ingest.completed\",\n      \"routing_key_progress\": \"ingest.progress\",\n      \"routing_key_error\": \"ingest.failed\"\n    }\n  }\n}"

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

```java Async URI ingestion
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.example.com/v1/artifacts/ingest/async")
  .header("Content-Type", "application/json")
  .body("{\n  \"ingest_body\": {\n    \"artifact\": \"annual_report_2023\",\n    \"input\": {\n      \"type\": \"uri\",\n      \"value\": \"s3://company-docs/annual-2023.pdf\"\n    },\n    \"collection\": \"financial_reports\",\n    \"metadata\": {\n      \"year\": \"2023\"\n    }\n  },\n  \"callback\": {\n    \"amqp\": {\n      \"exchange\": \"ingestion_events\",\n      \"routing_key_done\": \"ingest.completed\",\n      \"routing_key_progress\": \"ingest.progress\",\n      \"routing_key_error\": \"ingest.failed\"\n    }\n  }\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.example.com/v1/artifacts/ingest/async', [
  'body' => '{
  "ingest_body": {
    "artifact": "annual_report_2023",
    "input": {
      "type": "uri",
      "value": "s3://company-docs/annual-2023.pdf"
    },
    "collection": "financial_reports",
    "metadata": {
      "year": "2023"
    }
  },
  "callback": {
    "amqp": {
      "exchange": "ingestion_events",
      "routing_key_done": "ingest.completed",
      "routing_key_progress": "ingest.progress",
      "routing_key_error": "ingest.failed"
    }
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Async URI ingestion
using RestSharp;

var client = new RestClient("https://api.example.com/v1/artifacts/ingest/async");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"ingest_body\": {\n    \"artifact\": \"annual_report_2023\",\n    \"input\": {\n      \"type\": \"uri\",\n      \"value\": \"s3://company-docs/annual-2023.pdf\"\n    },\n    \"collection\": \"financial_reports\",\n    \"metadata\": {\n      \"year\": \"2023\"\n    }\n  },\n  \"callback\": {\n    \"amqp\": {\n      \"exchange\": \"ingestion_events\",\n      \"routing_key_done\": \"ingest.completed\",\n      \"routing_key_progress\": \"ingest.progress\",\n      \"routing_key_error\": \"ingest.failed\"\n    }\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Async URI ingestion
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "ingest_body": [
    "artifact": "annual_report_2023",
    "input": [
      "type": "uri",
      "value": "s3://company-docs/annual-2023.pdf"
    ],
    "collection": "financial_reports",
    "metadata": ["year": "2023"]
  ],
  "callback": ["amqp": [
      "exchange": "ingestion_events",
      "routing_key_done": "ingest.completed",
      "routing_key_progress": "ingest.progress",
      "routing_key_error": "ingest.failed"
    ]]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/v1/artifacts/ingest/async")! 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()
```

### Async text ingestion

**Request**

```json
{
  "ingest_body": {
    "artifact": "company_profile",
    "input": {
      "type": "text",
      "value": "Our company was founded in 2020..."
    },
    "collection": "corporate_docs",
    "metadata": {
      "author": "Marketing Team"
    }
  },
  "callback": {
    "amqp": {
      "exchange": "ingestion_events",
      "routing_key_done": "ingest.completed",
      "routing_key_progress": "ingest.progress",
      "routing_key_error": "ingest.failed"
    }
  }
}
```

**Response**

```json
{
  "task_id": "123e4567-e89b-12d3-a456-426614174000"
}
```

**SDK Code**

```python Async text ingestion
import requests

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

payload = {
    "ingest_body": {
        "artifact": "company_profile",
        "input": {
            "type": "text",
            "value": "Our company was founded in 2020..."
        },
        "collection": "corporate_docs",
        "metadata": { "author": "Marketing Team" }
    },
    "callback": { "amqp": {
            "exchange": "ingestion_events",
            "routing_key_done": "ingest.completed",
            "routing_key_progress": "ingest.progress",
            "routing_key_error": "ingest.failed"
        } }
}
headers = {"Content-Type": "application/json"}

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

print(response.json())
```

```javascript Async text ingestion
const url = 'https://api.example.com/v1/artifacts/ingest/async';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"ingest_body":{"artifact":"company_profile","input":{"type":"text","value":"Our company was founded in 2020..."},"collection":"corporate_docs","metadata":{"author":"Marketing Team"}},"callback":{"amqp":{"exchange":"ingestion_events","routing_key_done":"ingest.completed","routing_key_progress":"ingest.progress","routing_key_error":"ingest.failed"}}}'
};

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

```go Async text ingestion
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"ingest_body\": {\n    \"artifact\": \"company_profile\",\n    \"input\": {\n      \"type\": \"text\",\n      \"value\": \"Our company was founded in 2020...\"\n    },\n    \"collection\": \"corporate_docs\",\n    \"metadata\": {\n      \"author\": \"Marketing Team\"\n    }\n  },\n  \"callback\": {\n    \"amqp\": {\n      \"exchange\": \"ingestion_events\",\n      \"routing_key_done\": \"ingest.completed\",\n      \"routing_key_progress\": \"ingest.progress\",\n      \"routing_key_error\": \"ingest.failed\"\n    }\n  }\n}")

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

	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 Async text ingestion
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"ingest_body\": {\n    \"artifact\": \"company_profile\",\n    \"input\": {\n      \"type\": \"text\",\n      \"value\": \"Our company was founded in 2020...\"\n    },\n    \"collection\": \"corporate_docs\",\n    \"metadata\": {\n      \"author\": \"Marketing Team\"\n    }\n  },\n  \"callback\": {\n    \"amqp\": {\n      \"exchange\": \"ingestion_events\",\n      \"routing_key_done\": \"ingest.completed\",\n      \"routing_key_progress\": \"ingest.progress\",\n      \"routing_key_error\": \"ingest.failed\"\n    }\n  }\n}"

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

```java Async text ingestion
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.example.com/v1/artifacts/ingest/async")
  .header("Content-Type", "application/json")
  .body("{\n  \"ingest_body\": {\n    \"artifact\": \"company_profile\",\n    \"input\": {\n      \"type\": \"text\",\n      \"value\": \"Our company was founded in 2020...\"\n    },\n    \"collection\": \"corporate_docs\",\n    \"metadata\": {\n      \"author\": \"Marketing Team\"\n    }\n  },\n  \"callback\": {\n    \"amqp\": {\n      \"exchange\": \"ingestion_events\",\n      \"routing_key_done\": \"ingest.completed\",\n      \"routing_key_progress\": \"ingest.progress\",\n      \"routing_key_error\": \"ingest.failed\"\n    }\n  }\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.example.com/v1/artifacts/ingest/async', [
  'body' => '{
  "ingest_body": {
    "artifact": "company_profile",
    "input": {
      "type": "text",
      "value": "Our company was founded in 2020..."
    },
    "collection": "corporate_docs",
    "metadata": {
      "author": "Marketing Team"
    }
  },
  "callback": {
    "amqp": {
      "exchange": "ingestion_events",
      "routing_key_done": "ingest.completed",
      "routing_key_progress": "ingest.progress",
      "routing_key_error": "ingest.failed"
    }
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Async text ingestion
using RestSharp;

var client = new RestClient("https://api.example.com/v1/artifacts/ingest/async");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"ingest_body\": {\n    \"artifact\": \"company_profile\",\n    \"input\": {\n      \"type\": \"text\",\n      \"value\": \"Our company was founded in 2020...\"\n    },\n    \"collection\": \"corporate_docs\",\n    \"metadata\": {\n      \"author\": \"Marketing Team\"\n    }\n  },\n  \"callback\": {\n    \"amqp\": {\n      \"exchange\": \"ingestion_events\",\n      \"routing_key_done\": \"ingest.completed\",\n      \"routing_key_progress\": \"ingest.progress\",\n      \"routing_key_error\": \"ingest.failed\"\n    }\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Async text ingestion
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "ingest_body": [
    "artifact": "company_profile",
    "input": [
      "type": "text",
      "value": "Our company was founded in 2020..."
    ],
    "collection": "corporate_docs",
    "metadata": ["author": "Marketing Team"]
  ],
  "callback": ["amqp": [
      "exchange": "ingestion_events",
      "routing_key_done": "ingest.completed",
      "routing_key_progress": "ingest.progress",
      "routing_key_error": "ingest.failed"
    ]]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/v1/artifacts/ingest/async")! 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()
```