Skip to main content
Solved

Python SDK for Data Connector Actions (Collection API)

  • April 17, 2026
  • 3 replies
  • 45 views

Forum|alt.badge.img+5

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

Best answer by Kyler G

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
Forum|alt.badge.img+4
  • Lucid product team
  • April 21, 2026

Hello quodsimDan,

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


Kyler G
Forum|alt.badge.img+3
  • Lucid product team
  • Answer
  • April 30, 2026

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


Forum|alt.badge.img+5
  • Author
  • April 30, 2026

Thanks!  I will give this a shot.