Get/Export Document
Retrieves information about the requested document or exports it as an image.
Get Document: Requires at least read-only access. Document owner information is only returned if the requesting user has view access and the document is unpublished. If published, the user must be at least a collaborator.
Export Document: Exports a given document in a specified image format. When exporting oversized images, the resolution may be automatically scaled down to enable performant API requests.
Path parameters
ID of the document to be retrieved or exported.
Query parameters
1-based page index of the document to export. Defaults to the first page. Only a single page is allowed. Optional for export operation. Cannot be provided when pageId is provided.
Specific page of the document to export. Only a single page is allowed. Optional for export operation. Cannot be provided when page is provided.
Specifies the crop settings for the document export. Optional for export operation. Possible values are
- Default (no crop parameter) - Exports the entire page canvas area that contains your content. Automatically adjusts to include all items on the page, including the space between them and maintains the relative positioning and spacing of your document elements
- x, y, width, height - Crop to the specified region (in pixels) on the page. Example crop=1000,300,30,7
- Note: The region (in pixels) is accurate to the number of pixels on the canvas. The number of pixels of the outputted image will only match the crop window at a DPI of 160.
- content - Crop to page content. Example crop=content
Headers
When using the Export Document API, the format of the exported document is set via the Accept header. This header contains up to two parts, separated by a semicolon:
- A prefix stating which type of image you would like the document exported as. Options are:
- image/jpeg
- image/png
- Optionally, you can also supply the dots per inch (DPI) you want the exported image to have. If this value is not provided, a default of 160 will be used. For example:
- image/png;dpi=256
- image/jpeg;dpi=64
Response
OK with Document resource containing information about the requested document or the binary data in the response body for exports. The Accept header specifies the type of image for exports.
Example response
{
"documentId": "110808fd-4553-4316-bccf-4f25ff59a532",
"title": "document title",
"editUrl": "https://lucid.app/lucidchart/110808fd-4553-4316-bccf-4f25ff59a532/edit",
"viewUrl": "https://lucid.app/lucidchart/110808fd-4553-4316-bccf-4f25ff59a532/view",
"version": 101,
"pageCount": 5,
"canEdit": false,
"created": "2019-04-22T13:47:23Z",
"creatorId": 12345,
"lastModified": "2020-06-26T16:29:37Z",
"lastModifiedUserId": 54321,
"customAttributes": [],
"customTags": [
"in progress"
],
"product": "lucidchart",
"status": "Complete",
"classification": "Private",
"trashed": null,
"parent": null,
"repository": null,
"owner": {
"id": 123456,
"type": "user",
"name": "John Doe"
},
"accountId": 1234
}