"# File API\n\n- **Base URL:** `https://file.sls.epilot.io`\n- **Full API Docs:** [https://docs.epilot.io/api/file](https://docs.epilot.io/api/file)\n\n## Usage\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\nepilot.authorize(() => '')\nconst { data } = await epilot.file.uploadFileV2(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from '@epilot/sdk/file'\n\nconst fileClient = getClient()\nauthorize(fileClient, () => '')\nconst { data } = await fileClient.uploadFileV2(...)\n```\n\n## Operations\n\n**File**\n- [`uploadFileV2`](#uploadfilev2)\n- [`saveFileV2`](#savefilev2)\n- [`getFile`](#getfile)\n- [`deleteFile`](#deletefile)\n- [`downloadFile`](#downloadfile)\n- [`downloadS3File`](#downloads3file)\n- [`downloadFiles`](#downloadfiles)\n- [`createZipJob`](#createzipjob)\n- [`getZipJob`](#getzipjob)\n- [`getFileSummary`](#getfilesummary)\n- [`getFileSummaryFeedback`](#getfilesummaryfeedback)\n- [`putFileSummaryFeedback`](#putfilesummaryfeedback)\n- [`createFileSummaryJob`](#createfilesummaryjob)\n- [`getCurrentFileSummaryJob`](#getcurrentfilesummaryjob)\n- [`getFileSummaryJob`](#getfilesummaryjob)\n- [`generateFileSummary`](#generatefilesummary)\n- [`createFileAttributeSuggestionJob`](#createfileattributesuggestionjob)\n- [`getLatestFileAttributeSuggestions`](#getlatestfileattributesuggestions)\n- [`getFileAttributeSuggestionJob`](#getfileattributesuggestionjob)\n- [`updateFileAttributeSuggestionStatus`](#updatefileattributesuggestionstatus)\n- [`getFileText`](#getfiletext)\n- [`validateFile`](#validatefile)\n- [`verifyCustomDownloadUrl`](#verifycustomdownloadurl)\n- [`uploadFilePublic`](#uploadfilepublic)\n\n**Meter Reading Suggestions**\n- [`listMeterReadingSuggestions`](#listmeterreadingsuggestions)\n- [`createMeterReadingSuggestionJob`](#createmeterreadingsuggestionjob)\n- [`updateMeterReadingSuggestionStatus`](#updatemeterreadingsuggestionstatus)\n\n**Preview**\n- [`previewFile`](#previewfile)\n- [`previewS3File`](#previews3file)\n- [`previewS3FileGet`](#previews3fileget)\n- [`previewPublicFile`](#previewpublicfile)\n\n**Session**\n- [`getSession`](#getsession)\n- [`deleteSession`](#deletesession)\n\n**Public Links**\n- [`generatePublicLink`](#generatepubliclink)\n- [`listPublicLinksForFile`](#listpubliclinksforfile)\n- [`accessPublicLink`](#accesspubliclink)\n- [`revokePublicLink`](#revokepubliclink)\n\n**File Collections**\n- [`getUserSchemaFileCollections`](#getuserschemafilecollections)\n- [`createUserSchemaFileCollection`](#createuserschemafilecollection)\n- [`updateUserSchemaFileCollection`](#updateuserschemafilecollection)\n- [`deleteUserSchemaFileCollection`](#deleteuserschemafilecollection)\n- [`getFilesInCollection`](#getfilesincollection)\n- [`getGlobalFileCollections`](#getglobalfilecollections)\n- [`createGlobalFileCollection`](#createglobalfilecollection)\n- [`getGlobalFileCollection`](#getglobalfilecollection)\n- [`updateGlobalFileCollection`](#updateglobalfilecollection)\n- [`deleteGlobalFileCollection`](#deleteglobalfilecollection)\n\n**Schemas**\n- [`EntityId`](#entityid)\n- [`EntitySlug`](#entityslug)\n- [`ActivityId`](#activityid)\n- [`FileEntityId`](#fileentityid)\n- [`FileAttributes`](#fileattributes)\n- [`FileType`](#filetype)\n- [`FileSummaryJobStatus`](#filesummaryjobstatus)\n- [`FileSummaryJob`](#filesummaryjob)\n- [`FileSummary`](#filesummary)\n- [`FileSummaryFeedback`](#filesummaryfeedback)\n- [`FileSummaryFeedbackResponse`](#filesummaryfeedbackresponse)\n- [`PutFileSummaryFeedbackRequest`](#putfilesummaryfeedbackrequest)\n- [`FileAttributeSuggestionJobStatus`](#fileattributesuggestionjobstatus)\n- [`FileAttributeSuggestion`](#fileattributesuggestion)\n- [`FileAttributeSuggestionsPayload`](#fileattributesuggestionspayload)\n- [`FileAttributeSuggestionJob`](#fileattributesuggestionjob)\n- [`CreateFileAttributeSuggestionJobRequest`](#createfileattributesuggestionjobrequest)\n- [`UpdateFileAttributeSuggestionStatusRequest`](#updatefileattributesuggestionstatusrequest)\n- [`FileAttributeSuggestionError`](#fileattributesuggestionerror)\n- [`MeterReadingSuggestionError`](#meterreadingsuggestionerror)\n- [`CreateMeterReadingSuggestionJobRequest`](#createmeterreadingsuggestionjobrequest)\n- [`UpdateMeterReadingSuggestionStatusRequest`](#updatemeterreadingsuggestionstatusrequest)\n- [`MeterReadingSuggestion`](#meterreadingsuggestion)\n- [`MeterReadingSuggestedAlternative`](#meterreadingsuggestedalternative)\n- [`MeterReadingSuggestionJob`](#meterreadingsuggestionjob)\n- [`FileTextStatus`](#filetextstatus)\n- [`FileValidationRequest`](#filevalidationrequest)\n- [`FileValidationFileReference`](#filevalidationfilereference)\n- [`FileValidation`](#filevalidation)\n- [`FileValidationFile`](#filevalidationfile)\n- [`FileValidationObservation`](#filevalidationobservation)\n- [`FileValidationJudgement`](#filevalidationjudgement)\n- [`FileValidationFacts`](#filevalidationfacts)\n- [`FileValidationRuleResult`](#filevalidationruleresult)\n- [`FileValidationConditionResult`](#filevalidationconditionresult)\n- [`FileText`](#filetext)\n- [`FileTextReady`](#filetextready)\n- [`FileTextNotReady`](#filetextnotready)\n- [`FileTextUnsupported`](#filetextunsupported)\n- [`CustomDownloadUrl`](#customdownloadurl)\n- [`CustomDownloadUrlAuth`](#customdownloadurlauth)\n- [`FileEntity`](#fileentity)\n- [`CommonSaveFilePayload`](#commonsavefilepayload)\n- [`SaveS3FilePayload`](#saves3filepayload)\n- [`SaveFileFromSourceURLPayload`](#savefilefromsourceurlpayload)\n- [`SaveCustomFilePayload`](#savecustomfilepayload)\n- [`SaveFilePayload`](#savefilepayload)\n- [`SaveFilePayloadV2`](#savefilepayloadv2)\n- [`BatchSaveFileVersionPayload`](#batchsavefileversionpayload)\n- [`UploadFilePayload`](#uploadfilepayload)\n- [`FileUpload`](#fileupload)\n- [`DownloadFilesPayload`](#downloadfilespayload)\n- [`CreateZipJobPayload`](#createzipjobpayload)\n- [`ZipJob`](#zipjob)\n- [`VerifyCustomDownloadUrlPayload`](#verifycustomdownloadurlpayload)\n- [`S3Reference`](#s3reference)\n- [`S3Ref`](#s3ref)\n- [`FileItem`](#fileitem)\n- [`FileRelationItem`](#filerelationitem)\n- [`PublicLink`](#publiclink)\n- [`BaseEntityOwner`](#baseentityowner)\n- [`BaseEntityAcl`](#baseentityacl)\n- [`ErrorObject`](#errorobject)\n- [`FileCollectionId`](#filecollectionid)\n- [`GlobalFileCollection`](#globalfilecollection)\n- [`GlobalFileCollectionCreateRequest`](#globalfilecollectioncreaterequest)\n- [`GlobalFileCollectionUpdateRequest`](#globalfilecollectionupdaterequest)\n- [`GlobalFileCollectionDeleteJob`](#globalfilecollectiondeletejob)\n- [`FileCollectionItem`](#filecollectionitem)\n- [`FileCollectionAttributes`](#filecollectionattributes)\n- [`FileCollectionCreateRequest`](#filecollectioncreaterequest)\n\n### `uploadFileV2`\n\nCreate pre-signed S3 URL to upload a file to keep temporarily (one week).\n\n`POST /v2/files/upload`\n\n```ts\nconst { data } = await client.uploadFileV2(\n {\n file_entity_id: 'example',\n },\n {\n filename: 'document.pdf',\n mime_type: 'application/pdf',\n index_tag: '2f6a377c8e78',\n metadata: {\n color: 'blue'\n }\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"s3ref\": {\n \"bucket\": \"epilot-prod-user-content\",\n \"key\": \"123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf\"\n },\n \"upload_url\": \"https://epilot-prod-user-content.s3.eu-central-1.amazonaws.com/123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf?AWSParams=123\",\n \"public_url\": \"https://epilot-prod-user-content.s3.eu-central-1.amazonaws.com/123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf\"\n}\n```\n\n
\n\n---\n\n### `saveFileV2`\n\nSaves a permanent file entity. Updates an existing file entity when `_id` is passed.\n\n`POST /v2/files`\n\n```ts\nconst { data } = await client.saveFileV2(\n {\n activity_id: 'example',\n fill_activity: true,\n strict: true,\n async: true,\n delete_temp_file: true,\n version_only: true,\n },\n {\n _id: 'ef7d985c-2385-44f4-9c71-ae06a52264f8',\n file_entity_id: 'string',\n relations: [\n {\n entity_id: 'ef7d985c-2385-44f4-9c71-ae06a52264f8',\n _schema: 'contact',\n _tags: ['string']\n }\n ],\n _tags: ['tag1', 'tag2'],\n _purpose: ['8d396871-95a0-4c9d-bb4d-9eda9c35776c', 'da7cdf9a-01be-40c9-a29c-9a8f9f0de6f8'],\n _manifest: ['123e4567-e89b-12d3-a456-426614174000'],\n filename: 'document.pdf',\n type: 'document',\n mime_type: 'application/pdf',\n size_bytes: 1234,\n readable_size: '1.2 MB',\n etag: '9bb58f26192e4ba00f01e2e7b136bbd8',\n access_control: 'private',\n public_url: 'https://epilot-prod-user-content.s3.eu-central-1.amazonaws.com/123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf',\n custom_download_url: 'https://some-api-url.com/download?file_id=123',\n custom_download_url_auth: 'token',\n preview_summary_de: 'string',\n short_summary_de: 'string',\n preview_summary_en: 'string',\n short_summary_en: 'string',\n file_summary_execution_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n s3ref: {}\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"_title\": \"document.pdf\",\n \"_schema\": \"file\",\n \"_org\": \"123\",\n \"_id\": \"ef7d985c-2385-44f4-9c71-ae06a52264f8\",\n \"_tags\": [\"tag1\", \"tag2\"],\n \"_purpose\": [\"8d396871-95a0-4c9d-bb4d-9eda9c35776c\", \"da7cdf9a-01be-40c9-a29c-9a8f9f0de6f8\"],\n \"_manifest\": [\"123e4567-e89b-12d3-a456-426614174000\"],\n \"filename\": \"document.pdf\",\n \"type\": \"document\",\n \"mime_type\": \"application/pdf\",\n \"size_bytes\": 1234,\n \"readable_size\": \"1.2 MB\",\n \"etag\": \"9bb58f26192e4ba00f01e2e7b136bbd8\",\n \"access_control\": \"private\",\n \"public_url\": \"https://epilot-prod-user-content.s3.eu-central-1.amazonaws.com/123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf\",\n \"custom_download_url\": \"https://some-api-url.com/download?file_id=123\",\n \"custom_download_url_auth\": \"token\",\n \"preview_summary_de\": \"string\",\n \"short_summary_de\": \"string\",\n \"preview_summary_en\": \"string\",\n \"short_summary_en\": \"string\",\n \"file_summary_execution_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"source_url\": \"https://productengineer-content.s3.eu-west-1.amazonaws.com/product-engineer-checklist.pdf\",\n \"s3ref\": {},\n \"versions\": [\n {\n \"s3ref\": {},\n \"filename\": \"document.pdf\",\n \"size_bytes\": 1234,\n \"readable_size\": \"1.2 MB\",\n \"mime_type\": \"image/jpeg\",\n \"etag\": \"9bb58f26192e4ba00f01e2e7b136bbd8\"\n }\n ],\n \"_updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"_created_at\": \"1970-01-01T00:00:00.000Z\",\n \"_acl\": {\n \"view\": [\"org:456\"],\n \"edit\": [\"org:456\"],\n \"delete\": [\"org:456\"]\n },\n \"_owners\": [\n {\n \"org_id\": \"123\",\n \"user_id\": \"123\"\n }\n ],\n \"__additional\": {}\n}\n```\n\n
\n\n---\n\n### `getFile`\n\nGet a file entity by id\n\n`GET /v2/files/{id}`\n\n```ts\nconst { data } = await client.getFile({\n id: '123e4567-e89b-12d3-a456-426614174000',\n source_url: true,\n strict: true,\n async: true,\n})\n```\n\n
\nResponse\n\n```json\n{\n \"_title\": \"document.pdf\",\n \"_schema\": \"file\",\n \"_org\": \"123\",\n \"_id\": \"ef7d985c-2385-44f4-9c71-ae06a52264f8\",\n \"_tags\": [\"tag1\", \"tag2\"],\n \"_purpose\": [\"8d396871-95a0-4c9d-bb4d-9eda9c35776c\", \"da7cdf9a-01be-40c9-a29c-9a8f9f0de6f8\"],\n \"_manifest\": [\"123e4567-e89b-12d3-a456-426614174000\"],\n \"filename\": \"document.pdf\",\n \"type\": \"document\",\n \"mime_type\": \"application/pdf\",\n \"size_bytes\": 1234,\n \"readable_size\": \"1.2 MB\",\n \"etag\": \"9bb58f26192e4ba00f01e2e7b136bbd8\",\n \"access_control\": \"private\",\n \"public_url\": \"https://epilot-prod-user-content.s3.eu-central-1.amazonaws.com/123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf\",\n \"custom_download_url\": \"https://some-api-url.com/download?file_id=123\",\n \"custom_download_url_auth\": \"token\",\n \"preview_summary_de\": \"string\",\n \"short_summary_de\": \"string\",\n \"preview_summary_en\": \"string\",\n \"short_summary_en\": \"string\",\n \"file_summary_execution_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"source_url\": \"https://productengineer-content.s3.eu-west-1.amazonaws.com/product-engineer-checklist.pdf\",\n \"s3ref\": {},\n \"versions\": [\n {\n \"s3ref\": {},\n \"filename\": \"document.pdf\",\n \"size_bytes\": 1234,\n \"readable_size\": \"1.2 MB\",\n \"mime_type\": \"image/jpeg\",\n \"etag\": \"9bb58f26192e4ba00f01e2e7b136bbd8\"\n }\n ],\n \"_updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"_created_at\": \"1970-01-01T00:00:00.000Z\",\n \"_acl\": {\n \"view\": [\"org:456\"],\n \"edit\": [\"org:456\"],\n \"delete\": [\"org:456\"]\n },\n \"_owners\": [\n {\n \"org_id\": \"123\",\n \"user_id\": \"123\"\n }\n ],\n \"__additional\": {}\n}\n```\n\n
\n\n---\n\n### `deleteFile`\n\nDelete a file entity by id\n\n`DELETE /v2/files/{id}`\n\n```ts\nconst { data } = await client.deleteFile({\n id: '123e4567-e89b-12d3-a456-426614174000',\n purge: true,\n activity_id: 'example',\n strict: true,\n})\n```\n\n
\nResponse\n\n```json\n{\n \"_title\": \"document.pdf\",\n \"_schema\": \"file\",\n \"_org\": \"123\",\n \"_id\": \"ef7d985c-2385-44f4-9c71-ae06a52264f8\",\n \"_tags\": [\"tag1\", \"tag2\"],\n \"_purpose\": [\"8d396871-95a0-4c9d-bb4d-9eda9c35776c\", \"da7cdf9a-01be-40c9-a29c-9a8f9f0de6f8\"],\n \"_manifest\": [\"123e4567-e89b-12d3-a456-426614174000\"],\n \"filename\": \"document.pdf\",\n \"type\": \"document\",\n \"mime_type\": \"application/pdf\",\n \"size_bytes\": 1234,\n \"readable_size\": \"1.2 MB\",\n \"etag\": \"9bb58f26192e4ba00f01e2e7b136bbd8\",\n \"access_control\": \"private\",\n \"public_url\": \"https://epilot-prod-user-content.s3.eu-central-1.amazonaws.com/123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf\",\n \"custom_download_url\": \"https://some-api-url.com/download?file_id=123\",\n \"custom_download_url_auth\": \"token\",\n \"preview_summary_de\": \"string\",\n \"short_summary_de\": \"string\",\n \"preview_summary_en\": \"string\",\n \"short_summary_en\": \"string\",\n \"file_summary_execution_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"source_url\": \"https://productengineer-content.s3.eu-west-1.amazonaws.com/product-engineer-checklist.pdf\",\n \"s3ref\": {},\n \"versions\": [\n {\n \"s3ref\": {},\n \"filename\": \"document.pdf\",\n \"size_bytes\": 1234,\n \"readable_size\": \"1.2 MB\",\n \"mime_type\": \"image/jpeg\",\n \"etag\": \"9bb58f26192e4ba00f01e2e7b136bbd8\"\n }\n ],\n \"_updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"_created_at\": \"1970-01-01T00:00:00.000Z\",\n \"_acl\": {\n \"view\": [\"org:456\"],\n \"edit\": [\"org:456\"],\n \"delete\": [\"org:456\"]\n },\n \"_owners\": [\n {\n \"org_id\": \"123\",\n \"user_id\": \"123\"\n }\n ],\n \"__additional\": {}\n}\n```\n\n
\n\n---\n\n### `downloadFile`\n\nGenerate a pre-signed download URL for a file.\n\n`GET /v1/files/{id}/download`\n\n```ts\nconst { data } = await client.downloadFile({\n id: '123e4567-e89b-12d3-a456-426614174000',\n version: 1,\n attachment: true,\n x-track: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"download_url\": \"https://epilot-prod-user-content.s3.eu-central-1.amazonaws.com/123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf?AWSParams=123\"\n}\n```\n\n
\n\n---\n\n### `downloadS3File`\n\nGenerate a pre-signed download URL for a file using its S3 reference.\n\n`POST /v1/files:downloadS3`\n\n```ts\nconst { data } = await client.downloadS3File({\n s3_key: 'example',\n s3_bucket: 'example',\n attachment: true,\n})\n```\n\n
\nResponse\n\n```json\n{\n \"download_url\": \"https://epilot-prod-user-content.s3.eu-central-1.amazonaws.com/123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf?AWSParams=123\"\n}\n```\n\n
\n\n---\n\n### `downloadFiles`\n\nBulk generate pre-signed download URLs for multiple files in a single request.\n\n`POST /v1/files:downloadFiles`\n\n```ts\nconst { data } = await client.downloadFiles(\n null,\n [\n {\n id: 'ef7d985c-2385-44f4-9c71-ae06a52264f8',\n version: 0\n }\n ],\n)\n```\n\n
\nResponse\n\n```json\n[\n {\n \"download_url\": \"https://epilot-prod-user-content.s3.eu-central-1.amazonaws.com/123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf?AWSParams=123\",\n \"file_entity_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n]\n```\n\n
\n\n---\n\n### `createZipJob`\n\nCreate a background job to ZIP multiple files and send a download link via email.\n\n`POST /v1/files:zipJob`\n\n```ts\nconst { data } = await client.createZipJob(\n null,\n {},\n)\n```\n\n---\n\n### `getZipJob`\n\nGet the status of a ZIP job\n\n`GET /v1/files:zipJob/{job_id}`\n\n```ts\nconst { data } = await client.getZipJob({\n job_id: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"job_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"status\": \"completed\",\n \"progress\": {\n \"total_files\": 100,\n \"downloaded_files\": 75,\n \"failed_files\": 2\n },\n \"result\": {\n \"file_entity_id\": \"ef7d985c-2385-44f4-9c71-ae06a52264f8\",\n \"download_url\": \"https://epilot-prod-user-content.s3.eu-central-1.amazonaws.com/123/files.zip?X-Amz-...\",\n \"expires_at\": \"2024-01-02T12:00:00Z\",\n \"zip_size_bytes\": 104857600\n },\n \"error\": \"Failed to download file: access denied\",\n \"created_at\": \"2024-01-01T12:00:00Z\",\n \"created_by\": \"10234\",\n \"org_id\": \"123\",\n \"updated_at\": \"2024-01-01T12:05:00Z\"\n}\n```\n\n
\n\n---\n\n### `getFileSummary`\n\nGet summary text for a file entity together with the current summary job status when available.\n\n`GET /v1/files/{id}/summary`\n\n```ts\nconst { data } = await client.getFileSummary({\n id: '123e4567-e89b-12d3-a456-426614174000',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"status\": \"queued\",\n \"job_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"feedback_available\": true,\n \"preview_summary_de\": \"string\",\n \"short_summary_de\": \"string\",\n \"preview_summary_en\": \"string\",\n \"short_summary_en\": \"string\"\n}\n```\n\n
\n\n---\n\n### `getFileSummaryFeedback`\n\nGet file summary feedback\n\n`GET /v1/files/{id}/summary/feedback`\n\n```ts\nconst { data } = await client.getFileSummaryFeedback({\n id: '123e4567-e89b-12d3-a456-426614174000',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"feedback\": {\n \"rating\": \"up\",\n \"comment\": \"string\",\n \"user_id\": \"string\",\n \"submitted_at\": \"1970-01-01T00:00:00.000Z\"\n }\n}\n```\n\n
\n\n---\n\n### `putFileSummaryFeedback`\n\nSubmit file summary feedback\n\n`PUT /v1/files/{id}/summary/feedback`\n\n```ts\nconst { data } = await client.putFileSummaryFeedback(\n {\n id: '123e4567-e89b-12d3-a456-426614174000',\n },\n {\n rating: 'up',\n comment: 'string'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"feedback\": {\n \"rating\": \"up\",\n \"comment\": \"string\",\n \"user_id\": \"string\",\n \"submitted_at\": \"1970-01-01T00:00:00.000Z\"\n }\n}\n```\n\n
\n\n---\n\n### `createFileSummaryJob`\n\nCreate or return the current AI summary job for a file entity.\n\n`POST /v1/files/{id}/summary-jobs`\n\n```ts\nconst { data } = await client.createFileSummaryJob({\n id: '123e4567-e89b-12d3-a456-426614174000',\n})\n```\n\n---\n\n### `getCurrentFileSummaryJob`\n\nGet the latest AI summary job for the file entity's current source.\n\n`GET /v1/files/{id}/summary-jobs/current`\n\n```ts\nconst { data } = await client.getCurrentFileSummaryJob({\n id: '123e4567-e89b-12d3-a456-426614174000',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"job_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"file_id\": \"ef7d985c-2385-44f4-9c71-ae06a52264f8\",\n \"status\": \"queued\",\n \"error\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"completed_at\": \"1970-01-01T00:00:00.000Z\"\n}\n```\n\n
\n\n---\n\n### `getFileSummaryJob`\n\nGet an AI summary job by id.\n\n`GET /v1/files/{id}/summary-jobs/{job_id}`\n\n```ts\nconst { data } = await client.getFileSummaryJob({\n id: '123e4567-e89b-12d3-a456-426614174000',\n job_id: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"job_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"file_id\": \"ef7d985c-2385-44f4-9c71-ae06a52264f8\",\n \"status\": \"queued\",\n \"error\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"completed_at\": \"1970-01-01T00:00:00.000Z\"\n}\n```\n\n
\n\n---\n\n### `generateFileSummary`\n\nCompatibility alias for creating or returning the current AI summary job for a file entity.\n\n`POST /v1/files/{id}/summary:generate`\n\n```ts\nconst { data } = await client.generateFileSummary({\n id: '123e4567-e89b-12d3-a456-426614174000',\n})\n```\n\n---\n\n### `createFileAttributeSuggestionJob`\n\nStart 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\n\n`POST /v1/files/{id}/attribute-suggestion-jobs`\n\n```ts\nconst { data } = await client.createFileAttributeSuggestionJob(\n {\n id: '123e4567-e89b-12d3-a456-426614174000',\n },\n {\n entity_slug: 'opportunity',\n entity_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6'\n },\n)\n```\n\n---\n\n### `getLatestFileAttributeSuggestions`\n\nGet 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.\n\n`GET /v1/files/{id}/attribute-suggestion-jobs/latest`\n\n```ts\nconst { data } = await client.getLatestFileAttributeSuggestions({\n id: '123e4567-e89b-12d3-a456-426614174000',\n entity_id: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"jobId\": \"string\",\n \"jobStatus\": {\n \"status\": \"INITIATED\",\n \"progress\": 0,\n \"error\": \"string\"\n },\n \"payload\": {\n \"file_id\": \"string\",\n \"entity_id\": \"string\",\n \"entity_slug\": \"string\",\n \"generated_by\": \"string\",\n \"generated_at\": 0,\n \"suggestions\": [\n {\n \"attribute_name\": \"string\",\n \"attribute_label\": \"string\",\n \"attribute_type\": \"date\",\n \"suggested_value\": \"string\",\n \"confidence\": \"high\",\n \"source_page\": 0,\n \"evidence\": \"string\",\n \"status\": \"suggested\",\n \"status_updated_by\": \"string\",\n \"status_updated_at\": 0,\n \"discard_reason\": \"string\",\n \"is_copied\": true,\n \"copied_by\": \"string\",\n \"copied_at\": 0,\n \"suggestion_type\": \"new_value\"\n }\n ]\n },\n \"createdAt\": 0,\n \"updatedAt\": 0\n}\n```\n\n
\n\n---\n\n### `getFileAttributeSuggestionJob`\n\nGet an attribute suggestion job of the file. Poll until `jobStatus.status` is `COMPLETED` or `FAILED`.\n\n`GET /v1/files/{id}/attribute-suggestion-jobs/{job_id}`\n\n```ts\nconst { data } = await client.getFileAttributeSuggestionJob({\n id: '123e4567-e89b-12d3-a456-426614174000',\n job_id: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"jobId\": \"string\",\n \"jobStatus\": {\n \"status\": \"INITIATED\",\n \"progress\": 0,\n \"error\": \"string\"\n },\n \"payload\": {\n \"file_id\": \"string\",\n \"entity_id\": \"string\",\n \"entity_slug\": \"string\",\n \"generated_by\": \"string\",\n \"generated_at\": 0,\n \"suggestions\": [\n {\n \"attribute_name\": \"string\",\n \"attribute_label\": \"string\",\n \"attribute_type\": \"date\",\n \"suggested_value\": \"string\",\n \"confidence\": \"high\",\n \"source_page\": 0,\n \"evidence\": \"string\",\n \"status\": \"suggested\",\n \"status_updated_by\": \"string\",\n \"status_updated_at\": 0,\n \"discard_reason\": \"string\",\n \"is_copied\": true,\n \"copied_by\": \"string\",\n \"copied_at\": 0,\n \"suggestion_type\": \"new_value\"\n }\n ]\n },\n \"createdAt\": 0,\n \"updatedAt\": 0\n}\n```\n\n
\n\n---\n\n### `updateFileAttributeSuggestionStatus`\n\nRecord 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 \n\n`PATCH /v1/files/{id}/attribute-suggestion-jobs/{job_id}`\n\n```ts\nconst { data } = await client.updateFileAttributeSuggestionStatus(\n {\n id: '123e4567-e89b-12d3-a456-426614174000',\n job_id: 'example',\n },\n {\n suggestionStatusUpdates: [\n {},\n {}\n ]\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"jobId\": \"string\",\n \"jobStatus\": {\n \"status\": \"INITIATED\",\n \"progress\": 0,\n \"error\": \"string\"\n },\n \"payload\": {\n \"file_id\": \"string\",\n \"entity_id\": \"string\",\n \"entity_slug\": \"string\",\n \"generated_by\": \"string\",\n \"generated_at\": 0,\n \"suggestions\": [\n {\n \"attribute_name\": \"string\",\n \"attribute_label\": \"string\",\n \"attribute_type\": \"date\",\n \"suggested_value\": \"string\",\n \"confidence\": \"high\",\n \"source_page\": 0,\n \"evidence\": \"string\",\n \"status\": \"suggested\",\n \"status_updated_by\": \"string\",\n \"status_updated_at\": 0,\n \"discard_reason\": \"string\",\n \"is_copied\": true,\n \"copied_by\": \"string\",\n \"copied_at\": 0,\n \"suggestion_type\": \"new_value\"\n }\n ]\n },\n \"createdAt\": 0,\n \"updatedAt\": 0\n}\n```\n\n
\n\n---\n\n### `listMeterReadingSuggestions`\n\nList the meter reading suggestion jobs of a meter, newest first: one job per photo attached to the meter. Requires `entity:view` on the meter.\n\n`GET /v1/files:meterReadingSuggestions`\n\n```ts\nconst { data } = await client.listMeterReadingSuggestions({\n meter_id: 'example',\n schema: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"results\": [\n {\n \"meter_id\": \"string\",\n \"file_id\": \"string\",\n \"schema\": \"string\",\n \"file_name\": \"string\",\n \"status\": \"PENDING\",\n \"error\": \"string\",\n \"read_at\": \"1970-01-01T00:00:00.000Z\",\n \"read_at_source\": \"exif\",\n \"is_meter_photo\": true,\n \"meter_number_on_image\": \"string\",\n \"meter_number_mismatch\": true,\n \"suggestions\": [\n {\n \"suggestion_id\": \"string\",\n \"counter_id\": \"string\",\n \"value\": 0,\n \"value_raw\": \"string\",\n \"confidence\": \"high\",\n \"verbatim_span\": \"string\",\n \"evidence\": \"string\",\n \"warnings\": [\"below_last_reading\"],\n \"status\": \"pending\",\n \"decided_at\": \"1970-01-01T00:00:00.000Z\",\n \"decided_by\": \"string\",\n \"last_value\": 0,\n \"last_read_at\": \"1970-01-01T00:00:00.000Z\",\n \"suggested_alternative\": {\n \"value\": 0,\n \"value_raw\": \"string\",\n \"reason\": \"decimal_shift\"\n },\n \"photo_attached\": true\n }\n ],\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\"\n }\n ]\n}\n```\n\n
\n\n---\n\n### `createMeterReadingSuggestionJob`\n\nStart (or re-run) reading suggestions for one photo of a meter. Resets any previous job of the same meter and file. Requires `entity:edit` on the meter and `entity:view` on the file. The file must be \n\n`POST /v1/files:meterReadingSuggestions`\n\n```ts\nconst { data } = await client.createMeterReadingSuggestionJob(\n null,\n {\n meter_id: 'string',\n file_id: 'string',\n schema: 'meter'\n },\n)\n```\n\n---\n\n### `updateMeterReadingSuggestionStatus`\n\nRecord that a suggestion was accepted or dismissed. Saving the reading itself stays with the caller. Requires `entity:edit` on the meter.\n\n`PATCH /v1/files:meterReadingSuggestions/{meter_id}/{file_id}/{suggestion_id}`\n\n```ts\nconst { data } = await client.updateMeterReadingSuggestionStatus(\n {\n meter_id: 'example',\n file_id: 'example',\n suggestion_id: 'example',\n },\n {\n status: 'accepted'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"meter_id\": \"string\",\n \"file_id\": \"string\",\n \"schema\": \"string\",\n \"file_name\": \"string\",\n \"status\": \"PENDING\",\n \"error\": \"string\",\n \"read_at\": \"1970-01-01T00:00:00.000Z\",\n \"read_at_source\": \"exif\",\n \"is_meter_photo\": true,\n \"meter_number_on_image\": \"string\",\n \"meter_number_mismatch\": true,\n \"suggestions\": [\n {\n \"suggestion_id\": \"string\",\n \"counter_id\": \"string\",\n \"value\": 0,\n \"value_raw\": \"string\",\n \"confidence\": \"high\",\n \"verbatim_span\": \"string\",\n \"evidence\": \"string\",\n \"warnings\": [\"below_last_reading\"],\n \"status\": \"pending\",\n \"decided_at\": \"1970-01-01T00:00:00.000Z\",\n \"decided_by\": \"string\",\n \"last_value\": 0,\n \"last_read_at\": \"1970-01-01T00:00:00.000Z\",\n \"suggested_alternative\": {\n \"value\": 0,\n \"value_raw\": \"string\",\n \"reason\": \"decimal_shift\"\n },\n \"photo_attached\": true\n }\n ],\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\"\n}\n```\n\n
\n\n---\n\n### `getFileText`\n\nGet 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.\n\n`GET /v1/files/{id}/text`\n\n```ts\nconst { data } = await client.getFileText({\n id: '123e4567-e89b-12d3-a456-426614174000',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"status\": \"ready\",\n \"text\": \"string\",\n \"truncated\": true,\n \"total_chars\": 0\n}\n```\n\n
\n\n---\n\n### `validateFile`\n\nValidate an uploaded file against one or more document validation rules\n(validation-rules-api rules with `input_type: document`).\n\n`POST /v1/files/validations`\n\n```ts\nconst { data } = await client.validateFile(\n null,\n {\n file: {\n entity_id: 'ef7d985c-2385-44f4-9c71-ae06a52264f8'\n },\n rule_ids: ['string']\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"id\": \"string\",\n \"status\": \"completed\",\n \"file\": {\n \"entity_id\": \"ef7d985c-2385-44f4-9c71-ae06a52264f8\",\n \"s3ref\": {},\n \"filename\": \"string\",\n \"mime_type\": \"string\",\n \"size_bytes\": 0\n },\n \"observation\": {\n \"facts\": {\n \"mime_type\": \"string\",\n \"size_bytes\": 0,\n \"page_count\": 0,\n \"longer_edge_px\": 0,\n \"is_blank\": true,\n \"is_password_protected\": true\n },\n \"judgements\": {},\n \"document_type\": {\n \"slug\": \"string\",\n \"confidence\": 0\n }\n },\n \"results\": [\n {\n \"rule_id\": \"string\",\n \"rule_title\": \"string\",\n \"level\": \"basic\",\n \"is_valid\": true,\n \"failed_parts\": [\"string\"],\n \"warnings\": [\"string\"],\n \"conditions\": [\n {\n \"id\": \"string\",\n \"operator\": \"string\",\n \"outcome\": \"pass\",\n \"blocking\": true,\n \"message\": \"string\",\n \"evidence\": \"string\",\n \"explanation\": \"string\"\n }\n ]\n }\n ],\n \"created_at\": \"1970-01-01T00:00:00.000Z\"\n}\n```\n\n
\n\n---\n\n### `previewFile`\n\nGenerate a thumbnail preview for a file entity.\n\n`GET /v1/files/{id}/preview`\n\n```ts\nconst { data } = await client.previewFile({\n id: '123e4567-e89b-12d3-a456-426614174000',\n version: 1,\n w: 1,\n h: 1,\n})\n```\n\n---\n\n### `previewS3File`\n\nGenerate a thumbnail preview from an S3 reference.\n\n`POST /v1/files:previewS3`\n\n```ts\nconst { data } = await client.previewS3File(\n {\n w: 1,\n h: 1,\n },\n {},\n)\n```\n\n---\n\n### `previewS3FileGet`\n\nGet a thumbnail preview from an S3 reference using query parameters.\n\n`GET /v1/files:previewS3`\n\n```ts\nconst { data } = await client.previewS3FileGet({\n key: 'example',\n bucket: 'example',\n w: 1,\n h: 1,\n})\n```\n\n---\n\n### `previewPublicFile`\n\nGenerate a thumbnail preview for a public file entity.\n\n`GET /v1/files/public/{id}/preview`\n\n```ts\nconst { data } = await client.previewPublicFile({\n id: '123e4567-e89b-12d3-a456-426614174000',\n version: 1,\n w: 1,\n h: 1,\n keep_original: true,\n org_id: 'example',\n})\n```\n\n---\n\n### `getSession`\n\nStart a browser session by converting a Bearer token into a server-side cookie.\n\n`GET /v1/files/session`\n\n```ts\nconst { data } = await client.getSession()\n```\n\n---\n\n### `deleteSession`\n\nEnd a browser session by deleting the token cookie.\n\n`DELETE /v1/files/session`\n\n```ts\nconst { data } = await client.deleteSession()\n```\n\n---\n\n### `generatePublicLink`\n\nGenerate a public link to share a private file externally.\n\n`POST /v1/files/{id}/public/links`\n\n```ts\nconst { data } = await client.generatePublicLink({\n id: '123e4567-e89b-12d3-a456-426614174000',\n})\n```\n\n
\nResponse\n\n```json\n\"string\"\n```\n\n
\n\n---\n\n### `listPublicLinksForFile`\n\nFetches all public links previously generated for a file\n\n`GET /v1/files/{id}/public/links`\n\n```ts\nconst { data } = await client.listPublicLinksForFile({\n id: '123e4567-e89b-12d3-a456-426614174000',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"results\": [\n {\n \"id\": \"3ef5c6d9-818d-45e6-8efb-b1de59079a1c\",\n \"link\": \"https://file.sls.epilot.io/v1/files/public/links/3ef5c6d9-818d-45e6-8efb-b1de59079a1c\",\n \"last_accessed_at\": \"string\"\n }\n ]\n}\n```\n\n
\n\n---\n\n### `accessPublicLink`\n\nAccess a file via its public link.\n\n`GET /v1/files/public/links/{id}/{filename}`\n\n```ts\nconst { data } = await client.accessPublicLink({\n id: '123e4567-e89b-12d3-a456-426614174000',\n filename: 'example',\n hash: 'example',\n})\n```\n\n---\n\n### `revokePublicLink`\n\nRevokes a given public link by ID\n\n`DELETE /v1/files/public/links/{id}`\n\n```ts\nconst { data } = await client.revokePublicLink({\n id: '123e4567-e89b-12d3-a456-426614174000',\n})\n```\n\n---\n\n### `verifyCustomDownloadUrl`\n\nVerify that a custom download URL is valid and has not expired.\n\n`POST /v1/files/download:verify`\n\n```ts\nconst { data } = await client.verifyCustomDownloadUrl(\n null,\n {\n custom_download_url: 'https://some-api-url.com?file_id=123&expires_at=1699273500029&signature=abcdefg'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"valid\": true\n}\n```\n\n
\n\n---\n\n### `uploadFilePublic`\n\nCreate a pre-signed S3 URL for uploading a file without authentication.\n\n`POST /v1/files/public/upload`\n\n```ts\nconst { data } = await client.uploadFilePublic(\n null,\n {\n filename: 'document.pdf',\n mime_type: 'application/pdf',\n index_tag: '2f6a377c8e78',\n metadata: {\n color: 'blue'\n }\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"s3ref\": {\n \"bucket\": \"epilot-prod-user-content\",\n \"key\": \"123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf\"\n },\n \"upload_url\": \"https://epilot-prod-user-content.s3.eu-central-1.amazonaws.com/123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf?AWSParams=123\",\n \"error\": \"File entity not found\"\n}\n```\n\n
\n\n---\n\n### `getUserSchemaFileCollections`\n\nGet all file collections for the current user within a specific schema.\n\n`GET /v1/{slug}/collections`\n\n```ts\nconst { data } = await client.getUserSchemaFileCollections({\n slug: 'example',\n})\n```\n\n
\nResponse\n\n```json\n[\n {\n \"slug\": \"_system_files_collection_3fa85f64-5717-4562-b3fc-2c963f66afa6_10234:documents\",\n \"name\": \"Documents\",\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"parents\": [\"_system_files_collection_3fa85f64-5717-4562-b3fc-2c963f66afa6_10234\"],\n \"starred\": false,\n \"order\": 0,\n \"enabled_locations\": [\"string\"],\n \"enabled_purposes\": [\"9eefcb98-93cf-4c5b-a040-f1d26d57c177\", \"5c544c09-a691-43ed-a7fa-0a8b44b5b161\"],\n \"created_at\": \"2024-01-01T12:00:00Z\",\n \"updated_at\": \"2024-01-02T12:00:00Z\"\n }\n]\n```\n\n
\n\n---\n\n### `createUserSchemaFileCollection`\n\nCreate a new file collection for the current user within a specific schema.\n\n`POST /v1/{slug}/collections`\n\n```ts\nconst { data } = await client.createUserSchemaFileCollection(\n {\n slug: 'example',\n },\n {\n name: 'string',\n parents: ['string'],\n starred: false,\n enabled_locations: ['string'],\n enabled_purposes: ['string']\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"slug\": \"_system_files_collection_3fa85f64-5717-4562-b3fc-2c963f66afa6_10234:documents\",\n \"name\": \"Documents\",\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"parents\": [\"_system_files_collection_3fa85f64-5717-4562-b3fc-2c963f66afa6_10234\"],\n \"starred\": false,\n \"order\": 0,\n \"enabled_locations\": [\"string\"],\n \"enabled_purposes\": [\"9eefcb98-93cf-4c5b-a040-f1d26d57c177\", \"5c544c09-a691-43ed-a7fa-0a8b44b5b161\"],\n \"created_at\": \"2024-01-01T12:00:00Z\",\n \"updated_at\": \"2024-01-02T12:00:00Z\"\n}\n```\n\n
\n\n---\n\n### `updateUserSchemaFileCollection`\n\nUpdate an existing file collection.\n\n`PUT /v1/{slug}/collections/{collectionSlug}`\n\n```ts\nconst { data } = await client.updateUserSchemaFileCollection(\n {\n slug: 'example',\n collectionSlug: 'example',\n },\n {\n name: 'string',\n parents: ['string'],\n starred: false,\n enabled_locations: ['string'],\n enabled_purposes: ['string']\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"slug\": \"_system_files_collection_3fa85f64-5717-4562-b3fc-2c963f66afa6_10234:documents\",\n \"name\": \"Documents\",\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"parents\": [\"_system_files_collection_3fa85f64-5717-4562-b3fc-2c963f66afa6_10234\"],\n \"starred\": false,\n \"order\": 0,\n \"enabled_locations\": [\"string\"],\n \"enabled_purposes\": [\"9eefcb98-93cf-4c5b-a040-f1d26d57c177\", \"5c544c09-a691-43ed-a7fa-0a8b44b5b161\"],\n \"created_at\": \"2024-01-01T12:00:00Z\",\n \"updated_at\": \"2024-01-02T12:00:00Z\"\n}\n```\n\n
\n\n---\n\n### `deleteUserSchemaFileCollection`\n\nDelete a file collection.\n\n`DELETE /v1/{slug}/collections/{collectionSlug}`\n\n```ts\nconst { data } = await client.deleteUserSchemaFileCollection({\n slug: 'example',\n collectionSlug: 'example',\n})\n```\n\n---\n\n### `getFilesInCollection`\n\nGet all files within a specific collection for an entity.\n\n`GET /v1/entity/{id}/collections/{collectionSlug}/files`\n\n```ts\nconst { data } = await client.getFilesInCollection({\n id: '123e4567-e89b-12d3-a456-426614174000',\n collectionSlug: 'example',\n})\n```\n\n
\nResponse\n\n```json\n[\n {\n \"_title\": \"document.pdf\",\n \"_schema\": \"file\",\n \"_org\": \"123\",\n \"_id\": \"ef7d985c-2385-44f4-9c71-ae06a52264f8\",\n \"_tags\": [\"tag1\", \"tag2\"],\n \"_purpose\": [\"8d396871-95a0-4c9d-bb4d-9eda9c35776c\", \"da7cdf9a-01be-40c9-a29c-9a8f9f0de6f8\"],\n \"_manifest\": [\"123e4567-e89b-12d3-a456-426614174000\"],\n \"filename\": \"document.pdf\",\n \"type\": \"document\",\n \"mime_type\": \"application/pdf\",\n \"size_bytes\": 1234,\n \"readable_size\": \"1.2 MB\",\n \"etag\": \"9bb58f26192e4ba00f01e2e7b136bbd8\",\n \"access_control\": \"private\",\n \"public_url\": \"https://epilot-prod-user-content.s3.eu-central-1.amazonaws.com/123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf\",\n \"custom_download_url\": \"https://some-api-url.com/download?file_id=123\",\n \"custom_download_url_auth\": \"token\",\n \"preview_summary_de\": \"string\",\n \"short_summary_de\": \"string\",\n \"preview_summary_en\": \"string\",\n \"short_summary_en\": \"string\",\n \"file_summary_execution_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"source_url\": \"https://productengineer-content.s3.eu-west-1.amazonaws.com/product-engineer-checklist.pdf\",\n \"s3ref\": {},\n \"versions\": [\n {\n \"s3ref\": {},\n \"filename\": \"document.pdf\",\n \"size_bytes\": 1234,\n \"readable_size\": \"1.2 MB\",\n \"mime_type\": \"image/jpeg\",\n \"etag\": \"9bb58f26192e4ba00f01e2e7b136bbd8\"\n }\n ],\n \"_updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"_created_at\": \"1970-01-01T00:00:00.000Z\",\n \"_acl\": {\n \"view\": [\"org:456\"],\n \"edit\": [\"org:456\"],\n \"delete\": [\"org:456\"]\n },\n \"_owners\": [\n {\n \"org_id\": \"123\",\n \"user_id\": \"123\"\n }\n ],\n \"__additional\": {}\n }\n]\n```\n\n
\n\n---\n\n### `getGlobalFileCollections`\n\nGet all global file collections for a specific schema.\n\n`GET /v1/collections/{schemaSlug}`\n\n```ts\nconst { data } = await client.getGlobalFileCollections({\n schemaSlug: 'example',\n})\n```\n\n
\nResponse\n\n```json\n[\n {\n \"slug\": \"_system_files_collection_3fa85f64-5717-4562-b3fc-2c963f66afa6_10234:documents\",\n \"name\": \"Documents\",\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"parents\": [\"_system_files_collection_3fa85f64-5717-4562-b3fc-2c963f66afa6_10234\"],\n \"starred\": false,\n \"order\": 0,\n \"enabled_locations\": [\"string\"],\n \"enabled_purposes\": [\"9eefcb98-93cf-4c5b-a040-f1d26d57c177\", \"5c544c09-a691-43ed-a7fa-0a8b44b5b161\"],\n \"created_at\": \"2024-01-01T12:00:00Z\",\n \"updated_at\": \"2024-01-02T12:00:00Z\"\n }\n]\n```\n\n
\n\n---\n\n### `createGlobalFileCollection`\n\nCreate an organization-wide file collection shell for a schema.\n\n`POST /v1/collections/{schemaSlug}`\n\n```ts\nconst { data } = await client.createGlobalFileCollection(\n {\n schemaSlug: 'example',\n },\n {\n name: 'string',\n collection_slug: 'string',\n enabled_purposes: ['3fa85f64-5717-4562-b3fc-2c963f66afa6']\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"slug\": \"_system_files_collection_schema_opportunity:customer_documents\",\n \"name\": \"Customer Documents\",\n \"enabled_purposes\": [\"3fa85f64-5717-4562-b3fc-2c963f66afa6\"],\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\"\n}\n```\n\n
\n\n---\n\n### `getGlobalFileCollection`\n\nGet one global file collection within the requested schema namespace.\n\n`GET /v1/collections/{schemaSlug}/{collectionId}`\n\n```ts\nconst { data } = await client.getGlobalFileCollection({\n schemaSlug: 'example',\n collectionId: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"slug\": \"_system_files_collection_schema_opportunity:customer_documents\",\n \"name\": \"Customer Documents\",\n \"enabled_purposes\": [\"3fa85f64-5717-4562-b3fc-2c963f66afa6\"],\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\"\n}\n```\n\n
\n\n---\n\n### `updateGlobalFileCollection`\n\nUpdate a global file collection using merge semantics.\n\n`PUT /v1/collections/{schemaSlug}/{collectionId}`\n\n```ts\nconst { data } = await client.updateGlobalFileCollection(\n {\n schemaSlug: 'example',\n collectionId: 'example',\n },\n {\n name: 'string',\n enabled_purposes: ['3fa85f64-5717-4562-b3fc-2c963f66afa6']\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"slug\": \"_system_files_collection_schema_opportunity:customer_documents\",\n \"name\": \"Customer Documents\",\n \"enabled_purposes\": [\"3fa85f64-5717-4562-b3fc-2c963f66afa6\"],\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\"\n}\n```\n\n
\n\n---\n\n### `deleteGlobalFileCollection`\n\nDelete a global file collection. Files and file relationships are not deleted.\n\n`DELETE /v1/collections/{schemaSlug}/{collectionId}`\n\n```ts\nconst { data } = await client.deleteGlobalFileCollection({\n schemaSlug: 'example',\n collectionId: 'example',\n})\n```\n\n---\n\n## Schemas\n\n### `EntityId`\n\n```ts\ntype EntityId = string\n```\n\n### `EntitySlug`\n\nURL-friendly identifier for the entity schema\n\n```ts\ntype EntitySlug = string\n```\n\n### `ActivityId`\n\nSee https://github.com/ulid/spec\n\n```ts\ntype ActivityId = string // ulid\n```\n\n### `FileEntityId`\n\n```ts\ntype FileEntityId = string | string // uuid\n```\n\n### `FileAttributes`\n\n```ts\ntype FileAttributes = {\n _tags?: string[]\n _purpose?: string[]\n _manifest?: string // uuid[]\n filename?: string\n type?: \"document\" | \"document_template\" | \"text\" | \"image\" | \"video\" | \"audio\" | \"spreadsheet\" | \"presentation\" | \"font\" | \"archive\" | \"application\" | \"unknown\"\n mime_type?: string\n size_bytes?: number\n readable_size?: string\n etag?: string\n access_control?: \"private\" | \"public-read\"\n public_url?: string // url\n custom_download_url?: string // uri\n custom_download_url_auth?: \"presigned\" | \"token\"\n preview_summary_de?: string\n short_summary_de?: string\n preview_summary_en?: string\n short_summary_en?: string\n file_summary_execution_id?: string // uuid\n}\n```\n\n### `FileType`\n\n```ts\ntype FileType = \"document\" | \"document_template\" | \"text\" | \"image\" | \"video\" | \"audio\" | \"spreadsheet\" | \"presentation\" | \"font\" | \"archive\" | \"application\" | \"unknown\"\n```\n\n### `FileSummaryJobStatus`\n\nCurrent state of a file summary job.\n\n```ts\ntype FileSummaryJobStatus = \"queued\" | \"waiting_for_extraction\" | \"processing\" | \"completed\" | \"failed\" | \"unsupported\" | \"stale\"\n```\n\n### `FileSummaryJob`\n\n```ts\ntype FileSummaryJob = {\n job_id: string // uuid\n file_id: string | string // uuid\n status: \"queued\" | \"waiting_for_extraction\" | \"processing\" | \"completed\" | \"failed\" | \"unsupported\" | \"stale\"\n error?: string\n created_at: string // date-time\n updated_at: string // date-time\n completed_at?: string // date-time\n}\n```\n\n### `FileSummary`\n\n```ts\ntype FileSummary = {\n status?: \"queued\" | \"waiting_for_extraction\" | \"processing\" | \"completed\" | \"failed\" | \"unsupported\" | \"stale\"\n job_id?: string // uuid\n feedback_available?: boolean\n preview_summary_de?: string\n short_summary_de?: string\n preview_summary_en?: string\n short_summary_en?: string\n}\n```\n\n### `FileSummaryFeedback`\n\n```ts\ntype FileSummaryFeedback = {\n rating: \"up\" | \"down\"\n comment?: string\n user_id: string\n submitted_at: string // date-time\n}\n```\n\n### `FileSummaryFeedbackResponse`\n\n```ts\ntype FileSummaryFeedbackResponse = {\n feedback: {\n rating: \"up\" | \"down\"\n comment?: string\n user_id: string\n submitted_at: string // date-time\n }\n}\n```\n\n### `PutFileSummaryFeedbackRequest`\n\n```ts\ntype PutFileSummaryFeedbackRequest = {\n rating: \"up\" | \"down\"\n comment?: string\n}\n```\n\n### `FileAttributeSuggestionJobStatus`\n\n```ts\ntype FileAttributeSuggestionJobStatus = {\n status: \"INITIATED\" | \"IN_PROGRESS\" | \"COMPLETED\" | \"FAILED\"\n progress: number\n error?: string\n}\n```\n\n### `FileAttributeSuggestion`\n\n```ts\ntype FileAttributeSuggestion = {\n attribute_name?: string\n attribute_label?: string\n attribute_type?: \"date\" | \"number\" | \"boolean\" | \"select\" | \"string\"\n suggested_value?: string | number | boolean\n confidence?: \"high\" | \"medium\" | \"low\"\n source_page?: number\n evidence?: string\n status?: \"suggested\" | \"accepted\" | \"discarded\"\n status_updated_by?: string\n status_updated_at?: number\n discard_reason?: string\n is_copied?: boolean\n copied_by?: string\n copied_at?: number\n suggestion_type?: \"new_value\" | \"update\"\n}\n```\n\n### `FileAttributeSuggestionsPayload`\n\n```ts\ntype FileAttributeSuggestionsPayload = {\n file_id: string\n entity_id: string\n entity_slug: string\n generated_by?: string\n generated_at?: number\n suggestions: Array<{\n attribute_name?: string\n attribute_label?: string\n attribute_type?: \"date\" | \"number\" | \"boolean\" | \"select\" | \"string\"\n suggested_value?: string | number | boolean\n confidence?: \"high\" | \"medium\" | \"low\"\n source_page?: number\n evidence?: string\n status?: \"suggested\" | \"accepted\" | \"discarded\"\n status_updated_by?: string\n status_updated_at?: number\n discard_reason?: string\n is_copied?: boolean\n copied_by?: string\n copied_at?: number\n suggestion_type?: \"new_value\" | \"update\"\n }>\n}\n```\n\n### `FileAttributeSuggestionJob`\n\n```ts\ntype FileAttributeSuggestionJob = {\n jobId: string\n jobStatus: {\n status: \"INITIATED\" | \"IN_PROGRESS\" | \"COMPLETED\" | \"FAILED\"\n progress: number\n error?: string\n }\n payload: {\n file_id: string\n entity_id: string\n entity_slug: string\n generated_by?: string\n generated_at?: number\n suggestions: Array<{\n attribute_name?: { ... }\n attribute_label?: { ... }\n attribute_type?: { ... }\n suggested_value?: { ... }\n confidence?: { ... }\n source_page?: { ... }\n evidence?: { ... }\n status?: { ... }\n status_updated_by?: { ... }\n status_updated_at?: { ... }\n discard_reason?: { ... }\n is_copied?: { ... }\n copied_by?: { ... }\n copied_at?: { ... }\n suggestion_type?: { ... }\n }>\n }\n createdAt: number\n updatedAt: number\n}\n```\n\n### `CreateFileAttributeSuggestionJobRequest`\n\n```ts\ntype CreateFileAttributeSuggestionJobRequest = {\n entity_slug: string\n entity_id: string // uuid\n}\n```\n\n### `UpdateFileAttributeSuggestionStatusRequest`\n\n```ts\ntype UpdateFileAttributeSuggestionStatusRequest = {\n suggestionStatusUpdates: unknown | unknown[]\n}\n```\n\n### `FileAttributeSuggestionError`\n\n```ts\ntype FileAttributeSuggestionError = {\n status?: number\n error?: string\n 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\"\n}\n```\n\n### `MeterReadingSuggestionError`\n\n```ts\ntype MeterReadingSuggestionError = {\n status?: number\n error?: string\n error_code?: \"feature_disabled\" | \"file_not_found\" | \"not_an_image\" | \"schema_not_supported\" | \"file_not_attached\" | \"job_not_found\" | \"job_not_completed\" | \"suggestion_not_found\" | \"processing_enqueue_failed\"\n}\n```\n\n### `CreateMeterReadingSuggestionJobRequest`\n\n```ts\ntype CreateMeterReadingSuggestionJobRequest = {\n meter_id: string\n file_id: string\n schema?: string\n}\n```\n\n### `UpdateMeterReadingSuggestionStatusRequest`\n\n```ts\ntype UpdateMeterReadingSuggestionStatusRequest = {\n status: \"accepted\" | \"dismissed\"\n}\n```\n\n### `MeterReadingSuggestion`\n\n```ts\ntype MeterReadingSuggestion = {\n suggestion_id: string\n counter_id: string\n value: number\n value_raw: string\n confidence: \"high\" | \"medium\" | \"low\"\n verbatim_span: string\n evidence: string\n warnings: \"below_last_reading\" | \"meter_number_mismatch\" | \"unusually_high\" | \"possible_decimal_shift\" | \"decimal_unverified\"[]\n status: \"pending\" | \"accepted\" | \"dismissed\"\n decided_at: string // date-time\n decided_by: string\n last_value: number\n last_read_at: string // date-time\n suggested_alternative: {\n value: number\n value_raw: string\n reason: \"decimal_shift\" | \"decimal_unverified\"\n }\n photo_attached: boolean\n}\n```\n\n### `MeterReadingSuggestedAlternative`\n\nAnother reading to offer instead of `value`. `decimal_shift`: a decimal shift of `value` that is\nconsistent with `last_value` (between it and twice it), offered when `value` itself is implausible and\nexactly one shift (×0.01, ×0.1 or ×10) fits. `decimal_unverified`: `value` / 10, offered when there \n\n```ts\ntype MeterReadingSuggestedAlternative = {\n value: number\n value_raw: string\n reason: \"decimal_shift\" | \"decimal_unverified\"\n}\n```\n\n### `MeterReadingSuggestionJob`\n\n```ts\ntype MeterReadingSuggestionJob = {\n meter_id: string\n file_id: string\n schema: string\n file_name: string\n status: \"PENDING\" | \"IN_PROGRESS\" | \"COMPLETED\" | \"FAILED\"\n error: string\n read_at: string // date-time\n read_at_source: \"exif\" | \"none\"\n is_meter_photo: boolean\n meter_number_on_image: string\n meter_number_mismatch: boolean\n suggestions: Array<{\n suggestion_id: string\n counter_id: string\n value: number\n value_raw: string\n confidence: \"high\" | \"medium\" | \"low\"\n verbatim_span: string\n evidence: string\n warnings: \"below_last_reading\" | \"meter_number_mismatch\" | \"unusually_high\" | \"possible_decimal_shift\" | \"decimal_unverified\"[]\n status: \"pending\" | \"accepted\" | \"dismissed\"\n decided_at: string // date-time\n decided_by: string\n last_value: number\n last_read_at: string // date-time\n suggested_alternative: {\n value: { ... }\n value_raw: { ... }\n reason: { ... }\n }\n photo_attached: boolean\n }>\n created_at: string // date-time\n updated_at: string // date-time\n}\n```\n\n### `FileTextStatus`\n\nAvailability of the plain-text representation for a file entity.\n\n```ts\ntype FileTextStatus = \"ready\" | \"not_ready\" | \"unsupported\"\n```\n\n### `FileValidationRequest`\n\n```ts\ntype FileValidationRequest = {\n file: {\n entity_id: string | string // uuid\n } | {\n s3ref: unknown\n }\n rule_ids: string[]\n}\n```\n\n### `FileValidationFileReference`\n\nThe file to validate - a saved file entity, or an uploaded object not saved as an entity yet.\n\n```ts\ntype FileValidationFileReference = {\n entity_id: string | string // uuid\n} | {\n s3ref: unknown\n}\n```\n\n### `FileValidation`\n\n```ts\ntype FileValidation = {\n id: string\n status: \"completed\" | \"pending\" | \"failed\" | \"skipped\"\n file: {\n entity_id?: string | string // uuid\n s3ref?: unknown\n filename?: string\n mime_type?: string\n size_bytes?: number\n }\n observation: {\n facts: {\n mime_type?: { ... }\n size_bytes?: { ... }\n page_count?: { ... }\n longer_edge_px?: { ... }\n is_blank?: { ... }\n is_password_protected?: { ... }\n }\n judgements?: Record\n document_type?: {\n slug?: { ... }\n confidence?: { ... }\n }\n }\n results: Array<{\n rule_id: string\n rule_title?: string\n level: \"basic\" | \"standard\" | \"advanced\"\n is_valid: boolean\n failed_parts?: string[]\n warnings?: string[]\n conditions: Array<{\n id: { ... }\n operator: { ... }\n outcome: { ... }\n blocking: { ... }\n message: { ... }\n evidence?: { ... }\n explanation?: { ... }\n }>\n }>\n created_at: string // date-time\n}\n```\n\n### `FileValidationFile`\n\nThe file that was validated, with the identity facts collected from its content.\n\n```ts\ntype FileValidationFile = {\n entity_id?: string | string // uuid\n s3ref?: unknown\n filename?: string\n mime_type?: string\n size_bytes?: number\n}\n```\n\n### `FileValidationObservation`\n\nEverything observed about the file, as passed to the validation rules engine.\n\n```ts\ntype FileValidationObservation = {\n facts: {\n mime_type?: string\n size_bytes?: number\n page_count?: number\n longer_edge_px?: number\n is_blank?: boolean\n is_password_protected?: boolean\n }\n judgements?: Record\n document_type?: {\n slug?: string\n confidence?: number\n }\n}\n```\n\n### `FileValidationJudgement`\n\n```ts\ntype FileValidationJudgement = {\n result: \"pass\" | \"fail\" | \"uncertain\"\n confidence?: number\n evidence?: string\n explanation?: string\n}\n```\n\n### `FileValidationFacts`\n\nDeterministic properties of the file. A property that is absent could not be determined\n(for example the resolution of an image the service cannot decode); conditions that need it\nare skipped rather than failed.\n\n\n```ts\ntype FileValidationFacts = {\n mime_type?: string\n size_bytes?: number\n page_count?: number\n longer_edge_px?: number\n is_blank?: boolean\n is_password_protected?: boolean\n}\n```\n\n### `FileValidationRuleResult`\n\n```ts\ntype FileValidationRuleResult = {\n rule_id: string\n rule_title?: string\n level: \"basic\" | \"standard\" | \"advanced\"\n is_valid: boolean\n failed_parts?: string[]\n warnings?: string[]\n conditions: Array<{\n id: string\n operator: string\n outcome: \"pass\" | \"fail\" | \"uncertain\" | \"skipped\"\n blocking: boolean\n message: string\n evidence?: string\n explanation?: string\n }>\n}\n```\n\n### `FileValidationConditionResult`\n\n```ts\ntype FileValidationConditionResult = {\n id: string\n operator: string\n outcome: \"pass\" | \"fail\" | \"uncertain\" | \"skipped\"\n blocking: boolean\n message: string\n evidence?: string\n explanation?: string\n}\n```\n\n### `FileText`\n\n```ts\ntype FileText = {\n status: \"ready\"\n text: string\n truncated: boolean\n total_chars: number\n} | {\n status: \"not_ready\"\n} | {\n status: \"unsupported\"\n}\n```\n\n### `FileTextReady`\n\n```ts\ntype FileTextReady = {\n status: \"ready\"\n text: string\n truncated: boolean\n total_chars: number\n}\n```\n\n### `FileTextNotReady`\n\n```ts\ntype FileTextNotReady = {\n status: \"not_ready\"\n}\n```\n\n### `FileTextUnsupported`\n\n```ts\ntype FileTextUnsupported = {\n status: \"unsupported\"\n}\n```\n\n### `CustomDownloadUrl`\n\nCustom external download url used for the file\n\n```ts\ntype CustomDownloadUrl = string // uri\n```\n\n### `CustomDownloadUrlAuth`\n\nAuthorization 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\n\n```ts\ntype CustomDownloadUrlAuth = \"presigned\" | \"token\"\n```\n\n### `FileEntity`\n\n```ts\ntype FileEntity = {\n _title: string\n _schema: \"file\"\n _org: string\n _id: string | string // uuid\n _tags?: string[]\n _purpose?: string[]\n _manifest?: string // uuid[]\n filename: string\n type: \"document\" | \"document_template\" | \"text\" | \"image\" | \"video\" | \"audio\" | \"spreadsheet\" | \"presentation\" | \"font\" | \"archive\" | \"application\" | \"unknown\"\n mime_type?: string\n size_bytes?: number\n readable_size?: string\n etag?: string\n access_control: \"private\" | \"public-read\"\n public_url?: string // url\n custom_download_url?: string // uri\n custom_download_url_auth?: \"presigned\" | \"token\"\n preview_summary_de?: string\n short_summary_de?: string\n preview_summary_en?: string\n short_summary_en?: string\n file_summary_execution_id?: string // uuid\n source_url?: string\n s3ref?: object\n versions: Array<{\n s3ref?: unknown\n filename?: string\n size_bytes?: number\n readable_size?: string\n mime_type?: string\n etag?: string\n }>\n _updated_at?: string // date-time\n _created_at?: string // date-time\n _acl?: {\n view?: string[]\n edit?: string[]\n delete?: string[]\n }\n _owners?: Array<{\n org_id: string\n user_id?: string\n }>\n __additional?: Record\n}\n```\n\n### `CommonSaveFilePayload`\n\n```ts\ntype CommonSaveFilePayload = {\n _id?: object\n file_entity_id?: string\n relations?: Array<{\n entity_id: string\n _schema?: string\n _tags?: string[]\n }>\n}\n```\n\n### `SaveS3FilePayload`\n\n```ts\ntype SaveS3FilePayload = {\n _id?: object\n file_entity_id?: string\n relations?: Array<{\n entity_id: string\n _schema?: string\n _tags?: string[]\n }>\n _tags?: string[]\n _purpose?: string[]\n _manifest?: string // uuid[]\n filename?: string\n type?: \"document\" | \"document_template\" | \"text\" | \"image\" | \"video\" | \"audio\" | \"spreadsheet\" | \"presentation\" | \"font\" | \"archive\" | \"application\" | \"unknown\"\n mime_type?: string\n size_bytes?: number\n readable_size?: string\n etag?: string\n access_control?: \"private\" | \"public-read\"\n public_url?: string // url\n custom_download_url?: string // uri\n custom_download_url_auth?: \"presigned\" | \"token\"\n preview_summary_de?: string\n short_summary_de?: string\n preview_summary_en?: string\n short_summary_en?: string\n file_summary_execution_id?: string // uuid\n s3ref?: unknown\n}\n```\n\n### `SaveFileFromSourceURLPayload`\n\n```ts\ntype SaveFileFromSourceURLPayload = {\n _id?: object\n file_entity_id?: string\n relations?: Array<{\n entity_id: string\n _schema?: string\n _tags?: string[]\n }>\n _tags?: string[]\n _purpose?: string[]\n _manifest?: string // uuid[]\n filename?: string\n type?: \"document\" | \"document_template\" | \"text\" | \"image\" | \"video\" | \"audio\" | \"spreadsheet\" | \"presentation\" | \"font\" | \"archive\" | \"application\" | \"unknown\"\n mime_type?: string\n size_bytes?: number\n readable_size?: string\n etag?: string\n access_control?: \"private\" | \"public-read\"\n public_url?: string // url\n custom_download_url?: string // uri\n custom_download_url_auth?: \"presigned\" | \"token\"\n preview_summary_de?: string\n short_summary_de?: string\n preview_summary_en?: string\n short_summary_en?: string\n file_summary_execution_id?: string // uuid\n source_url?: string // uri\n}\n```\n\n### `SaveCustomFilePayload`\n\n```ts\ntype SaveCustomFilePayload = {\n _id?: object\n file_entity_id?: string\n relations?: Array<{\n entity_id: string\n _schema?: string\n _tags?: string[]\n }>\n _tags?: string[]\n _purpose?: string[]\n _manifest?: string // uuid[]\n filename?: string\n type?: \"document\" | \"document_template\" | \"text\" | \"image\" | \"video\" | \"audio\" | \"spreadsheet\" | \"presentation\" | \"font\" | \"archive\" | \"application\" | \"unknown\"\n mime_type?: string\n size_bytes?: number\n readable_size?: string\n etag?: string\n access_control?: \"private\" | \"public-read\"\n public_url?: string // url\n custom_download_url?: string // uri\n custom_download_url_auth?: \"presigned\" | \"token\"\n preview_summary_de?: string\n short_summary_de?: string\n preview_summary_en?: string\n short_summary_en?: string\n file_summary_execution_id?: string // uuid\n}\n```\n\n### `SaveFilePayload`\n\n```ts\ntype SaveFilePayload = {\n _id?: object\n file_entity_id?: string\n relations?: Array<{\n entity_id: string\n _schema?: string\n _tags?: string[]\n }>\n _tags?: string[]\n _purpose?: string[]\n _manifest?: string // uuid[]\n filename?: string\n type?: \"document\" | \"document_template\" | \"text\" | \"image\" | \"video\" | \"audio\" | \"spreadsheet\" | \"presentation\" | \"font\" | \"archive\" | \"application\" | \"unknown\"\n mime_type?: string\n size_bytes?: number\n readable_size?: string\n etag?: string\n access_control?: \"private\" | \"public-read\"\n public_url?: string // url\n custom_download_url?: string // uri\n custom_download_url_auth?: \"presigned\" | \"token\"\n preview_summary_de?: string\n short_summary_de?: string\n preview_summary_en?: string\n short_summary_en?: string\n file_summary_execution_id?: string // uuid\n s3ref?: unknown\n} | {\n _id?: object\n file_entity_id?: string\n relations?: Array<{\n entity_id: string\n _schema?: string\n _tags?: string[]\n }>\n _tags?: string[]\n _purpose?: string[]\n _manifest?: string // uuid[]\n filename?: string\n type?: \"document\" | \"document_template\" | \"text\" | \"image\" | \"video\" | \"audio\" | \"spreadsheet\" | \"presentation\" | \"font\" | \"archive\" | \"application\" | \"unknown\"\n mime_type?: string\n size_bytes?: number\n readable_size?: string\n etag?: string\n access_control?: \"private\" | \"public-read\"\n public_url?: string // url\n custom_download_url?: string // uri\n custom_download_url_auth?: \"presigned\" | \"token\"\n preview_summary_de?: string\n short_summary_de?: string\n preview_summary_en?: string\n short_summary_en?: string\n file_summary_execution_id?: string // uuid\n source_url?: string // uri\n} | {\n _id?: object\n file_entity_id?: string\n relations?: Array<{\n entity_id: string\n _schema?: string\n _tags?: string[]\n }>\n _tags?: string[]\n _purpose?: string[]\n _manifest?: string // uuid[]\n filename?: string\n type?: \"document\" | \"document_template\" | \"text\" | \"image\" | \"video\" | \"audio\" | \"spreadsheet\" | \"presentation\" | \"font\" | \"archive\" | \"application\" | \"unknown\"\n mime_type?: string\n size_bytes?: number\n readable_size?: string\n etag?: string\n access_control?: \"private\" | \"public-read\"\n public_url?: string // url\n custom_download_url?: string // uri\n custom_download_url_auth?: \"presigned\" | \"token\"\n preview_summary_de?: string\n short_summary_de?: string\n preview_summary_en?: string\n short_summary_en?: string\n file_summary_execution_id?: string // uuid\n}\n```\n\n### `SaveFilePayloadV2`\n\n```ts\ntype SaveFilePayloadV2 = {\n _id?: object\n file_entity_id?: string\n relations?: Array<{\n entity_id: string\n _schema?: string\n _tags?: string[]\n }>\n _tags?: string[]\n _purpose?: string[]\n _manifest?: string // uuid[]\n filename?: string\n type?: \"document\" | \"document_template\" | \"text\" | \"image\" | \"video\" | \"audio\" | \"spreadsheet\" | \"presentation\" | \"font\" | \"archive\" | \"application\" | \"unknown\"\n mime_type?: string\n size_bytes?: number\n readable_size?: string\n etag?: string\n access_control?: \"private\" | \"public-read\"\n public_url?: string // url\n custom_download_url?: string // uri\n custom_download_url_auth?: \"presigned\" | \"token\"\n preview_summary_de?: string\n short_summary_de?: string\n preview_summary_en?: string\n short_summary_en?: string\n file_summary_execution_id?: string // uuid\n s3ref?: unknown\n} | {\n _id?: object\n file_entity_id?: string\n relations?: Array<{\n entity_id: string\n _schema?: string\n _tags?: string[]\n }>\n _tags?: string[]\n _purpose?: string[]\n _manifest?: string // uuid[]\n filename?: string\n type?: \"document\" | \"document_template\" | \"text\" | \"image\" | \"video\" | \"audio\" | \"spreadsheet\" | \"presentation\" | \"font\" | \"archive\" | \"application\" | \"unknown\"\n mime_type?: string\n size_bytes?: number\n readable_size?: string\n etag?: string\n access_control?: \"private\" | \"public-read\"\n public_url?: string // url\n custom_download_url?: string // uri\n custom_download_url_auth?: \"presigned\" | \"token\"\n preview_summary_de?: string\n short_summary_de?: string\n preview_summary_en?: string\n short_summary_en?: string\n file_summary_execution_id?: string // uuid\n source_url?: string // uri\n} | {\n _id?: object\n file_entity_id?: string\n relations?: Array<{\n entity_id: string\n _schema?: string\n _tags?: string[]\n }>\n _tags?: string[]\n _purpose?: string[]\n _manifest?: string // uuid[]\n filename?: string\n type?: \"document\" | \"document_template\" | \"text\" | \"image\" | \"video\" | \"audio\" | \"spreadsheet\" | \"presentation\" | \"font\" | \"archive\" | \"application\" | \"unknown\"\n mime_type?: string\n size_bytes?: number\n readable_size?: string\n etag?: string\n access_control?: \"private\" | \"public-read\"\n public_url?: string // url\n custom_download_url?: string // uri\n custom_download_url_auth?: \"presigned\" | \"token\"\n preview_summary_de?: string\n short_summary_de?: string\n preview_summary_en?: string\n short_summary_en?: string\n file_summary_execution_id?: string // uuid\n}\n```\n\n### `BatchSaveFileVersionPayload`\n\nPayload for batch version save. Only s3ref payloads are supported.\n\n```ts\ntype BatchSaveFileVersionPayload = {\n _id?: object\n file_entity_id?: string\n filename?: string\n mime_type?: string\n access_control?: \"private\" | \"public-read\"\n s3ref: unknown\n}\n```\n\n### `UploadFilePayload`\n\n```ts\ntype UploadFilePayload = {\n filename: string\n mime_type?: string\n index_tag?: string\n metadata?: Record\n}\n```\n\n### `FileUpload`\n\n```ts\ntype FileUpload = {\n s3ref?: object\n upload_url?: string // url\n public_url?: string // url\n}\n```\n\n### `DownloadFilesPayload`\n\n```ts\ntype DownloadFilesPayload = Array<{\n id: string | string // uuid\n version?: number\n}>\n```\n\n### `CreateZipJobPayload`\n\nRequest payload to create a ZIP job for bulk file download.\nProvide either an explicit list of `file_entity_ids` (up to 1000) or an\n`entity_query` that resolves to file entities (up to 100000).\n\n\n```ts\ntype CreateZipJobPayload = unknown | unknown\n```\n\n### `ZipJob`\n\nZIP job status and result\n\n```ts\ntype ZipJob = {\n job_id?: string // uuid\n status?: \"queued\" | \"downloading\" | \"zipping\" | \"uploading\" | \"sending_notification\" | \"completed\" | \"failed\"\n progress?: {\n total_files?: number\n downloaded_files?: number\n failed_files?: number\n }\n result?: {\n file_entity_id?: string // uuid\n download_url?: string // uri\n expires_at?: string // date-time\n zip_size_bytes?: number\n }\n error?: string\n created_at?: string // date-time\n created_by?: string\n org_id?: string\n updated_at?: string // date-time\n}\n```\n\n### `VerifyCustomDownloadUrlPayload`\n\n```ts\ntype VerifyCustomDownloadUrlPayload = {\n custom_download_url: string\n}\n```\n\n### `S3Reference`\n\n```ts\ntype S3Reference = {\n bucket: string\n key: string\n}\n```\n\n### `S3Ref`\n\n```ts\ntype S3Ref = {\n bucket: string\n key: string\n}\n```\n\n### `FileItem`\n\n```ts\ntype FileItem = {\n s3ref?: unknown\n filename?: string\n size_bytes?: number\n readable_size?: string\n mime_type?: string\n etag?: string\n}\n```\n\n### `FileRelationItem`\n\n```ts\ntype FileRelationItem = {\n entity_id: string\n _schema?: string\n _tags?: string[]\n}\n```\n\n### `PublicLink`\n\n```ts\ntype PublicLink = {\n id?: string\n link?: string\n last_accessed_at?: string\n}\n```\n\n### `BaseEntityOwner`\n\nThe user / organization owning this entity.\n\nNote: Owner implicitly has access to the entity regardless of ACLs.\n\n\n```ts\ntype BaseEntityOwner = {\n org_id: string\n user_id?: string\n}\n```\n\n### `BaseEntityAcl`\n\nAccess control list (ACL) for an entity. Defines sharing access to external orgs or users.\n\n```ts\ntype BaseEntityAcl = {\n view?: string[]\n edit?: string[]\n delete?: string[]\n}\n```\n\n### `ErrorObject`\n\nA generic error returned by the API\n\n```ts\ntype ErrorObject = {\n status?: number\n error?: string\n}\n```\n\n### `FileCollectionId`\n\nGenerated uuid for a file collection\n\n```ts\ntype FileCollectionId = string // uuid\n```\n\n### `GlobalFileCollection`\n\nAn organization-wide file collection shell scoped to one entity schema\n\n```ts\ntype GlobalFileCollection = {\n id: string // uuid\n slug: string\n name: string\n enabled_purposes: string // uuid[]\n created_at?: string // date-time\n updated_at?: string // date-time\n}\n```\n\n### `GlobalFileCollectionCreateRequest`\n\nRequest body for creating a global file collection shell\n\n```ts\ntype GlobalFileCollectionCreateRequest = {\n name: string\n collection_slug?: string\n enabled_purposes?: string // uuid[]\n}\n```\n\n### `GlobalFileCollectionUpdateRequest`\n\nMerge-style request body for updating a global file collection shell\n\n```ts\ntype GlobalFileCollectionUpdateRequest = {\n name?: string\n enabled_purposes?: string // uuid[]\n}\n```\n\n### `GlobalFileCollectionDeleteJob`\n\nEntity API taxonomy bulk job deleting a global file collection\n\n```ts\ntype GlobalFileCollectionDeleteJob = {\n job_id: string // uuid\n status?: string\n}\n```\n\n### `FileCollectionItem`\n\nA file collection with identifiers and timestamps\n\n```ts\ntype FileCollectionItem = {\n slug?: string\n name: string\n id?: string // uuid\n parents?: string[]\n starred?: boolean\n order?: number\n enabled_locations?: string[]\n enabled_purposes?: string[]\n created_at?: string // date-time\n updated_at?: string // date-time\n}\n```\n\n### `FileCollectionAttributes`\n\n```ts\ntype FileCollectionAttributes = {\n name?: string\n parents?: string[]\n starred?: boolean\n enabled_locations?: string[]\n enabled_purposes?: string[]\n}\n```\n\n### `FileCollectionCreateRequest`\n\nRequest body for creating a file collection\n\n```ts\ntype FileCollectionCreateRequest = {\n name: string\n parents?: string[]\n starred?: boolean\n enabled_locations?: string[]\n enabled_purposes?: string[]\n}\n```\n"