Skip to main content

Overview

The Velt Python SDK exposes two independent backends: Self-hosting backend (sdk.selfHosting.*) simplifies backend implementation by 90%. Instead of writing custom database queries and storage logic, you:
  1. Pass your DB and storage configs to the SDK
  2. Pass the raw request object directly to SDK methods
  3. Return the resulting response object straight to the client
REST API backend (sdk.api.*) — new in v0.1.9 — provides feature parity with the Velt Node SDK. 17 services, typed @dataclass request objects, and raw Velt API responses. No database or AWS configuration needed.

Installation

Requirements

  • Python 3.8+
  • Django 4.2.26+ (only if using the self-hosting backend)
  • MongoDB (Percona Server or MongoDB Atlas) for self-hosting
  • requests for REST API calls (installed automatically)

Quick Start

Initialize the SDK

Self-hosting initialization (MongoDB + optional AWS):
REST API-only initialization (no database needed — new in v0.1.9):
The database section is optional when using only sdk.api.*. Set VELT_API_KEY and VELT_AUTH_TOKEN environment variables as an alternative to passing credentials in the config dict.

Configuration

Environment Variables

The SDK reads the following environment variables automatically. These can be used instead of (or in addition to) config dict keys.

Self-Hosting Configuration

Configure MongoDB connection for storing comments, reactions, and user data.

Self-Hosting Backend

The SDK provides methods that accept the raw request from the frontend and return the properly formatted response.

Comments

getComments

Response

saveComments

Response

deleteComment

Response

Reactions

getReactions

Response

saveReactions

Response

deleteReaction

Response

Users

getUsers

Response

Attachments

saveAttachment

Response

deleteAttachment

Response

Token

getToken

  • Generates a Velt auth token for a user. Self-hosting variant.
  • Params: positional — organizationId, userId, email (optional), isAdmin (optional)
  • Returns: VeltSelfHostingResponse
Response
Note: getToken takes positional / keyword arguments — it does NOT accept a dataclass request object. Signature: getToken(organizationId, userId, email=None, isAdmin=False).

Framework Examples

SDK Initialization (velt_sdk.py)
API Endpoints (views.py)
Configuration (settings.py)

REST API Backend

Added in v0.1.9. The sdk.api.* namespace provides feature parity with the Velt Node SDK for REST. 17 services are available, each accepting typed @dataclass request objects and returning the raw Velt API response without local reshaping. No database or AWS configuration is required — only apiKey and authToken.
Every method returns a dict with either a result key (success) or an error key (failure). See VeltApiResponse.

Organizations

addOrganizations

Response

getOrganizations

Response

updateOrganizations

Response

deleteOrganizations

Response

updateOrganizationDisableState

Response

Folders

addFolder

Response

getFolders

Response

updateFolder

Response

deleteFolder

Response

updateFolderAccess

Response

Documents

addDocuments

Response

getDocuments

Response

updateDocuments

Response

deleteDocuments

Response

moveDocuments

Response

updateDocumentAccess

Response

updateDocumentDisableState

Response

migrateDocuments

Response
Note: This call is asynchronous. Poll status via migrateDocumentsStatus.

migrateDocumentsStatus

Response

Users

addUsers

Response

getUsers

Response

updateUsers

Response

deleteUsers

Response

User Groups

addUserGroups

Response

addUsersToGroup

Response

deleteUsersFromGroup

Response

Notifications

addNotifications

Response

getNotifications

Response

updateNotifications

Response

deleteNotifications

Response

getNotificationConfig

Response

setNotificationConfig

Response

Comment Annotations

addCommentAnnotations

Response

getCommentAnnotations

Response

getCommentAnnotationsCount

Response

updateCommentAnnotations

Response

deleteCommentAnnotations

Response

addComments

Response

getComments

Response

updateComments

Response

deleteComments

Response

Activities

addActivities

Response

getActivities

Response

updateActivities

Response

deleteActivities

Response

Access Control

addPermissions

Response

getPermissions

Response

removePermissions

Response

generateSignature

Response

generateToken

Response

CRDT

addCrdtData

Response

getCrdtData

Response

updateCrdtData

Response

Presence

addPresence

Response

updatePresence

Response

deletePresence

Response

Livestate

broadcastEvent

Response

Recordings

getRecordings

Response

Rewriter

askAi

  • Sends a model, prompt, and text to Velt’s AI rewriter and returns the transformed text.
  • Params: AskAiRequest
  • Returns: AskAiResponse
Response
Note: This call may take several seconds and has no client-side timeout. Wrap calls in your own timeout if needed.

GDPR

deleteAllUserData

Response
Note: This call is asynchronous and returns a jobId. Poll status via getDeleteUserDataStatus.

getAllUserData

Response

getDeleteUserDataStatus

Response

Workspace

createWorkspace

Response

getWorkspace

Response

createApiKey

Response

updateApiKey

Response

getApiKeys

Response

getApiKeyMetadata

Response

resetAuthToken

Response

getAuthTokens

Response

addDomains

Response

deleteDomains

Response

getDomains

Response

getEmailStatus

Response
Response

getEmailConfig

Response

updateEmailConfig

Response

getWebhookConfig

Response

updateWebhookConfig

Response

Token

getToken

  • Generates a Velt auth token for a user.
  • Params: positional — organizationId, userId, email (optional), isAdmin (optional)
  • Returns: VeltApiResponse
Response
Note: getToken takes positional / keyword arguments — it does NOT accept a dataclass request object. Signature: getToken(organizationId, userId, email=None, isAdmin=False).

Data Isolation

Every sdk.api.* method requires an organizationId in its request payload. Velt’s API enforces data isolation server-side — requests without a valid organizationId will be rejected.

Error Handling

The SDK raises typed exceptions for different failure modes. All exceptions extend VeltSDKError.
Import path: from velt_py.exceptions import VeltSDKError, VeltValidationError, VeltTokenError, VeltApiError Common self-hosting error codes returned in the response errorCode field:
  • INVALID_INPUT — Request data is malformed or missing required fields
  • INTERNAL_ERROR — Server-side error during processing
  • NOT_FOUND — Requested resource was not found

Resources