Files

Get or create a preview

Returns a PDF preview of the current version of the specified file, creating it if it does not exist yet.

The 202 response has two shapes:

  • Preview already exists: 'downloadUrl' contains a presigned URL to the PDF preview and 'expiry' is its expiry time. The URL is valid for 1 day.
  • Preview does not exist yet: a conversion is requested and processed asynchronously; 'downloadUrl' and 'expiry' are null. Poll the 'Location' header (GetPreviewById) until it returns 200.

The preview is always generated as a PDF, regardless of the source file type. Previews are keyed by document version, so uploading a new version of the file produces a new preview.

post/matters/{matterId}/documents/files/{fileId}/preview

Path parameters

matterIdstring required

Unique identifier of the matter to which the file belongs.

fileIdstring required

Unique identifier of the file.

Response

When the request is accepted. Returns a 'PreviewFileInfo' object, with 'downloadUrl' and 'expiry' populated if the preview already exists and null if conversion is still pending.

fileIdstring nullable

Unique identifier of the requested file

documentVersionIdstring nullable

Unique identifier of the document version the preview was generated from. Pass this to GetPreviewById.

downloadUrlstring nullable

Temporary presigned URL to download the PDF preview. Valid for 1 day. Null when the preview has not been generated yet (conversion is pending); poll GetPreviewById until it is available.

expirystring date-time nullable

Expiry date/time (UTC) after which the download link is no longer accessible. Null when the preview has not been generated yet (conversion is pending).

Example response

{
  "fileId": "b471682e-fa17-4e46-b7fe-9b2b8fdcb3c2",
  "documentVersionId": "0f8fad5b-d9cb-469f-a165-70867728950e",
  "downloadUrl": "https://bucket.s3.amazonaws.com/previews/accounts/b471682e-fa17-4e46-b7fe-9b2b8fdcb3c2/documents/0f8fad5b-d9cb-469f-a165-70867728950e?X-Amz-Expires=86400&X-Amz-Signature=...",
  "expiry": "2022-04-23T14:30:00Z"
}

Changes

Changed in 1 of the 5 revisions of this API.1

    • added the optional property errors to the response with the 400 status

      response-optional-property-added