npm SDK API Reference
getTemplateUrl(options)
Retrieves the template associated with a document and returns a presigned URL that can be used directly to fetch the file. The presigned URL expires after 1 hour.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
documentId | string | Yes | The unique identifier of the document |
accessToken | string | Yes | Your organization access token |
baseUrl | string | Yes | The Artos API base URL |
apiClient | ApiClient | No | Pre-configured API client (advanced usage) |
Promise<GetTemplateUrlResponse>
getDocumentSources(options)
Lists all sources associated with a given section within a document. Used to populate the Sources panel when a user selects or highlights a section of the draft.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
documentId | string | Yes | The unique identifier of the document |
sectionId | string | Yes | The section ID to retrieve sources for |
accessToken | string | Yes | Your organization access token |
baseUrl | string | Yes | The Artos API base URL |
apiClient | ApiClient | No | Pre-configured API client (advanced usage) |
Promise<GetDocumentSourcesResponse>
getDocumentSourceUrl(options)
Fetches the presigned URL for a given source reference, enabling preview of the original source material from within the Sources panel.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
documentSourceId | string | Yes | Source ID obtained from getDocumentSources |
accessToken | string | Yes | Your organization access token |
baseUrl | string | Yes | The Artos API base URL |
apiClient | ApiClient | No | Pre-configured API client (advanced usage) |
Promise<GetDocumentSourceUrlResponse>
getSectionFromText(options)
Given a user-defined text selection within the draft editor, identifies the enclosing section and returns its metadata. Use the returned sectionId with getDocumentSources to retrieve sources for that section.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
documentId | string | Yes | The document ID |
highlightedText | string | Yes | The raw text string of the user’s selection |
accessToken | string | Yes | Your organization access token |
baseUrl | string | Yes | The Artos API base URL |
apiClient | ApiClient | No | Pre-configured API client (advanced usage) |
Promise<GetSectionFromTextResponse>
getDocumentSections(options)
Retrieves all sections for a given document, returning each section’s ID, title, and display order. Useful for building navigation, table of contents, or populating section selectors.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
documentId | string | Yes | The unique identifier of the document |
accessToken | string | Yes | Your organization access token |
baseUrl | string | Yes | The Artos API base URL |
apiClient | ApiClient | No | Pre-configured API client (advanced usage) |
Promise<GetDocumentSectionsResponse>
generateProxyUrl(options)
Fetches a file by streaming it through the backend’s proxy endpoint. Takes a presigned S3 URL and streams the file content back, returning it as a Blob. Useful for displaying source documents in the browser without exposing S3 URLs directly.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
presignedUrl | string | Yes | A presigned S3 URL to stream through the proxy |
baseUrl | string | Yes | The Artos API base URL |
apiClient | ApiClient | No | Pre-configured API client (advanced usage) |
Promise<GenerateProxyUrlResponse>
getDocumentPresignedUrl(options)
Retrieves a presigned URL for downloading a generated document file. The backend locates the document in S3 (checking internal and output paths) and returns a time-limited presigned URL that can be used to fetch or display the file directly.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
documentId | string | Yes | The unique identifier of the document |
accessToken | string | Yes | Your organization access token |
baseUrl | string | Yes | The Artos API base URL |
apiClient | ApiClient | No | Pre-configured API client (advanced usage) |
Promise<GetDocumentPresignedUrlResponse>
getSectionRules(options)
Retrieves all rules for a given document MRT section, including resolved source chunks, tables, presigned URLs, template URLs, breadcrumbs, and rule metadata. This is the primary function for building rule-level detail panels, audit trails, and source traceability views in your UI.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
sectionId | string | Yes | The MRT section ID (from getDocumentSections) |
accessToken | string | Yes | Your organization access token |
baseUrl | string | Yes | The Artos API base URL |
apiClient | ApiClient | No | Pre-configured API client (advanced usage) |
Promise<GetSectionRulesResponse>
Rule Types
| Rule Type | Category | Description | Has templateUrl | Source Fields |
|---|---|---|---|---|
template_text | Template | Text generated from template instructions | Yes | sourceChunks |
template_table | Template | Table generated from template structure | Yes | sourceChunks, table |
copy_paste | Extraction | Direct excerpt from a source document | No | sourceChunk |
summarize_content | Extraction | Summarized content from a source | No | sourceChunk |
copy_paste_placeholder | Placeholder | Placeholder for future copy/paste | No | - |
template_text_rule | Template | Alias for template_text | Yes | sourceChunks |
template_table_rule | Template | Alias for template_table | Yes | sourceChunks, table |
templateUrl
A presigned S3 URL pointing to the original template file used during document generation. Only populated for template-related rules (template_text, template_table, and their _rule variants). The URL expires after 1 hour.
Use this to let users view or download the original template alongside the generated content, enabling side-by-side comparison of what the template instructed vs. what was produced.