Documents
Manage documents and their chunks, including creation via URL or file upload, retrieval, update, deletion, search, and status control. Documents can be associated with datasets.
["xxxx"]
78c8e44c-9ef2-461d-88ba-ee7783a90251
{{tenantId}}
the API Key
{{apiKey}}
s3, gcs
use url or storageBucket + storagePath
use url or storageBucket + storagePath
POST /admin/api/v1/documents?tenantId=text HTTP/1.1
Host: api.workfx.ai
Content-Type: application/json
Accept: */*
Content-Length: 288
{
"id": "text",
"tenantId": "text",
"tenantUnitId": "text",
"documentType": "UnstructuredFile",
"documentSubType": "pdf",
"documentName": "text",
"storageType": "text",
"storageBucket": "text",
"storagePath": "text",
"url": "text",
"title": "text",
"customProperties": {},
"enabled": true,
"documentContent": "text"
}
{
"id": "text",
"tenantUnitId": "text",
"documentType": "UnstructuredFile",
"documentSubType": "pdf",
"documentName": "text",
"storageType": "text",
"storageBucket": "text",
"storagePath": "text",
"url": "text",
"createdTime": "text",
"updatedTime": "text",
"status": "created",
"createdBy": "text",
"updatedBy": "text",
"title": "text",
"category": "text",
"processingProgress": 1,
"customProperties": {},
"enabled": true,
"documentContent": "text"
}
{{currentTenantId}}
{{tenantUnitId}}
the API Key
{{apiKey}}
UnstructuredFile
pdf
["[\"{{datasetId}}\"]"]
{{tenantUnitId}}
file://D:\study\Code\codeRepos\ecompilot-web\tests\synthetic_tests\WoolworthsAnnualReport.pdf
{{tenantId}}
{"test":true}
POST /admin/api/v1/documents/upload HTTP/1.1
Host: api.workfx.ai
Content-Type: multipart/form-data
Accept: */*
Content-Length: 317
{
"documentType": "UnstructuredFile",
"documentSubType": "pdf",
"category": "",
"datasetIds": [
"[\"{{datasetId}}\"]"
],
"tenantUnitId": "{{tenantUnitId}}",
"file": "file://D:\\study\\Code\\codeRepos\\ecompilot-web\\tests\\synthetic_tests\\WoolworthsAnnualReport.pdf",
"tenantId": "{{tenantId}}",
"customProperties": "{\"test\":true}"
}
{
"id": "text",
"tenantId": "text",
"tenantUnitId": "text",
"documentType": "UnstructuredFile",
"documentSubType": "pdf",
"documentName": "text",
"storageType": "text",
"storageBucket": "text",
"storagePath": "text",
"url": "text",
"createdTime": "text",
"updatedTime": "text",
"status": "created",
"createdBy": "text",
"updatedBy": "text",
"title": "text",
"category": "text",
"processingProgress": 1,
"customProperties": {},
"enabled": true,
"documentContent": "text"
}
External ID of the document
Optional list of dataset IDs as JSON string
["your-dataset-id"]
{{tenantId}}
the API Key
{{apiKey}}
External ID used to identify the document
Name of the document
Tenant ID
Tenant Unit ID
URL of the document to fetch and process
Direct content of the document, if provided
Document successfully upserted
Invalid input
Unauthorized
Internal server error
PUT /admin/api/v1/api/v1/documents/byExternalId/{externalId}?tenantId=text HTTP/1.1
Host: api.workfx.ai
Content-Type: application/json
Accept: */*
Content-Length: 216
{
"externalId": "integration_test_external_id",
"documentName": "integration_test_document",
"tenantUnitId": "your-tenant-unit-id",
"tenantId": "your-tenant-id",
"url": "https://example.com/sample.docx",
"custom_properties": {}
}
{
"externalId": "text",
"documentName": "text",
"status": "text"
}
2549d630-81ab-41b9-a691-5377fe140fed
{{tenantId}}
the API Key
{{apiKey}}
GET /admin/api/v1/documents/{documentId}?tenantId=text HTTP/1.1
Host: api.workfx.ai
Accept: */*
{
"id": "text",
"tenantId": "text",
"tenantUnitId": "text",
"documentType": "UnstructuredFile",
"documentSubType": "pdf",
"documentName": "text",
"storageType": "text",
"storageBucket": "text",
"storagePath": "text",
"url": "text",
"createdTime": "text",
"updatedTime": "text",
"status": "created",
"createdBy": "text",
"updatedBy": "text",
"title": "text",
"category": "text",
"processingProgress": 1,
"customProperties": {},
"enabled": true,
"documentContent": "text"
}
UnstructuredFile
{{tenantUnitId}}
dataset ids, seperate with comma
xxx,yyy,zzz
UnstructuredFile StructuredFile UnstructuredWebpage StructuredWebpage
UnstructuredFile
default to 1 if not passing this query
1
default to 10 if not passing this query
10
{{tenantId}}
the API Key
{{apiKey}}
GET /admin/api/v1/documents?tenantId=text HTTP/1.1
Host: api.workfx.ai
Accept: */*
{
"data": [
{
"id": "text",
"tenantId": "text",
"tenantUnitId": "text",
"documentType": "UnstructuredFile",
"documentSubType": "pdf",
"documentName": "text",
"storageType": "text",
"storageBucket": "text",
"storagePath": "text",
"url": "text",
"createdTime": "text",
"updatedTime": "text",
"status": "created",
"createdBy": "text",
"updatedBy": "text",
"title": "text",
"category": "text",
"processingProgress": 1,
"customProperties": {},
"enabled": true,
"documentContent": "text"
}
],
"pagination": {
"totalCount": 1,
"currentPage": 1,
"pageSize": 1,
"totalPages": 1
}
}
{{tenantId}}
the API Key
{{apiKey}}
DELETE /admin/api/v1/documents/{documentId}?tenantId=text HTTP/1.1
Host: api.workfx.ai
Accept: */*
No content
["xxxx","yyyy"]
{{tenantId}}
the API Key
{{apiKey}}
GET /admin/api/v1/documents/byIds?tenantId=text HTTP/1.1
Host: api.workfx.ai
Accept: */*
[
{
"id": "text",
"tenantId": "text",
"tenantUnitId": "text",
"documentType": "UnstructuredFile",
"documentSubType": "pdf",
"documentName": "text",
"storageType": "text",
"storageBucket": "text",
"storagePath": "text",
"url": "text",
"createdTime": "text",
"updatedTime": "text",
"status": "created",
"createdBy": "text",
"updatedBy": "text",
"title": "text",
"category": "text",
"processingProgress": 1,
"customProperties": {},
"enabled": true,
"documentContent": "text"
}
]
{{tenantId}}
the API Key
{{apiKey}}
use url or storageBucket + storagePath
PATCH /admin/api/v1/documents/{documentId}?tenantId=text HTTP/1.1
Host: api.workfx.ai
Content-Type: application/json
Accept: */*
Content-Length: 76
{
"url": "text",
"customProperties": {},
"enabled": true,
"documentContent": "text"
}
{
"id": "text",
"tenantId": "text",
"tenantUnitId": "text",
"documentType": "UnstructuredFile",
"documentSubType": "pdf",
"documentName": "text",
"storageType": "text",
"storageBucket": "text",
"storagePath": "text",
"url": "text",
"createdTime": "text",
"updatedTime": "text",
"status": "created",
"createdBy": "text",
"updatedBy": "text",
"title": "text",
"category": "text",
"processingProgress": 1,
"customProperties": {},
"enabled": true,
"documentContent": "text"
}
{{tenantId}}
the API Key
{{apiKey}}
PATCH /admin/api/v1/documents/{documentId}/toggle?tenantId=text HTTP/1.1
Host: api.workfx.ai
Content-Type: application/json
Accept: */*
Content-Length: 16
{
"enabled": true
}
{}
default to 1 if not passing this query
1
default to 10 if not passing this query
10
{{tenantId}}
the API Key
{{apiKey}}
GET /admin/api/v1/api/v1/documents/{documentId}/documentChunks/?tenantId=text HTTP/1.1
Host: api.workfx.ai
Accept: */*
{
"data": [
{
"content": "text",
"contentComplement": "text",
"createdTime": "text",
"documentId": "text",
"id": "text",
"keywords": {},
"metadata": {
"file_directory": "text",
"filename": "text",
"filetype": "text",
"languages": [
"text"
],
"last_modified": "text",
"page_number": 1
},
"status": "text",
"tenantId": "text",
"tenantUnitId": "text",
"updatedTime": "text"
}
],
"pagination": {
"currentPage": 1,
"pageSize": 1,
"totalCount": 1,
"totalPages": 1
}
}
{{tenantId}}
the API Key
{{apiKey}}
default is 5
currently support 'english' or 'chinese' , default is 'english'
POST /admin/api/v1/api/v1/documentChunks/search?tenantId=text HTTP/1.1
Host: api.workfx.ai
Content-Type: application/json
Accept: */*
Content-Length: 110
{
"tenant_id": "text",
"tenant_unit_id": "text",
"dataset_ids": [
"text"
],
"query": "text",
"top_k": 1,
"language": "text"
}
[
{
"content": "text",
"content_complement": "text",
"created_time": "text",
"document_id": "text",
"document_name": "text",
"document_sub_type": "text",
"document_type": "text",
"id": "text",
"keywords": [
"text"
],
"metadata": {
"dataset_ids": [
"text"
]
},
"score": 1,
"tenant_id": "text",
"tenant_unit_id": "text",
"updated_time": "text"
}
]
{{tenantId}}
the API Key
{{apiKey}}
PATCH /admin/api/v1/api/v1/documents/{document_id}/documentChunks/<chunk_id>?tenantId=text HTTP/1.1
Host: api.workfx.ai
Content-Type: application/json
Accept: */*
Content-Length: 38
{
"content": "text",
"keywords": [
"text"
]
}
{}
[""]
the API Key
{{apiKey}}
DELETE /admin/api/v1/documents/{document_id}/documentChunks/batch HTTP/1.1
Host: api.workfx.ai
Content-Type: application/json
Accept: */*
Content-Length: 28
{
"documentChunkIds": [
"id1"
]
}
{}
8313c091-eb49-4d42-91cb-0a1f965a4e90
07284edf-f254-4503-8ca6-c2deff022fd4
the API Key
{{apiKey}}
active or inactive
PATCH /admin/api/v1/documents/{document_id}/documentChunks/batch/status?tenantUnitId=text HTTP/1.1
Host: api.workfx.ai
Content-Type: application/json
Accept: */*
Content-Length: 52
{
"status": "active",
"documentChunkIds": [
"id1",
"id2"
]
}
{}
{{tenantId}}
the API Key
{{apiKey}}
active or inactive
PATCH /admin/api/v1/api/v1/documents/{document_id}/documentChunks/<chunk_id>/status?tenantUnitId=text&tenantId=text HTTP/1.1
Host: api.workfx.ai
Content-Type: application/json
Accept: */*
Content-Length: 19
{
"status": "active"
}
{}
Last updated
Was this helpful?