Create Document
Creates a new document for the requesting user, with the specified title.
- Can create either a Lucidchart or Lucidspark document.
- The
titleandproductmust be provided as raw JSON data. - The
parentcan optionally be provided as raw JSON data. See Document Creation Location.
curl 'https://api.lucid.app/documents'\
--request 'POST'\
--header 'Authorization: Bearer <OAuth 2.0 Access Token>'\
--header 'Lucid-Api-Version: 1'\
--data '
{
"title": "Created Document",
"product": "lucidchart",
"parent": 1234
}'Copy Document
Copies one of the requesting user's existing documents, with the specified title.
- Include the documentId of the desired document to be copied as the
templateparameter. - The
titleandtemplatemust be provided as raw JSON data. - The
parentcan optionally be provided as raw JSON data. See Document Creation Location. - Note that a document's collaborator permissions are not copied.
curl 'https://api.lucid.co/documents'\
--request 'POST'\
--header 'Authorization: Bearer <OAuth 2.0 Access Token>'\
--header 'Lucid-Api-Version: 1'\
--data '
{
"title": "Copied Document",
"template": "110808fd-4553-4316-bccf-4f25ff59a532"
}'Import Document
Imports an external non-Lucid file as a new document within Lucid.
- Can import as either a Lucidchart or Lucidspark document.
- The
file,type, andproduct, must be provided within form-data, with the supported types listed in the below chart. - The
parentcan optionally be provided within form-data. See Document Creation Location. - The
titlecan optionally be provided within form-data. If notitleis provided, the new document's title will be the imported filename.
curl 'https://api.lucid.app/documents'\
--request 'POST'\
--header 'Authorization: Bearer <OAuth 2.0 Access Token>'\
--header 'Lucid-Api-Version: 1'\
--form 'file=@<location>/import.lucid;type=x-application/vnd.lucid.standardImport'\
--form 'product=lucidchart'\
--form 'title=Imported Document'\
--form 'parent=1234'Body Params for Import Document (form-data)
| Property | Type | Description |
|---|---|---|
| file | string (binary) | The file data as multipart/form-data. Generally, the application or client used to make the API request will handle reading in the file data and setting the multi-part boundaries. Required for Importing a document. |
| type | string | The type of file provided for import. Supported types are listed in the below chart . Required for Importing a document. |
| product | string | "lucidchart" or "lucidscale". Required for Importing a document. |
| title | string | Title that should be given to the newly imported document. Optionally used for Importing a document. |
| parent | number | ID of the folder to create the new document in. Optionally used for Importing a document. |
Valid Import Types
| Vendor | Extensions | Type | Product |
|---|---|---|---|
| standard (JSON) | .lucid | x-application/vnd.lucid.standardImport | Lucidchart/Lucidspark |
| draw.io | .drawio .xml | x-application/vnd.lucid.drawio | Lucidchart |
| visio | .vsdx .vdx | x-application/vnd.lucid.visio | Lucidchart |
| gliffy | .gliffy .gon .gxml | x-application/vnd.lucid.gliffy | Lucidchart |
| board | x-application/vnd.lucid.board | Lucidspark |
Standard ImportFor more information on how to use the Standard Import, refer to the extensive reference documentation here.
For examples of how to use the Standard Import, refer to the
/standard-importfolder in Lucid's repository of Sample Lucid REST Applications. This repo also contains some example.lucidZIP files you can reference or use in your own projects.
Board import
- The
boardimport type only accepts pdfs that are exports of digital whiteboards.- The
boardimport type can only be authorized by users with a Lucidspark Enterprise license.- The
boardimport type is experimental and importing the same board may produce varying results over time.
- These endpoints can only create a new Lucidchart or Lucidspark document. They cannot modify an existing document's contents.
##### Document Creation LocationWhen there is no
parentfield on the request, the new document will be created in a default location depending on the authorizing token's scopes.
- If the token authorizing the request uses one of the
document.appscopes, then the document will be created in anapp-specific folder.- If one of the
document.contentscopes is used, the document will be created in the user's 'My Documents folder'.- If both types of scopes are authorized on the token, the
document.contentbehavior will take priority and the document will be created in the user's 'My Documents' folder.
##### Bootstrap Data for Create/Copy DocumentBootstrap data can be attached to the created document to be consumed by a specific Extension Package . See Bootstrap Data for documents created via API for usage.
Valid Authentication Methods
API Key Grants:
- DocumentEdit
OAuth 2.0 User Token Scopes:
- lucidchart.document.content
- lucidchart.document.app.folder
- lucidspark.document.content
- lucidspark.document.app.folder