Skip to main content
Apr 17, 2026 3:18 PM UTC
Solved

Python SDK for Data Connector Actions (Collection API)

Hi Lucid team,

We're building a LucidChart extension with a data connector that currently runs on Azure Functions (Node.js/TypeScript). We're in the process of migrating our backend to Python (FastAPI) and have successfully moved most of our data connector actions — the HTTP contract (POST with action data + OAuth token) works great from any language.

However, we have one action that we can't migrate: it uses DataConnectorAsynchronousAction.client.update() method to write data into Lucid document Collections. This might only be available through the TypeScript lucid-extension-sdk, and we haven't found a Python equivalent.

Specifically, our action reads simulation result CSV files from Azure Blob Storage, transforms them, and pushes them into Lucid Collections so they can be visualized within the document. The client.update() call with collection schemas and serialized fields is the only way we've found to do this.

Questions:
  1. Is there a Python SDK (or REST API) for writing to Lucid Collections from a data connector?
  2. If not, is this on the roadmap?
  3. Is there documentation on the underlying HTTP protocol that client.update() uses, so we could potentially call it directly without the TypeScript SDK?

 

Any guidance would be appreciated. We'd love to fully consolidate our backend into a single Python service.

Thanks!

Dan

Kyler G
Kyler GAnswer
Lucid product team
Apr 30, 2026 3:24 PM UTC

Hi Dan,

Is there a Python SDK / REST API for writing to Collections?

There is no Python SDK today. But the HTTP endpoint that client.update() calls is public so you can call it directly with the following:

  - Method/URL: POST https://api.lucid.co/v1/data/dataSource/update (also served at /data/dataSource/update)


  - Headers:
    - Content-Type: application/json
    - Lucid-Api-Version: 1 
    - data-update-token: <token>


  - Body (camelCase): 
  {
    "name": "<dataSourceName>",
    "upstreamConfig": { ... },
    "sourceForeignKeys": [ ... ],
    "creationPermission": "<...>",
    "updateData": {
      "<collectionId>": { 
        "schema": {
          "fields": [ ... ],
          "primaryKey": [ ... ],
          "fieldLabelOverrides": { ... }
        },
        "itemsPatch": {
        "items": {
        "<primaryKey>": {
...serializedFields
}
},
          "itemsDeleted": [ ... ]
        },
        "properties": {
          "Represents": [ ... ],
          "Name": "...",
          "IsHiddenFromDataPanel": false
        }
      }
    }
  }


The field shapes should match what you're already constructing in TypeScript (SerializedFields, SchemaDefinition, etc.).

You can get the token from action requests Lucid sends to your data connector. The inbound POST body looks like:

  {
    "action": { "name": "MyAction", "data": ... },
    "packageId": "...",
    "userCredential": "...",
    "documentUpdateToken": "<-- THIS IS THE TOKEN>",
    "documentCollections": { ... },
    "userId": 123,
    "accountId": 456,
    "documentId": "..."
  }


In your Python handler, you can read the body["documentUpdateToken"] and forward it as the data-update-token header on the outbound POST /v1/data/dataSource/update.

The field is nullable — it's only present for actions targeting a document, not for things like webhook setup, so it may be empty on some requests.

Let me know if this helps or you still have questions.
Thanks,
Kyler

Comments

Michael B
Lucid product team
Apr 21, 2026 2:16 PM UTC

Hello quodsimDan,

We are reviewing your question now and will be in touch.

Translate
Kyler G
Kyler GAnswer
Lucid product team
Apr 30, 2026 3:24 PM UTC

Hi Dan,

Is there a Python SDK / REST API for writing to Collections?

There is no Python SDK today. But the HTTP endpoint that client.update() calls is public so you can call it directly with the following:

  - Method/URL: POST https://api.lucid.co/v1/data/dataSource/update (also served at /data/dataSource/update)


  - Headers:
    - Content-Type: application/json
    - Lucid-Api-Version: 1 
    - data-update-token: <token>


  - Body (camelCase): 
  {
    "name": "<dataSourceName>",
    "upstreamConfig": { ... },
    "sourceForeignKeys": [ ... ],
    "creationPermission": "<...>",
    "updateData": {
      "<collectionId>": { 
        "schema": {
          "fields": [ ... ],
          "primaryKey": [ ... ],
          "fieldLabelOverrides": { ... }
        },
        "itemsPatch": {
        "items": {
        "<primaryKey>": {
...serializedFields
}
},
          "itemsDeleted": [ ... ]
        },
        "properties": {
          "Represents": [ ... ],
          "Name": "...",
          "IsHiddenFromDataPanel": false
        }
      }
    }
  }


The field shapes should match what you're already constructing in TypeScript (SerializedFields, SchemaDefinition, etc.).

You can get the token from action requests Lucid sends to your data connector. The inbound POST body looks like:

  {
    "action": { "name": "MyAction", "data": ... },
    "packageId": "...",
    "userCredential": "...",
    "documentUpdateToken": "<-- THIS IS THE TOKEN>",
    "documentCollections": { ... },
    "userId": 123,
    "accountId": 456,
    "documentId": "..."
  }


In your Python handler, you can read the body["documentUpdateToken"] and forward it as the data-update-token header on the outbound POST /v1/data/dataSource/update.

The field is nullable — it's only present for actions targeting a document, not for things like webhook setup, so it may be empty on some requests.

Let me know if this helps or you still have questions.
Thanks,
Kyler

Translate
Apr 30, 2026 7:57 PM UTC

Thanks!  I will give this a shot.

Translate