Skip to main content
GET
/
v1
/
namespace
/
{namespaceId}
/
documents
TypeScript
import { Agentset } from "agentset";

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

const docs = await ns.documents.all();
console.log(docs);
{
  "success": true,
  "data": [
    {
      "id": "<string>",
      "ingestJobId": "<string>",
      "name": "<string>",
      "tenantId": "<string>",
      "status": "BACKLOG",
      "error": "<string>",
      "source": {
        "type": "<string>",
        "text": "<string>"
      },
      "properties": {
        "fileSize": 123,
        "mimeType": "<string>"
      },
      "config": {
        "chunkSize": 4503599627370512,
        "delimiter": "<string>",
        "metadata": {},
        "languageCode": "af",
        "mode": "fast",
        "disableImageExtraction": true,
        "disableImageCaptions": true,
        "chartUnderstanding": true,
        "keepPageheaderInOutput": true,
        "keepPagefooterInOutput": true,
        "forceOcr": true,
        "disableOcrMath": true,
        "useLlm": true,
        "chunkOverlap": 123,
        "maxChunkSize": 123,
        "chunkingStrategy": "basic",
        "strategy": "auto"
      },
      "totalChunks": 123,
      "totalTokens": 123,
      "totalCharacters": 123,
      "totalPages": 123,
      "createdAt": "<string>",
      "queuedAt": "<string>",
      "preProcessingAt": "<string>",
      "processingAt": "<string>",
      "completedAt": "<string>",
      "failedAt": "<string>"
    }
  ],
  "pagination": {
    "nextCursor": "<string>",
    "prevCursor": "<string>",
    "hasMore": true
  }
}

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.

Pattern: ^[A-Za-z0-9]{1,64}$

Path Parameters

namespaceId
string
required

The id of the namespace (prefixed with ns_)

Example:

"ns_123"

Query Parameters

statuses
enum<string>[]

Comma separated list of statuses to filter by.

The status of the document.

Available options:
BACKLOG,
QUEUED,
QUEUED_FOR_RESYNC,
QUEUED_FOR_DELETE,
PRE_PROCESSING,
PROCESSING,
DELETING,
CANCELLING,
COMPLETED,
FAILED,
CANCELLED
orderBy
enum<string>
default:createdAt

The field to order by. Default is createdAt.

Available options:
createdAt
order
enum<string>
default:desc

The order to sort by. Default is desc.

Available options:
asc,
desc
ingestJobId
string

The ingest job ID to filter documents by.

cursor
string

The cursor to paginate by.

cursorDirection
enum<string>
default:forward

The direction to paginate by.

Available options:
forward,
backward
perPage
number
default:30

The number of records to return per page.

Required range: 1 <= x <= 100

Response

The retrieved ingest jobs

success
boolean
required
data
Document · object[]
required
pagination
object
required