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>"
      },
      "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.

Path Parameters

namespaceId
string
required

The id of the namespace (prefixed with ns_)

Examples:

"ns_123"

Query Parameters

statuses
enum<string>[]

Comma separated list of statuses to filter by.

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>

The direction to paginate by.

Available options:
forward,
backward
perPage
number
default:30
Required range: 1 <= x <= 100

Response

The retrieved ingest jobs

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