File API
- Base URL:
https://file.sls.epilot.io - Full API Docs: https://docs.epilot.io/api/file
Usageโ
import { epilot } from '@epilot/sdk'
epilot.authorize(() => '<token>')
const { data } = await epilot.file.uploadFileV2(...)
Tree-shakeable importโ
import { getClient, authorize } from '@epilot/sdk/file'
const fileClient = getClient()
authorize(fileClient, () => '<token>')
const { data } = await fileClient.uploadFileV2(...)
Operationsโ
File
uploadFileV2saveFileV2getFiledeleteFiledownloadFiledownloadS3FiledownloadFilescreateZipJobgetZipJobgetFileSummarygetFileSummaryFeedbackputFileSummaryFeedbackcreateFileSummaryJobgetCurrentFileSummaryJobgetFileSummaryJobgenerateFileSummarycreateFileAttributeSuggestionJobgetLatestFileAttributeSuggestionsgetFileAttributeSuggestionJobupdateFileAttributeSuggestionStatusgetFileTextvalidateFileverifyCustomDownloadUrluploadFilePublic
Preview
Session
Public Links
File Collections
getUserSchemaFileCollectionscreateUserSchemaFileCollectionupdateUserSchemaFileCollectiondeleteUserSchemaFileCollectiongetFilesInCollectiongetGlobalFileCollections
Schemas
EntityIdEntitySlugActivityIdFileEntityIdFileAttributesFileTypeFileSummaryJobStatusFileSummaryJobFileSummaryFileSummaryFeedbackFileSummaryFeedbackResponsePutFileSummaryFeedbackRequestFileAttributeSuggestionJobStatusFileAttributeSuggestionFileAttributeSuggestionsPayloadFileAttributeSuggestionJobCreateFileAttributeSuggestionJobRequestUpdateFileAttributeSuggestionStatusRequestFileAttributeSuggestionErrorFileTextStatusFileValidationRequestFileValidationFileReferenceFileValidationFileValidationFileFileValidationObservationFileValidationJudgementFileValidationFactsFileValidationRuleResultFileValidationConditionResultFileTextFileTextReadyFileTextNotReadyFileTextUnsupportedCustomDownloadUrlCustomDownloadUrlAuthFileEntityCommonSaveFilePayloadSaveS3FilePayloadSaveFileFromSourceURLPayloadSaveCustomFilePayloadSaveFilePayloadSaveFilePayloadV2BatchSaveFileVersionPayloadUploadFilePayloadFileUploadDownloadFilesPayloadCreateZipJobPayloadZipJobVerifyCustomDownloadUrlPayloadS3ReferenceS3RefFileItemFileRelationItemPublicLinkBaseEntityOwnerBaseEntityAclErrorObjectFileCollectionIdFileCollectionItemFileCollectionAttributesFileCollectionCreateRequest
uploadFileV2โ
Create pre-signed S3 URL to upload a file to keep temporarily (one week).
POST /v2/files/upload
const { data } = await client.uploadFileV2(
{
file_entity_id: 'example',
},
{
filename: 'document.pdf',
mime_type: 'application/pdf',
index_tag: '2f6a377c8e78',
metadata: {
color: 'blue'
}
},
)
Response
{
"s3ref": {
"bucket": "epilot-prod-user-content",
"key": "123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf"
},
"upload_url": "https://epilot-prod-user-content.s3.eu-central-1.amazonaws.com/123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf?AWSParams=123",
"public_url": "https://epilot-prod-user-content.s3.eu-central-1.amazonaws.com/123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf"
}
saveFileV2โ
Saves a permanent file entity. Updates an existing file entity when _id is passed.
POST /v2/files
const { data } = await client.saveFileV2(
{
activity_id: 'example',
fill_activity: true,
strict: true,
async: true,
delete_temp_file: true,
version_only: true,
},
{
_id: 'ef7d985c-2385-44f4-9c71-ae06a52264f8',
file_entity_id: 'string',
relations: [
{
entity_id: 'ef7d985c-2385-44f4-9c71-ae06a52264f8',
_schema: 'contact',
_tags: ['string']
}
],
_tags: ['tag1', 'tag2'],
_purpose: ['8d396871-95a0-4c9d-bb4d-9eda9c35776c', 'da7cdf9a-01be-40c9-a29c-9a8f9f0de6f8'],
_manifest: ['123e4567-e89b-12d3-a456-426614174000'],
filename: 'document.pdf',
type: 'document',
mime_type: 'application/pdf',
size_bytes: 1234,
readable_size: '1.2 MB',
etag: '9bb58f26192e4ba00f01e2e7b136bbd8',
access_control: 'private',
public_url: 'https://epilot-prod-user-content.s3.eu-central-1.amazonaws.com/123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf',
custom_download_url: 'https://some-api-url.com/download?file_id=123',
custom_download_url_auth: 'token',
preview_summary_de: 'string',
short_summary_de: 'string',
preview_summary_en: 'string',
short_summary_en: 'string',
file_summary_execution_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',
s3ref: {}
},
)
Response
{
"_title": "document.pdf",
"_schema": "file",
"_org": "123",
"_id": "ef7d985c-2385-44f4-9c71-ae06a52264f8",
"_tags": ["tag1", "tag2"],
"_purpose": ["8d396871-95a0-4c9d-bb4d-9eda9c35776c", "da7cdf9a-01be-40c9-a29c-9a8f9f0de6f8"],
"_manifest": ["123e4567-e89b-12d3-a456-426614174000"],
"filename": "document.pdf",
"type": "document",
"mime_type": "application/pdf",
"size_bytes": 1234,
"readable_size": "1.2 MB",
"etag": "9bb58f26192e4ba00f01e2e7b136bbd8",
"access_control": "private",
"public_url": "https://epilot-prod-user-content.s3.eu-central-1.amazonaws.com/123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf",
"custom_download_url": "https://some-api-url.com/download?file_id=123",
"custom_download_url_auth": "token",
"preview_summary_de": "string",
"short_summary_de": "string",
"preview_summary_en": "string",
"short_summary_en": "string",
"file_summary_execution_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"source_url": "https://productengineer-content.s3.eu-west-1.amazonaws.com/product-engineer-checklist.pdf",
"s3ref": {},
"versions": [
{
"s3ref": {},
"filename": "document.pdf",
"size_bytes": 1234,
"readable_size": "1.2 MB",
"mime_type": "image/jpeg",
"etag": "9bb58f26192e4ba00f01e2e7b136bbd8"
}
],
"_updated_at": "1970-01-01T00:00:00.000Z",
"_created_at": "1970-01-01T00:00:00.000Z",
"_acl": {
"view": ["org:456"],
"edit": ["org:456"],
"delete": ["org:456"]
},
"_owners": [
{
"org_id": "123",
"user_id": "123"
}
],
"__additional": {}
}
getFileโ
Get a file entity by id
GET /v2/files/{id}
const { data } = await client.getFile({
id: '123e4567-e89b-12d3-a456-426614174000',
source_url: true,
strict: true,
async: true,
})
Response
{
"_title": "document.pdf",
"_schema": "file",
"_org": "123",
"_id": "ef7d985c-2385-44f4-9c71-ae06a52264f8",
"_tags": ["tag1", "tag2"],
"_purpose": ["8d396871-95a0-4c9d-bb4d-9eda9c35776c", "da7cdf9a-01be-40c9-a29c-9a8f9f0de6f8"],
"_manifest": ["123e4567-e89b-12d3-a456-426614174000"],
"filename": "document.pdf",
"type": "document",
"mime_type": "application/pdf",
"size_bytes": 1234,
"readable_size": "1.2 MB",
"etag": "9bb58f26192e4ba00f01e2e7b136bbd8",
"access_control": "private",
"public_url": "https://epilot-prod-user-content.s3.eu-central-1.amazonaws.com/123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf",
"custom_download_url": "https://some-api-url.com/download?file_id=123",
"custom_download_url_auth": "token",
"preview_summary_de": "string",
"short_summary_de": "string",
"preview_summary_en": "string",
"short_summary_en": "string",
"file_summary_execution_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"source_url": "https://productengineer-content.s3.eu-west-1.amazonaws.com/product-engineer-checklist.pdf",
"s3ref": {},
"versions": [
{
"s3ref": {},
"filename": "document.pdf",
"size_bytes": 1234,
"readable_size": "1.2 MB",
"mime_type": "image/jpeg",
"etag": "9bb58f26192e4ba00f01e2e7b136bbd8"
}
],
"_updated_at": "1970-01-01T00:00:00.000Z",
"_created_at": "1970-01-01T00:00:00.000Z",
"_acl": {
"view": ["org:456"],
"edit": ["org:456"],
"delete": ["org:456"]
},
"_owners": [
{
"org_id": "123",
"user_id": "123"
}
],
"__additional": {}
}
deleteFileโ
Delete a file entity by id
DELETE /v2/files/{id}
const { data } = await client.deleteFile({
id: '123e4567-e89b-12d3-a456-426614174000',
purge: true,
activity_id: 'example',
strict: true,
})
Response
{
"_title": "document.pdf",
"_schema": "file",
"_org": "123",
"_id": "ef7d985c-2385-44f4-9c71-ae06a52264f8",
"_tags": ["tag1", "tag2"],
"_purpose": ["8d396871-95a0-4c9d-bb4d-9eda9c35776c", "da7cdf9a-01be-40c9-a29c-9a8f9f0de6f8"],
"_manifest": ["123e4567-e89b-12d3-a456-426614174000"],
"filename": "document.pdf",
"type": "document",
"mime_type": "application/pdf",
"size_bytes": 1234,
"readable_size": "1.2 MB",
"etag": "9bb58f26192e4ba00f01e2e7b136bbd8",
"access_control": "private",
"public_url": "https://epilot-prod-user-content.s3.eu-central-1.amazonaws.com/123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf",
"custom_download_url": "https://some-api-url.com/download?file_id=123",
"custom_download_url_auth": "token",
"preview_summary_de": "string",
"short_summary_de": "string",
"preview_summary_en": "string",
"short_summary_en": "string",
"file_summary_execution_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"source_url": "https://productengineer-content.s3.eu-west-1.amazonaws.com/product-engineer-checklist.pdf",
"s3ref": {},
"versions": [
{
"s3ref": {},
"filename": "document.pdf",
"size_bytes": 1234,
"readable_size": "1.2 MB",
"mime_type": "image/jpeg",
"etag": "9bb58f26192e4ba00f01e2e7b136bbd8"
}
],
"_updated_at": "1970-01-01T00:00:00.000Z",
"_created_at": "1970-01-01T00:00:00.000Z",
"_acl": {
"view": ["org:456"],
"edit": ["org:456"],
"delete": ["org:456"]
},
"_owners": [
{
"org_id": "123",
"user_id": "123"
}
],
"__additional": {}
}
downloadFileโ
Generate a pre-signed download URL for a file.
GET /v1/files/{id}/download
const { data } = await client.downloadFile({
id: '123e4567-e89b-12d3-a456-426614174000',
version: 1,
attachment: true,
x-track: 'example',
})
Response
{
"download_url": "https://epilot-prod-user-content.s3.eu-central-1.amazonaws.com/123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf?AWSParams=123"
}
downloadS3Fileโ
Generate a pre-signed download URL for a file using its S3 reference.
POST /v1/files:downloadS3
const { data } = await client.downloadS3File({
s3_key: 'example',
s3_bucket: 'example',
attachment: true,
})
Response
{
"download_url": "https://epilot-prod-user-content.s3.eu-central-1.amazonaws.com/123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf?AWSParams=123"
}
downloadFilesโ
Bulk generate pre-signed download URLs for multiple files in a single request.
POST /v1/files:downloadFiles
const { data } = await client.downloadFiles(
null,
[
{
id: 'ef7d985c-2385-44f4-9c71-ae06a52264f8',
version: 0
}
],
)
Response
[
{
"download_url": "https://epilot-prod-user-content.s3.eu-central-1.amazonaws.com/123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf?AWSParams=123",
"file_entity_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
]
createZipJobโ
Create a background job to ZIP multiple files and send a download link via email.
POST /v1/files:zipJob
const { data } = await client.createZipJob(
null,
{},
)
getZipJobโ
Get the status of a ZIP job
GET /v1/files:zipJob/{job_id}
const { data } = await client.getZipJob({
job_id: 'example',
})
Response
{
"job_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"status": "completed",
"progress": {
"total_files": 100,
"downloaded_files": 75,
"failed_files": 2
},
"result": {
"file_entity_id": "ef7d985c-2385-44f4-9c71-ae06a52264f8",
"download_url": "https://epilot-prod-user-content.s3.eu-central-1.amazonaws.com/123/files.zip?X-Amz-...",
"expires_at": "2024-01-02T12:00:00Z",
"zip_size_bytes": 104857600
},
"error": "Failed to download file: access denied",
"created_at": "2024-01-01T12:00:00Z",
"created_by": "10234",
"org_id": "123",
"updated_at": "2024-01-01T12:05:00Z"
}
getFileSummaryโ
Get summary text for a file entity together with the current summary job status when available.
GET /v1/files/{id}/summary
const { data } = await client.getFileSummary({
id: '123e4567-e89b-12d3-a456-426614174000',
})
Response
{
"status": "queued",
"job_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"feedback_available": true,
"preview_summary_de": "string",
"short_summary_de": "string",
"preview_summary_en": "string",
"short_summary_en": "string"
}
getFileSummaryFeedbackโ
Get file summary feedback
GET /v1/files/{id}/summary/feedback
const { data } = await client.getFileSummaryFeedback({
id: '123e4567-e89b-12d3-a456-426614174000',
})
Response
{
"feedback": {
"rating": "up",
"comment": "string",
"user_id": "string",
"submitted_at": "1970-01-01T00:00:00.000Z"
}
}
putFileSummaryFeedbackโ
Submit file summary feedback
PUT /v1/files/{id}/summary/feedback
const { data } = await client.putFileSummaryFeedback(
{
id: '123e4567-e89b-12d3-a456-426614174000',
},
{
rating: 'up',
comment: 'string'
},
)
Response
{
"feedback": {
"rating": "up",
"comment": "string",
"user_id": "string",
"submitted_at": "1970-01-01T00:00:00.000Z"
}
}
createFileSummaryJobโ
Create or return the current AI summary job for a file entity.
POST /v1/files/{id}/summary-jobs
const { data } = await client.createFileSummaryJob({
id: '123e4567-e89b-12d3-a456-426614174000',
})
getCurrentFileSummaryJobโ
Get the latest AI summary job for the file entity's current source.
GET /v1/files/{id}/summary-jobs/current
const { data } = await client.getCurrentFileSummaryJob({
id: '123e4567-e89b-12d3-a456-426614174000',
})
Response
{
"job_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"file_id": "ef7d985c-2385-44f4-9c71-ae06a52264f8",
"status": "queued",
"error": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z",
"completed_at": "1970-01-01T00:00:00.000Z"
}
getFileSummaryJobโ
Get an AI summary job by id.
GET /v1/files/{id}/summary-jobs/{job_id}
const { data } = await client.getFileSummaryJob({
id: '123e4567-e89b-12d3-a456-426614174000',
job_id: 'example',
})
Response
{
"job_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"file_id": "ef7d985c-2385-44f4-9c71-ae06a52264f8",
"status": "queued",
"error": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z",
"completed_at": "1970-01-01T00:00:00.000Z"
}
generateFileSummaryโ
Compatibility alias for creating or returning the current AI summary job for a file entity.
POST /v1/files/{id}/summary:generate
const { data } = await client.generateFileSummary({
id: '123e4567-e89b-12d3-a456-426614174000',
})
createFileAttributeSuggestionJobโ
Start an auto-fill job that reads the file's extracted text and suggests values for the related entity's attributes. Requires entity:view on the file and on the related entity. Returns 404 with `err
POST /v1/files/{id}/attribute-suggestion-jobs
const { data } = await client.createFileAttributeSuggestionJob(
{
id: '123e4567-e89b-12d3-a456-426614174000',
},
{
entity_slug: 'opportunity',
entity_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6'
},
)
getLatestFileAttributeSuggestionsโ
Get the most recent attribute suggestion job of any status for the file and the given entity. Returns 404 with error_code: no_file_attribute_suggestions_job when auto-fill has not run yet.
GET /v1/files/{id}/attribute-suggestion-jobs/latest
const { data } = await client.getLatestFileAttributeSuggestions({
id: '123e4567-e89b-12d3-a456-426614174000',
entity_id: 'example',
})
Response
{
"jobId": "string",
"jobStatus": {
"status": "INITIATED",
"progress": 0,
"error": "string"
},
"payload": {
"file_id": "string",
"entity_id": "string",
"entity_slug": "string",
"generated_by": "string",
"generated_at": 0,
"suggestions": [
{
"attribute_name": "string",
"attribute_label": "string",
"attribute_type": "date",
"suggested_value": "string",
"confidence": "high",
"source_page": 0,
"evidence": "string",
"status": "suggested",
"status_updated_by": "string",
"status_updated_at": 0,
"discard_reason": "string",
"is_copied": true,
"copied_by": "string",
"copied_at": 0,
"suggestion_type": "new_value"
}
]
},
"createdAt": 0,
"updatedAt": 0
}
getFileAttributeSuggestionJobโ
Get an attribute suggestion job of the file. Poll until jobStatus.status is COMPLETED or FAILED.
GET /v1/files/{id}/attribute-suggestion-jobs/{job_id}
const { data } = await client.getFileAttributeSuggestionJob({
id: '123e4567-e89b-12d3-a456-426614174000',
job_id: 'example',
})
Response
{
"jobId": "string",
"jobStatus": {
"status": "INITIATED",
"progress": 0,
"error": "string"
},
"payload": {
"file_id": "string",
"entity_id": "string",
"entity_slug": "string",
"generated_by": "string",
"generated_at": 0,
"suggestions": [
{
"attribute_name": "string",
"attribute_label": "string",
"attribute_type": "date",
"suggested_value": "string",
"confidence": "high",
"source_page": 0,
"evidence": "string",
"status": "suggested",
"status_updated_by": "string",
"status_updated_at": 0,
"discard_reason": "string",
"is_copied": true,
"copied_by": "string",
"copied_at": 0,
"suggestion_type": "new_value"
}
]
},
"createdAt": 0,
"updatedAt": 0
}
updateFileAttributeSuggestionStatusโ
Record that suggestions were accepted, discarded or copied. Only the suggestion entries named in the request change; unknown attribute names are ignored. Applying a value to the entity stays with the
PATCH /v1/files/{id}/attribute-suggestion-jobs/{job_id}
const { data } = await client.updateFileAttributeSuggestionStatus(
{
id: '123e4567-e89b-12d3-a456-426614174000',
job_id: 'example',
},
{
suggestionStatusUpdates: [
{},
{}
]
},
)
Response
{
"jobId": "string",
"jobStatus": {
"status": "INITIATED",
"progress": 0,
"error": "string"
},
"payload": {
"file_id": "string",
"entity_id": "string",
"entity_slug": "string",
"generated_by": "string",
"generated_at": 0,
"suggestions": [
{
"attribute_name": "string",
"attribute_label": "string",
"attribute_type": "date",
"suggested_value": "string",
"confidence": "high",
"source_page": 0,
"evidence": "string",
"status": "suggested",
"status_updated_by": "string",
"status_updated_at": 0,
"discard_reason": "string",
"is_copied": true,
"copied_by": "string",
"copied_at": 0,
"suggestion_type": "new_value"
}
]
},
"createdAt": 0,
"updatedAt": 0
}
getFileTextโ
Get the plain-text representation of a file entity. Returns status not_ready while text is being prepared and unsupported when text is unavailable for the file or organization.
GET /v1/files/{id}/text
const { data } = await client.getFileText({
id: '123e4567-e89b-12d3-a456-426614174000',
})
Response
{
"status": "ready",
"text": "string",
"truncated": true,
"total_chars": 0
}
validateFileโ
Validate an uploaded file against one or more document validation rules
(validation-rules-api rules with input_type: document).
POST /v1/files/validations
const { data } = await client.validateFile(
null,
{
file: {
entity_id: 'ef7d985c-2385-44f4-9c71-ae06a52264f8'
},
rule_ids: ['string']
},
)
Response
{
"id": "string",
"status": "completed",
"file": {
"entity_id": "ef7d985c-2385-44f4-9c71-ae06a52264f8",
"s3ref": {},
"filename": "string",
"mime_type": "string",
"size_bytes": 0
},
"observation": {
"facts": {
"mime_type": "string",
"size_bytes": 0,
"page_count": 0,
"longer_edge_px": 0,
"is_blank": true,
"is_password_protected": true
},
"judgements": {},
"document_type": {
"slug": "string",
"confidence": 0
}
},
"results": [
{
"rule_id": "string",
"rule_title": "string",
"level": "basic",
"is_valid": true,
"failed_parts": ["string"],
"warnings": ["string"],
"conditions": [
{
"id": "string",
"operator": "string",
"outcome": "pass",
"blocking": true,
"message": "string",
"evidence": "string",
"explanation": "string"
}
]
}
],
"created_at": "1970-01-01T00:00:00.000Z"
}
previewFileโ
Generate a thumbnail preview for a file entity.
GET /v1/files/{id}/preview
const { data } = await client.previewFile({
id: '123e4567-e89b-12d3-a456-426614174000',
version: 1,
w: 1,
h: 1,
})
previewS3Fileโ
Generate a thumbnail preview from an S3 reference.
POST /v1/files:previewS3
const { data } = await client.previewS3File(
{
w: 1,
h: 1,
},
{},
)
previewS3FileGetโ
Get a thumbnail preview from an S3 reference using query parameters.
GET /v1/files:previewS3
const { data } = await client.previewS3FileGet({
key: 'example',
bucket: 'example',
w: 1,
h: 1,
})
previewPublicFileโ
Generate a thumbnail preview for a public file entity.
GET /v1/files/public/{id}/preview
const { data } = await client.previewPublicFile({
id: '123e4567-e89b-12d3-a456-426614174000',
version: 1,
w: 1,
h: 1,
keep_original: true,
org_id: 'example',
})
getSessionโ
Start a browser session by converting a Bearer token into a server-side cookie.
GET /v1/files/session
const { data } = await client.getSession()
deleteSessionโ
End a browser session by deleting the token cookie.
DELETE /v1/files/session
const { data } = await client.deleteSession()
generatePublicLinkโ
Generate a public link to share a private file externally.
POST /v1/files/{id}/public/links
const { data } = await client.generatePublicLink({
id: '123e4567-e89b-12d3-a456-426614174000',
})
Response
"string"
listPublicLinksForFileโ
Fetches all public links previously generated for a file
GET /v1/files/{id}/public/links
const { data } = await client.listPublicLinksForFile({
id: '123e4567-e89b-12d3-a456-426614174000',
})
Response
{
"results": [
{
"id": "3ef5c6d9-818d-45e6-8efb-b1de59079a1c",
"link": "https://file.sls.epilot.io/v1/files/public/links/3ef5c6d9-818d-45e6-8efb-b1de59079a1c",
"last_accessed_at": "string"
}
]
}
accessPublicLinkโ
Access a file via its public link.
GET /v1/files/public/links/{id}/{filename}
const { data } = await client.accessPublicLink({
id: '123e4567-e89b-12d3-a456-426614174000',
filename: 'example',
hash: 'example',
})
revokePublicLinkโ
Revokes a given public link by ID
DELETE /v1/files/public/links/{id}
const { data } = await client.revokePublicLink({
id: '123e4567-e89b-12d3-a456-426614174000',
})
verifyCustomDownloadUrlโ
Verify that a custom download URL is valid and has not expired.
POST /v1/files/download:verify
const { data } = await client.verifyCustomDownloadUrl(
null,
{
custom_download_url: 'https://some-api-url.com?file_id=123&expires_at=1699273500029&signature=abcdefg'
},
)
Response
{
"valid": true
}
uploadFilePublicโ
Create a pre-signed S3 URL for uploading a file without authentication.
POST /v1/files/public/upload
const { data } = await client.uploadFilePublic(
null,
{
filename: 'document.pdf',
mime_type: 'application/pdf',
index_tag: '2f6a377c8e78',
metadata: {
color: 'blue'
}
},
)
Response
{
"s3ref": {
"bucket": "epilot-prod-user-content",
"key": "123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf"
},
"upload_url": "https://epilot-prod-user-content.s3.eu-central-1.amazonaws.com/123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf?AWSParams=123",
"error": "File entity not found"
}
getUserSchemaFileCollectionsโ
Get all file collections for the current user within a specific schema.
GET /v1/{slug}/collections
const { data } = await client.getUserSchemaFileCollections({
slug: 'example',
})
Response
[
{
"slug": "_system_files_collection_3fa85f64-5717-4562-b3fc-2c963f66afa6_10234:documents",
"name": "Documents",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"parents": ["_system_files_collection_3fa85f64-5717-4562-b3fc-2c963f66afa6_10234"],
"starred": false,
"order": 0,
"enabled_locations": ["string"],
"enabled_purposes": ["9eefcb98-93cf-4c5b-a040-f1d26d57c177", "5c544c09-a691-43ed-a7fa-0a8b44b5b161"],
"created_at": "2024-01-01T12:00:00Z",
"updated_at": "2024-01-02T12:00:00Z"
}
]
createUserSchemaFileCollectionโ
Create a new file collection for the current user within a specific schema.
POST /v1/{slug}/collections
const { data } = await client.createUserSchemaFileCollection(
{
slug: 'example',
},
{
name: 'string',
parents: ['string'],
starred: false,
enabled_locations: ['string'],
enabled_purposes: ['string']
},
)
Response
{
"slug": "_system_files_collection_3fa85f64-5717-4562-b3fc-2c963f66afa6_10234:documents",
"name": "Documents",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"parents": ["_system_files_collection_3fa85f64-5717-4562-b3fc-2c963f66afa6_10234"],
"starred": false,
"order": 0,
"enabled_locations": ["string"],
"enabled_purposes": ["9eefcb98-93cf-4c5b-a040-f1d26d57c177", "5c544c09-a691-43ed-a7fa-0a8b44b5b161"],
"created_at": "2024-01-01T12:00:00Z",
"updated_at": "2024-01-02T12:00:00Z"
}
updateUserSchemaFileCollectionโ
Update an existing file collection.
PUT /v1/{slug}/collections/{collectionSlug}
const { data } = await client.updateUserSchemaFileCollection(
{
slug: 'example',
collectionSlug: 'example',
},
{
name: 'string',
parents: ['string'],
starred: false,
enabled_locations: ['string'],
enabled_purposes: ['string']
},
)
Response
{
"slug": "_system_files_collection_3fa85f64-5717-4562-b3fc-2c963f66afa6_10234:documents",
"name": "Documents",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"parents": ["_system_files_collection_3fa85f64-5717-4562-b3fc-2c963f66afa6_10234"],
"starred": false,
"order": 0,
"enabled_locations": ["string"],
"enabled_purposes": ["9eefcb98-93cf-4c5b-a040-f1d26d57c177", "5c544c09-a691-43ed-a7fa-0a8b44b5b161"],
"created_at": "2024-01-01T12:00:00Z",
"updated_at": "2024-01-02T12:00:00Z"
}
deleteUserSchemaFileCollectionโ
Delete a file collection.
DELETE /v1/{slug}/collections/{collectionSlug}
const { data } = await client.deleteUserSchemaFileCollection({
slug: 'example',
collectionSlug: 'example',
})
getFilesInCollectionโ
Get all files within a specific collection for an entity.
GET /v1/entity/{id}/collections/{collectionSlug}/files
const { data } = await client.getFilesInCollection({
id: '123e4567-e89b-12d3-a456-426614174000',
collectionSlug: 'example',
})
Response
[
{
"_title": "document.pdf",
"_schema": "file",
"_org": "123",
"_id": "ef7d985c-2385-44f4-9c71-ae06a52264f8",
"_tags": ["tag1", "tag2"],
"_purpose": ["8d396871-95a0-4c9d-bb4d-9eda9c35776c", "da7cdf9a-01be-40c9-a29c-9a8f9f0de6f8"],
"_manifest": ["123e4567-e89b-12d3-a456-426614174000"],
"filename": "document.pdf",
"type": "document",
"mime_type": "application/pdf",
"size_bytes": 1234,
"readable_size": "1.2 MB",
"etag": "9bb58f26192e4ba00f01e2e7b136bbd8",
"access_control": "private",
"public_url": "https://epilot-prod-user-content.s3.eu-central-1.amazonaws.com/123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf",
"custom_download_url": "https://some-api-url.com/download?file_id=123",
"custom_download_url_auth": "token",
"preview_summary_de": "string",
"short_summary_de": "string",
"preview_summary_en": "string",
"short_summary_en": "string",
"file_summary_execution_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"source_url": "https://productengineer-content.s3.eu-west-1.amazonaws.com/product-engineer-checklist.pdf",
"s3ref": {},
"versions": [
{
"s3ref": {},
"filename": "document.pdf",
"size_bytes": 1234,
"readable_size": "1.2 MB",
"mime_type": "image/jpeg",
"etag": "9bb58f26192e4ba00f01e2e7b136bbd8"
}
],
"_updated_at": "1970-01-01T00:00:00.000Z",
"_created_at": "1970-01-01T00:00:00.000Z",
"_acl": {
"view": ["org:456"],
"edit": ["org:456"],
"delete": ["org:456"]
},
"_owners": [
{
"org_id": "123",
"user_id": "123"
}
],
"__additional": {}
}
]
getGlobalFileCollectionsโ
Get all global file collections for a specific schema.
GET /v1/collections/{schemaSlug}
const { data } = await client.getGlobalFileCollections({
schemaSlug: 'example',
})
Response
[
{
"slug": "_system_files_collection_3fa85f64-5717-4562-b3fc-2c963f66afa6_10234:documents",
"name": "Documents",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"parents": ["_system_files_collection_3fa85f64-5717-4562-b3fc-2c963f66afa6_10234"],
"starred": false,
"order": 0,
"enabled_locations": ["string"],
"enabled_purposes": ["9eefcb98-93cf-4c5b-a040-f1d26d57c177", "5c544c09-a691-43ed-a7fa-0a8b44b5b161"],
"created_at": "2024-01-01T12:00:00Z",
"updated_at": "2024-01-02T12:00:00Z"
}
]
Schemasโ
EntityIdโ
type EntityId = string
EntitySlugโ
URL-friendly identifier for the entity schema
type EntitySlug = string
ActivityIdโ
See https://github.com/ulid/spec
type ActivityId = string // ulid
FileEntityIdโ
type FileEntityId = string | string // uuid
FileAttributesโ
type FileAttributes = {
_tags?: string[]
_purpose?: string[]
_manifest?: string // uuid[]
filename?: string
type?: "document" | "document_template" | "text" | "image" | "video" | "audio" | "spreadsheet" | "presentation" | "font" | "archive" | "application" | "unknown"
mime_type?: string
size_bytes?: number
readable_size?: string
etag?: string
access_control?: "private" | "public-read"
public_url?: string // url
custom_download_url?: string // uri
custom_download_url_auth?: "presigned" | "token"
preview_summary_de?: string
short_summary_de?: string
preview_summary_en?: string
short_summary_en?: string
file_summary_execution_id?: string // uuid
}
FileTypeโ
type FileType = "document" | "document_template" | "text" | "image" | "video" | "audio" | "spreadsheet" | "presentation" | "font" | "archive" | "application" | "unknown"
FileSummaryJobStatusโ
Current state of a file summary job.
type FileSummaryJobStatus = "queued" | "waiting_for_extraction" | "processing" | "completed" | "failed" | "unsupported" | "stale"
FileSummaryJobโ
type FileSummaryJob = {
job_id: string // uuid
file_id: string | string // uuid
status: "queued" | "waiting_for_extraction" | "processing" | "completed" | "failed" | "unsupported" | "stale"
error?: string
created_at: string // date-time
updated_at: string // date-time
completed_at?: string // date-time
}
FileSummaryโ
type FileSummary = {
status?: "queued" | "waiting_for_extraction" | "processing" | "completed" | "failed" | "unsupported" | "stale"
job_id?: string // uuid
feedback_available?: boolean
preview_summary_de?: string
short_summary_de?: string
preview_summary_en?: string
short_summary_en?: string
}
FileSummaryFeedbackโ
type FileSummaryFeedback = {
rating: "up" | "down"
comment?: string
user_id: string
submitted_at: string // date-time
}
FileSummaryFeedbackResponseโ
type FileSummaryFeedbackResponse = {
feedback: {
rating: "up" | "down"
comment?: string
user_id: string
submitted_at: string // date-time
}
}
PutFileSummaryFeedbackRequestโ
type PutFileSummaryFeedbackRequest = {
rating: "up" | "down"
comment?: string
}
FileAttributeSuggestionJobStatusโ
type FileAttributeSuggestionJobStatus = {
status: "INITIATED" | "IN_PROGRESS" | "COMPLETED" | "FAILED"
progress: number
error?: string
}
FileAttributeSuggestionโ
type FileAttributeSuggestion = {
attribute_name?: string
attribute_label?: string
attribute_type?: "date" | "number" | "boolean" | "select" | "string"
suggested_value?: string | number | boolean
confidence?: "high" | "medium" | "low"
source_page?: number
evidence?: string
status?: "suggested" | "accepted" | "discarded"
status_updated_by?: string
status_updated_at?: number
discard_reason?: string
is_copied?: boolean
copied_by?: string
copied_at?: number
suggestion_type?: "new_value" | "update"
}
FileAttributeSuggestionsPayloadโ
type FileAttributeSuggestionsPayload = {
file_id: string
entity_id: string
entity_slug: string
generated_by?: string
generated_at?: number
suggestions: Array<{
attribute_name?: string
attribute_label?: string
attribute_type?: "date" | "number" | "boolean" | "select" | "string"
suggested_value?: string | number | boolean
confidence?: "high" | "medium" | "low"
source_page?: number
evidence?: string
status?: "suggested" | "accepted" | "discarded"
status_updated_by?: string
status_updated_at?: number
discard_reason?: string
is_copied?: boolean
copied_by?: string
copied_at?: number
suggestion_type?: "new_value" | "update"
}>
}
FileAttributeSuggestionJobโ
type FileAttributeSuggestionJob = {
jobId: string
jobStatus: {
status: "INITIATED" | "IN_PROGRESS" | "COMPLETED" | "FAILED"
progress: number
error?: string
}
payload: {
file_id: string
entity_id: string
entity_slug: string
generated_by?: string
generated_at?: number
suggestions: Array<{
attribute_name?: { ... }
attribute_label?: { ... }
attribute_type?: { ... }
suggested_value?: { ... }
confidence?: { ... }
source_page?: { ... }
evidence?: { ... }
status?: { ... }
status_updated_by?: { ... }
status_updated_at?: { ... }
discard_reason?: { ... }
is_copied?: { ... }
copied_by?: { ... }
copied_at?: { ... }
suggestion_type?: { ... }
}>
}
createdAt: number
updatedAt: number
}
CreateFileAttributeSuggestionJobRequestโ
type CreateFileAttributeSuggestionJobRequest = {
entity_slug: string
entity_id: string // uuid
}
UpdateFileAttributeSuggestionStatusRequestโ
type UpdateFileAttributeSuggestionStatusRequest = {
suggestionStatusUpdates: unknown | unknown[]
}
FileAttributeSuggestionErrorโ
type FileAttributeSuggestionError = {
status?: number
error?: string
error_code?: "entity_or_schema_unavailable" | "file_not_extracted" | "extraction_unsupported" | "extraction_failed" | "extraction_status_unavailable" | "processing_enqueue_failed" | "no_file_attribute_suggestions_job" | "job_not_found"
}
FileTextStatusโ
Availability of the plain-text representation for a file entity.
type FileTextStatus = "ready" | "not_ready" | "unsupported"
FileValidationRequestโ
type FileValidationRequest = {
file: {
entity_id: string | string // uuid
} | {
s3ref: unknown
}
rule_ids: string[]
}
FileValidationFileReferenceโ
The file to validate - a saved file entity, or an uploaded object not saved as an entity yet.
type FileValidationFileReference = {
entity_id: string | string // uuid
} | {
s3ref: unknown
}
FileValidationโ
type FileValidation = {
id: string
status: "completed" | "pending" | "failed" | "skipped"
file: {
entity_id?: string | string // uuid
s3ref?: unknown
filename?: string
mime_type?: string
size_bytes?: number
}
observation: {
facts: {
mime_type?: { ... }
size_bytes?: { ... }
page_count?: { ... }
longer_edge_px?: { ... }
is_blank?: { ... }
is_password_protected?: { ... }
}
judgements?: Record<string, {
result: { ... }
confidence?: { ... }
evidence?: { ... }
explanation?: { ... }
}>
document_type?: {
slug?: { ... }
confidence?: { ... }
}
}
results: Array<{
rule_id: string
rule_title?: string
level: "basic" | "standard" | "advanced"
is_valid: boolean
failed_parts?: string[]
warnings?: string[]
conditions: Array<{
id: { ... }
operator: { ... }
outcome: { ... }
blocking: { ... }
message: { ... }
evidence?: { ... }
explanation?: { ... }
}>
}>
created_at: string // date-time
}
FileValidationFileโ
The file that was validated, with the identity facts collected from its content.
type FileValidationFile = {
entity_id?: string | string // uuid
s3ref?: unknown
filename?: string
mime_type?: string
size_bytes?: number
}
FileValidationObservationโ
Everything observed about the file, as passed to the validation rules engine.
type FileValidationObservation = {
facts: {
mime_type?: string
size_bytes?: number
page_count?: number
longer_edge_px?: number
is_blank?: boolean
is_password_protected?: boolean
}
judgements?: Record<string, {
result: "pass" | "fail" | "uncertain"
confidence?: number
evidence?: string
explanation?: string
}>
document_type?: {
slug?: string
confidence?: number
}
}
FileValidationJudgementโ
type FileValidationJudgement = {
result: "pass" | "fail" | "uncertain"
confidence?: number
evidence?: string
explanation?: string
}
FileValidationFactsโ
Deterministic properties of the file. A property that is absent could not be determined (for example the resolution of an image the service cannot decode); conditions that need it are skipped rather than failed.
type FileValidationFacts = {
mime_type?: string
size_bytes?: number
page_count?: number
longer_edge_px?: number
is_blank?: boolean
is_password_protected?: boolean
}
FileValidationRuleResultโ
type FileValidationRuleResult = {
rule_id: string
rule_title?: string
level: "basic" | "standard" | "advanced"
is_valid: boolean
failed_parts?: string[]
warnings?: string[]
conditions: Array<{
id: string
operator: string
outcome: "pass" | "fail" | "uncertain" | "skipped"
blocking: boolean
message: string
evidence?: string
explanation?: string
}>
}
FileValidationConditionResultโ
type FileValidationConditionResult = {
id: string
operator: string
outcome: "pass" | "fail" | "uncertain" | "skipped"
blocking: boolean
message: string
evidence?: string
explanation?: string
}
FileTextโ
type FileText = {
status: "ready"
text: string
truncated: boolean
total_chars: number
} | {
status: "not_ready"
} | {
status: "unsupported"
}
FileTextReadyโ
type FileTextReady = {
status: "ready"
text: string
truncated: boolean
total_chars: number
}
FileTextNotReadyโ
type FileTextNotReady = {
status: "not_ready"
}
FileTextUnsupportedโ
type FileTextUnsupported = {
status: "unsupported"
}
CustomDownloadUrlโ
Custom external download url used for the file
type CustomDownloadUrl = string // uri
CustomDownloadUrlAuthโ
Authorization mode for the custom_download_url. presigned (the default) uses an HMAC-signed URL; token authorizes the download via the caller's bearer token, matched against the exact stored custom_download_url. In token mode the File API returns the unsigned custom_download_url (no expires_at/s
type CustomDownloadUrlAuth = "presigned" | "token"
FileEntityโ
type FileEntity = {
_title: string
_schema: "file"
_org: string
_id: string | string // uuid
_tags?: string[]
_purpose?: string[]
_manifest?: string // uuid[]
filename: string
type: "document" | "document_template" | "text" | "image" | "video" | "audio" | "spreadsheet" | "presentation" | "font" | "archive" | "application" | "unknown"
mime_type?: string
size_bytes?: number
readable_size?: string
etag?: string
access_control: "private" | "public-read"
public_url?: string // url
custom_download_url?: string // uri
custom_download_url_auth?: "presigned" | "token"
preview_summary_de?: string
short_summary_de?: string
preview_summary_en?: string
short_summary_en?: string
file_summary_execution_id?: string // uuid
source_url?: string
s3ref?: object
versions: Array<{
s3ref?: unknown
filename?: string
size_bytes?: number
readable_size?: string
mime_type?: string
etag?: string
}>
_updated_at?: string // date-time
_created_at?: string // date-time
_acl?: {
view?: string[]
edit?: string[]
delete?: string[]
}
_owners?: Array<{
org_id: string
user_id?: string
}>
__additional?: Record<string, unknown>
}
CommonSaveFilePayloadโ
type CommonSaveFilePayload = {
_id?: object
file_entity_id?: string
relations?: Array<{
entity_id: string
_schema?: string
_tags?: string[]
}>
}
SaveS3FilePayloadโ
type SaveS3FilePayload = {
_id?: object
file_entity_id?: string
relations?: Array<{
entity_id: string
_schema?: string
_tags?: string[]
}>
_tags?: string[]
_purpose?: string[]
_manifest?: string // uuid[]
filename?: string
type?: "document" | "document_template" | "text" | "image" | "video" | "audio" | "spreadsheet" | "presentation" | "font" | "archive" | "application" | "unknown"
mime_type?: string
size_bytes?: number
readable_size?: string
etag?: string
access_control?: "private" | "public-read"
public_url?: string // url
custom_download_url?: string // uri
custom_download_url_auth?: "presigned" | "token"
preview_summary_de?: string
short_summary_de?: string
preview_summary_en?: string
short_summary_en?: string
file_summary_execution_id?: string // uuid
s3ref?: unknown
}
SaveFileFromSourceURLPayloadโ
type SaveFileFromSourceURLPayload = {
_id?: object
file_entity_id?: string
relations?: Array<{
entity_id: string
_schema?: string
_tags?: string[]
}>
_tags?: string[]
_purpose?: string[]
_manifest?: string // uuid[]
filename?: string
type?: "document" | "document_template" | "text" | "image" | "video" | "audio" | "spreadsheet" | "presentation" | "font" | "archive" | "application" | "unknown"
mime_type?: string
size_bytes?: number
readable_size?: string
etag?: string
access_control?: "private" | "public-read"
public_url?: string // url
custom_download_url?: string // uri
custom_download_url_auth?: "presigned" | "token"
preview_summary_de?: string
short_summary_de?: string
preview_summary_en?: string
short_summary_en?: string
file_summary_execution_id?: string // uuid
source_url?: string // uri
}
SaveCustomFilePayloadโ
type SaveCustomFilePayload = {
_id?: object
file_entity_id?: string
relations?: Array<{
entity_id: string
_schema?: string
_tags?: string[]
}>
_tags?: string[]
_purpose?: string[]
_manifest?: string // uuid[]
filename?: string
type?: "document" | "document_template" | "text" | "image" | "video" | "audio" | "spreadsheet" | "presentation" | "font" | "archive" | "application" | "unknown"
mime_type?: string
size_bytes?: number
readable_size?: string
etag?: string
access_control?: "private" | "public-read"
public_url?: string // url
custom_download_url?: string // uri
custom_download_url_auth?: "presigned" | "token"
preview_summary_de?: string
short_summary_de?: string
preview_summary_en?: string
short_summary_en?: string
file_summary_execution_id?: string // uuid
}
SaveFilePayloadโ
type SaveFilePayload = {
_id?: object
file_entity_id?: string
relations?: Array<{
entity_id: string
_schema?: string
_tags?: string[]
}>
_tags?: string[]
_purpose?: string[]
_manifest?: string // uuid[]
filename?: string
type?: "document" | "document_template" | "text" | "image" | "video" | "audio" | "spreadsheet" | "presentation" | "font" | "archive" | "application" | "unknown"
mime_type?: string
size_bytes?: number
readable_size?: string
etag?: string
access_control?: "private" | "public-read"
public_url?: string // url
custom_download_url?: string // uri
custom_download_url_auth?: "presigned" | "token"
preview_summary_de?: string
short_summary_de?: string
preview_summary_en?: string
short_summary_en?: string
file_summary_execution_id?: string // uuid
s3ref?: unknown
} | {
_id?: object
file_entity_id?: string
relations?: Array<{
entity_id: string
_schema?: string
_tags?: string[]
}>
_tags?: string[]
_purpose?: string[]
_manifest?: string // uuid[]
filename?: string
type?: "document" | "document_template" | "text" | "image" | "video" | "audio" | "spreadsheet" | "presentation" | "font" | "archive" | "application" | "unknown"
mime_type?: string
size_bytes?: number
readable_size?: string
etag?: string
access_control?: "private" | "public-read"
public_url?: string // url
custom_download_url?: string // uri
custom_download_url_auth?: "presigned" | "token"
preview_summary_de?: string
short_summary_de?: string
preview_summary_en?: string
short_summary_en?: string
file_summary_execution_id?: string // uuid
source_url?: string // uri
} | {
_id?: object
file_entity_id?: string
relations?: Array<{
entity_id: string
_schema?: string
_tags?: string[]
}>
_tags?: string[]
_purpose?: string[]
_manifest?: string // uuid[]
filename?: string
type?: "document" | "document_template" | "text" | "image" | "video" | "audio" | "spreadsheet" | "presentation" | "font" | "archive" | "application" | "unknown"
mime_type?: string
size_bytes?: number
readable_size?: string
etag?: string
access_control?: "private" | "public-read"
public_url?: string // url
custom_download_url?: string // uri
custom_download_url_auth?: "presigned" | "token"
preview_summary_de?: string
short_summary_de?: string
preview_summary_en?: string
short_summary_en?: string
file_summary_execution_id?: string // uuid
}
SaveFilePayloadV2โ
type SaveFilePayloadV2 = {
_id?: object
file_entity_id?: string
relations?: Array<{
entity_id: string
_schema?: string
_tags?: string[]
}>
_tags?: string[]
_purpose?: string[]
_manifest?: string // uuid[]
filename?: string
type?: "document" | "document_template" | "text" | "image" | "video" | "audio" | "spreadsheet" | "presentation" | "font" | "archive" | "application" | "unknown"
mime_type?: string
size_bytes?: number
readable_size?: string
etag?: string
access_control?: "private" | "public-read"
public_url?: string // url
custom_download_url?: string // uri
custom_download_url_auth?: "presigned" | "token"
preview_summary_de?: string
short_summary_de?: string
preview_summary_en?: string
short_summary_en?: string
file_summary_execution_id?: string // uuid
s3ref?: unknown
} | {
_id?: object
file_entity_id?: string
relations?: Array<{
entity_id: string
_schema?: string
_tags?: string[]
}>
_tags?: string[]
_purpose?: string[]
_manifest?: string // uuid[]
filename?: string
type?: "document" | "document_template" | "text" | "image" | "video" | "audio" | "spreadsheet" | "presentation" | "font" | "archive" | "application" | "unknown"
mime_type?: string
size_bytes?: number
readable_size?: string
etag?: string
access_control?: "private" | "public-read"
public_url?: string // url
custom_download_url?: string // uri
custom_download_url_auth?: "presigned" | "token"
preview_summary_de?: string
short_summary_de?: string
preview_summary_en?: string
short_summary_en?: string
file_summary_execution_id?: string // uuid
source_url?: string // uri
} | {
_id?: object
file_entity_id?: string
relations?: Array<{
entity_id: string
_schema?: string
_tags?: string[]
}>
_tags?: string[]
_purpose?: string[]
_manifest?: string // uuid[]
filename?: string
type?: "document" | "document_template" | "text" | "image" | "video" | "audio" | "spreadsheet" | "presentation" | "font" | "archive" | "application" | "unknown"
mime_type?: string
size_bytes?: number
readable_size?: string
etag?: string
access_control?: "private" | "public-read"
public_url?: string // url
custom_download_url?: string // uri
custom_download_url_auth?: "presigned" | "token"
preview_summary_de?: string
short_summary_de?: string
preview_summary_en?: string
short_summary_en?: string
file_summary_execution_id?: string // uuid
}
BatchSaveFileVersionPayloadโ
Payload for batch version save. Only s3ref payloads are supported.
type BatchSaveFileVersionPayload = {
_id?: object
file_entity_id?: string
filename?: string
mime_type?: string
access_control?: "private" | "public-read"
s3ref: unknown
}
UploadFilePayloadโ
type UploadFilePayload = {
filename: string
mime_type?: string
index_tag?: string
metadata?: Record<string, string>
}
FileUploadโ
type FileUpload = {
s3ref?: object
upload_url?: string // url
public_url?: string // url
}
DownloadFilesPayloadโ
type DownloadFilesPayload = Array<{
id: string | string // uuid
version?: number
}>
CreateZipJobPayloadโ
Request payload to create a ZIP job for bulk file download.
Provide either an explicit list of file_entity_ids (up to 1000) or an
entity_query that resolves to file entities (up to 10000).
type CreateZipJobPayload = unknown | unknown
ZipJobโ
ZIP job status and result
type ZipJob = {
job_id?: string // uuid
status?: "queued" | "downloading" | "zipping" | "uploading" | "sending_notification" | "completed" | "failed"
progress?: {
total_files?: number
downloaded_files?: number
failed_files?: number
}
result?: {
file_entity_id?: string // uuid
download_url?: string // uri
expires_at?: string // date-time
zip_size_bytes?: number
}
error?: string
created_at?: string // date-time
created_by?: string
org_id?: string
updated_at?: string // date-time
}
VerifyCustomDownloadUrlPayloadโ
type VerifyCustomDownloadUrlPayload = {
custom_download_url: string
}
S3Referenceโ
type S3Reference = {
bucket: string
key: string
}
S3Refโ
type S3Ref = {
bucket: string
key: string
}
FileItemโ
type FileItem = {
s3ref?: unknown
filename?: string
size_bytes?: number
readable_size?: string
mime_type?: string
etag?: string
}
FileRelationItemโ
type FileRelationItem = {
entity_id: string
_schema?: string
_tags?: string[]
}
PublicLinkโ
type PublicLink = {
id?: string
link?: string
last_accessed_at?: string
}
BaseEntityOwnerโ
The user / organization owning this entity.
Note: Owner implicitly has access to the entity regardless of ACLs.
type BaseEntityOwner = {
org_id: string
user_id?: string
}
BaseEntityAclโ
Access control list (ACL) for an entity. Defines sharing access to external orgs or users.
type BaseEntityAcl = {
view?: string[]
edit?: string[]
delete?: string[]
}
ErrorObjectโ
A generic error returned by the API
type ErrorObject = {
status?: number
error?: string
}
FileCollectionIdโ
Generated uuid for a file collection
type FileCollectionId = string // uuid
FileCollectionItemโ
A file collection with identifiers and timestamps
type FileCollectionItem = {
slug?: string
name: string
id?: string // uuid
parents?: string[]
starred?: boolean
order?: number
enabled_locations?: string[]
enabled_purposes?: string[]
created_at?: string // date-time
updated_at?: string // date-time
}
FileCollectionAttributesโ
type FileCollectionAttributes = {
name?: string
parents?: string[]
starred?: boolean
enabled_locations?: string[]
enabled_purposes?: string[]
}
FileCollectionCreateRequestโ
Request body for creating a file collection
type FileCollectionCreateRequest = {
name: string
parents?: string[]
starred?: boolean
enabled_locations?: string[]
enabled_purposes?: string[]
}