Skip to main content
Answer

Programmatic creation of shapes/connectors in Lucidchart via API

  • November 25, 2025
  • 2 replies
  • 21 views

Forum|alt.badge.img+2

Hi,

We’re building an automation using n8n where an AI agent generates a flowchart spec and then creates a Lucidchart diagram automatically.

We’re already successfully using the Documents API with an API key to call:
POST https://api.lucid.co/v1/documents
to create a new Lucid document.

What we’re missing is a supported API for editing document contents – specifically, creating shapes and connectors on a page programmatically.

Could you please clarify:

  1. Is there a supported, documented API (REST or otherwise) that allows us to:
    • Create shapes (e.g., rectangles)
    • Create connectors between shapes
    • Set text labels and basic style
      in a Lucidchart (or Lucidspark) document?
  2. If yes:
    • What is the endpoint URL and HTTP method?
    • What auth mechanism is required (API key vs OAuth 2.0), and which scopes or grants?
    • Could you provide the smallest working example request that, for our account,
      creates a single rectangle and a single connector in a document we own?
  3. If not available via REST, is the recommended approach to use the Lucid Extension SDK instead (e.g., an extension that runs in the editor and draws shapes based on data)?
    • If so, is there a best‑practice pattern for sending external data (like our AI‑generated diagram spec) into an extension so it can construct the diagram?

We’re currently getting a 401 when attempting to PATCH document content endpoints we’ve inferred, which suggests those endpoints aren’t available with our current key/plan.

Any pointers to the right product/API surface (Documents API vs Data API vs Extension SDK) and a concrete example call would be very helpful.

Yes, we are aware that Lucid has a ChatGPT AI option

Thanks!
Stephen

Best answer by StephenS

Found the answer Overview
Thanks

Comments

Forum|alt.badge.img+2
  • Author
  • Answer
  • November 25, 2025

Found the answer Overview
Thanks


Richard Udell
Forum|alt.badge.img+8
  • Lucid support team
  • November 25, 2025

Hi ​@StephenS , thank you for contributing to the Lucid developer community. I’m glad you found what you needed in our API guide. Please don’t hesitate reach out with any further questions, we’re here to help!