Skip to content

WebsitesDocumentsApi

Defined in: packages/sdk/src/resources/WebsitesDocumentsApi.ts:21

vc.websites.documents.* — admin-uploaded project documents. Upload flow is two-step:

  1. create() → returns presigned POST URL + fields.
  2. Submit the file directly to S3 as multipart/form-data.
  3. complete() to finalize the metadata row.

Downloads are presigned GETs with a short TTL — request one each time the user clicks download.

  • Resource

new WebsitesDocumentsApi(opts): WebsitesDocumentsApi

Defined in: packages/sdk/src/request.ts:93

VantageClientOptions

WebsitesDocumentsApi

Resource.constructor

complete(websiteId, documentId): Promise<{ document: ProjectDocument; }>

Defined in: packages/sdk/src/resources/WebsitesDocumentsApi.ts:35

Finalize an upload after the S3 PUT completes.

string

string

Promise<{ document: ProjectDocument; }>


create(websiteId, input): Promise<CreateDocumentResponse>

Defined in: packages/sdk/src/resources/WebsitesDocumentsApi.ts:27

Create a metadata slot + presigned upload URL.

string

CreateDocumentInput

Promise<CreateDocumentResponse>


delete(websiteId, documentId): Promise<void>

Defined in: packages/sdk/src/resources/WebsitesDocumentsApi.ts:74

Delete a document. Removes both the DDB row and S3 object.

string

string

Promise<void>


downloadUrl(websiteId, documentId, opts?): Promise<DocumentDownloadResponse>

Defined in: packages/sdk/src/resources/WebsitesDocumentsApi.ts:50

Mint a short-TTL presigned URL. Default disposition: "attachment" forces a download; pass "inline" to get a URL the browser will render in-tab (used by the in-app PDF/image viewer).

string

string

"inline" | "attachment"

Promise<DocumentDownloadResponse>


list(websiteId): Promise<{ documents: ProjectDocument[]; }>

Defined in: packages/sdk/src/resources/WebsitesDocumentsApi.ts:22

string

Promise<{ documents: ProjectDocument[]; }>


rename(websiteId, documentId, name): Promise<{ document: ProjectDocument; }>

Defined in: packages/sdk/src/resources/WebsitesDocumentsApi.ts:63

Rename a document (display name only).

string

string

string

Promise<{ document: ProjectDocument; }>