Create/Copy/Import Document

Create Document

Creates a new document for the requesting user, with the specified title.

  • Can create either a Lucidchart or Lucidspark document.
  • The title and product must be provided as raw JSON data.
  • The parent can 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 template parameter.
  • The title and template must be provided as raw JSON data.
  • The parent can 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.app/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",
          "parent": 1234
        }'

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, and product, must be provided within form-data, with the supported types listed in the below chart.
  • The parent can optionally be provided within form-data. See Document Creation Location.
  • The title can optionally be provided within form-data. If no title is 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)

PropertyTypeDescription
filestring (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.
typestringThe type of file provided for import. Supported types are listed in the below chart . Required for Importing a document.
productstring"lucidchart" or "lucidscale". Required for Importing a document.
titlestringTitle that should be given to the newly imported document. Optionally used for Importing a document.
parentnumberID of the folder to create the new document in. Optionally used for Importing a document.

Valid Import Types

VendorExtensionsTypeProduct
standard (JSON).lucidx-application/vnd.lucid.standardImportLucidchart/Lucidspark
draw.io.drawio .xmlx-application/vnd.lucid.drawioLucidchart
visio.vsdx .vdxx-application/vnd.lucid.visioLucidchart
gliffy.gliffy .gon .gxmlx-application/vnd.lucid.gliffyLucidchart
board.pdfx-application/vnd.lucid.boardLucidspark

📘

Standard Import

For 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-import folder in Lucid's repository of Sample Lucid REST Applications. This repo also contains some example .lucid ZIP files you can reference or use in your own projects.

📘

Board import

  • The board import type only accepts pdfs that are exports of digital whiteboards.
  • The board import type can only be authorized by users with a Lucidspark Enterprise license.
  • The board import 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 Location

When there is no parent field 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.app scopes, then the document will be created in an app-specific folder.
  • If one of the document.content scopes 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.content behavior will take priority and the document will be created in the user's 'My Documents' folder.

📘

Bootstrap Data for Create/Copy Document

Bootstrap 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

Language
Credentials