Skip to main content
POST
/
v1
/
namespace
/
{namespaceId}
/
ingest-jobs
TypeScript
import { Agentset } from "agentset";

const agentset = new Agentset({ apiKey: 'agentset_xxx' });
const ns = agentset.namespace('ns_xxx');

const job = await ns.ingestion.create({
  payload: {
    type: "TEXT",
    text: "This is some content to ingest into the knowledge base.",
  },
  config: {
    metadata: {
      foo: "bar",
    },
  },
});
console.log(job);
{
  "success": true,
  "data": {
    "id": "<string>",
    "name": "<string>",
    "namespaceId": "<string>",
    "tenantId": "<string>",
    "externalId": "<string>",
    "status": "BACKLOG",
    "error": "<string>",
    "payload": {
      "type": "<string>",
      "text": "<string>",
      "fileName": "<string>"
    },
    "config": {
      "chunkSize": 123,
      "maxChunkSize": 123,
      "chunkOverlap": 123,
      "metadata": {},
      "chunkingStrategy": "basic",
      "strategy": "auto"
    },
    "createdAt": "<string>",
    "queuedAt": "<string>",
    "preProcessingAt": "<string>",
    "processingAt": "<string>",
    "completedAt": "<string>",
    "failedAt": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Default authentication mechanism

Headers

x-tenant-id
string

Optional tenant id to use for the request. If not provided, the namespace will be used directly. Must be alphanumeric and up to 64 characters.

Path Parameters

namespaceId
string
required

The id of the namespace (prefixed with ns_)

Examples:

"ns_123"

Body

application/json
payload
object
required

The ingest job payload.

  • Text Payload
  • URL Payload
  • Managed File Payload
  • Batch Payload
name
string | null

The name of the ingest job.

config
object

The ingest job config.

externalId
string | null

A unique external ID of the ingest job. You can use this to identify the ingest job in your system.

Response

The created ingest job

success
boolean
required
data
object
required
I