WebsitesDocumentsApi
Defined in: packages/sdk/src/resources/WebsitesDocumentsApi.ts:21
vc.websites.documents.* — admin-uploaded project documents.
Upload flow is two-step:
create()→ returns presigned POST URL + fields.- Submit the file directly to S3 as multipart/form-data.
complete()to finalize the metadata row.
Downloads are presigned GETs with a short TTL — request one each time the user clicks download.
Extends
Section titled “Extends”Resource
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new WebsitesDocumentsApi(
opts):WebsitesDocumentsApi
Defined in: packages/sdk/src/request.ts:93
Parameters
Section titled “Parameters”Returns
Section titled “Returns”WebsitesDocumentsApi
Inherited from
Section titled “Inherited from”Resource.constructor
Methods
Section titled “Methods”complete()
Section titled “complete()”complete(
websiteId,documentId):Promise<{document:ProjectDocument; }>
Defined in: packages/sdk/src/resources/WebsitesDocumentsApi.ts:35
Finalize an upload after the S3 PUT completes.
Parameters
Section titled “Parameters”websiteId
Section titled “websiteId”string
documentId
Section titled “documentId”string
Returns
Section titled “Returns”Promise<{ document: ProjectDocument; }>
create()
Section titled “create()”create(
websiteId,input):Promise<CreateDocumentResponse>
Defined in: packages/sdk/src/resources/WebsitesDocumentsApi.ts:27
Create a metadata slot + presigned upload URL.
Parameters
Section titled “Parameters”websiteId
Section titled “websiteId”string
CreateDocumentInput
Returns
Section titled “Returns”Promise<CreateDocumentResponse>
delete()
Section titled “delete()”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.
Parameters
Section titled “Parameters”websiteId
Section titled “websiteId”string
documentId
Section titled “documentId”string
Returns
Section titled “Returns”Promise<void>
downloadUrl()
Section titled “downloadUrl()”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).
Parameters
Section titled “Parameters”websiteId
Section titled “websiteId”string
documentId
Section titled “documentId”string
disposition?
Section titled “disposition?”"inline" | "attachment"
Returns
Section titled “Returns”Promise<DocumentDownloadResponse>
list()
Section titled “list()”list(
websiteId):Promise<{documents:ProjectDocument[]; }>
Defined in: packages/sdk/src/resources/WebsitesDocumentsApi.ts:22
Parameters
Section titled “Parameters”websiteId
Section titled “websiteId”string
Returns
Section titled “Returns”Promise<{ documents: ProjectDocument[]; }>
rename()
Section titled “rename()”rename(
websiteId,documentId,name):Promise<{document:ProjectDocument; }>
Defined in: packages/sdk/src/resources/WebsitesDocumentsApi.ts:63
Rename a document (display name only).
Parameters
Section titled “Parameters”websiteId
Section titled “websiteId”string
documentId
Section titled “documentId”string
string
Returns
Section titled “Returns”Promise<{ document: ProjectDocument; }>