# null
Source: https://docs.velt.dev/CLAUDE
# Rewriter
Source: https://docs.velt.dev/ai-copilot/design/overview
Let AI suggest improvements to your website text
[Open in larger window](https://landing-page-demo-velt.vercel.app/?feature=rewriter)
# Setup
Source: https://docs.velt.dev/ai-copilot/design/setup
Import the `useVeltClient` React hook.
You can use this hook within your component to fetch the Velt client.
```js React theme={null}
let { client } = useVeltClient();
```
Create a `useEffect` hook with the client as dependency.
```js React theme={null}
useEffect(() => {
//code to enable Rewriter
}, [client]);
```
`Rewriter` is not enabled by default.
Within the `useEffect` hook, call `client.getRewriterElement()` and then `enableRewriter()` on the returned object to enable `Rewriter`.
Now when a user highlights text on your website, the `Rewriter` tool will pop up.
```js React theme={null}
const rewriterElement = client.getRewriterElement();
rewriterElement.enableRewriter();
rewriterElement.disableRewriter(); //to disable
```
Test out `Rewriter` by highlighting some text.
`Rewriter` is not enabled by default.
Call `Velt.getRewriterElement()` and then `enableRewriter()` on the returned object to enable `Rewriter`.
Now when a user highlights text on your website, the `Rewriter` tool will pop up.
```js theme={null}
if (Velt) {
const rewriterElement = Velt.getRewriterElement();
rewriterElement.enableRewriter();
rewriterElement.disableRewriter(); //to disable
}
```
Test out `Rewriter` by highlighting some text.
```js React / Next.js theme={null}
import { useEffect } from "react";
import { useVeltClient } from "@veltdev/react";
export default function App() {
let { client } = useVeltClient();
useEffect(() => {
if (client) {
//Enable Rewriter
const rewriterElement = client.getRewriterElement();
rewriterElement.enableRewriter();
rewriterElement.disableRewriter(); //to disable
}
}, [client]);
return (
// your app template
);
}
```
```html HTML theme={null}
Collaboration App
```
# Generate Token
Source: https://docs.velt.dev/api-reference/rest-apis/v1/auth/generate-token
POST https://api.velt.dev/v1/auth/token/get
Use this API to generate a JWT token used by your client to authenticate with Velt. The token encodes user information and optional properties such as organization and admin status.
* JWT token expires in 48 hours.
* For v1, `apiKey` and `authToken` are provided in the request body (not headers).
# Endpoint
`POST https://api.velt.dev/v1/auth/token/get`
# Headers
application/json
# Body
#### Params
Your Velt API Key.
Your Auth Token from the Velt console. See Auth Tokens.
Unique identifier for the user.
Organization ID. Should match the `organizationId` used in the `identify` call.
Whether the user has admin privileges. This is the only supported way to set a user as admin. Do not set this in the `identify` call.
User email. If provided, it is validated against the email used in the `identify` call.
## **Example Requests**
#### Generate token with organization and admin
```JSON theme={null}
{
"data": {
"apiKey": "YOUR_API_KEY",
"authToken": "YOUR_AUTH_TOKEN",
"userId": "yourUserId",
"userProperties": {
"isAdmin": true,
"organizationId": "YOUR_ORGANIZATION_ID",
"email": "user@example.com"
}
}
}
```
#### Minimal token request
```JSON theme={null}
{
"data": {
"apiKey": "YOUR_API_KEY",
"authToken": "YOUR_AUTH_TOKEN",
"userId": "yourUserId",
"userProperties": {
"organizationId": "YOUR_ORGANIZATION_ID"
}
}
}
```
# Response
Generate the JWT token on your server, not your client, to keep your secrets secure.
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Token generated successfully.",
"data": {
"token": "YOUR_JWT_TOKEN"
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "Auth token not found.",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Token generated successfully.",
"data": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
}
}
```
# Add Comment Annotations
Source: https://docs.velt.dev/api-reference/rest-apis/v1/comments-feature/comment-annotations/add-comment-annotations
POST https://api.velt.dev/v1/commentannotations/add
Use this API to add comment annotations to a document within an organization.
* You can add comments on an elemement, text or page.
* You can provide HTML or text content.
* Additional filters can be applied using location IDs.
# Endpoint
`POST https://api.velt.dev/v1/commentannotations/add`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Document ID
Custom Annotation ID. If not provided, Velt will generate a unique ID for the annotation.
Location ID
Location Name
Target Element
Element DOM Id
Target Text. Provide this if you want to add comment annotation on the provided text content.
Occurrence. Provide this if you want to add comment annotation on a text content.
Select All Content. Provide this if you want to select and add comment annotation on the entire text content of the target elementId.
Array of Comment Data
Custom Comment ID. If not provided, Velt will generate a unique ID for the comment.
Comment content in plain text string
Comment content in HTML string
Use this for self-hosting comments data. Set this as true if you are comments resolver data provider in the SDK.
Use this for self-hosting comments data. Set this as true if this comment will have text content. Sometimes, comments might only have attachments and in that case, set this as false.
User object from whom the comment is added
Created At timestamp (in milliseconds since epoch).
Last Updated timestamp (in milliseconds since epoch).
Array of tagged user contacts
Display text of the tagged user (e.g. "@Username")
User ID of the tagged user
Email of the tagged user
Name of the tagged user
User ID of the tagged user
Status
Status ID
Status Name
Type.
Text and comment pin color
Background color on the status indicator
Raw SVG of the icon. Either `svg` or `iconUrl` is required.
Icon URL. Either `svg` or `iconUrl` is required.
User object to whom the comment is assigned
Custom key/value metadata object
Created At timestamp (in milliseconds since epoch).
Last Updated timestamp (in milliseconds since epoch).
Priority
Priority ID
Priority Color
Priority Name
Priority Light Color
## **Example Requests**
#### Add comment annotation by organizationId, documentId and location
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"commentAnnotations": [
{
"location": {
"id": "yourLocationId",
"locationName": "yourLocationName"
},
"targetElement": {
"elementId": "yourElementId",
"targetText": "Your Target Text",
"occurrence": 1,
"selectAllContent": false
},
"commentData": [
{
"commentText": "Sample Comment",
"commentHtml": "
Sample Comment
",
"from": {
"userId": "yourUserId",
"name": "yourUserName",
"email": "yourUserEmail",
}
}
]
}
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Comment Annotation(s) added successfully.",
"data": {
"-O0mpUziLcBwzREvZKs6": {
"success": true,
"annotationId": "-O0mpUziLcBwzREvZKs6",
"commentIds": [
126535
],
"message": "Added Successfully"
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Comment Annotation(s) added successfully.",
"data": {
"-O0mpUziLcBwzREvZKs6": {
"success": true,
"annotationId": "-O0mpUziLcBwzREvZKs6",
"commentIds": [
126535
],
"message": "Added Successfully"
}
}
}
}
```
# Delete Comment Annotations
Source: https://docs.velt.dev/api-reference/rest-apis/v1/comments-feature/comment-annotations/delete-comment-annotations
POST https://api.velt.dev/v1/commentannotations/delete
Use this API to delete comment annotations from a document within an organization.
Additional filters can be applied using location IDs, annotation IDs, or user IDs.
# Endpoint
`POST https://api.velt.dev/v1/commentannotations/delete`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Document ID
Array of Location IDs
Array of Annotation IDs
Array of User IDs
## **Example Requests**
#### 1. Delete annotations by organizationId and documentId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId"
}
}
```
#### 2. Delete annotations by organizationId, documentId and locationIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"locationIds": [
"locationx"
]
}
}
```
#### 3. Delete annotations by organizationId, documentId, locationIds and userIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"locationIds": [
"locationx"
],
"userIds": [
"yourUserId"
]
}
}
```
#### 4. Delete annotations by organizationId, documentId and userIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"userIds": [
"yourUserId"
]
}
}
```
#### 5. Delete annotations by organizationId, documentId and annotationIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"annotationIds": [
"yourAnnotationId1",
"yourAnnotationId2"
]
}
}
```
#### 6. Delete annotations by organizationId, documentId, locationIds and annotationIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"locationIds": [
"locationx"
],
"annotationIds": [
"yourAnnotationId1",
"yourAnnotationId2"
]
}
}
```
#### 7. Delete annotations by documentId. This will work if the document was created without an organization.
```JSON theme={null}
{
"data": {
"documentId": "yourDocumentId"
}
}
```
#### 8. Delete annotations by documentId and locationIds. This will work if the document was created without an organization.
```JSON theme={null}
{
"data": {
"documentId": "yourDocumentId",
"locationIds": [
"locationx"
]
}
}
```
#### 9. Delete annotations by documentId and userIds. This will work if the document was created without an organization.
```JSON theme={null}
{
"data": {
"documentId": "yourDocumentId",
"userIds": [
"yourUserId"
]
}
}
```
#### 10. Delete annotations by documentId and annotationIds. This will work if the document was created without an organization.
```JSON theme={null}
{
"data": {
"documentId": "yourDocumentId",
"annotationIds": [
"yourAnnotationId1",
"yourAnnotationId2"
]
}
}
```
#### 11. Delete annotations by documentId, locationIds, and userIds. This will work if the document was created without an organization.
```JSON theme={null}
{
"data": {
"documentId": "yourDocumentId",
"locationIds": [
"locationx"
],
"userIds": [
"yourUserId"
]
}
}
```
#### 12. Delete annotations by documentId, locationIds, and annotationIds. This will work if the document was created without an organization.
```JSON theme={null}
{
"data": {
"documentId": "yourDocumentId",
"locationIds": [
"locationx"
],
"annotationIds": [
"yourAnnotationId1",
"yourAnnotationId2"
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Annotations deleted successfully.",
"data": {
"yourAnnotationId1": {
"success": true,
"id": "yourAnnotationId",
"message": "Deleted Successfully"
},
"yourAnnotationId2": {
"success": false,
"id": "yourAnnotationId2",
"message": "Annotation not found."
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Annotations deleted successfully.",
"data": {
"yourAnnotationId": {
"success": true,
"id": "yourAnnotationId",
"message": "Deleted Successfully"
}
}
}
}
```
# Get Comment Annotations
Source: https://docs.velt.dev/api-reference/rest-apis/v1/comments-feature/comment-annotations/get-comment-annotations
POST https://api.velt.dev/v1/commentannotations/get
Use this API to retrieve comment annotations from a document within an organization.
Additional filters can be applied using location IDs, annotation IDs, or user IDs.
Use this for SDK v3 or prior versions.
# Endpoint
`POST https://api.velt.dev/v1/commentannotations/get`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Document ID
Array of Location IDs. Limit: Only 30 IDs can be passed at a time.
Array of Annotation IDs. Limit: Only 30 IDs can be passed at a time.
Array of User IDs. Limit: Only 30 IDs can be passed at a time.
## **Example Requests**
#### 1. Get annotations by organizationId and documentId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
}
}
```
#### 2. Get annotations by organizationId, documentId, and locationIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"locationIds": [
"locationx"
],
}
}
```
#### 3. Get annotations by organizationId, documentId, locationIds, and userIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"locationIds": [
"locationx"
],
"userIds": [
"yourUserId"
],
}
}
```
#### 4. Get annotations by organizationId, documentId, and userIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"userIds": [
"yourUserId"
],
}
}
```
#### 5. Get annotations by organizationId, documentId, and annotationIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"annotationIds": [
"yourAnnotationId1",
"yourAnnotationId2"
],
}
}
```
#### 6. Get annotations by organizationId, documentId, locationIds, and annotationIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"locationIds": [
"locationx"
],
"annotationIds": [
"yourAnnotationId1",
"yourAnnotationId2"
],
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Annotations fetched successfully.",
"data": [
{
"annotationId": "yourAnnotationId",
"comments": [
{
"commentId": 123456,
"commentText": "This is a sample comment text.",
"commentHtml": "
",
"from": {
"userId": "user123",
"name": "John Doe",
"email": "john.doe@example.com"
},
"lastUpdated": "2023-06-15T10:30:00Z",
"type": "text",
}
],
"from": {
"userId": "user123",
"name": "John Doe",
"email": "john.doe@example.com"
},
"color": "#00FF00",
"createdAt": "2023-06-15T10:30:00Z",
"lastUpdated": "2023-06-15T10:30:00Z",
"status": {
"id": "OPEN",
"name": "Open",
"color": "#0000FF",
"type": "default"
}
},
null // null is returned only if you provided an annotationId that doesn't exist
]
}
}
```
# Get Comment Annotations Count
Source: https://docs.velt.dev/api-reference/rest-apis/v1/comments-feature/comment-annotations/get-comment-annotations-count
POST https://api.velt.dev/v1/commentannotations/count/get
Use this API to retrieve the count of comment annotations for specified documents, including both total and unread counts.
Prior to using this API, you must:
* Enable advanced queries option in [the console](https://console.velt.dev/dashboard/config/appconfig)
* Deploy v4 series of the Velt SDK.
# Endpoint
`POST https://api.velt.dev/v1/commentannotations/count/get`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Array of document IDs to get comment annotation counts for. Limit: Only 30 IDs can be passed at a time.
ID of the user requesting the counts
Array of status IDs to filter comments by (e.g., "OPEN", "IN\_PROGRESS")
#### **Example Request**
```JSON theme={null}
{
"data": {
"organizationId": "ORG_ID",
"documentIds": ["DOC_1", "DOC_2"],
"userId": "1.1",
"statusIds": ["OPEN", "IN_PROGRESS"]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Comment count retrieved successfully.",
"data": {
"DOC_1": {
"total": 4,
"unread": 2
},
"DOC_2": {
"total": 2,
"unread": 0
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Comment count retrieved successfully.",
"data": {
"DOC_1": {
"total": 4,
"unread": 2
},
"DOC_2": {
"total": 2,
"unread": 0
}
}
}
}
```
# Update Comment Annotations
Source: https://docs.velt.dev/api-reference/rest-apis/v1/comments-feature/comment-annotations/update-comment-annotations
POST https://api.velt.dev/v1/commentannotations/update
Use this API to update comment annotations in a document within an organization.
Additional filters can be applied using location IDs, annotation IDs, or user IDs.
# Endpoint
`POST https://api.velt.dev/v1/commentannotations/update`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Document ID
Array of Location IDs
Array of User IDs. These are the users who created the comment annotation.
Array of Annotation IDs
Location ID
Location Name
Target Element
Element DOM Id
Target Text. Provide this if you want to add comment annotation on the provided text content.
Occurrence. Provide this if you want to add comment annotation on a text content.
Select All Content. Provide this if you want to select and add comment annotation on the entire text content of the target elementId.
User object from whom the Comment Annotation is added
Status
Status ID
Status Name
Type.
Text and comment pin color
Background color on the status indicator
Raw SVG of the icon.
Icon URL.
User object to whom the comment is assigned
Custom key/value metadata object
Priority
Priority ID
Priority Name
Priority Color
Priority Light Color
Old user's ID
Old user's name
Old user's email
New user's ID
New user's name
New user's email
## **Example Requests**
#### 1. Update all comment annotations by organizationId and documentId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"updatedData" : {
"status": {
"type": "ongoing"
}
}
}
}
```
#### 2. Update comment annotations by organizationId, documentId and locationIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"locationIds": [
"locationx"
],
"updatedData" : {
"status": {
"type": "ongoing"
}
}
}
}
```
#### 3. Update annotations by organizationId, documentId, locationIds and userIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"locationIds": [
"locationx"
],
"userIds": [
"yourUserId"
],
"updatedData" : {
"status": {
"type": "ongoing"
}
}
}
}
```
#### 4. Update comment annotations by organizationId, documentId and userIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"userIds": [
"yourUserId"
],
"updatedData" : {
"status": {
"type": "ongoing"
}
}
}
}
```
#### 5. Update comment annotations by organizationId, documentId and annotationIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"annotationIds": [
"yourAnnotationId1",
"yourAnnotationId2"
],
"updatedData" : {
"status": {
"type": "ongoing"
}
}
}
}
```
#### 6. Update comment annotations by organizationId, documentId, locationIds and annotationIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"locationIds": [
"locationx"
],
"annotationIds": [
"yourAnnotationId1",
"yourAnnotationId2"
],
"updatedData" : {
"status": {
"type": "ongoing"
}
}
}
}
```
#### 7. Update Users in existing comment annotations
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"annotationIds": [
"yourAnnotationId1",
"yourAnnotationId2"
],
"updateUsers" : [
{
"oldUser": {
"userId": "oldUserId",
},
"newUser": {
"userId": "newUserId",
"name": "newUserName",
"email": "newUserEmail"
}
}
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Annotations updated successfully.",
"data": {
"yourAnnotationId1": {
"success": true,
"id": "yourAnnotationId1",
"message": "Annotations updated successfully"
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Annotations updated successfully.",
"data": {
"yourAnnotationId1": {
"success": true,
"id": "yourAnnotationId1",
"message": "Annotations updated successfully"
}
}
}
}
```
# Add Comments
Source: https://docs.velt.dev/api-reference/rest-apis/v1/comments-feature/comments/add-comments
POST https://api.velt.dev/v1/commentannotations/comments/add
Use this API to add comments within a specific CommentAnnotation.
# Endpoint
`POST https://api.velt.dev/v1/commentannotations/comments/add`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Document ID
Comment Annotation ID
Array of Comment Data
Custom Comment ID. If not provided, Velt will generate a unique ID for the comment.
Comment content in plain text string
Comment content in HTML string
Use this for self-hosting comments data. Set this as true if you are comments resolver data provider in the SDK.
Use this for self-hosting comments data. Set this as true if this comment will have text content. Sometimes, comments might only have attachments and in that case, set this as false.
User object from whom the comment is added
Created At timestamp (in milliseconds since epoch).
Last Updated timestamp (in milliseconds since epoch).
Array of tagged user contacts
Display text of the tagged user (e.g. "@Username")
User ID of the tagged user
Email of the tagged user
Name of the tagged user
User ID of the tagged user
## **Example Requests**
#### 1. Add comment in a CommentAnnotation by organizationId, documentId, and annotationId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"annotationId": "yourAnnotationId",
"commentData": [
{
"commentText": "Sample Comment",
"commentHtml": "
Hello
",
"from": {
"userId": "yourUserId"
}
}
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Comment(s) added successfully.",
"data": [
778115
]
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Comment(s) added successfully.",
"data": [
778115
]
}
}
```
# Delete Comments
Source: https://docs.velt.dev/api-reference/rest-apis/v1/comments-feature/comments/delete-comments
POST https://api.velt.dev/v1/commentannotations/comments/delete
Use this API to delete comments within a specific CommentAnnotation.
Additional filters can be applied using comment IDs.
# Endpoint
`POST https://api.velt.dev/v1/commentannotations/comments/delete`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Document ID
Comment Annotation ID
Array of Comment IDs
## **Example Requests**
#### 1. Delete all comments of a CommentAnnotation by organizationId, documentId, and annotationId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"annotationId": "yourAnnotationId"
}
}
```
#### 2. Delete specific comments of a CommentAnnotation by organizationId, documentId, annotationId and commentIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"annotationId": "yourAnnotationId",
"commentIds": [
153783,
607395
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Comments(s) deleted successfully.",
"data": {
"153783": {
"success": true,
"id": 153783,
"message": "Deleted successfully"
},
"607395": {
"success": false,
"id": 607395,
"message": "Not found"
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Comments(s) deleted successfully.",
"data": {
"153783": {
"success": true,
"id": 153783,
"message": "Deleted successfully"
}
}
}
}
```
# Get Comments
Source: https://docs.velt.dev/api-reference/rest-apis/v1/comments-feature/comments/get-comments
POST https://api.velt.dev/v1/commentannotations/comments/get
Use this API to retrieve comments in a specific CommentAnnotation.
Additional filters can be applied using comment IDs.
Prior to using this API, you must:
* Enable advanced queries option in [the console](https://console.velt.dev/dashboard/config/appconfig)
* Deploy v4 series of the Velt SDK.
# Endpoint
`POST https://api.velt.dev/v1/commentannotations/comments/get`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Document ID
Comment Annotation ID
User IDs
Array of Comment IDs
## **Example Requests**
#### 1. Get all comments with a CommentAnnotation by organizationId, documentId, and annotationId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"annotationId": "yourAnnotationId"
}
}
```
#### 2. Get specific comments of a CommentAnnotation by organizationId, documentId, annotationId and commentIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"annotationId": "yourAnnotationId",
"commentIds": [
153783,
607395
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Comments(s) retrieved successfully.",
"data": [
{
"commentHtml": "
",
"commentId": 153783,
"commentText": "Sample Comment Text",
"from": {
"email": "user@example.com",
"name": "User Name",
"userId": "yourUserId"
},
"lastUpdated": "2024-06-20T09:53:42.258Z",
"status": "added",
"type": "text"
}
]
}
}
```
# Update Comments
Source: https://docs.velt.dev/api-reference/rest-apis/v1/comments-feature/comments/update-comments
POST https://api.velt.dev/v1/commentannotations/comments/update
Use this API to update comments within a specific CommentAnnotation.
# Endpoint
`POST https://api.velt.dev/v1/commentannotations/comments/update`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Document ID
Comment Annotation ID
Comment IDs
Comment data
Comment content in plain text string
Comment content in HTML string
Use this for self-hosting comments data. Set this as true if you are comments resolver data provider in the SDK.
Use this for self-hosting comments data. Set this as true if this comment will have text content. Sometimes, comments might only have attachments and in that case, set this as false.
User object from whom the comment is added
Array of tagged user contacts
Display text of the tagged user (e.g. "@Username")
User ID of the tagged user
Email of the tagged user
Name of the tagged user
User ID of the tagged user
## **Example Requests**
#### Update comment in a CommentAnnotation by organizationId, documentId, annotationId and commentId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"annotationId": "yourAnnotationId",
"commentIds": [
153783,
607395
],
"updatedData": {
"commentText": "Sample Updated Comment",
"commentHtml": "
Hello Updated
"
}
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Comment updated successfully.",
"data": {
"607395": {
"success": true,
"id": 607395,
"message": "Updated successfully"
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Comment updated successfully.",
"data": {
"607395": {
"success": true,
"id": 607395,
"message": "Updated successfully"
}
}
}
}
```
# Add Documents
Source: https://docs.velt.dev/api-reference/rest-apis/v1/documents/add-documents
POST https://api.velt.dev/v1/organizations/documents/add
Use this API to add documents with metadata to an organization.
# Endpoint
`POST https://api.velt.dev/v1/organizations/documents/add`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Array of Document objects
Folder ID to add the documents to.
## **Example Requests**
#### 1. Create new documents
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documents": [
{
"documentId": "yourDocumentId",
"documentName": "Your Document Name"
}
]
}
}
```
#### 2. Create new documents in a specific folder
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documents": [
{
"documentId": "yourDocumentId",
"documentName": "Your Document Name"
}
],
"folderId": "yourFolderId"
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Document(s) added successfully.",
"data": {
"yourDocumentId": {
"success": true,
"id": "8121657101517513",
"message": "Added Successfully"
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Document(s) added successfully.",
"data": {
"yourDocumentId": {
"success": true,
"id": "8121657101517513",
"message": "Added Successfully"
}
}
}
}
```
# Delete Documents
Source: https://docs.velt.dev/api-reference/rest-apis/v1/documents/delete-documents
POST https://api.velt.dev/v1/organizations/documents/delete
Use this API to delete specific documents from an organization.
# Endpoint
`POST https://api.velt.dev/v1/organizations/documents/delete`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Array of Document IDs
## **Example Requests**
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentIds": ["yourDocumentId1", "yourDocumentId2"]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Document(s) deleted successfully.",
"data": {
"yourDocumentId1": {
"success": true,
"id": "6737987049068973",
"message": "Deleted Successfully"
},
"yourDocumentId2": {
"success": true,
"id": "2131443384150904",
"message": "Document does not exist"
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Document(s) deleted successfully.",
"data": {
"yourDocumentId1": {
"success": true,
"id": "6737987049068973",
"message": "Deleted Successfully"
}
}
}
}
```
# Get Documents
Source: https://docs.velt.dev/api-reference/rest-apis/v1/documents/get-documents
POST https://api.velt.dev/v1/organizations/documents/get
Use this API to retrieve specific documents or all documents from an organization.
Use this for SDK v3 or prior versions.
# Endpoint
`POST https://api.velt.dev/v1/organizations/documents/get`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Array of Document IDs. Limit: Only 30 IDs can be passed at a time.
## **Example Requests**
#### 1. Get all documents from organization
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
}
}
```
#### 2. Get specific documents from organization
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentIds": ["yourDocumentId1", "yourDocumentId2"],
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Document(s) retrieved successfully.",
"data": [
{
"documentName": "yourDocumentName",
"disabled": false,
"accessType": "public",
"id": "yourDocumentId",
}
]
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Document(s) retrieved successfully.",
"data": [
{
"documentName": "yourDocumentName",
"disabled": false,
"accessType": "public",
"id": "yourDocumentId",
}
]
}
}
```
# Move Documents
Source: https://docs.velt.dev/api-reference/rest-apis/v1/documents/move-documents
POST https://api.velt.dev/v1/organizations/documents/move
Use this API to move documents to a different folder within an organization.
# Endpoint
`POST https://api.velt.dev/v1/organizations/documents/move`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Array of Document IDs. Limit: Only 30 IDs can be passed at a time.
ID of the folder where documents will be moved
## **Example Requests**
#### Move documents to a folder
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentIds": ["yourDocumentId1", "yourDocumentId2"],
"folderId": "targetFolderId"
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Documents moved successfully."
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Documents moved successfully."
}
}
```
# Update Access for Documents
Source: https://docs.velt.dev/api-reference/rest-apis/v1/documents/update-document-access
POST https://api.velt.dev/v1/organizations/documents/access/update
Use this API to update the access type for a single or multiple documents at once.
You can update the default access type for all the documents associated with your API Key in [console](https://console.velt.dev/dashboard/config/appconfig).
# Endpoint
`https://api.velt.dev/v1/organizations/documents/access/update`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Array of Document IDs
Access type for the documents. Allowed values: `organizationPrivate`, `restricted`, `public`.
[Learn more](/key-concepts/overview#access-control).
## **Example Requests**
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentIds": ["yourDocumentId1, yourDocumentId2"],
"accessType": "organizationPrivate"
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Updated access for documents successfully.",
"data": {
"yourDocumentId": {
"success": true,
"accessType": "organizationPrivate",
"message": "Document access type updated."
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Updated access for documents successfully.",
"data": {
"yourDocumentId": {
"success": true,
"accessType": "organizationPrivate",
"message": "Document access type updated."
}
}
}
}
```
# Update Disabled State for Documents
Source: https://docs.velt.dev/api-reference/rest-apis/v1/documents/update-document-disable-state
POST https://api.velt.dev/v1/organizations/documents/access/disablestate/update
Use this API to enable or disable both read and write access for all users.
Let's say your customer's trial or subscription has ended and you want to disable their access to the Velt data, you could use this to diable access to specific documents.
# Endpoint
`https://api.velt.dev/v1/organizations/documents/access/disablestate/update`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Array of Document IDs
Whether to disable read and write access to the specified documents. Allowed values: `true`, `false`
## **Example Requests**
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentIds": ["yourDocumentId"],
"disabled": true
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Updated disable state for documents successfully.",
"data": {
"yourDocumentId": {
"success": true,
"disabled": true,
"message": "Document disabled state updated."
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Updated disable state for documents successfully.",
"data": {
"yourDocumentId": {
"success": true,
"disabled": true,
"message": "Document disabled state updated."
}
}
}
}
```
# Update Documents
Source: https://docs.velt.dev/api-reference/rest-apis/v1/documents/update-documents
POST https://api.velt.dev/v1/organizations/documents/update
Use this API to update metadata of documents within an organization.
# Endpoint
`POST https://api.velt.dev/v1/organizations/documents/update`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Array of Document objects
## **Example Requests**
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documents": [
{
"documentId": "yourDocumentId",
"documentName": "Your Document Name"
}
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Document(s) updated successfully.",
"data": {
"yourDocumentId": {
"success": true,
"id": "8121657101517513",
"message": "Updated Successfully"
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Document(s) updated successfully.",
"data": {
"yourDocumentId": {
"success": true,
"id": "8121657101517513",
"message": "Updated Successfully"
}
}
}
}
```
# Add Folder
Source: https://docs.velt.dev/api-reference/rest-apis/v1/folders/add-folder
POST https://api.velt.dev/v1/organizations/folders/add
Use this API to create a new folder in an organization.
Prior to using this API, you must:
* Enable advanced queries option in [the console](https://console.velt.dev/dashboard/config/appconfig)
* Deploy v4 series of the Velt SDK.
# Endpoint
`POST https://api.velt.dev/v1/organizations/folders/add`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Unique identifier for the new folder
Name of the folder
ID of the parent folder
## **Example Requests**
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"folders": [
{
"folderId": "yourFolderId",
"folderName": "yourFolderName",
"parentFolderId": "yourParentFolderId"
}
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Folder created successfully.",
"data": {
"yourFolderId": {
"success": true,
"id": "yourFolderId",
"message": "Folder added."
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Folder created successfully.",
"data": {
"yourFolderId": {
"success": true,
"id": "yourFolderId",
"message": "Folder added."
}
}
}
}
```
# Get Folders
Source: https://docs.velt.dev/api-reference/rest-apis/v1/folders/get-folders
POST https://api.velt.dev/v1/organizations/folders/get
Use this API to retrieve the given folder's metadata and its subfolders.
Prior to using this API, you must:
* Enable advanced queries option in [the console](https://console.velt.dev/dashboard/config/appconfig)
* Deploy v4 series of the Velt SDK.
# Endpoint
`POST https://api.velt.dev/v1/organizations/folders/get`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Folder ID to retrieve a specific folder and its subfolders. If not provided, all folders in the organization will be retrieved.
## **Example Requests**
#### 1. Get all folders in organization
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId"
}
}
```
#### 2. Get specific folder in an organization
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"folderId": "yourFolderId"
}
}
```
# Response
#### Success Response for All Folders
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Folders retrieved successfully.",
"data": [
{
"folderId": "folderId1",
"folderName": "Folder 1",
"organizationId": "yourOrganizationId",
"parentFolderId": "root",
"createdAt": 1738695615706,
"lastUpdated": 1738696287859
},
{
"folderId": "folderId2",
"folderName": "Folder 2",
"organizationId": "yourOrganizationId",
"parentFolderId": "root",
"createdAt": 1738695077691,
"lastUpdated": 1738695077691
}
]
}
}
```
#### Success Response for Specific Folder
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Folders retrieved successfully.",
"data": [
{
"folderId": "folderId1",
"folderName": "Folder 1",
"organizationId": "yourOrganizationId",
"parentFolderId": "root",
"createdAt": 1738695077691,
"lastUpdated": 1738695077691,
"subFolders": [
{
"folderId": "childFolderId1",
"folderName": "Child Folder 1",
"organizationId": "yourOrganizationId",
"parentFolderId": "folderId1",
"createdAt": 1738695615706,
"lastUpdated": 1738698727591
}
]
}
]
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Folders retrieved successfully.",
"data": [
{
"folderId": "folderId1",
"folderName": "Folder 1",
"organizationId": "yourOrganizationId",
"parentFolderId": "root",
"createdAt": 1738695077691,
"lastUpdated": 1738695077691,
"subFolders": [
{
"folderId": "childFolderId1",
"folderName": "Child Folder 1",
"organizationId": "yourOrganizationId",
"parentFolderId": "folderId1",
"createdAt": 1738695615706,
"lastUpdated": 1738698727591
}
]
}
]
}
}
```
# Update Folder
Source: https://docs.velt.dev/api-reference/rest-apis/v1/folders/update-folder
POST https://api.velt.dev/v1/organizations/folders/update
Use this API to:
1. update metadata of a folder within an organization.
2. move a folder and its contents to a different parent folder.
Prior to using this API, you must:
* Enable advanced queries option in [the console](https://console.velt.dev/dashboard/config/appconfig)
* Deploy v4 series of the Velt SDK.
# Endpoint
`POST https://api.velt.dev/v1/organizations/folders/update`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Unique identifier for the new folder
Name of the folder
ID of the parent folder
## **Example Request**
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"folders": [
{
"folderId": "yourFolderId",
"folderName": "yourFolderName",
"parentFolderId": "yourParentFolderId"
}
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Folder Updated successfully.",
"data": {
"yourFolderId": {
"success": true,
"id": "yourFolderId",
"message": "Folder Updated."
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Folder Updated successfully.",
"data": {
"yourFolderId": {
"success": true,
"id": "yourFolderId",
"message": "Folder Updated."
}
}
}
}
```
# Update Access for Folders
Source: https://docs.velt.dev/api-reference/rest-apis/v1/folders/update-folder-access
POST https://api.velt.dev/v1/organizations/folders/access/update
Use this API to update the access type for a single or multiple folders at once.
You can update the default access type for all the folders associated with your API Key in [console](https://console.velt.dev/dashboard/config/appconfig).
# Endpoint
`https://api.velt.dev/v1/organizations/folders/access/update`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Array of Folder IDs
Access type for the folders. Allowed values: `organizationPrivate`, `restricted`, `public`.
[Learn more](/key-concepts/overview#access-control).
## **Example Requests**
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"folderIds": ["yourFolderId1, yourFolderId2"],
"accessType": "organizationPrivate"
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Updated access for folders successfully.",
"data": {
"yourFolderId": {
"success": true,
"accessType": "organizationPrivate",
"message": "Folder access type updated."
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Updated access for folders successfully.",
"data": {
"yourFolderId": {
"success": true,
"accessType": "organizationPrivate",
"message": "Folder access type updated."
}
}
}
}
```
# Delete All User Data
Source: https://docs.velt.dev/api-reference/rest-apis/v1/gdpr/delete-all-user-data-gdpr
POST https://api.velt.dev/v1/users/data/delete
Remove All User data from Velt.
Use this API to remove all user data from Velt. This will:
* remove their access from all the documents and data in the organization.
* remove them from @mention contact dropdown list.
* remove them from @mentions where they were tagged.
* remove all feature data created by the user. eg: comments, reactions etc.
- This API may take up to 5 minutes to return a 202 response since it runs an asynchronous job to delete user data across the system.
- To speed up this process, you can optionally provide the organizationIds where the user belongs.
- The actual deletion of data can take upto 24 hours to complete.
# Endpoint
`POST https://api.velt.dev/v1/users/data/delete`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Array of user Ids.
Array of organization Ids. These are the organizations that the user is part of.
## **Example Request**
```JSON theme={null}
{
"data": {
"userIds": [
"yourUserId1",
"yourUserId2"
],
"organizationIds": [
"yourOrganizationId1",
"yourOrganizationId2"
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"status": "success",
"message": "Data deletion process has been initiated.",
"data": {
"jobId": "dsQuvPmIynANgPLLEhCm",
"tasksCount": 5
},
"statusCode": 202
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"status": "success",
"message": "Data deletion process has been initiated.",
"data": {
"jobId": "dsQuvPmIynANgPLLEhCm",
"tasksCount": 5
},
"statusCode": 202
}
```
# Get All User Data
Source: https://docs.velt.dev/api-reference/rest-apis/v1/gdpr/get-all-user-data-gdpr
POST https://api.velt.dev/v1/users/data/get
Get all feature data for a user stored in Velt.
Use this API to get all feature data for a user stored in Velt.
* The data will be paginated and returned in chunks of 100 items per feature data.
* You can use the `nextPageToken` returned in the response to fetch the next chunk of data.
* If there are no more items to fetch, the `nextPageToken` will not be returned.
* Here is the data that will be included:
* **User profile data:** If they were added to any organization, document or folder.
* **Comments data:** All the comments created by the user or where they were involved in.
* **Reactions data:** All the reactions created by the user.
* **Notifications data:** All the notifications where the user was involved in.
* **Recordings data:** All the recordings created by the user.
This API may take a few seconds to return a response depending on the dataset size.
# Endpoint
`POST https://api.velt.dev/v1/users/data/get`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
The organization Id of the organization that the user is part of.
The user Id of the user you want to get the data for.
Page token retrieved from previous API call.
## **Example Request**
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"userId": "yourUserId",
"pageToken": "yourPageToken"
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Data fetched successfully.",
"data": {
"comments": [..], //Upto 100 items. Empty array if no items are found.
"reactions": [..], //Upto 100 items. Empty array if no items are found.
"recordings": [..], //Upto 100 items. Empty array if no items are found.
"notifications": [..] //Upto 100 items. Empty array if no items are found.
},
"nextPageToken": "bhdwdqwjs298e39e479ddkeuw==329" // This will be null if there are no more items to fetch.
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT",
"code": 500
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Data fetched successfully.",
"data": {
"comments": [..], //Upto 100 items. Empty array if no items are found.
"reactions": [..], //Upto 100 items. Empty array if no items are found.
"recordings": [..], //Upto 100 items. Empty array if no items are found.
"notifications": [..] //Upto 100 items. Empty array if no items are found.
},
"nextPageToken": "bhdwdqwjs298e39e479ddkeuw==329" //This will be null if there are no more items to fetch.
}
}
```
# Get Delete All User Data Status
Source: https://docs.velt.dev/api-reference/rest-apis/v1/gdpr/get-delete-user-data-status-gdpr
POST https://api.velt.dev/v1/users/data/delete/status
Get the status of the data deletion process for a user.
Use this API to get the status of the data deletion process for a user.
This API may take a few seconds to return a response depending on the dataset size.
# Endpoint
`POST https://api.velt.dev/v1/users/data/delete/status`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
The job Id of the data deletion process.
## **Example Request**
```JSON theme={null}
{
"data": {
"jobId": "yourJobId"
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Data fetched successfully.",
"data": {
"isDeleteCompleted": true,
"tasksLeft": 0,
"lastTaskCompletedTime": 1748972106739
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT",
"code": 500
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Data fetched successfully.",
"data": {
"isDeleteCompleted": true,
"tasksLeft": 0,
"lastTaskCompletedTime": 1748972106739
}
}
}
```
# Broadcast Event
Source: https://docs.velt.dev/api-reference/rest-apis/v1/livestate/broadcast-event
POST https://api.velt.dev/v1/livestate/broadcast
Use this API to broadcast live state events to any document. Use it with the [Live State](/realtime-collaboration/live-state-sync/setup#get-live-data) feature.
# Endpoint
`POST https://api.velt.dev/v1/livestate/broadcast`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body Parameters
Organization ID where the document belongs
Document ID to broadcast the event to
Unique identifier for the live state data
The data to broadcast. Can be any valid serializable JSON object.
If true, merges the new data with existing data instead of replacing it
## Example Request
```JSON theme={null}
{
"organizationId": "YOUR_ORGANIZATION_ID",
"documentId": "YOUR_DOCUMENT_ID",
"liveStateDataId": "sample_live_state_data_id",
"data": {
"status": "active",
"message": "Hello World",
"customField": "custom value"
},
"merge": true
}
```
# Response
## Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Event broadcasted successfully.",
"data": {
"success": true
}
}
}
```
## Error Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "ERROR_CODE"
}
}
```
```json theme={null}
{
"result": {
"status": "success",
"message": "Event broadcasted successfully.",
"data": {
"success": true
}
}
}
```
# Delete Data by Location
Source: https://docs.velt.dev/api-reference/rest-apis/v1/locations/delete-data-by-location
POST https://api.velt.dev/v1/organizations/documents/locations/data/delete
Delete all data associated with a specific location
Use this API to delete all data (comments, recordings, or any other feature data) associated with a specific location.
# Endpoint
`POST https://api.velt.dev/v1/organizations/documents/locations/data/delete`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Your API key
Your Auth Token
Document ID
The location object containing the data to be deleted
## **Example Request**
```JSON theme={null}
{
"data": {
"apiKey": "YOUR_API_KEY",
"authToken": "YOUR_AUTH_TOKEN",
"documentId": "YOUR_DOCUMENT_ID",
"location": {
"id": "scene_1",
"locationName": "White scene"
}
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Data deleted successfully.",
"data": null
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Data deleted successfully.",
"data": null
}
}
```
# Update Location
Source: https://docs.velt.dev/api-reference/rest-apis/v1/locations/update-location
POST https://api.velt.dev/v1/organizations/documents/locations/update
Update a Location's metadata
Use this API to update a Location's metadata.
# Endpoint
`POST https://api.velt.dev/v1/organizations/documents/locations/update`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Your API key
Your Auth Token
Organization ID. Provide the organizationId if you are using Organizations feature.
Document ID
The current location object
The updated location object
When true, merges new location fields with existing ones. When false, completely replaces the old location object.
Default: false
## **Example Request**
```JSON theme={null}
{
"data": {
"apiKey": "YOUR_API_KEY",
"authToken": "YOUR_AUTH_TOKEN",
"documentId": "YOUR_DOCUMENT_ID",
"migrate": {
"oldLocation": {
"id": "scene_1",
"locationName": "Untitled scene"
},
"newLocation": {
"id": "scene_1",
"locationName": "White scene"
}
},
"merge": true
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Location updated.",
"data": null
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Location updated.",
"data": null
}
}
```
# Add Notifications
Source: https://docs.velt.dev/api-reference/rest-apis/v1/notifications/add-notifications
POST https://api.velt.dev/v1/notifications/add
Use this API to add notifications.
# Endpoint
`POST https://api.velt.dev/v1/notifications/add`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Document ID
User who took the action
Notification ID. If not provided, Velt will generate a random ID.
Use this if you want more control on the ID being set and prevent duplicate notifications.
Only the special characters `_`, `-` are allowed.
Display Headline Message Template
Display Headline Message Template Data (Optional)
User who took the action
User who was directly affected by the action
Any custom field with string value
Display Body Message
Array of Notify Users
Default is true.
If set to true, the notification will be sent to all users in the organization.
If set to false, the notification will be sent to only the users specified in the `notifyUsers` array.
Any custom object to be stored with the notification.
When the user clicks on the notification, this data will be sent in the callback.
If set to true, a new document will be created before the notification is created.
If set to true, a new organization will be created (if it doesn't exist) before the notification is created.
## **Example Request**
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"actionUser": {
"userId": "yourUserId",
"name": "User Name",
"email": "user@example.com"
},
"displayHeadlineMessageTemplate": "This is main template, you can pass variables using curly brackets like this: {actionUser}, {recipientUser}, {yourCustomVariableWithStringValue}",
"displayHeadlineMessageTemplateData": {
"actionUser": {
"userId": "yourUserId",
"name": "User Name",
"email": "user@example.com"
},
"recipientUser": {
"userId": "recipientUserId",
"name": "Recipient Name",
"email": "recipient@example.com"
},
"yourCustomField": "Variable will be replaced with this text"
},
"displayBodyMessage": "This is body message (Secondary message)",
"notifyUsers": [
{
"email": "test@example.com",
"userId": "testingUserId"
},
{
"userId": "yourUserId",
"name": "User Name",
"email": "user@example.com"
}
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Notification added successfully.",
"data": {
"success": true,
"message": "Notification added successfully."
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Notification added successfully.",
"data": {
"success": true,
"message": "Notification added successfully."
}
}
}
```
# Delete Notifications
Source: https://docs.velt.dev/api-reference/rest-apis/v1/notifications/delete-notifications
POST https://api.velt.dev/v1/notifications/delete
Use this API to delete notifications.
# Endpoint
`POST https://api.velt.dev/v1/notifications/delete`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Document ID (Optional)
Location ID (Optional)
User ID (Optional)
Array of Notification IDs (Optional)
## **Example Requests**
#### 1. Delete by organizationId and documentId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId"
}
}
```
#### 2. Delete by organizationId, documentId and notificationIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"notificationIds": [
"yourNotificationId"
]
}
}
```
#### 3. Delete by organizationId and userId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"userId": "yourUserId"
}
}
```
#### 4. Delete by organizationId, userId and notificationIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"userId": "yourUserId",
"notificationIds": [
"yourNotificationId"
]
}
}
```
#### 5. Delete by organizationId, documentId and userId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"userId": "yourUserId"
}
}
```
#### 6. Delete by organizationId, documentId, userId and notificationIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"userId": "yourUserId",
"notificationIds": [
"yourNotificationId"
]
}
}
```
#### 7.Delete by organizationId, documentId and locationId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"locationId": "yourLocationId"
}
}
```
#### 8. Delete by organizationId, documentId, locationId and notificationIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"locationId": "yourLocationId",
"notificationIds": [
"yourNotificationId"
]
}
}
```
#### 9. Delete by organizationId, locationId and userId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"locationId": "yourLocationId",
"userId": "yourUserId",
}
}
```
#### 10. Delete by organizationId, locationId, userId, and notificationIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"locationId": "yourLocationId",
"userId": "yourUserId",
"notificationIds": [
"yourNotificationId"
]
}
}
```
#### 11. Delete by organizationId, documentId, locationId and userId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"locationId": "yourLocationId",
"userId": "yourUserId",
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Notification(s) deleted successfully.",
"data": {
"8955243231506071": {
"success": true,
"message": "Notification deleted."
}
}
}
}
```
#### When some notifications are not found
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Notification(s) deleted successfully.",
"data": {
"89552432315060712": {
"success": false,
"message": "Failed to delete notification."
},
"8955243231506071": {
"success": true,
"message": "Notification deleted."
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Notification(s) deleted successfully.",
"data": {
"8955243231506071": {
"success": true,
"message": "Notification deleted."
}
}
}
}
```
# Get Config
Source: https://docs.velt.dev/api-reference/rest-apis/v1/notifications/get-config
POST https://api.velt.dev/v1/notifications/config/get
To use this API, you must have the this feature enabled in [Velt console](https://console.velt.dev/dashboard/config/notification)
Use this API to set the notifications config for users.
# Endpoint
`POST https://api.velt.dev/v1/notifications/config/get`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
The ID of the organization.
An array of document IDs. The notification configuration will be fetched for these documents for the specified user. Max 30 documents can be fetched at a time.
The ID of the user.
## **Example Request**
```JSON theme={null}
{
"data": {
"organizationId": "org1",
"documentIds": ["doc1"],
"userId":"USER_ID1"
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "User config fetched successfully.",
"data": [
{
"config": {
"inbox": "ALL",
"email": "ALL"
},
"metadata": {
"organizationId": "org1",
"apiKey": "API_KEY",
"documentId": "doc1",
"userId": "USER_ID1"
}
}
]
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "User config fetched successfully.",
"data": [
{
"config": {
"inbox": "ALL",
"email": "ALL"
},
"metadata": {
"organizationId": "org1",
"apiKey": "API_KEY",
"documentId": "doc1",
"userId": "USER_ID1"
}
}
]
}
}
```
# Get Notifications
Source: https://docs.velt.dev/api-reference/rest-apis/v1/notifications/get-notifications
POST https://api.velt.dev/v1/notifications/get
Use this API to retrieve notifications.
Use this for SDK v3 or prior versions.
# Endpoint
`POST https://api.velt.dev/v1/notifications/get`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Document ID
Location ID
User ID
Array of Notification IDs. Limit: Only 30 items can be passed at a time.
## **Example Requests**
#### 1. Get by organizationId, documentId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId"
}
}
```
#### 2. Get by organizationId, documentId and notificationIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"notificationIds": [
"yourNotificationId"
]
}
}
```
#### 3. Get by organizationId, documentId and locationId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"locationId": "yourLocationId"
}
}
```
#### 4. Get by organizationId, documentId, locationId and notificationIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"locationId": "yourLocationId",
"notificationIds": [
"yourNotificationId"
]
}
}
```
#### 5. Get by organizationId and userId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"userId": "yourUserId"
}
}
```
#### 6. Get by organizationId, userId and notificationIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"userId": "yourUserId",
"notificationIds": [
"yourNotificationId"
]
}
}
```
#### 7. Get by organizationId, documentId and userId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"userId": "yourUserId"
}
}
```
#### 8. Get by organizationId, locationId and userId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"userId": "yourUserId",
"locationId": "yourLocationId"
}
}
```
#### 9. Get by organizationId, documentId, locationId, and userId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"userId": "yourUserId",
"locationId": "yourLocationId"
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Notification(s) retrieved successfully.",
"data": [
{
"id": "notificationId",
"notificationSource": "custom",
"notificationSourceData": {}, //The data of the notification source. e.g., CommentAnnotation
"actionUser": {
"email": "user@example.com",
"name": "User Name",
"userId": "yourUserId"
},
"displayBodyMessage": "This is body message (Secondary message)",
"displayHeadlineMessageTemplate": "This is main template, you can pass variables using curly brackets like this: {actionUser}, {recipientUser}, {yourCustomVariableWithStringValue}",
"displayHeadlineMessageTemplateData": {
"actionUser": {
"email": "user@example.com",
"name": "User Name",
"userId": "yourUserId"
},
"recipientUser": {
"email": "recipient@example.com",
"name": "Recipient Name",
"userId": "recipientUserId"
},
"yourCustomVariableWithStringValue": "Variable will be replaced with this text"
},
"metadata": {
"apiKey": "yourApiKey",
"documentId": "yourDocumentId",
"organizationId": "yourOrganizationId"
},
"notifyUsers": {
"yourNotifyUserId": true
},
"notifyUsersByUserId": {
"yourNotifyUserById": true
},
"timestamp": 1722409519944
}
]
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Notification(s) retrieved successfully.",
"data": [
{
"id": "notificationId",
"notificationSource": "custom",
"notificationSourceData": {}, //The data of the notification source. e.g., CommentAnnotation
"actionUser": {
"email": "user@example.com",
"name": "User Name",
"userId": "yourUserId"
},
"displayBodyMessage": "This is body message (Secondary message)",
"displayHeadlineMessageTemplate": "This is main template, you can pass variables using curly brackets like this: {actionUser}, {recipientUser}, {yourCustomVariableWithStringValue}",
"displayHeadlineMessageTemplateData": {
"actionUser": {
"email": "user@example.com",
"name": "User Name",
"userId": "yourUserId"
},
"recipientUser": {
"email": "recipient@example.com",
"name": "Recipient Name",
"userId": "recipientUserId"
},
"yourCustomVariableWithStringValue": "Variable will be replaced with this text"
},
"metadata": {
"apiKey": "yourApiKey",
"documentId": "yourDocumentId",
"organizationId": "yourOrganizationId"
},
"notifyUsers": {
"yourNotifyUserId": true
},
"notifyUsersByUserId": {
"yourNotifyUserById": true
},
"timestamp": 1722409519944
}
]
}
}
```
# Set Config
Source: https://docs.velt.dev/api-reference/rest-apis/v1/notifications/set-config
POST https://api.velt.dev/v1/notifications/config/set
To use this API, you must have the this feature enabled in [Velt console](https://console.velt.dev/dashboard/config/notification)
Use this API to set the notifications config for users.
# Endpoint
`POST https://api.velt.dev/v1/notifications/config/set`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
The ID of the organization.
An array of document IDs. The notification configuration will be applied to these documents for the specified users.
An array of user IDs. The notification configuration will be set for these users.
Object containing the notification preferences.
In-app inbox notification preference. Valid values:
`ALL`: User receives all notifications in their inbox.
`MINE`: User receives notifications in their inbox only for activities directly involving them (e.g., mentions, replies).
`NONE`: User receives no notifications in their inbox.
`ALL`: User receives email notifications for all activities.
`MINE`: User receives email notifications only for activities directly involving them.
`NONE`: User receives no email notifications.
Optional.
Slack notification preference (requires Slack integration to be effective). Valid values:
`ALL`: User receives Slack notifications for all activities.
`MINE`: User receives Slack notifications only for activities directly involving them.
`NONE`: User receives no Slack notifications.
Optional.
## **Example Request**
```JSON theme={null}
{
"data": {
"organizationId": "org1",
"documentIds": ["doc1"],
"userIds":["USER_ID1"],
"config":{
"inbox": "ALL", // ALL | MINE | NONE
"email": "ALL" // ALL | MINE | NONE
}
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "User config set successfully.",
"data": {
"USER_ID1": {
"success": true,
"userId": "USER_ID1",
"documentId": "doc1",
"message": "User config set successfully."
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "User config set successfully.",
"data": {
"USER_ID1": {
"success": true,
"userId": "USER_ID1",
"documentId": "doc1",
"message": "User config set successfully."
}
}
}
}
```
# Update Notifications
Source: https://docs.velt.dev/api-reference/rest-apis/v1/notifications/update-notifications
POST https://api.velt.dev/v1/notifications/update
Use this API to update notifications.
# Endpoint
`POST https://api.velt.dev/v1/notifications/update`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Document ID (Optional)
Location ID
User ID (Optional)
Notifications object
Notification ID
User who took the action
Display Headline Message Template
Display Headline Message Template Data
User who took the action
User who was directly affected by the action
Any custom field with string value
Display Body Message
Any custom object to be stored with the notification.
When the user clicks on the notification, this data will be sent to in the callback.
Array of user ids that you want to mark the notification as read.
Use this with the `readByUserIds` param. If `true`, the read notifications will be not be removed from the "For You" tab.
## **Example Requests**
#### 1. Update by organizationId and documentId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"notifications": [
{
"id": "yourNotificationId",
"displayBodyMessage": "This is body message (Secondary message)",
}
]
}
}
```
#### 2. Update by organizationId, documentId and locationId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"locationId": "yourLocationId",
"notifications": [
{
"id": "yourNotificationId",
"displayBodyMessage": "This is body message (Secondary message)",
}
]
}
}
```
#### 3. Update by organizationId, documentId and userId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"userId": "yourUserId",
"notifications": [
{
"id": "yourNotificationId",
"displayBodyMessage": "This is body message (Secondary message)",
}
]
}
}
```
#### 4. Update by organizationId and userId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"userId": "yourUserId",
"notifications": [
{
"id": "yourNotificationId",
"displayBodyMessage": "This is body message (Secondary message)",
}
]
}
}
```
#### 5. Update by organizationId, documentId, locationId and userId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"userId": "yourUserId",
"locationId": "yourLocationId",
"notifications": [
{
"id": "yourNotificationId",
"displayBodyMessage": "This is body message (Secondary message)",
}
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Notification(s) updated successfully.",
"data": {
"5471488637912692": {
"success": true,
"message": "Notification updated."
}
}
}
}
```
#### When some notifications are not found
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Notification(s) updated successfully.",
"data": {
"5471488637912692": {
"success": false,
"message": "Failed to update notification."
},
"5471488637912693": {
"success": true,
"message": "Notification updated."
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Notification(s) updated successfully.",
"data": {
"5471488637912692": {
"success": true,
"message": "Notification updated."
}
}
}
}
```
# Add Organizations
Source: https://docs.velt.dev/api-reference/rest-apis/v1/organizations/add-organizations
POST https://api.velt.dev/v1/organizations/add
Use this API to add new organizations and its metadata.
# Endpoint
`POST https://api.velt.dev/v1/organizations/add`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Array of Organization objects
## **Example Requests**
#### Add organization
```JSON theme={null}
{
"data": {
"organizations": [
{
"organizationId": "yourOrganizationId",
"organizationName": "Your Organization Name"
}
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Organization(s) added successfully.",
"data": {
"yourOrganizationId": {
"success": true,
"id": "02cf91e5e7a5f4c0b600c84cf248384b",
"message": "Added Successfully"
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Organization(s) added successfully.",
"data": {
"yourOrganizationId": {
"success": true,
"id": "02cf91e5e7a5f4c0b600c84cf248384b",
"message": "Added Successfully"
}
}
}
}
```
# Delete Organizations
Source: https://docs.velt.dev/api-reference/rest-apis/v1/organizations/delete-organizations
POST https://api.velt.dev/v1/organizations/delete
Use this API to delete specific organization(s) data by their IDs.
# Endpoint
`POST https://api.velt.dev/v1/organizations/delete`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Array of Organization IDs
## **Example Requests**
#### Delete specific organization
```JSON theme={null}
{
"data": {
"organizationIds": [
"yourOrganizationId1",
"yourOrganizationId2"
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Organization(s) deleted successfully.",
"data": {
"yourOrganizationId1": {
"success": true,
"id": "02cf91e5e7a5f4c0b600c84cf248384b",
"message": "Deleted Successfully"
},
{
"yourOrganizationId2": {
"success": false,
"id": "02cf91e5e7a5f4c0b600c84cf248384b",
"message": "Organization does not exist"
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Organization(s) deleted successfully.",
"data": {
"yourOrganizationId": {
"success": true,
"id": "02cf91e5e7a5f4c0b600c84cf248384b",
"message": "Deleted Successfully"
}
}
}
}
```
# Get Organizations
Source: https://docs.velt.dev/api-reference/rest-apis/v1/organizations/get-organizations
POST https://api.velt.dev/v1/organizations/get
Use this API to retrieve specific organizations by organization IDs.
Use this for SDK v3 or prior versions.
# Endpoint
`POST https://api.velt.dev/v1/organizations/get`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Array of Organization IDs (Optional).
Limit: Only 30 IDs can be passed at a time.
If this is not provided, all organizations will be returned.
## **Example Requests**
```JSON theme={null}
{
"data": {
"organizationIds": [
"yourOrganizationId"
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Organization(s) retrieved successfully.",
"data": [
{
"id": "yourOrganizationId",
"organizationName": "Your Organization Name",
"disabled": false,
// other metadata fields may be included here
}
// ... more organizations if multiple were retrieved
]
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Organization(s) retrieved successfully.",
"data": [
{
"id": "yourOrganizationId",
"organizationName": "Your Organization Name",
"disabled": false,
// other metadata fields may be included here
}
// ... more organizations if multiple were retrieved
]
}
}
```
# Update Disabled State for Organizations
Source: https://docs.velt.dev/api-reference/rest-apis/v1/organizations/update-organization-disable-state
POST https://api.velt.dev/v1/organizations/access/disablestate/update
Use this API to enable or disable both read and write access for all documents for all users.
Let's say your customer's trial or subscription has ended and you want to disable their access to the Velt data, you could use this to disable access to the entire organization data.If organization does not exist, it will be created.
# Endpoint
`POST https://api.velt.dev/v1/organizations/access/disablestate/update`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Array of Organization IDs
Whether to disable read and write access to the specified organizations. Allowed values: `true`, `false`.
## **Example Requests**
```JSON theme={null}
{
"data": {
"organizationIds": ["yourOrganizationId1","yourOrganizationId2"],
"disabled": true
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Updated disable state for Organization(s) successfully.",
"data": {
"yourOrganizationId1": {
"success": true,
"id": "02cf91e5e7a5f4c0b600c84cf248384b",
"message": "Updated disable state for organization Successfully"
},
"yourOrganizationId2": {
"success": false,
"id": "44e0132f4c6b0d453f18df42d2263b4e",
"message": "Organization does not exist"
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Updated disable state for Organization(s) successfully.",
"data": {
"yourOrganizationId": {
"success": true,
"id": "02cf91e5e7a5f4c0b600c84cf248384b",
"message": "Updated disable state for organization Successfully"
}
}
}
}
```
# Update Organizations
Source: https://docs.velt.dev/api-reference/rest-apis/v1/organizations/update-organizations
POST https://api.velt.dev/v1/organizations/update
Use this API to update existing organization(s) metadata.
# Endpoint
`POST https://api.velt.dev/v1/organizations/update`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Array of Organization objects
## **Example Requests**
```JSON theme={null}
{
"data": {
"organizations": [
{
"organizationId": "yourOrganizationId",
"organizationName": "Your Updated Organization Name"
}
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Organization(s) updated successfully.",
"data": {
"yourOrganizationId": {
"success": true,
"id": "02cf91e5e7a5f4c0b600c84cf248384b",
"message": "Updated Successfully"
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Organization(s) updated successfully.",
"data": {
"yourOrganizationId": {
"success": true,
"id": "02cf91e5e7a5f4c0b600c84cf248384b",
"message": "Updated Successfully"
}
}
}
}
```
# Add User Groups
Source: https://docs.velt.dev/api-reference/rest-apis/v1/user-groups/add-groups
POST https://api.velt.dev/v1/organizations/usergroups/add
Use this API to add organization user groups to a specific organization.
# Endpoint
`POST https://api.velt.dev/v1/organizations/usergroups/add`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Array of Organization User Group objects
## **Example Request**
#### Add organization user group in a specific organization
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"organizationUserGroups": [
{
"groupId": "engineering",
"groupName": "Engineering"
}
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Organization User Groups added successfully.",
"data": {
"yourGroupId": {
"success": true,
"id": "77ab6767b022ad0323ba39c24f12cc95",
"message": "Organization user group added."
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Organization User Groups added successfully.",
"data": {
"yourGroupId": {
"success": true,
"id": "77ab6767b022ad0323ba39c24f12cc95",
"message": "Organization user group added."
}
}
}
}
```
# Add Users to Groups
Source: https://docs.velt.dev/api-reference/rest-apis/v1/user-groups/add-users-to-group
POST https://api.velt.dev/v1/organizations/usergroups/users/add
Use this API to add users to a specific organization user group.
# Endpoint
`POST https://api.velt.dev/v1/organizations/usergroups/users/add`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Organization User Group ID
Array of User IDs
## **Example Requests**
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"organizationUserGroupId": "yourGroupId",
"userIds": ["yourUserId1"]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Added organization users to group successfully.",
"data": {
"yourUserId1": {
"success": true,
"organizationUserGroupId": "yourGroupId",
"message": "User added to organization user group."
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Added organization users to group successfully.",
"data": {
"yourUserId1": {
"success": true,
"organizationUserGroupId": "yourGroupId",
"message": "User added to organization user group."
}
}
}
}
```
# Delete Users from Groups
Source: https://docs.velt.dev/api-reference/rest-apis/v1/user-groups/delete-users-from-group
POST https://api.velt.dev/v1/organizations/usergroups/users/delete
Use this API to delete users from a specific organization user group.
# Endpoint
`POST https://api.velt.dev/v1/organizations/usergroups/users/delete`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Organization User Group ID
Array of User IDs
If true, all users in the group will be deleted.
## **Example Requests**
#### Delete specific users from group
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"organizationUserGroupId": "yourGroupId",
"userIds": ["yourUserId1"]
}
}
```
#### Delete all users from group
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"organizationUserGroupId": "yourGroupId",
"deleteAll": true
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Deleted users from group successfully.",
"data": {
"yourUserId1": {
"success": true,
"organizationUserGroupId": "yourGroupId",
"message": "User deleted from organization user group."
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Deleted users from group successfully.",
"data": {
"yourUserId1": {
"success": true,
"organizationUserGroupId": "yourGroupId",
"message": "User deleted from organization user group."
}
}
}
}
```
# Add Users
Source: https://docs.velt.dev/api-reference/rest-apis/v1/users/add-users
POST https://api.velt.dev/v1/users/add
Use this API to add Users to:
1. **Organization:** This will provide them access to all the documents in the organization unless the document has `restricted` access type. It will also show users in the contact list of the organization.
2. **Folder:** This will provide them access to all the documents in the folder. If you pass the `folderId`, then the users will be added to the folder and not the organization.
3. **Document:** This will provide them access to the specified document. It will also show users in the contact list of the document. If you pass the `documentId`, then the users will be added to the document and not the organization or folder.
* If organization does not exist, it will be created.
* If you provide documentId or folderId, then the users will only be added at that level and not at the organization level. To also add users at the organization level, you will need to call this API again with only the organizationId.
* If User's `initial` is not provided in the User object, then it will be automatically created using the name field.
# Endpoint
`POST https://api.velt.dev/v1/users/add`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Document ID. Provide this if you want to add users to a specific document.
Folder ID. Provide this if you want to add users to a specific folder. Either provide `documentId` or `folderId`.
Array of [User](/api-reference/sdk/models/data-models#user) objects.
## **Example Requests**
#### 1. Add users to a specific organization
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"users": [
{
"userId": "yourUserId1",
"name": "User Name",
"email": "user@email.com"
}
]
}
}
```
#### 2. Add users to a specific document within an organization
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"users": [
{
"userId": "yourUserId1",
"name": "User Name",
"email": "user@email.com"
}
]
}
}
```
#### 3. Add users to a specific folder within an organization
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"folderId": "yourFolderId",
"users": [
{
"userId": "yourUserId1",
"name": "User Name",
"email": "user@email.com"
}
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "User(s) processed successfully.",
"data": {
"yourUserId1": {
"success": true,
"id": "4c250058149d6c9fb8c894c9ef29c790",
"message": "User added."
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "User(s) processed successfully.",
"data": {
"yourUserId1": {
"success": true,
"id": "4c250058149d6c9fb8c894c9ef29c790",
"message": "User added."
}
}
}
}
```
# Delete Users
Source: https://docs.velt.dev/api-reference/rest-apis/v1/users/delete-users
POST https://api.velt.dev/v1/users/delete
Remove Users from an Organization or a Document.
Use this API to remove Users from:
1. **Organization:** This will remove their access from all the documents and data in the organization. It will also remove these users from the contact list of the organization.
2. **Document:** This will remove their access from the specified document. It will also remove these users from the contact list of the document. If you pass the `documentId`, then the users will be removed from the document.
# Endpoint
`POST https://api.velt.dev/v1/users/delete`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Document IDs. Provide this if you want to delete users from a specific document.
Folder ID. Either provide `documentId` or `folderId`.
Array of user Ids.
## **Example Requests**
#### 1. Delete users in a specific organization
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"userIds": [
"yourUserId1"
]
}
}
```
#### 2. Delete users in a specific document within an organization
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"userIds": [
"yourUserId1"
]
}
}
```
#### 3. Delete users in a specific folder within an organization
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"folderId": "yourFolderId",
"userIds": [
"yourUserId1"
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "User(s) deleted successfully.",
"data": {
"yourUserId1": {
"success": true,
"message": "User removed."
}
}
}
}
```
#### User(s) Not Found
```JSON theme={null}
{
"result": {
"status": "success",
"message": "User(s) deleted successfully.",
"data": {
"yourUserId1": {
"success": true,
"message": "User removed."
},
{
"yourUserId2": {
"success": false,
"message": "User does not exist."
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "User(s) deleted successfully.",
"data": {
"yourUserId1": {
"success": true,
"message": "User removed."
}
}
}
}
```
# Get Users
Source: https://docs.velt.dev/api-reference/rest-apis/v1/users/get-users
POST https://api.velt.dev/v1/users/get
Use this API to retrieve users based on various filters such as organization ID, document ID, organization user group IDs or user IDs. You can use these filters in various combinations to get the desired users. Some examples are shown below.
Use this for SDK v3 or prior versions.
# Endpoint
`POST https://api.velt.dev/v1/users/get`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### **Params**
Organization ID
Document ID
Array of User IDs. Limit: Only 30 items can be passed at a time.
Array of Organization User Group IDs. Only 30 items can be passed at a time.
## **Example Requests**
#### 1. Get users by organizationId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId"
}
}
```
#### 2. Get users by documentId within an organization
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId"
}
}
```
#### 3. Get users by specific user IDs in an organization
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"userIds": [
"yourUserId1",
"yourUserId2"
]
}
}
```
#### 4. Get users by specific user IDs in the given organization and document
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"userIds": [
"yourUserId1",
"yourUserId2"
]
}
}
```
#### 5. Get users by organization and organization user group IDs
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"organizationUserGroupIds": [
"yourOrganizationUserGroupId"
]
}
}
```
#### 6. Get users by organization, organization user group IDs and user IDs
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"userIds": [
"yourUserId1",
"yourUserId2"
],
"organizationUserGroupIds": [
"yourOrganizationUserGroupId"
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "User(s) retrieved successfully.",
"data": [
{
"email": "userEmail@domain.com",
"name": "userName",
"userId": "yourUserId"
}
]
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "Error retrieving user(s).",
"status": "ERROR_CODE"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "User(s) retrieved successfully.",
"data": [
{
"email": "userEmail@domain.com",
"name": "userName",
"userId": "yourUserId"
}
]
}
}
```
# Update Users
Source: https://docs.velt.dev/api-reference/rest-apis/v1/users/update-users
POST https://api.velt.dev/v1/users/update
Use this API to update user metadata based on various filters such as organization ID, document ID, folder ID and user IDs.
You can use these filters in various combinations to get the desired results.
The user metadata such as name, email etc can be updated.
# Endpoint
`POST https://api.velt.dev/v1/users/update`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### **Params**
Organization ID
Document ID
Folder ID. Either provide `documentId` or `folderId`.
Array of [User](/api-reference/sdk/models/data-models#user) objects.
## **Example Requests**
#### 1. Update users in a specific organization
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"users": [
{
"userId": "yourUserId1",
"name": "User Name",
"email": "user@email.com"
}
]
}
}
```
#### 2. Update users in a specific document within an organization
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"users": [
{
"userId": "yourUserId1",
"name": "User Name",
"email": "user@email.com"
}
]
}
}
```
#### 3. Update users in a specific folder within an organization
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"folderId": "yourFolderId",
"users": [
{
"userId": "yourUserId1",
"name": "User Name",
"email": "user@email.com"
}
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "User(s) processed successfully.",
"data": {
"yourUserId1": {
"success": true,
"id": "7d87015b055a168b098cf05b870e40ff",
"message": "User updated."
}
}
}
}
```
#### Some User(s) Not Found
```JSON theme={null}
{
"result": {
"status": "success",
"message": "User(s) processed successfully.",
"data": {
"yourUserId1": {
"success": true,
"id": "7d87015b055a168b098cf05b870e40ff",
"message": "User updated."
},
"yourUserId2": {
"success": false,
"id": "ad22d93b49ad990d2b3d582d08d7768a",
"message": "User does not exist."
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "User(s) processed successfully.",
"data": {
"yourUserId1": {
"success": true,
"id": "7d87015b055a168b098cf05b870e40ff",
"message": "User updated."
}
}
}
}
```
# Add Domains
Source: https://docs.velt.dev/api-reference/rest-apis/v1/workspace/add-domain
POST https://api.velt.dev/v1/workspace/domains/add
Use this API to add new organizations and its metadata.
# Endpoint
`POST https://api.velt.dev/v1/workspace/domains/add`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Array of domains
# Example Request
```JSON theme={null}
{
"data": {
"domains" : [
"https://www.google.com",
"https://*.firebase.com"
]
}
}
```
# Example Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Domain(s) added successfully to allowed domains.",
"data": {
"domainsAdded": [
"google.com",
"*.firebase.com"
]
}
}
}
```
#### Failure Response
##### If some domains are already in the allowed domains
```JSON theme={null}
{
"error": {
"details": {
"domainsAdded": [
"velt.dev"
],
"skippedDomains": [
"google.com"
]
},
"message": "Domain(s) added successfully to allowed domains. Skipped existing domains.",
"status": "INTERNAL"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Domain(s) added successfully to allowed domains.",
"data": {
"domainsAdded": [
"google.com",
"*.firebase.com"
]
}
}
}
```
# Delete Domains
Source: https://docs.velt.dev/api-reference/rest-apis/v1/workspace/delete-domain
POST https://api.velt.dev/v1/workspace/domains/delete
Use this API to add new organizations and its metadata.
# Endpoint
`POST https://api.velt.dev/v1/workspace/domains/delete`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Array of domains
# Example Request
```JSON theme={null}
{
"data": {
"domains" : [
"https://www.google.com",
"https://*.firebase.com"
]
}
}
```
# Example Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Domain(s) removed successfully from allowed domains.",
"data": {
"domainsRemoved": [
"google.com",
"*.firebase.com"
]
}
}
}
```
#### Failure Response
##### If some domains are not in the allowed domains
```JSON theme={null}
{
"error": {
"details": {
"domainsRemoved": [
"velt.dev"
],
"skippedDomains": [
"google.com"
]
},
"message": "Domain(s) removed successfully from allowed domains. Skipped non-existing domains.",
"status": "INTERNAL"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Domain(s) removed successfully from allowed domains.",
"data": {
"domainsRemoved": [
"google.com",
"*.firebase.com"
]
}
}
}
```
# Add Permissions
Source: https://docs.velt.dev/api-reference/rest-apis/v2/auth/add-permissions
POST https://api.velt.dev/v2/auth/permissions/add
Use this API to add permissions to a user for various resources like organizations, folders, documents, etc.
* You can add permissions for multiple resources in a single API call.
* The `expiresAt` field is optional. If provided, the permission will expire at the given timestamp.
**Access Control**
* Set `accessRole` to `viewer` (read-only) or `editor` (read/write) on each resource to define the user's capabilities for that resource.
* `accessRole` can only be set via the v2 Users and Auth Permissions REST APIs. Frontend SDK methods do not accept or change `accessRole`.
* Relevant endpoints: `/v2/users/add`, `/v2/users/update`, `/v2/auth/permissions/add`, `/v2/auth/generate_token`.
* See the [Access Control overview](/key-concepts/overview#access-control) for concepts and detailed guidance.
# Endpoint
`POST https://api.velt.dev/v2/auth/permissions/add`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
The ID of the user to add permissions to.
Array of resource objects to grant permissions for.
The type of resource. Can be `organization`, `document` or `folder`.
The ID of the resource.
The ID of the organization. Required if `type` is `document` or `folder`.
Optional access role for this resource. Allowed values: “viewer” | “editor”. Default: "editor".
A Unix timestamp (in seconds) that specifies when the permission should expire. This is optional.
## **Example Requests**
#### 1. Add permissions to a specific organization
```json theme={null}
{
"data": {
"user": {
"userId": "some-user-id"
},
"permissions": {
"resources": [
{
"type": "organization",
"id": "YOUR_ORGANIZATION_ID",
"accessRole": "editor"
}
]
}
}
}
```
```json theme={null}
{
"data": {
"user": {
"userId": "some-user-id"
},
"permissions": {
"resources": [
{
"type": "organization",
"id": "YOUR_ORGANIZATION_ID",
"accessRole": "viewer"
}
]
}
}
}
```
#### 2. Add permissions to a specific document within an organization
```json theme={null}
{
"data": {
"user": {
"userId": "some-user-id"
},
"permissions": {
"resources": [
{
"type": "document",
"id": "YOUR_DOCUMENT_ID",
"organizationId": "YOUR_ORGANIZATION_ID",
"accessRole": "editor",
"expiresAt": 1728902400
}
]
}
}
}
```
```json theme={null}
{
"data": {
"user": {
"userId": "some-user-id"
},
"permissions": {
"resources": [
{
"type": "document",
"id": "YOUR_DOCUMENT_ID",
"organizationId": "YOUR_ORGANIZATION_ID",
"accessRole": "viewer",
"expiresAt": 1728902400
}
]
}
}
}
```
#### 3. Add permissions to a specific folder within an organization
```json theme={null}
{
"data": {
"user": {
"userId": "some-user-id"
},
"permissions": {
"resources": [
{
"type": "folder",
"id": "YOUR_FOLDER_ID",
"organizationId": "YOUR_ORGANIZATION_ID",
"accessRole": "editor"
}
]
}
}
}
```
```json theme={null}
{
"data": {
"user": {
"userId": "some-user-id"
},
"permissions": {
"resources": [
{
"type": "folder",
"id": "YOUR_FOLDER_ID",
"organizationId": "YOUR_ORGANIZATION_ID",
"accessRole": "viewer"
}
]
}
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Permissions added successfully."
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Permissions added successfully."
}
}
```
# Generate Signature
Source: https://docs.velt.dev/api-reference/rest-apis/v2/auth/generate-signature
POST https://api.velt.dev/v2/auth/generate_signature
Use this API to generate a secure signature for Permission Provider responses. The signature validates the integrity of permission decisions returned from your authorization service.
**Security Critical:** This endpoint must be called from your backend server, never from client-side code. The signature ensures that permission responses haven't been tampered with.
**Permission Provider Integration**
This API is used in conjunction with the [Permission Provider configuration mode](/key-concepts/overview#c-real-time-permission-provider). When implementing your backend Permission Provider endpoint, use this endpoint to generate a secure signature for your permission response.
# Endpoint
`POST https://api.velt.dev/v2/auth/generate_signature`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Array of permission decisions to sign. Each object must include user ID, resource information, access decision, and optional role/expiration.
ID of the user this permission applies to.
ID of the resource (document, folder, or organization).
Type of the resource. Allowed values: `"document"` | `"folder"` | `"organization"`.
Whether the user has access to the resource.
Access role for the user. Only applicable for document resources. Allowed values: `"viewer"` | `"editor"`. `viewer` can view and comment, `editor` can edit content.
UTC timestamp in milliseconds when this permission expires. Velt will revalidate access after expiration.
## **Example Requests**
#### 1. Generate signature for document access with viewer role and expiration
```JSON theme={null}
{
"data": {
"permissions": [
{
"userId": "user123",
"resourceId": "document456",
"type": "document",
"hasAccess": true,
"accessRole": "viewer",
"expiresAt": 1759745729823
}
]
}
}
```
#### 2. Generate signature for multiple resources (organization and folder)
```JSON theme={null}
{
"data": {
"permissions": [
{
"userId": "user123",
"resourceId": "org789",
"type": "organization",
"hasAccess": true
},
{
"userId": "user123",
"resourceId": "folder101",
"type": "folder",
"hasAccess": true
}
]
}
}
```
#### 3. Generate signature denying access
```JSON theme={null}
{
"data": {
"permissions": [
{
"userId": "user456",
"resourceId": "document789",
"type": "document",
"hasAccess": false
}
]
}
}
```
#### 4. Generate signature for document with editor role
```JSON theme={null}
{
"data": {
"permissions": [
{
"userId": "user789",
"resourceId": "document123",
"type": "document",
"hasAccess": true,
"accessRole": "editor"
}
]
}
}
```
#### 5. Generate signature for document with viewer role
```JSON theme={null}
{
"data": {
"permissions": [
{
"userId": "user456",
"resourceId": "document123",
"type": "document",
"hasAccess": true,
"accessRole": "viewer"
}
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Signature generated successfully.",
"data": {
"signature": "a1b2c3d4e5f6..."
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Signature generated successfully.",
"data": {
"signature": "a1b2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef1234567890"
}
}
}
```
# Generate Token
Source: https://docs.velt.dev/api-reference/rest-apis/v2/auth/generate-token
POST https://api.velt.dev/v2/auth/generate_token
Use this API to generate authentication JWT token for users to access Velt features. The token contains user information and permissions for specific resources like organizations, folders and documents.
Within `permissions.resources[]`, use `accessRole` to assign `viewer` (read-only) or `editor` (read/write) for each resource.
**Access Control**
* Set `accessRole` to `viewer` (read-only) or `editor` (read/write) on each resource to define the user's capabilities for that resource.
* `accessRole` can only be set via the v2 Users and Auth Permissions REST APIs. Frontend SDK methods do not accept or change `accessRole`.
* Relevant endpoints: `/v2/users/add`, `/v2/users/update`, `/v2/auth/permissions/add`, `/v2/auth/generate_token`.
* See the [Access Control overview](/key-concepts/overview#access-control) for concepts and detailed guidance.
* JWT token expires in 48 hours.
* You can specify permissions for different resource types (organization, folder, document)
# Endpoint
`POST https://api.velt.dev/v2/auth/generate_token`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Unique identifier for the user.
Whether the user has admin privileges. Defaults to false.
Display name of the user.
Email address of the user.
Array of resource permission objects.
Type of resource. Can be "organization", "document", or "folder".
ID of the resource.
Organization ID. Required when type is "document" or "folder".
Optional access role for this resource. Allowed values: “viewer” | “editor”. Default: "editor".
Unix timestamp when the permission expires. Optional.
## **Example Requests**
#### 1. Generate token with organization and document permissions (viewer on org, editor on document)
```JSON theme={null}
{
"userId": "user123",
"userProperties": {
"isAdmin": false,
"name": "John Doe",
"email": "john@example.com"
},
"permissions": {
"resources": [
{
"type": "organization",
"id": "org_123",
"accessRole": "viewer"
},
{
"type": "document",
"id": "doc_456",
"organizationId": "org_123",
"accessRole": "editor",
"expiresAt": 1640995200
}
]
}
}
```
#### 2. Generate token with only organization access (viewer)
```JSON theme={null}
{
"userId": "user456",
"userProperties": {
"isAdmin": true,
"name": "Jane Smith",
"email": "jane@example.com"
},
"permissions": {
"resources": [
{
"type": "organization",
"id": "org_789",
"accessRole": "viewer"
}
]
}
}
```
#### 3. Generate token with folder permissions (editor)
```JSON theme={null}
{
"userId": "user789",
"userProperties": {
"isAdmin": false,
"name": "Bob Wilson",
"email": "bob@example.com"
},
"permissions": {
"resources": [
{
"type": "organization",
"id": "org_123"
},
{
"type": "folder",
"id": "folder_001",
"organizationId": "org_123",
"accessRole": "editor"
}
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Token generated successfully.",
"data": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Token generated successfully.",
"data": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJ1c2VyMTIzIiwiaWF0IjoxNjQwOTk1MjAwfQ.signature"
}
}
}
```
# Get Permissions
Source: https://docs.velt.dev/api-reference/rest-apis/v2/auth/get-permissions
POST https://api.velt.dev/v2/auth/permissions/get
Use this API to get a user's permissions for various resources like organizations, folders, documents, etc.
* Returns permissions per user and resource. Temporary permissions include an `expiresAt` (Unix seconds) value.
* See the [Access Control overview](/key-concepts/overview#access-control) for concepts and detailed guidance.
# Endpoint
`POST https://api.velt.dev/v2/auth/permissions/get`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
The ID of the organization to query.
Array of user IDs to fetch permissions for.
Optional array of folder IDs to include in the result.
Optional array of document IDs to include in the result.
## Example Request
```json theme={null}
{
"data": {
"organizationId": "org1",
"documentIds": ["freestyle-comments1"],
"userIds": ["samarth"]
}
}
```
```bash cURL theme={null}
curl --location 'https://api.velt.dev/v2/auth/permissions/get' \
--header 'x-velt-api-key: apiKey' \
--header 'x-velt-auth-token: authToken' \
--header 'Content-Type: application/json' \
--data '{
"data": {
"organizationId": "org1",
"documentIds": [
"freestyle-comments1"
],
"userIds": [
"samarth"
]
}
}'
```
# Response
Error responses include an `errorCode` field with structured error codes from the [UserPermissionAccessRoleResult](/api-reference/sdk/models/data-models#userpermissionaccessroleresult) enum. This helps you handle permission resolution failures programmatically.
## Response Schema
The response returns a nested structure with permissions per user and resource type. Each resource permission can include:
| Field | Type | Description |
| ------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `accessRole` | `string` | The user's access role (`"editor"` or `"viewer"`) |
| `expiresAt` | `number` | Unix timestamp (seconds) when temporary access expires |
| `error` | `string` | Human-readable error message if permission resolution failed |
| `errorCode` | `string` | Error code from [UserPermissionAccessRoleResult](/api-reference/sdk/models/data-models#userpermissionaccessroleresult) enum (v4.5.4+) |
#### Success Response
```json theme={null}
{
"result": {
"status": "success",
"message": "User permissions retrieved successfully.",
"data": {
"1.1": {
"documents": {
"document1-26-may-2025-folder2": {
"accessRole": "viewer"
}
},
"organization": {
"org1": {
"accessRole": "editor"
}
}
}
}
}
}
```
#### Permission Denied
```json theme={null}
{
"result": {
"status": "success",
"message": "User permissions retrieved successfully.",
"data": {
"1.1": {
"documents": {
"document5": {
"error": "User does not have access to document",
"errorCode": "permission_denied"
}
},
"organization": {
"org1": {
"accessRole": "editor"
}
}
}
}
}
}
```
#### Error Response Examples
When a resource does not exist, is denied, or encounters an error, the response includes both an `error` message and an `errorCode`:
**Resource Not Found:**
```json theme={null}
{
"error": {
"details": {
"1.1": {
"documents": {
"document1-26-may-2025-folder222": {
"error": "Document does not exist",
"errorCode": "does_not_exist"
}
},
"organization": {
"org1": {
"accessRole": "editor"
}
}
}
},
"message": "Folder or document does not exist",
"status": "NOT_FOUND"
}
}
```
#### API Failure Response
```json theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "User permissions retrieved successfully.",
"data": {
"1.1": {
"documents": {
"document1-26-may-2025-folder2": {
"accessRole": "viewer"
}
},
"organization": {
"org1": {
"accessRole": "editor"
}
}
}
}
}
}
```
# Remove Permissions
Source: https://docs.velt.dev/api-reference/rest-apis/v2/auth/remove-permissions
POST https://api.velt.dev/v2/auth/permissions/remove
Use this API to remove permissions from a user for specific resources like organizations or documents.
This endpoint allows you to revoke access for a user from one or more resources.
# Endpoint
`POST https://api.velt.dev/v2/auth/permissions/remove`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
The ID of the user from whom to remove permissions.
An array of resource objects from which to remove user permissions.
The type of resource. Must be one of: `organization`, `document`, or `folder`.
The ID of the resource.
The ID of the organization. Required if `type` is `document`.
## **Example Requests**
#### Remove permissions from an organization and a document
```JSON theme={null}
{
"data": {
"userId": "USER_ID",
"permissions": {
"resources": [
{
"type": "organization",
"id": "ORGANIZATION_ID"
},
{
"type": "document",
"id": "DOCUMENT_ID",
"organizationId": "ORGANIZATION_ID"
}
]
}
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Permissions removed successfully."
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Permissions removed successfully."
}
}
```
# Add Comment Annotations
Source: https://docs.velt.dev/api-reference/rest-apis/v2/comments-feature/comment-annotations/add-comment-annotations
POST https://api.velt.dev/v2/commentannotations/add
Use this API to add comment annotations to a document within an organization.
* You can add comments on an elemement, text or page.
* You can provide HTML or text content.
* Additional filters can be applied using location IDs.
# Endpoint
`POST https://api.velt.dev/v2/commentannotations/add`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Document ID
When enabled, verifies the user has access to the document before creating comment annotations.
This ensures annotations respect document access permissions configured via Access Control or Permission Provider.
Default: `false`
Custom Annotation ID. If not provided, Velt will generate a unique ID for the annotation.
Location ID
Location Name
Target Element
Element DOM Id
Target Text. Provide this if you want to add comment annotation on the provided text content.
Occurrence. Provide this if you want to add comment annotation on a text content.
Select All Content. Provide this if you want to select and add comment annotation on the entire text content of the target elementId.
Array of Comment Data
Custom Comment ID. If not provided, Velt will generate a unique ID for the comment.
Comment content in plain text string. To tag users, wrap their userId in double curly braces like `{{userId}}`. The frontend will replace this with the user's name.
Comment content in HTML string. To tag users, wrap their userId in double curly braces like `{{userId}}`. The frontend will replace this with the user's name.
Custom key/value metadata object. This is used to store any additional information about the comment.
Use this for self-hosting comments data. Set this as true if you are comments resolver data provider in the SDK.
Use this for self-hosting comments data. Set this as true if this comment will have text content. Sometimes, comments might only have attachments and in that case, set this as false.
When enabled, adding comments via the REST API will trigger in-app notifications, email notifications to relevant users and also trigger webhooks matching the SDK’s native notification behavior. Default: false.
User object from whom the comment is added
Created At timestamp (in milliseconds since epoch).
Last Updated timestamp (in milliseconds since epoch).
Array of tagged user contacts. Use this field to provide information about users tagged in the comment. Each userId wrapped in `{{userId}}` in commentText or commentHtml should have a corresponding entry here so the frontend can replace it with the user's name.
User ID of the tagged user. This should match the userId used in `{{userId}}` syntax within commentText or commentHtml.
Contact information for the tagged user
User ID of the tagged user
Name of the tagged user
Email of the tagged user
Status
Status ID
Status Name
Type. Must be one of: `default`, `ongoing`, or `terminal`.
Text and comment pin color
Background color on the status indicator
Raw SVG of the icon. Either `svg` or `iconUrl` is required.
Icon URL. Either `svg` or `iconUrl` is required.
User object to whom the comment is assigned
Custom key/value metadata object
Created At timestamp (in milliseconds since epoch).
Last Updated timestamp (in milliseconds since epoch).
Priority
Priority ID
Priority Color
Priority Name
Priority Light Color
## **Example Requests**
#### Add comment annotation by organizationId, documentId and location
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"commentAnnotations": [
{
"location": {
"id": "yourLocationId",
"locationName": "yourLocationName"
},
"targetElement": {
"elementId": "yourElementId",
"targetText": "Your Target Text",
"occurrence": 1,
"selectAllContent": false
},
"commentData": [
{
"commentText": "Sample Comment",
"commentHtml": "
Sample Comment
",
"from": {
"userId": "yourUserId",
"name": "yourUserName",
"email": "yourUserEmail",
}
}
]
}
]
}
}
```
#### Add comment annotation with user tagging
```JSON theme={null}
{
"data": {
"organizationId": "acme-corp",
"documentId": "design-mockup-v2",
"commentAnnotations": [
{
"commentData": [
{
"triggerNotification": true,
"commentText": "Hey {{user_sarah_chen}}, can you review this color scheme? I think we should use a darker shade for better contrast.",
"commentHtml": "
Hey {{user_sarah_chen}}, can you review this color scheme? I think we should use a darker shade for better contrast.
",
"from": {
"userId": "user_john_smith",
"name": "John Smith",
"email": "john.smith@acme-corp.com"
},
"taggedUserContacts": [
{
"userId": "user_sarah_chen",
"contact": {
"userId": "user_sarah_chen",
"name": "Sarah Chen",
"email": "sarah.chen@acme-corp.com"
}
}
]
}
]
}
]
}
}
```
In this example, `{{user_sarah_chen}}` in the commentText will be replaced with "Sarah Chen" on the frontend, displaying as "Hey Sarah Chen, can you review this color scheme? I think we should use a darker shade for better contrast."
#### Add comment annotation with permission verification
```JSON theme={null}
{
"data": {
"organizationId": "acme-corp",
"documentId": "design-mockup-v2",
"verifyUserPermissions": true,
"commentAnnotations": [
{
"commentData": [
{
"commentText": "Please review this section",
"from": {
"userId": "user_john_smith",
"name": "John Smith",
"email": "john.smith@acme-corp.com"
}
}
]
}
]
}
}
```
When `verifyUserPermissions` is enabled, the API verifies the user has access to the document before creating the comment annotation. If verification fails, the request will be rejected.
#### Add comment annotation with access context
```JSON theme={null}
{
"data": {
"organizationId": "acme-corp",
"documentId": "analytics-dashboard",
"commentAnnotations": [
{
"context": {
"access": {
"entityId": "numberOfVisitors",
"dashboardId": "myDashboard"
}
},
"commentData": [
{
"commentText": "Traffic numbers look unusual today",
"from": {
"userId": "user_john_smith",
"name": "John Smith",
"email": "john.smith@acme-corp.com"
}
}
]
}
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Comment Annotation(s) added successfully.",
"data": {
"-O0mpUziLcBwzREvZKs6": {
"success": true,
"annotationId": "-O0mpUziLcBwzREvZKs6",
"commentIds": [
126535
],
"message": "Added Successfully"
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Comment Annotation(s) added successfully.",
"data": {
"-O0mpUziLcBwzREvZKs6": {
"success": true,
"annotationId": "-O0mpUziLcBwzREvZKs6",
"commentIds": [
126535
],
"message": "Added Successfully"
}
}
}
}
```
# Delete Comment Annotations
Source: https://docs.velt.dev/api-reference/rest-apis/v2/comments-feature/comment-annotations/delete-comment-annotations
POST https://api.velt.dev/v2/commentannotations/delete
Use this API to delete comment annotations from a document within an organization.
Additional filters can be applied using location IDs, annotation IDs, or user IDs.
# Endpoint
`POST https://api.velt.dev/v2/commentannotations/delete`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Document ID
Array of Location IDs
Array of Annotation IDs
Array of User IDs
## **Example Requests**
#### 1. Delete annotations by organizationId and documentId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId"
}
}
```
#### 2. Delete annotations by organizationId, documentId and locationIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"locationIds": [
"locationx"
]
}
}
```
#### 3. Delete annotations by organizationId, documentId, locationIds and userIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"locationIds": [
"locationx"
],
"userIds": [
"yourUserId"
]
}
}
```
#### 4. Delete annotations by organizationId, documentId and userIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"userIds": [
"yourUserId"
]
}
}
```
#### 5. Delete annotations by organizationId, documentId and annotationIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"annotationIds": [
"yourAnnotationId1",
"yourAnnotationId2"
]
}
}
```
#### 6. Delete annotations by organizationId, documentId, locationIds and annotationIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"locationIds": [
"locationx"
],
"annotationIds": [
"yourAnnotationId1",
"yourAnnotationId2"
]
}
}
```
#### 7. Delete annotations by documentId. This will work if the document was created without an organization.
```JSON theme={null}
{
"data": {
"documentId": "yourDocumentId"
}
}
```
#### 8. Delete annotations by documentId and locationIds. This will work if the document was created without an organization.
```JSON theme={null}
{
"data": {
"documentId": "yourDocumentId",
"locationIds": [
"locationx"
]
}
}
```
#### 9. Delete annotations by documentId and userIds. This will work if the document was created without an organization.
```JSON theme={null}
{
"data": {
"documentId": "yourDocumentId",
"userIds": [
"yourUserId"
]
}
}
```
#### 10. Delete annotations by documentId and annotationIds. This will work if the document was created without an organization.
```JSON theme={null}
{
"data": {
"documentId": "yourDocumentId",
"annotationIds": [
"yourAnnotationId1",
"yourAnnotationId2"
]
}
}
```
#### 11. Delete annotations by documentId, locationIds, and userIds. This will work if the document was created without an organization.
```JSON theme={null}
{
"data": {
"documentId": "yourDocumentId",
"locationIds": [
"locationx"
],
"userIds": [
"yourUserId"
]
}
}
```
#### 12. Delete annotations by documentId, locationIds, and annotationIds. This will work if the document was created without an organization.
```JSON theme={null}
{
"data": {
"documentId": "yourDocumentId",
"locationIds": [
"locationx"
],
"annotationIds": [
"yourAnnotationId1",
"yourAnnotationId2"
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Annotations deleted successfully.",
"data": {
"yourAnnotationId1": {
"success": true,
"id": "yourAnnotationId",
"message": "Deleted Successfully"
},
"yourAnnotationId2": {
"success": false,
"id": "yourAnnotationId2",
"message": "Annotation not found."
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Annotations deleted successfully.",
"data": {
"yourAnnotationId": {
"success": true,
"id": "yourAnnotationId",
"message": "Deleted Successfully"
}
}
}
}
```
# Get Comment Annotations Count
Source: https://docs.velt.dev/api-reference/rest-apis/v2/comments-feature/comment-annotations/get-comment-annotations-count
POST https://api.velt.dev/v2/commentannotations/count/get
Use this API to retrieve the count of comment annotations for specified documents, including both total and unread counts.
Prior to using this API, you must:
* Enable advanced queries option in [the console](https://console.velt.dev/dashboard/config/appconfig)
* Deploy v4 series of the Velt SDK.
# Endpoint
`POST https://api.velt.dev/v2/commentannotations/count/get`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Array of document IDs to get comment annotation counts for. Limit: Only 30 IDs can be passed at a time.
ID of the user requesting the counts
Array of status IDs to filter comments by (e.g., "OPEN", "IN\_PROGRESS")
#### **Example Request**
```JSON theme={null}
{
"data": {
"organizationId": "ORG_ID",
"documentIds": ["DOC_1", "DOC_2"],
"userId": "1.1",
"statusIds": ["OPEN", "IN_PROGRESS"]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Comment count retrieved successfully.",
"data": {
"DOC_1": {
"total": 4,
"unread": 2
},
"DOC_2": {
"total": 2,
"unread": 0
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Comment count retrieved successfully.",
"data": {
"DOC_1": {
"total": 4,
"unread": 2
},
"DOC_2": {
"total": 2,
"unread": 0
}
}
}
}
```
# Get Comment Annotations
Source: https://docs.velt.dev/api-reference/rest-apis/v2/comments-feature/comment-annotations/get-comment-annotations-v2
POST https://api.velt.dev/v2/commentannotations/get
Use this API to retrieve comment annotations from a document within an organization.
Additional filters can be applied using location IDs, annotation IDs, or user IDs.
Prior to using this API, you must:
* Enable advanced queries option in [the console](https://console.velt.dev/dashboard/config/appconfig)
* Deploy v4 series of the Velt SDK.
# Endpoint
`POST https://api.velt.dev/v2/commentannotations/get`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Document ID. Pass a single document Id or use the documentIds field to pass multiple document Ids.
Array of Document IDs. Limit: Only 30 IDs can be passed at a time.
If you don't provide this, data for all documents will be fetched.
Data will be grouped by document ID.
Array of Location IDs. Limit: Only 30 IDs can be passed at a time.
Folder ID. Filters annotations by the folder.
Array of Annotation IDs. Limit: Only 30 IDs can be passed at a time.
Array of User IDs. Limit: Only 30 IDs can be passed at a time.
Status IDs of the annotations to filter on.
Filter annotations updated after the given lastUpdated timestamp (in milliseconds since epoch).
Filter annotations updated before the given lastUpdated timestamp (in milliseconds since epoch).
Filter annotations created after the given createdAt timestamp (in milliseconds since epoch).
Filter annotations created before the given createdAt timestamp (in milliseconds since epoch).
Number of items to be retrieved per page. Default: 1000.
Page token retrieved from previous API call.
## **Example Requests**
#### 1. Get annotations by organizationId and documentId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"pageSize": 10,
"pageToken": "1720441573192",
"statusId": "OPEN"
}
}
```
#### 2. Get annotations by organizationId and documentIds grouped by documentId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentIds": ["yourDocumentId1", "yourDocumentId2"],
"groupByDocumentId": true
}
}
```
#### 3. Get annotations by organizationId, documentId, and locationIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"locationIds": [
"locationx"
],
"pageSize": 10,
"pageToken": "1720441573192",
"statusId": "OPEN"
}
}
```
#### 4. Get annotations by organizationId, documentId, locationIds, and userIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"locationIds": [
"locationx"
],
"userIds": [
"yourUserId"
],
"pageSize": 10,
"pageToken": "1720441573192",
"statusId": "OPEN"
}
}
```
#### 5. Get annotations by organizationId, documentId, and userIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"userIds": [
"yourUserId"
],
"pageSize": 10,
"pageToken": "1720441573192",
"statusId": "OPEN"
}
}
```
#### 6. Get annotations by organizationId, documentId, and annotationIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"annotationIds": [
"yourAnnotationId1",
"yourAnnotationId2"
],
"pageSize": 10,
"pageToken": "1720441573192",
"statusId": "OPEN"
}
}
```
#### 7. Get annotations by organizationId, documentId, locationIds, and annotationIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"locationIds": [
"locationx"
],
"annotationIds": [
"yourAnnotationId1",
"yourAnnotationId2"
],
"pageSize": 10,
"pageToken": "1720441573192",
"statusId": "OPEN"
}
}
```
#### 8. Get annotations by organizationId, statusIds, updatedAfter, and updatedBefore
```JSON theme={null}
{
"data": {
"organizationId": "myorg1",
"statusIds": ["OPEN"],
"updatedAfter": 1720441573192,
"updatedBefore": 1720441573192,
}
}
```
#### 9. Get annotations by organizationId, folderId
```JSON theme={null}
{
"data": {
"organizationId": "myorg1",
"folderId": "folderId1"
}
}
```
# Response
**Response Field Notes:**
* `reactionAnnotationIds`: Returns an array of reaction annotation IDs (strings), not full reaction objects
* `viewedBy`: This field is not currently returned by this endpoint
* `createdAt` and `lastUpdated`: Timestamps are returned in milliseconds since epoch for annotations and in ISO 8601 format for comments
#### Success Response with single documentId
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Annotations fetched successfully.",
"data": [
{
"comments": [
{
"commentId": 123456,
"type": "text",
"to": [],
"status": "updated",
"attachments": [],
"recorders": [],
"reactionAnnotationIds": [
"TPVIZ7VH6rgh4nKm2xjs",
"REgRT9CY852tr12m3kto"
],
"taggedUserContacts": [],
"customList": [],
"toOrganizationUserGroup": [],
"commentText": "This is a sample comment text.",
"commentHtml": "
",
"lastUpdated": "2023-06-15T10:30:00Z",
"createdAt": 1687344600000,
"from": {
"userId": "user123",
"organizationId": "d448b95936703db7d0923122172fb13c",
"userSnippylyId": "1174701858709696",
"photoUrl": "",
"initial": "J",
"clientUserName": "John Doe",
"name": "John Doe",
"clientOrganizationId": "yourOrganizationId",
"plan": "trial",
"email": "john.doe@example.com",
"color": "#a259fe",
"textColor": "#FFFFFF",
"isAdmin": true
},
"isDraft": false,
"isCommentTextAvailable": true
}
],
"type": "comment",
"status": {
"id": "OPEN",
"name": "Open",
"color": "var(--velt-accent, #625DF5)",
"lightColor": "var(--velt-accent-light, #E7E8FA)",
"type": "default",
"svg": "\n \n "
},
"pageInfo": {
"deviceInfo": {
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36",
"browserName": "Chrome",
"browserVersion": "142",
"deviceType": "Tablet",
"orientation": "landscape",
"osName": "Macintosh",
"osVersion": "10.15.7",
"screenWidth": 1512,
"screenHeight": 982
},
"url": "https://example.com/document",
"path": "/document",
"queryParams": "",
"baseUrl": "https://example.com",
"title": "Document Title",
"screenWidth": 1512,
"commentUrl": "https://example.com/document?scommentId=yourAnnotationId"
},
"customList": [],
"subscribedUsers": {
"061a01a98f80f415b1431236b62bb10b": {
"user": {
"userId": "user123"
},
"type": "auto"
}
},
"unsubscribedUsers": {},
"subscribedGroups": {},
"from": {
"userId": "user123",
"organizationId": "d448b95936703db7d0923122172fb13c",
"userSnippylyId": "1174701858709696",
"photoUrl": "",
"initial": "J",
"clientUserName": "John Doe",
"name": "John Doe",
"clientOrganizationId": "yourOrganizationId",
"plan": "trial",
"email": "john.doe@example.com",
"color": "#a259fe",
"textColor": "#FFFFFF",
"isAdmin": true
},
"lastUpdated": 1687344661000,
"createdAt": 1687344600000,
"annotationId": "yourAnnotationId",
"metadata": {
"apiKey": "yourApiKey",
"documentId": "yourDocumentId",
"organizationId": "yourOrganizationId"
},
"annotationNumber": 1,
"annotationIndex": 2
},
null // null is returned only if you provided an annotationId that doesn't exist
],
"nextPageToken": "pageToken"
}
}
```
```JSON Multiple Documents theme={null}
{
"result": {
"status": "success",
"message": "Annotations fetched successfully.",
"data": {
"documentId1": [
{
"annotationId": "annotationId1",
"comments": [
//comment objects
],
"from": {
//from user object
},
"status": {
"color": "#625DF5",
"id": "OPEN",
"lightColor": "#E7E8FA",
"name": "Open",
"type": "default"
},
//other fields
},
{
"annotationId": "annotationId2",
"comments": [
//comment objects
],
"from": {
//from user object
},
"status": {
"color": "#625DF5",
"id": "OPEN",
"lightColor": "#E7E8FA",
"name": "Open",
"type": "default"
},
//other fields
},
],
"documentId1": [
{
"annotationId": "annotationId1",
"comments": [
//comment objects
],
"from": {
//from user object
},
"status": {
"color": "#625DF5",
"id": "OPEN",
"lightColor": "#E7E8FA",
"name": "Open",
"type": "default"
},
//other fields
},
{
"annotationId": "annotationId2",
"comments": [
//comment objects
],
"from": {
//from user object
},
"status": {
"color": "#625DF5",
"id": "OPEN",
"lightColor": "#E7E8FA",
"name": "Open",
"type": "default"
},
//other fields
},
]
},
"nextPageToken": "Ds7NMZw0wWSdmfJFLNioTw=="
}
}
```
# Update Comment Annotations
Source: https://docs.velt.dev/api-reference/rest-apis/v2/comments-feature/comment-annotations/update-comment-annotations
POST https://api.velt.dev/v2/commentannotations/update
Use this API to update comment annotations in a document within an organization.
Additional filters can be applied using location IDs, annotation IDs, or user IDs.
# Endpoint
`POST https://api.velt.dev/v2/commentannotations/update`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Document ID
Array of Location IDs
Array of User IDs. These are the users who created the comment annotation.
Array of Annotation IDs
Location ID
Location Name
Target Element
Element DOM Id
Target Text. Provide this if you want to add comment annotation on the provided text content.
Occurrence. Provide this if you want to add comment annotation on a text content.
Select All Content. Provide this if you want to select and add comment annotation on the entire text content of the target elementId.
User object from whom the Comment Annotation is added
Status
Status ID
Status Name
Type. Must be one of: `default`, `ongoing`, or `terminal`.
Text and comment pin color
Background color on the status indicator
Raw SVG of the icon.
Icon URL.
User object to whom the comment is assigned
Custom key/value metadata object
Priority
Priority ID
Priority Name
Priority Color
Priority Light Color
Old user's ID
Old user's name
Old user's email
New user's ID
New user's name
New user's email
## **Example Requests**
#### 1. Update all comment annotations by organizationId and documentId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"annotationIds": [
"yourAnnotationId1",
"yourAnnotationId2"
],
"updatedData" : {
"status": {
"id": "inprogress",
"name": "In Progress",
"type": "ongoing"
}
}
}
}
```
#### 2. Update comment annotations by organizationId, documentId and locationIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"locationIds": [
"locationx"
],
"annotationIds": [
"yourAnnotationId1",
"yourAnnotationId2"
],
"updatedData" : {
"status": {
"id": "inprogress",
"name": "In Progress",
"type": "ongoing"
}
}
}
}
```
#### 3. Update annotations by organizationId, documentId, locationIds and userIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"locationIds": [
"locationx"
],
"userIds": [
"yourUserId"
],
"annotationIds": [
"yourAnnotationId1",
"yourAnnotationId2"
],
"updatedData" : {
"status": {
"id": "inprogress",
"name": "In Progress",
"type": "ongoing"
}
}
}
}
```
#### 4. Update comment annotations by organizationId, documentId and userIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"userIds": [
"yourUserId"
],
"annotationIds": [
"yourAnnotationId1",
"yourAnnotationId2"
],
"updatedData" : {
"status": {
"id": "inprogress",
"name": "In Progress",
"type": "ongoing"
}
}
}
}
```
#### 5. Update comment annotations by organizationId, documentId and annotationIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"annotationIds": [
"yourAnnotationId1",
"yourAnnotationId2"
],
"updatedData" : {
"status": {
"id": "inprogress",
"name": "In Progress",
"type": "ongoing"
}
}
}
}
```
#### 6. Update comment annotations by organizationId, documentId, locationIds and annotationIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"locationIds": [
"locationx"
],
"annotationIds": [
"yourAnnotationId1",
"yourAnnotationId2"
],
"updatedData" : {
"status": {
"id": "inprogress",
"name": "In Progress",
"type": "ongoing"
}
}
}
}
```
#### 7. Update Users in existing comment annotations
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"annotationIds": [
"yourAnnotationId1",
"yourAnnotationId2"
],
"updateUsers" : [
{
"oldUser": {
"userId": "oldUserId",
},
"newUser": {
"userId": "newUserId",
"name": "newUserName",
"email": "newUserEmail"
}
}
]
}
}
```
#### 8. Update comment annotations with access context
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"annotationIds": [
"yourAnnotationId1"
],
"updatedData": {
"context": {
"access": {
"entityId": "numberOfAccounts",
"dashboardId": "salesDashboard"
}
}
}
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Annotations updated successfully.",
"data": {
"yourAnnotationId1": {
"success": true,
"id": "yourAnnotationId1",
"message": "Annotations updated successfully"
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Annotations updated successfully.",
"data": {
"yourAnnotationId1": {
"success": true,
"id": "yourAnnotationId1",
"message": "Annotations updated successfully"
}
}
}
}
```
# Add Comments
Source: https://docs.velt.dev/api-reference/rest-apis/v2/comments-feature/comments/add-comments
POST https://api.velt.dev/v2/commentannotations/comments/add
Use this API to add comments within a specific CommentAnnotation.
# Endpoint
`POST https://api.velt.dev/v2/commentannotations/comments/add`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
If set to true, a new organization will be created (if it doesn't exist) before the comment is added.
Document ID
If set to true, a new document will be created (if it doesn't exist) before the comment is added.
Comment Annotation ID
When enabled, verifies the user has access to the document before adding comments.
This ensures comments respect document access permissions configured via Access Control or Permission Provider.
Default: `false`
Array of Comment Data
Custom Comment ID. If not provided, Velt will generate a unique ID for the comment.
Comment content in plain text string
Comment content in HTML string
Custom key/value metadata object. This is used to store any additional information about the comment.
Use this for self-hosting comments data. Set this as true if you are comments resolver data provider in the SDK.
Use this for self-hosting comments data. Set this as true if this comment will have text content. Sometimes, comments might only have attachments and in that case, set this as false.
User object from whom the comment is added
Created At timestamp (in milliseconds since epoch).
Last Updated timestamp (in milliseconds since epoch).
Array of tagged user contacts
Display text of the tagged user (e.g. "@Username")
User ID of the tagged user
Email of the tagged user
Name of the tagged user
User ID of the tagged user
Array of attachments to include with the comment. See [Attachment](/api-reference/sdk/models/data-models#attachment) for full schema details.
Unique identifier for the attachment
File name of the attachment
Path to the file in storage bucket
File size in bytes
File type (e.g., "image", "video", "document")
Download URL of the attachment
Thumbnail URL of the attachment
MIME type of the attachment (e.g., "image/png", "video/mp4")
Custom metadata for the attachment (e.g., dimensions, timestamps, etc.)
## **Example Requests**
#### 1. Add comment in a CommentAnnotation by organizationId, documentId, and annotationId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"annotationId": "yourAnnotationId",
"commentData": [
{
"commentText": "Sample Comment",
"commentHtml": "
",
"from": {
"userId": "yourUserId"
}
}
]
}
}
```
When `verifyUserPermissions` is enabled, the API verifies the user has access to the document before adding the comment. If verification fails, the request will be rejected.
#### 3. Add comment with attachments
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"createOrganization": true,
"documentId": "yourDocumentId",
"createDocument": true,
"annotationId": "yourAnnotationId",
"commentData": [
{
"commentId": 123,
"commentText": "Please review this screenshot",
"commentHtml": "
Please review this screenshot
",
"context": {},
"attachments": [
{
"attachmentId": 100001,
"name": "screenshot.png",
"bucketPath": "attachments/org-123/doc-456/screenshot.png",
"size": 1024000,
"type": "image",
"url": "https://storage.googleapis.com/bucket/screenshot.png",
"thumbnail": "https://storage.googleapis.com/bucket/screenshot_thumb.png",
"mimeType": "image/png",
"metadata": {
"width": 1920,
"height": 1080,
"uploadedAt": 1696118400000
}
}
],
"from": {
"userId": "yourUserId"
}
}
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Comment(s) added successfully.",
"data": [
778115
]
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Comment(s) added successfully.",
"data": [
778115
]
}
}
```
# Delete Comments
Source: https://docs.velt.dev/api-reference/rest-apis/v2/comments-feature/comments/delete-comments
POST https://api.velt.dev/v2/commentannotations/comments/delete
Use this API to delete comments within a specific CommentAnnotation.
Additional filters can be applied using comment IDs.
# Endpoint
`POST https://api.velt.dev/v2/commentannotations/comments/delete`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Document ID
Comment Annotation ID
Array of Comment IDs
## **Example Requests**
#### 1. Delete all comments of a CommentAnnotation by organizationId, documentId, and annotationId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"annotationId": "yourAnnotationId"
}
}
```
#### 2. Delete specific comments of a CommentAnnotation by organizationId, documentId, annotationId and commentIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"annotationId": "yourAnnotationId",
"commentIds": [
153783,
607395
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Comments(s) deleted successfully.",
"data": {
"153783": {
"success": true,
"id": 153783,
"message": "Deleted successfully"
},
"607395": {
"success": false,
"id": 607395,
"message": "Not found"
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Comments(s) deleted successfully.",
"data": {
"153783": {
"success": true,
"id": 153783,
"message": "Deleted successfully"
}
}
}
}
```
# Get Comments
Source: https://docs.velt.dev/api-reference/rest-apis/v2/comments-feature/comments/get-comments
POST https://api.velt.dev/v2/commentannotations/comments/get
Use this API to retrieve comments in a specific CommentAnnotation.
Additional filters can be applied using comment IDs.
Prior to using this API, you must:
* Enable advanced queries option in [the console](https://console.velt.dev/dashboard/config/appconfig)
* Deploy v4 series of the Velt SDK.
# Endpoint
`POST https://api.velt.dev/v2/commentannotations/comments/get`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Document ID
Comment Annotation ID
User IDs
Array of Comment IDs
## **Example Requests**
#### 1. Get all comments with a CommentAnnotation by organizationId, documentId, and annotationId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"annotationId": "yourAnnotationId"
}
}
```
#### 2. Get specific comments of a CommentAnnotation by organizationId, documentId, annotationId and commentIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"annotationId": "yourAnnotationId",
"commentIds": [
153783,
607395
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Comments(s) retrieved successfully.",
"data": [
{
"commentHtml": "
",
"commentId": 153783,
"commentText": "Sample Comment Text",
"from": {
"email": "user@example.com",
"name": "User Name",
"userId": "yourUserId"
},
"lastUpdated": "2024-06-20T09:53:42.258Z",
"status": "added",
"type": "text",
"reactionAnnotations": [
{
"reactionId": "reaction_001",
"emoji": "👍",
"from": {
"userId": "user456",
"name": "Jane Smith",
"email": "jane.smith@example.com"
},
"createdAt": "2024-06-20T09:55:00Z"
}
]
}
]
}
}
```
# Update Comments
Source: https://docs.velt.dev/api-reference/rest-apis/v2/comments-feature/comments/update-comments
POST https://api.velt.dev/v2/commentannotations/comments/update
Use this API to update comments within a specific CommentAnnotation.
# Endpoint
`POST https://api.velt.dev/v2/commentannotations/comments/update`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Document ID
Comment Annotation ID
Comment IDs
Comment data
Comment content in plain text string
Comment content in HTML string
Custom key/value metadata object. This is used to store any additional information about the comment.
Use this for self-hosting comments data. Set this as true if you are comments resolver data provider in the SDK.
Use this for self-hosting comments data. Set this as true if this comment will have text content. Sometimes, comments might only have attachments and in that case, set this as false.
User object from whom the comment is added
Array of tagged user contacts
Display text of the tagged user (e.g. "@Username")
User ID of the tagged user
Email of the tagged user
Name of the tagged user
User ID of the tagged user
Array of attachments to include with the comment. See [Attachment](/api-reference/sdk/models/data-models#attachment) for full schema details.
Unique identifier for the attachment
File name of the attachment
Path to the file in storage bucket
File size in bytes
File type (e.g., "image", "video", "document")
Download URL of the attachment
Thumbnail URL of the attachment
MIME type of the attachment (e.g., "image/png", "video/mp4")
Custom metadata for the attachment (e.g., dimensions, timestamps, etc.)
## **Example Requests**
#### 1. Update comment in a CommentAnnotation by organizationId, documentId, annotationId and commentId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"annotationId": "yourAnnotationId",
"commentIds": [
153783,
607395
],
"updatedData": {
"commentText": "Sample Updated Comment",
"commentHtml": "
Hello Updated
"
}
}
}
```
#### 2. Update comment with attachments
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"annotationId": "yourAnnotationId",
"commentIds": [
123456
],
"updatedData": {
"commentText": "Updated comment text with new attachments",
"commentHtml": "
Updated comment text with new attachments
",
"attachments": [
{
"attachmentId": 100001,
"name": "updated-screenshot.png",
"bucketPath": "attachments/org-123/doc-456/updated-screenshot.png",
"size": 1536000,
"type": "image",
"url": "https://storage.googleapis.com/bucket/updated-screenshot.png",
"thumbnail": "https://storage.googleapis.com/bucket/updated-screenshot_thumb.png",
"mimeType": "image/png",
"metadata": {
"width": 1920,
"height": 1080,
"updatedAt": 1696122000000
}
}
]
}
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Comment updated successfully.",
"data": {
"607395": {
"success": true,
"id": 607395,
"message": "Updated successfully"
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Comment updated successfully.",
"data": {
"607395": {
"success": true,
"id": 607395,
"message": "Updated successfully"
}
}
}
}
```
# Add Documents
Source: https://docs.velt.dev/api-reference/rest-apis/v2/documents/add-documents
POST https://api.velt.dev/v2/organizations/documents/add
Use this API to add documents with metadata to an organization.
# Endpoint
`POST https://api.velt.dev/v2/organizations/documents/add`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
If set to true, a new organization will be created (if it doesn't exist) before the document(s) are created.
Array of Document objects
Folder ID to add the documents to.
If set to true and `folderId` is provided but doesn't exist, a new folder will be created before the document(s) are created.
## **Example Requests**
#### 1. Create new documents
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documents": [
{
"documentId": "yourDocumentId",
"documentName": "Your Document Name"
}
]
}
}
```
#### 2. Create new documents in a specific folder
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documents": [
{
"documentId": "yourDocumentId",
"documentName": "Your Document Name"
}
],
"folderId": "yourFolderId"
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Document(s) added successfully.",
"data": {
"yourDocumentId": {
"success": true,
"id": "8121657101517513",
"message": "Added Successfully"
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Document(s) added successfully.",
"data": {
"yourDocumentId": {
"success": true,
"id": "8121657101517513",
"message": "Added Successfully"
}
}
}
}
```
# Delete Documents
Source: https://docs.velt.dev/api-reference/rest-apis/v2/documents/delete-documents
POST https://api.velt.dev/v2/organizations/documents/delete
Use this API to delete specific documents from an organization.
# Endpoint
`POST https://api.velt.dev/v2/organizations/documents/delete`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Array of Document IDs
## **Example Requests**
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentIds": ["yourDocumentId1", "yourDocumentId2"]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Document(s) deleted successfully.",
"data": {
"yourDocumentId1": {
"success": true,
"id": "6737987049068973",
"message": "Deleted Successfully"
},
"yourDocumentId2": {
"success": true,
"id": "2131443384150904",
"message": "Document does not exist"
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Document(s) deleted successfully.",
"data": {
"yourDocumentId1": {
"success": true,
"id": "6737987049068973",
"message": "Deleted Successfully"
}
}
}
}
```
# Get Documents
Source: https://docs.velt.dev/api-reference/rest-apis/v2/documents/get-documents-v2
POST https://api.velt.dev/v2/organizations/documents/get
Use this API to retrieve specific documents or all documents from an organization.
Prior to using this API, you must:
* Enable advanced queries option in [the console](https://console.velt.dev/dashboard/config/appconfig)
* Deploy v4 series of the Velt SDK.
# Endpoint
`POST https://api.velt.dev/v2/organizations/documents/get`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Array of Document IDs. Limit: Only 30 IDs can be passed at a time.
Folder ID. Filters documents by the given folder ID.
Number of items to be retrieved per page. Default: 1000.
Page token retrieved from previous API call.
## **Example Requests**
#### 1. Get all documents from organization
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"pageSize": 20,
"pageToken": "8740648311207869"
}
}
```
#### 2. Get specific documents from organization
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentIds": ["yourDocumentId1", "yourDocumentId2"],
}
}
```
#### 3. Get documents by organizationId, folderId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"folderId": "yourFolderId"
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Document(s) retrieved successfully.",
"data": [
{
"documentName": "yourDocumentName",
"disabled": false,
"accessType": "public",
"id": "yourDocumentId",
}
],
"pageToken": "nextPageToken"
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Document(s) retrieved successfully.",
"data": [
{
"documentName": "yourDocumentName",
"disabled": false,
"accessType": "public",
"id": "yourDocumentId",
}
],
"pageToken": "nextPageToken"
}
}
```
# Move Documents
Source: https://docs.velt.dev/api-reference/rest-apis/v2/documents/move-documents
POST https://api.velt.dev/v2/organizations/documents/move
Use this API to move documents to a different folder within an organization.
# Endpoint
`POST https://api.velt.dev/v2/organizations/documents/move`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Array of Document IDs. Limit: Only 30 IDs can be passed at a time.
ID of the folder where documents will be moved
## **Example Requests**
#### Move documents to a folder
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentIds": ["yourDocumentId1", "yourDocumentId2"],
"folderId": "targetFolderId"
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Documents moved successfully."
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Documents moved successfully."
}
}
```
# Update Access for Documents
Source: https://docs.velt.dev/api-reference/rest-apis/v2/documents/update-document-access
POST https://api.velt.dev/v2/organizations/documents/access/update
Use this API to update the access type for a single or multiple documents at once.
You can update the default access type for all the documents associated with your API Key in [console](https://console.velt.dev/dashboard/config/appconfig).
# Endpoint
`https://api.velt.dev/v2/organizations/documents/access/update`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Array of Document IDs
Access type for the documents. Allowed values: `organizationPrivate`, `restricted`, `public`.
[Learn more](/key-concepts/overview#access-control).
## **Example Requests**
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentIds": ["yourDocumentId1, yourDocumentId2"],
"accessType": "organizationPrivate"
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Updated access for documents successfully.",
"data": {
"yourDocumentId": {
"success": true,
"accessType": "organizationPrivate",
"message": "Document access type updated."
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Updated access for documents successfully.",
"data": {
"yourDocumentId": {
"success": true,
"accessType": "organizationPrivate",
"message": "Document access type updated."
}
}
}
}
```
# Update Disabled State for Documents
Source: https://docs.velt.dev/api-reference/rest-apis/v2/documents/update-document-disable-state
POST https://api.velt.dev/v2/organizations/documents/access/disablestate/update
Use this API to enable or disable both read and write access for all users.
Let's say your customer's trial or subscription has ended and you want to disable their access to the Velt data, you could use this to diable access to specific documents.
# Endpoint
`https://api.velt.dev/v2/organizations/documents/access/disablestate/update`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Array of Document IDs
Whether to disable read and write access to the specified documents. Allowed values: `true`, `false`
## **Example Requests**
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentIds": ["yourDocumentId"],
"disabled": true
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Updated disable state for documents successfully.",
"data": {
"yourDocumentId": {
"success": true,
"disabled": true,
"message": "Document disabled state updated."
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Updated disable state for documents successfully.",
"data": {
"yourDocumentId": {
"success": true,
"disabled": true,
"message": "Document disabled state updated."
}
}
}
}
```
# Update Documents
Source: https://docs.velt.dev/api-reference/rest-apis/v2/documents/update-documents
POST https://api.velt.dev/v2/organizations/documents/update
Use this API to update metadata of documents within an organization.
# Endpoint
`POST https://api.velt.dev/v2/organizations/documents/update`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Array of Document objects
## **Example Requests**
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documents": [
{
"documentId": "yourDocumentId",
"documentName": "Your Document Name"
}
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Document(s) updated successfully.",
"data": {
"yourDocumentId": {
"success": true,
"id": "8121657101517513",
"message": "Updated Successfully"
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Document(s) updated successfully.",
"data": {
"yourDocumentId": {
"success": true,
"id": "8121657101517513",
"message": "Updated Successfully"
}
}
}
}
```
# Add Folder
Source: https://docs.velt.dev/api-reference/rest-apis/v2/folders/add-folder
POST https://api.velt.dev/v2/organizations/folders/add
Use this API to create a new folder in an organization.
Prior to using this API, you must:
* Enable advanced queries option in [the console](https://console.velt.dev/dashboard/config/appconfig)
* Deploy v4 series of the Velt SDK.
# Endpoint
`POST https://api.velt.dev/v2/organizations/folders/add`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
If set to true, a new organization will be created (if it doesn't exist) before the folder is created.
Unique identifier for the new folder
Name of the folder
ID of the parent folder
Access type for the folder. Allowed values: `organizationPrivate`, `restricted`, `public`. [Learn more](/key-concepts/overview#access-control).
## **Example Requests**
#### 1. Create folder without access type
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"folders": [
{
"folderId": "yourFolderId",
"folderName": "yourFolderName",
"parentFolderId": "yourParentFolderId"
}
]
}
}
```
#### 2. Create folder with restricted access type
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"folders": [
{
"folderId": "folder2025",
"folderName": "folder2025",
"accessType": "restricted"
}
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Folder created successfully.",
"data": {
"yourFolderId": {
"success": true,
"id": "yourFolderId",
"message": "Folder added."
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Folder created successfully.",
"data": {
"yourFolderId": {
"success": true,
"id": "yourFolderId",
"message": "Folder added."
}
}
}
}
```
# Delete Folder
Source: https://docs.velt.dev/api-reference/rest-apis/v2/folders/delete-folder
POST https://api.velt.dev/v2/organizations/folders/delete
Delete a folder and all its contents (documents and subfolders).
Prior to using this API, you must:
* Enable advanced queries option in [the console](https://console.velt.dev/dashboard/config/appconfig)
* Deploy v4 series of the Velt SDK.
# Endpoint
`POST https://api.velt.dev/v2/organizations/folders/delete`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
Organization ID
ID of the folder to delete.
## **Example Request**
```JSON theme={null}
{
"data": {
"organizationId": "org10",
"folderId": "folderId2"
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Folder deletion initiated successfully.",
"data": null
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"code": "not-found",
"message": "Folder not found."
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Folder deletion initiated successfully.",
"data": null
}
}
```
# Get Folders
Source: https://docs.velt.dev/api-reference/rest-apis/v2/folders/get-folders
POST https://api.velt.dev/v2/organizations/folders/get
Use this API to retrieve the given folder's metadata and its subfolders. You can retrieve nested subfolders at any depth level using the `maxDepth` parameter. The response includes an `ancestors` array showing the parent hierarchy and an `inheritAccessFromParent` field indicating whether access is inherited.
Prior to using this API, you must:
* Enable advanced queries option in [the console](https://console.velt.dev/dashboard/config/appconfig)
* Deploy v4 series of the Velt SDK.
# Endpoint
`POST https://api.velt.dev/v2/organizations/folders/get`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Folder ID to retrieve a specific folder and its subfolders. If not provided, all folders in the organization will be retrieved.
Maximum depth level for retrieving nested subfolders. Allows you to retrieve subfolders at any depth level. If not provided, only immediate subfolders are retrieved.
## **Example Requests**
#### 1. Get all folders in organization
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId"
}
}
```
#### 2. Get specific folder in an organization
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"folderId": "yourFolderId"
}
}
```
#### 3. Get folder with nested subfolders at specific depth
Use the `maxDepth` parameter to retrieve nested subfolders at any depth level. The response includes an `ancestors` array showing the parent hierarchy and an `inheritAccessFromParent` field indicating whether access is inherited.
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"folderId": "yourFolderId",
"maxDepth": 3
}
}
```
# Response
#### Success Response for All Folders
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Folders retrieved successfully.",
"data": [
{
"folderId": "folderId1",
"folderName": "Folder 1",
"organizationId": "yourOrganizationId",
"parentFolderId": "root",
"apiKey": "yourApiKey",
"createdAt": 1738695615706,
"lastUpdated": 1738696287859,
"ancestors": ["root"],
"accessType": "public",
"inheritAccessFromParent": false
},
{
"folderId": "folderId2",
"folderName": "Folder 2",
"organizationId": "yourOrganizationId",
"parentFolderId": "root",
"apiKey": "yourApiKey",
"createdAt": 1738695077691,
"lastUpdated": 1738695077691,
"ancestors": ["root"],
"accessType": "restricted",
"inheritAccessFromParent": true
}
]
}
}
```
#### Success Response for Specific Folder
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Folder(s) retrieved successfully.",
"data": [
{
"folderId": "folderId1",
"folderName": "Folder 1",
"organizationId": "yourOrganizationId",
"parentFolderId": "root",
"apiKey": "yourApiKey",
"createdAt": 1738695077691,
"lastUpdated": 1738695077691,
"ancestors": ["root"],
"accessType": "public",
"inheritAccessFromParent": false,
"subFolders": [
{
"folderId": "childFolderId1",
"folderName": "Child Folder 1",
"organizationId": "yourOrganizationId",
"parentFolderId": "folderId1",
"apiKey": "yourApiKey",
"createdAt": 1738695615706,
"lastUpdated": 1738698727591,
"ancestors": ["root", "folderId1"],
"accessType": "public",
"inheritAccessFromParent": true
}
]
}
]
}
}
```
#### Success Response with maxDepth
When using `maxDepth`, the response includes deeply nested subfolders. Each folder includes an `ancestors` array showing its full parent hierarchy and an `inheritAccessFromParent` field indicating whether it inherits access permissions from its parent.
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Folder(s) retrieved successfully.",
"data": [
{
"folderId": "folder1",
"folderName": "folder1",
"parentFolderId": "root",
"apiKey": "yourApiKey",
"organizationId": "yourOrganizationId",
"createdAt": 1758876118035,
"lastUpdated": 1758876118035,
"ancestors": ["root"],
"accessType": "public",
"inheritAccessFromParent": false,
"subFolders": [
{
"folderId": "folder1.1",
"folderName": "folder1.1",
"parentFolderId": "folder1",
"apiKey": "yourApiKey",
"organizationId": "yourOrganizationId",
"createdAt": 1758876239180,
"lastUpdated": 1758876239180,
"ancestors": ["root", "folder1"],
"accessType": "public",
"inheritAccessFromParent": true,
"subFolders": [
{
"folderId": "folder1.1.1",
"folderName": "folder1.1.1",
"apiKey": "yourApiKey",
"organizationId": "yourOrganizationId",
"parentFolderId": "folder1.1",
"createdAt": 1758883072416,
"lastUpdated": 1758883072416,
"ancestors": ["root", "folder1", "folder1.1"],
"accessType": "public",
"inheritAccessFromParent": false,
"subFolders": [
{
"folderId": "folder1.1.1.1",
"folderName": "folder1.1.1.1",
"parentFolderId": "folder1.1.1",
"apiKey": "yourApiKey",
"organizationId": "yourOrganizationId",
"createdAt": 1758906266851,
"lastUpdated": 1758906266851,
"ancestors": ["root", "folder1", "folder1.1", "folder1.1.1"],
"accessType": "public",
"inheritAccessFromParent": true
}
]
}
]
}
]
}
]
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Folder(s) retrieved successfully.",
"data": [
{
"folderId": "folder1",
"folderName": "folder1",
"parentFolderId": "root",
"apiKey": "yourApiKey",
"organizationId": "yourOrganizationId",
"createdAt": 1758876118035,
"lastUpdated": 1758876118035,
"ancestors": ["root"],
"accessType": "public",
"inheritAccessFromParent": false,
"subFolders": [
{
"folderId": "folder1.1",
"folderName": "folder1.1",
"parentFolderId": "folder1",
"apiKey": "yourApiKey",
"organizationId": "yourOrganizationId",
"createdAt": 1758876239180,
"lastUpdated": 1758876239180,
"ancestors": ["root", "folder1"],
"accessType": "public",
"inheritAccessFromParent": true,
"subFolders": [
{
"folderId": "folder1.1.1",
"folderName": "folder1.1.1",
"apiKey": "yourApiKey",
"organizationId": "yourOrganizationId",
"parentFolderId": "folder1.1",
"createdAt": 1758883072416,
"lastUpdated": 1758883072416,
"ancestors": ["root", "folder1", "folder1.1"],
"accessType": "public",
"inheritAccessFromParent": false,
"subFolders": [
{
"folderId": "folder1.1.1.1",
"folderName": "folder1.1.1.1",
"parentFolderId": "folder1.1.1",
"apiKey": "yourApiKey",
"organizationId": "yourOrganizationId",
"createdAt": 1758906266851,
"lastUpdated": 1758906266851,
"ancestors": ["root", "folder1", "folder1.1", "folder1.1.1"],
"accessType": "public",
"inheritAccessFromParent": true
}
]
}
]
}
]
}
]
}
}
```
# Update Folder
Source: https://docs.velt.dev/api-reference/rest-apis/v2/folders/update-folder
POST https://api.velt.dev/v2/organizations/folders/update
Use this API to:
1. update metadata of a folder within an organization.
2. move a folder and its contents to a different parent folder.
Prior to using this API, you must:
* Enable advanced queries option in [the console](https://console.velt.dev/dashboard/config/appconfig)
* Deploy v4 series of the Velt SDK.
**Automatic Folder Move Handling:** When moving a folder to a different parent by updating the `parentFolderId`, the API automatically updates the folder's `ancestors` array and `accessType`, and propagates these changes to all subfolders within the moved folder.
# Endpoint
`POST https://api.velt.dev/v2/organizations/folders/update`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Unique identifier for the new folder
Name of the folder
ID of the parent folder
## **Example Request**
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"folders": [
{
"folderId": "yourFolderId",
"folderName": "yourFolderName",
"parentFolderId": "yourParentFolderId"
}
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Folder Updated successfully.",
"data": {
"yourFolderId": {
"success": true,
"id": "yourFolderId",
"message": "Folder Updated."
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Folder Updated successfully.",
"data": {
"yourFolderId": {
"success": true,
"id": "yourFolderId",
"message": "Folder Updated."
}
}
}
}
```
# Update Access for Folders
Source: https://docs.velt.dev/api-reference/rest-apis/v2/folders/update-folder-access
POST https://api.velt.dev/v2/organizations/folders/access/update
Use this API to update the access type for a single or multiple folders at once.
You can update the default access type for all the folders associated with your API Key in [console](https://console.velt.dev/dashboard/config/appconfig).
# Endpoint
`https://api.velt.dev/v2/organizations/folders/access/update`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Array of Folder IDs
Access type for the folders. Allowed values: `organizationPrivate`, `restricted`, `public`.
[Learn more](/key-concepts/overview#access-control).
Configure the folder to inherit access permissions from its parent folder. When set to `true`, the folder automatically inherits all access settings from its parent.
## **Example Requests**
#### 1. Update folder access type
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"folderIds": ["yourFolderId1, yourFolderId2"],
"accessType": "organizationPrivate"
}
}
```
#### 2. Configure folder to inherit access from parent
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"folderIds": ["yourFolderId1"],
"inheritFromParent": true
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Updated access for folders successfully.",
"data": {
"yourFolderId": {
"success": true,
"accessType": "organizationPrivate",
"message": "Folder access type updated."
}
}
}
}
```
#### Success Inherit Access From Parent Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Folder access type updated.",
"data": {
"folder1": {
"success": true,
"accessType": null,
"inheritFromParent": true,
"message": "Folder access type updated."
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Updated access for folders successfully.",
"data": {
"yourFolderId": {
"success": true,
"accessType": "organizationPrivate",
"message": "Folder access type updated."
}
}
}
}
```
# Delete All User Data
Source: https://docs.velt.dev/api-reference/rest-apis/v2/gdpr/delete-all-user-data-gdpr
POST https://api.velt.dev/v2/users/data/delete
Remove All User data from Velt.
Use this API to remove all user data from Velt. This will:
* remove their access from all the documents and data in the organization.
* remove them from @mention contact dropdown list.
* remove them from @mentions where they were tagged.
* remove all feature data created by the user. eg: comments, reactions etc.
- This API may take up to 5 minutes to return a 202 response since it runs an asynchronous job to delete user data across the system.
- To speed up this process, you can optionally provide the organizationIds where the user belongs.
- The actual deletion of data can take upto 24 hours to complete.
# Endpoint
`POST https://api.velt.dev/v2/users/data/delete`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Array of user Ids.
Array of organization Ids. These are the organizations that the user is part of.
## **Example Request**
```JSON theme={null}
{
"data": {
"userIds": [
"yourUserId1",
"yourUserId2"
],
"organizationIds": [
"yourOrganizationId1",
"yourOrganizationId2"
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"status": "success",
"message": "Data deletion process has been initiated.",
"data": {
"jobId": "dsQuvPmIynANgPLLEhCm",
"tasksCount": 5
},
"statusCode": 202
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"status": "success",
"message": "Data deletion process has been initiated.",
"data": {
"jobId": "dsQuvPmIynANgPLLEhCm",
"tasksCount": 5
},
"statusCode": 202
}
```
# Get All User Data
Source: https://docs.velt.dev/api-reference/rest-apis/v2/gdpr/get-all-user-data-gdpr
POST https://api.velt.dev/v2/users/data/get
Get all feature data for a user stored in Velt.
Use this API to get all feature data for a user stored in Velt.
* The data will be paginated and returned in chunks of 100 items per feature data.
* You can use the `nextPageToken` returned in the response to fetch the next chunk of data.
* If there are no more items to fetch, the `nextPageToken` will not be returned.
* Here is the data that will be included:
* **User profile data:** If they were added to any organization, document or folder.
* **Comments data:** All the comments created by the user or where they were involved in.
* **Reactions data:** All the reactions created by the user.
* **Notifications data:** All the notifications where the user was involved in.
* **Recordings data:** All the recordings created by the user.
This API may take a few seconds to return a response depending on the dataset size.
# Endpoint
`POST https://api.velt.dev/v2/users/data/get`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
The organization Id of the organization that the user is part of.
The user Id of the user you want to get the data for.
Page token retrieved from previous API call.
## **Example Request**
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"userId": "yourUserId",
"pageToken": "yourPageToken"
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Data fetched successfully.",
"data": {
"comments": [..], //Upto 100 items. Empty array if no items are found.
"reactions": [..], //Upto 100 items. Empty array if no items are found.
"recordings": [..], //Upto 100 items. Empty array if no items are found.
"notifications": [..] //Upto 100 items. Empty array if no items are found.
},
"nextPageToken": "bhdwdqwjs298e39e479ddkeuw==329" // This will be null if there are no more items to fetch.
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT",
"code": 500
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Data fetched successfully.",
"data": {
"comments": [..], //Upto 100 items. Empty array if no items are found.
"reactions": [..], //Upto 100 items. Empty array if no items are found.
"recordings": [..], //Upto 100 items. Empty array if no items are found.
"notifications": [..] //Upto 100 items. Empty array if no items are found.
},
"nextPageToken": "bhdwdqwjs298e39e479ddkeuw==329" //This will be null if there are no more items to fetch.
}
}
```
# Get Delete All User Data Status
Source: https://docs.velt.dev/api-reference/rest-apis/v2/gdpr/get-delete-user-data-status-gdpr
POST https://api.velt.dev/v2/users/data/delete/status
Get the status of the data deletion process for a user.
Use this API to get the status of the data deletion process for a user.
This API may take a few seconds to return a response depending on the dataset size.
# Endpoint
`POST https://api.velt.dev/v2/users/data/delete/status`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
The job Id of the data deletion process.
## **Example Request**
```JSON theme={null}
{
"data": {
"jobId": "yourJobId"
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Data fetched successfully.",
"data": {
"isDeleteCompleted": true,
"tasksLeft": 0,
"lastTaskCompletedTime": 1748972106739
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT",
"code": 500
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Data fetched successfully.",
"data": {
"isDeleteCompleted": true,
"tasksLeft": 0,
"lastTaskCompletedTime": 1748972106739
}
}
}
```
# Broadcast Event
Source: https://docs.velt.dev/api-reference/rest-apis/v2/livestate/broadcast-event
POST https://api.velt.dev/v2/livestate/broadcast
Use this API to broadcast live state events to any document. Use it with the [Live State](/realtime-collaboration/live-state-sync/setup#get-live-data) feature.
# Endpoint
`POST https://api.velt.dev/v2/livestate/broadcast`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body Parameters
Organization ID where the document belongs
Document ID to broadcast the event to
Unique identifier for the live state data
The data to broadcast. Can be any valid serializable JSON object.
If true, merges the new data with existing data instead of replacing it
## Example Request
```JSON theme={null}
{
"organizationId": "YOUR_ORGANIZATION_ID",
"documentId": "YOUR_DOCUMENT_ID",
"liveStateDataId": "sample_live_state_data_id",
"data": {
"status": "active",
"message": "Hello World",
"customField": "custom value"
},
"merge": true
}
```
# Response
## Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Event broadcasted successfully.",
"data": {
"success": true
}
}
}
```
## Error Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "ERROR_CODE"
}
}
```
```json theme={null}
{
"result": {
"status": "success",
"message": "Event broadcasted successfully.",
"data": {
"success": true
}
}
}
```
# Add Notifications
Source: https://docs.velt.dev/api-reference/rest-apis/v2/notifications/add-notifications
POST https://api.velt.dev/v2/notifications/add
Use this API to add notifications.
# Endpoint
`POST https://api.velt.dev/v2/notifications/add`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
If set to true, a new organization will be created (if it doesn't exist) before the notification is created.
Document ID
If set to true, a new document will be created before the notification is created.
User who took the action
When enabled, notifications are only created for users who have access to the specified document.
This ensures notifications respect document access permissions configured via Access Control or Permission Provider.
Default: `false`
Notification ID. If not provided, Velt will generate a random ID.
Use this if you want more control on the ID being set and prevent duplicate notifications.
Only the special characters `_`, `-` are allowed.
Display Headline Message Template
Display Headline Message Template Data (Optional)
User who took the action
User who was directly affected by the action
Any custom field with string value
Display Body Message
Array of Notify Users
Default is true.
If set to true, the notification will be sent to all users in the organization.
If set to false, the notification will be sent to only the users specified in the `notifyUsers` array.
Any custom object to be stored with the notification.
When the user clicks on the notification, this data will be sent in the callback.
Context for filtering notifications. Use this to enable context-based filtering of notifications.
Key-value pairs for filtering. Keys are custom field names, values are strings or numbers.
```json theme={null}
{
"entityId": "numberOfVisitors",
"dashboardId": "myDashboard"
}
```
## **Example Request**
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"actionUser": {
"userId": "yourUserId",
"name": "User Name",
"email": "user@example.com"
},
"displayHeadlineMessageTemplate": "This is main template, you can pass variables using curly brackets like this: {actionUser}, {recipientUser}, {yourCustomVariableWithStringValue}",
"displayHeadlineMessageTemplateData": {
"actionUser": {
"userId": "yourUserId",
"name": "User Name",
"email": "user@example.com"
},
"recipientUser": {
"userId": "recipientUserId",
"name": "Recipient Name",
"email": "recipient@example.com"
},
"yourCustomField": "Variable will be replaced with this text"
},
"displayBodyMessage": "This is body message (Secondary message)",
"notifyUsers": [
{
"email": "test@example.com",
"userId": "testingUserId"
},
{
"userId": "yourUserId",
"name": "User Name",
"email": "user@example.com"
}
]
}
}
```
## **Example Request with Permission Verification**
```JSON theme={null}
{
"data": {
"organizationId": "org1",
"documentId": "document3",
"actionUser": {
"userId": "1.1"
},
"verifyUserPermissions": true,
"displayHeadlineMessageTemplate": "This is main template, you can pass variables using curly brackets like this: {actionUser}, {recipientUser}",
"displayHeadlineMessageTemplateData": {
"actionUser": {
"userId": "1.1"
},
"recipientUser": {
"userId": "2.2"
}
},
"displayBodyMessage": "This is body message (Secondary message)",
"notifyUsers": [
{
"userId": "2.2"
}
],
"notifyAll": false
}
}
```
When `verifyUserPermissions` is enabled, the API checks document access for each user before creating notifications. Only users with access to the document will receive notifications.
## **Example Request with Context**
```JSON theme={null}
{
"data": {
"organizationId": "org1",
"documentId": "document3",
"actionUser": {
"userId": "1.1",
"name": "User One",
"email": "user1@example.com"
},
"context": {
"access": {
"entityId": "numberOfVisitors",
"dashboardId": "myDashboard"
}
},
"displayHeadlineMessageTemplate": "New comment on {entityName}",
"displayHeadlineMessageTemplateData": {
"entityName": "Visitor Analytics"
},
"displayBodyMessage": "A new comment has been added to the visitor analytics dashboard",
"notifyUsers": [
{
"userId": "2.2"
}
],
"notifyAll": false
}
}
```
When context is provided, notifications will be filtered based on the specified context fields. Users will only receive notifications that match their context permissions.
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Notification added successfully.",
"data": {
"success": true,
"message": "Notification added successfully."
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Notification added successfully.",
"data": {
"success": true,
"message": "Notification added successfully."
}
}
}
```
# Delete Notifications
Source: https://docs.velt.dev/api-reference/rest-apis/v2/notifications/delete-notifications
POST https://api.velt.dev/v2/notifications/delete
Use this API to delete notifications.
# Endpoint
`POST https://api.velt.dev/v2/notifications/delete`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Document ID (Optional)
Location ID (Optional)
User ID (Optional)
Array of Notification IDs (Optional)
## **Example Requests**
#### 1. Delete by organizationId and documentId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId"
}
}
```
#### 2. Delete by organizationId, documentId and notificationIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"notificationIds": [
"yourNotificationId"
]
}
}
```
#### 3. Delete by organizationId and userId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"userId": "yourUserId"
}
}
```
#### 4. Delete by organizationId, userId and notificationIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"userId": "yourUserId",
"notificationIds": [
"yourNotificationId"
]
}
}
```
#### 5. Delete by organizationId, documentId and userId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"userId": "yourUserId"
}
}
```
#### 6. Delete by organizationId, documentId, userId and notificationIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"userId": "yourUserId",
"notificationIds": [
"yourNotificationId"
]
}
}
```
#### 7.Delete by organizationId, documentId and locationId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"locationId": "yourLocationId"
}
}
```
#### 8. Delete by organizationId, documentId, locationId and notificationIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"locationId": "yourLocationId",
"notificationIds": [
"yourNotificationId"
]
}
}
```
#### 9. Delete by organizationId, locationId and userId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"locationId": "yourLocationId",
"userId": "yourUserId",
}
}
```
#### 10. Delete by organizationId, locationId, userId, and notificationIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"locationId": "yourLocationId",
"userId": "yourUserId",
"notificationIds": [
"yourNotificationId"
]
}
}
```
#### 11. Delete by organizationId, documentId, locationId and userId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"locationId": "yourLocationId",
"userId": "yourUserId",
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Notification(s) deleted successfully.",
"data": {
"8955243231506071": {
"success": true,
"message": "Notification deleted."
}
}
}
}
```
#### When some notifications are not found
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Notification(s) deleted successfully.",
"data": {
"89552432315060712": {
"success": false,
"message": "Failed to delete notification."
},
"8955243231506071": {
"success": true,
"message": "Notification deleted."
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Notification(s) deleted successfully.",
"data": {
"8955243231506071": {
"success": true,
"message": "Notification deleted."
}
}
}
}
```
# Get Config
Source: https://docs.velt.dev/api-reference/rest-apis/v2/notifications/get-config
POST https://api.velt.dev/v2/notifications/config/get
To use this API, you must have the this feature enabled in [Velt console](https://console.velt.dev/dashboard/config/notification)
Use this API to set the notifications config for users.
# Endpoint
`POST https://api.velt.dev/v2/notifications/config/get`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
The ID of the organization.
An array of document IDs. The notification configuration will be fetched for these documents for the specified user. Max 30 documents can be fetched at a time.
The ID of the user.
## **Example Request**
```JSON theme={null}
{
"data": {
"organizationId": "org1",
"documentIds": ["doc1"],
"userId":"USER_ID1"
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "User config fetched successfully.",
"data": [
{
"config": {
"inbox": "ALL",
"email": "ALL"
},
"metadata": {
"organizationId": "org1",
"apiKey": "API_KEY",
"documentId": "doc1",
"userId": "USER_ID1"
}
}
]
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "User config fetched successfully.",
"data": [
{
"config": {
"inbox": "ALL",
"email": "ALL"
},
"metadata": {
"organizationId": "org1",
"apiKey": "API_KEY",
"documentId": "doc1",
"userId": "USER_ID1"
}
}
]
}
}
```
# Get Notifications
Source: https://docs.velt.dev/api-reference/rest-apis/v2/notifications/get-notifications-v2
POST https://api.velt.dev/v2/notifications/get
Use this API to retrieve notifications.
Prior to using this API, you must:
* Enable advanced queries option in [the console](https://console.velt.dev/dashboard/config/appconfig)
* Deploy v4 series of the Velt SDK.
# Endpoint
`POST https://api.velt.dev/v2/notifications/get`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Document ID. Either pass this or userId.
Location ID
User ID. Either pass this or documentId.
Array of Notification IDs. Limit: Only 30 items can be passed at a time.
Number of items to be retrieved per page. Default: 1000.
Page token retrieved from previous API call.
Order of the notifications based on timestamp. Must be either `asc` or `desc`. Default: `desc`.
## **Example Requests**
#### 1. Get by organizationId, documentId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"pageSize": 20,
"pageToken": "8740648311207869"
}
}
```
#### 2. Get by organizationId, documentId and notificationIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"notificationIds": [
"yourNotificationId"
]
}
}
```
#### 3. Get by organizationId, documentId and locationId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"locationId": "yourLocationId",
"pageSize": 20,
"pageToken": "8740648311207869"
}
}
```
#### 4. Get by organizationId, documentId, locationId and notificationIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"locationId": "yourLocationId",
"notificationIds": [
"yourNotificationId"
]
}
}
```
#### 5. Get by organizationId and userId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"userId": "yourUserId",
"pageSize": 20,
"pageToken": "8740648311207869"
}
}
```
#### 6. Get by organizationId, userId and notificationIds
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"userId": "yourUserId",
"notificationIds": [
"yourNotificationId"
]
}
}
```
#### 7. Get by organizationId, documentId and userId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"userId": "yourUserId",
"pageSize": 20,
"pageToken": "8740648311207869"
}
}
```
#### 8. Get by organizationId, locationId and userId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"userId": "yourUserId",
"locationId": "yourLocationId",
"pageSize": 20,
"pageToken": "8740648311207869"
}
}
```
#### 9. Get by organizationId, documentId, locationId, and userId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"userId": "yourUserId",
"locationId": "yourLocationId",
"pageSize": 20,
"pageToken": "8740648311207869"
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Notification(s) retrieved successfully.",
"data": [
{
"id": "notificationId",
"notificationSource": "custom",
"notificationSourceData": {}, //The data of the notification source. e.g., CommentAnnotation
"actionUser": {
"email": "user@example.com",
"name": "User Name",
"userId": "yourUserId"
},
"displayBodyMessage": "This is body message (Secondary message)",
"displayHeadlineMessageTemplate": "This is main template, you can pass variables using curly brackets like this: {actionUser}, {recipientUser}, {yourCustomVariableWithStringValue}",
"displayHeadlineMessageTemplateData": {
"actionUser": {
"email": "user@example.com",
"name": "User Name",
"userId": "yourUserId"
},
"recipientUser": {
"email": "recipient@example.com",
"name": "Recipient Name",
"userId": "recipientUserId"
},
"yourCustomVariableWithStringValue": "Variable will be replaced with this text"
},
"metadata": {
"apiKey": "yourApiKey",
"documentId": "yourDocumentId",
"organizationId": "yourOrganizationId"
},
"notifyUsers": {
"yourNotifyUserId": true
},
"notifyUsersByUserId": {
"yourNotifyUserById": true
},
"timestamp": 1722409519944
}
],
"pageToken": "nextPageToken"
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Notification(s) retrieved successfully.",
"data": [
{
"id": "notificationId",
"notificationSource": "custom",
"notificationSourceData": {}, //The data of the notification source. e.g., CommentAnnotation
"actionUser": {
"email": "user@example.com",
"name": "User Name",
"userId": "yourUserId"
},
"displayBodyMessage": "This is body message (Secondary message)",
"displayHeadlineMessageTemplate": "This is main template, you can pass variables using curly brackets like this: {actionUser}, {recipientUser}, {yourCustomVariableWithStringValue}",
"displayHeadlineMessageTemplateData": {
"actionUser": {
"email": "user@example.com",
"name": "User Name",
"userId": "yourUserId"
},
"recipientUser": {
"email": "recipient@example.com",
"name": "Recipient Name",
"userId": "recipientUserId"
},
"yourCustomVariableWithStringValue": "Variable will be replaced with this text"
},
"metadata": {
"apiKey": "yourApiKey",
"documentId": "yourDocumentId",
"organizationId": "yourOrganizationId"
},
"notifyUsers": {
"yourNotifyUserId": true
},
"notifyUsersByUserId": {
"yourNotifyUserById": true
},
"timestamp": 1722409519944
}
],
"pageToken": "nextPageToken"
}
}
```
# Set Config
Source: https://docs.velt.dev/api-reference/rest-apis/v2/notifications/set-config
POST https://api.velt.dev/v2/notifications/config/set
To use this API, you must have the this feature enabled in [Velt console](https://console.velt.dev/dashboard/config/notification)
Use this API to set the notifications config for users.
# Endpoint
`POST https://api.velt.dev/v2/notifications/config/set`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
The ID of the organization.
An array of document IDs. The notification configuration will be applied to these documents for the specified users.
An array of user IDs. The notification configuration will be set for these users.
Object containing the notification preferences.
In-app inbox notification preference. Valid values:
`ALL`: User receives all notifications in their inbox.
`MINE`: User receives notifications in their inbox only for activities directly involving them (e.g., mentions, replies).
`NONE`: User receives no notifications in their inbox.
`ALL`: User receives email notifications for all activities.
`MINE`: User receives email notifications only for activities directly involving them.
`NONE`: User receives no email notifications.
Optional.
Slack notification preference (requires Slack integration to be effective). Valid values:
`ALL`: User receives Slack notifications for all activities.
`MINE`: User receives Slack notifications only for activities directly involving them.
`NONE`: User receives no Slack notifications.
Optional.
## **Example Request**
```JSON theme={null}
{
"data": {
"organizationId": "org1",
"documentIds": ["doc1"],
"userIds":["USER_ID1"],
"config":{
"inbox": "ALL", // ALL | MINE | NONE
"email": "ALL" // ALL | MINE | NONE
}
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "User config set successfully.",
"data": {
"USER_ID1": {
"success": true,
"userId": "USER_ID1",
"documentId": "doc1",
"message": "User config set successfully."
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "User config set successfully.",
"data": {
"USER_ID1": {
"success": true,
"userId": "USER_ID1",
"documentId": "doc1",
"message": "User config set successfully."
}
}
}
}
```
# Update Notifications
Source: https://docs.velt.dev/api-reference/rest-apis/v2/notifications/update-notifications
POST https://api.velt.dev/v2/notifications/update
Use this API to update notifications.
# Endpoint
`POST https://api.velt.dev/v2/notifications/update`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Document ID (Optional)
Location ID
User ID (Optional)
When enabled, notifications are only updated for users who have access to the specified document.
This ensures notification updates respect document access permissions configured via Access Control or Permission Provider.
Default: `false`
Notifications object
Notification ID
User who took the action
Display Headline Message Template
Display Headline Message Template Data
User who took the action
User who was directly affected by the action
Any custom field with string value
Display Body Message
Any custom object to be stored with the notification.
When the user clicks on the notification, this data will be sent to in the callback.
Array of user ids that you want to mark the notification as read.
Use this with the `readByUserIds` param. If `true`, the read notifications will be not be removed from the "For You" tab.
## **Example Requests**
#### 1. Update by organizationId and documentId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"notifications": [
{
"id": "yourNotificationId",
"displayBodyMessage": "This is body message (Secondary message)",
}
]
}
}
```
#### 2. Update by organizationId, documentId and locationId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"locationId": "yourLocationId",
"notifications": [
{
"id": "yourNotificationId",
"displayBodyMessage": "This is body message (Secondary message)",
}
]
}
}
```
#### 3. Update by organizationId, documentId and userId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"userId": "yourUserId",
"notifications": [
{
"id": "yourNotificationId",
"displayBodyMessage": "This is body message (Secondary message)",
}
]
}
}
```
#### 4. Update by organizationId and userId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"userId": "yourUserId",
"notifications": [
{
"id": "yourNotificationId",
"displayBodyMessage": "This is body message (Secondary message)",
}
]
}
}
```
#### 5. Update by organizationId, documentId, locationId and userId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"userId": "yourUserId",
"locationId": "yourLocationId",
"notifications": [
{
"id": "yourNotificationId",
"displayBodyMessage": "This is body message (Secondary message)",
}
]
}
}
```
#### 6. Update with Permission Verification
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"verifyUserPermissions": true,
"notifications": [
{
"id": "yourNotificationId",
"displayBodyMessage": "This is updated body message (Secondary message)"
}
]
}
}
```
When `verifyUserPermissions` is enabled, the API checks document access for each user before updating their notifications. Updates are only applied to users with access to the document.
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Notification(s) updated successfully.",
"data": {
"5471488637912692": {
"success": true,
"message": "Notification updated."
}
}
}
}
```
#### When some notifications are not found
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Notification(s) updated successfully.",
"data": {
"5471488637912692": {
"success": false,
"message": "Failed to update notification."
},
"5471488637912693": {
"success": true,
"message": "Notification updated."
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Notification(s) updated successfully.",
"data": {
"5471488637912692": {
"success": true,
"message": "Notification updated."
}
}
}
}
```
# Add Organizations
Source: https://docs.velt.dev/api-reference/rest-apis/v2/organizations/add-organizations
POST https://api.velt.dev/v2/organizations/add
Use this API to add new organizations and its metadata.
# Endpoint
`POST https://api.velt.dev/v2/organizations/add`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Array of Organization objects
## **Example Requests**
#### Add organization
```JSON theme={null}
{
"data": {
"organizations": [
{
"organizationId": "yourOrganizationId",
"organizationName": "Your Organization Name"
}
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Organization(s) added successfully.",
"data": {
"yourOrganizationId": {
"success": true,
"id": "02cf91e5e7a5f4c0b600c84cf248384b",
"message": "Added Successfully"
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Organization(s) added successfully.",
"data": {
"yourOrganizationId": {
"success": true,
"id": "02cf91e5e7a5f4c0b600c84cf248384b",
"message": "Added Successfully"
}
}
}
}
```
# Delete Organizations
Source: https://docs.velt.dev/api-reference/rest-apis/v2/organizations/delete-organizations
POST https://api.velt.dev/v2/organizations/delete
Use this API to delete specific organization(s) data by their IDs.
# Endpoint
`POST https://api.velt.dev/v2/organizations/delete`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Array of Organization IDs
## **Example Requests**
#### Delete specific organization
```JSON theme={null}
{
"data": {
"organizationIds": [
"yourOrganizationId1",
"yourOrganizationId2"
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Organization(s) deleted successfully.",
"data": {
"yourOrganizationId1": {
"success": true,
"id": "02cf91e5e7a5f4c0b600c84cf248384b",
"message": "Deleted Successfully"
},
{
"yourOrganizationId2": {
"success": false,
"id": "02cf91e5e7a5f4c0b600c84cf248384b",
"message": "Organization does not exist"
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Organization(s) deleted successfully.",
"data": {
"yourOrganizationId": {
"success": true,
"id": "02cf91e5e7a5f4c0b600c84cf248384b",
"message": "Deleted Successfully"
}
}
}
}
```
# Get Organizations
Source: https://docs.velt.dev/api-reference/rest-apis/v2/organizations/get-organizations-v2
POST https://api.velt.dev/v2/organizations/get
Use this API to retrieve specific organizations by organization IDs.
Prior to using this API, you must:
* Enable advanced queries option in [the console](https://console.velt.dev/dashboard/config/appconfig)
* Deploy v4 series of the Velt SDK.
# Endpoint
`POST https://api.velt.dev/v2/organizations/get`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Array of Organization IDs (Optional).
Limit: Only 30 IDs can be passed at a time.
If this is not provided, all organizations will be returned.
Number of items to be retrieved per page (Optional). Default: 1000.
Page token retrieved from previous API call. (Optional)
## **Example Requests**
```JSON theme={null}
{
"data": {
"organizationIds": [
"yourOrganizationId"
],
"pageSize": 1000,
"pageToken": "pageToken"
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Organization(s) retrieved successfully.",
"data": [
{
"id": "yourOrganizationId",
"organizationName": "Your Organization Name",
"disabled": false,
// other metadata fields may be included here
}
// ... more organizations if multiple were retrieved
],
"nextPageToken": "pageToken"
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Organization(s) retrieved successfully.",
"data": [
{
"id": "yourOrganizationId",
"organizationName": "Your Organization Name",
"disabled": false,
// other metadata fields may be included here
}
// ... more organizations if multiple were retrieved
],
"nextPageToken": "pageToken"
}
}
```
# Update Disabled State for Organizations
Source: https://docs.velt.dev/api-reference/rest-apis/v2/organizations/update-organization-disable-state
POST https://api.velt.dev/v2/organizations/access/disablestate/update
Use this API to enable or disable both read and write access for all documents for all users.
Let's say your customer's trial or subscription has ended and you want to disable their access to the Velt data, you could use this to disable access to the entire organization data.If organization does not exist, it will be created.
# Endpoint
`POST https://api.velt.dev/v2/organizations/access/disablestate/update`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Array of Organization IDs
Whether to disable read and write access to the specified organizations. Allowed values: `true`, `false`.
## **Example Requests**
```JSON theme={null}
{
"data": {
"organizationIds": ["yourOrganizationId1","yourOrganizationId2"],
"disabled": true
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Updated disable state for Organization(s) successfully.",
"data": {
"yourOrganizationId1": {
"success": true,
"id": "02cf91e5e7a5f4c0b600c84cf248384b",
"message": "Updated disable state for organization Successfully"
},
"yourOrganizationId2": {
"success": false,
"id": "44e0132f4c6b0d453f18df42d2263b4e",
"message": "Organization does not exist"
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Updated disable state for Organization(s) successfully.",
"data": {
"yourOrganizationId": {
"success": true,
"id": "02cf91e5e7a5f4c0b600c84cf248384b",
"message": "Updated disable state for organization Successfully"
}
}
}
}
```
# Update Organizations
Source: https://docs.velt.dev/api-reference/rest-apis/v2/organizations/update-organizations
POST https://api.velt.dev/v2/organizations/update
Use this API to update existing organization(s) metadata.
# Endpoint
`POST https://api.velt.dev/v2/organizations/update`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Array of Organization objects
## **Example Requests**
```JSON theme={null}
{
"data": {
"organizations": [
{
"organizationId": "yourOrganizationId",
"organizationName": "Your Updated Organization Name"
}
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Organization(s) updated successfully.",
"data": {
"yourOrganizationId": {
"success": true,
"id": "02cf91e5e7a5f4c0b600c84cf248384b",
"message": "Updated Successfully"
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Organization(s) updated successfully.",
"data": {
"yourOrganizationId": {
"success": true,
"id": "02cf91e5e7a5f4c0b600c84cf248384b",
"message": "Updated Successfully"
}
}
}
}
```
# Add User Groups
Source: https://docs.velt.dev/api-reference/rest-apis/v2/user-groups/add-groups
POST https://api.velt.dev/v2/organizations/usergroups/add
Use this API to add organization user groups to a specific organization.
# Endpoint
`POST https://api.velt.dev/v2/organizations/usergroups/add`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
If set to true, a new organization will be created (if it doesn't exist) before the group(s) are created.
Array of Organization User Group objects
## **Example Request**
#### Add organization user group in a specific organization
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"organizationUserGroups": [
{
"groupId": "engineering",
"groupName": "Engineering"
}
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Organization User Groups added successfully.",
"data": {
"yourGroupId": {
"success": true,
"id": "77ab6767b022ad0323ba39c24f12cc95",
"message": "Organization user group added."
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Organization User Groups added successfully.",
"data": {
"yourGroupId": {
"success": true,
"id": "77ab6767b022ad0323ba39c24f12cc95",
"message": "Organization user group added."
}
}
}
}
```
# Add Users to Groups
Source: https://docs.velt.dev/api-reference/rest-apis/v2/user-groups/add-users-to-group
POST https://api.velt.dev/v2/organizations/usergroups/users/add
Use this API to add users to a specific organization user group.
# Endpoint
`POST https://api.velt.dev/v2/organizations/usergroups/users/add`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Organization User Group ID
Array of User IDs
## **Example Requests**
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"organizationUserGroupId": "yourGroupId",
"userIds": ["yourUserId1"]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Added organization users to group successfully.",
"data": {
"yourUserId1": {
"success": true,
"organizationUserGroupId": "yourGroupId",
"message": "User added to organization user group."
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Added organization users to group successfully.",
"data": {
"yourUserId1": {
"success": true,
"organizationUserGroupId": "yourGroupId",
"message": "User added to organization user group."
}
}
}
}
```
# Delete Users from Groups
Source: https://docs.velt.dev/api-reference/rest-apis/v2/user-groups/delete-users-from-group
POST https://api.velt.dev/v2/organizations/usergroups/users/delete
Use this API to delete users from a specific organization user group.
# Endpoint
`POST https://api.velt.dev/v2/organizations/usergroups/users/delete`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Organization User Group ID
Array of User IDs
If true, all users in the group will be deleted.
## **Example Requests**
#### Delete specific users from group
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"organizationUserGroupId": "yourGroupId",
"userIds": ["yourUserId1"]
}
}
```
#### Delete all users from group
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"organizationUserGroupId": "yourGroupId",
"deleteAll": true
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Deleted users from group successfully.",
"data": {
"yourUserId1": {
"success": true,
"organizationUserGroupId": "yourGroupId",
"message": "User deleted from organization user group."
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Deleted users from group successfully.",
"data": {
"yourUserId1": {
"success": true,
"organizationUserGroupId": "yourGroupId",
"message": "User deleted from organization user group."
}
}
}
}
```
# Add Users
Source: https://docs.velt.dev/api-reference/rest-apis/v2/users/add-users
POST https://api.velt.dev/v2/users/add
Use this API to add Users to:
1. **Organization:** This will provide them access to all the documents in the organization unless the document has `restricted` access type. It will also show users in the contact list of the organization.
2. **Folder:** This will provide them access to all the documents in the folder. If you pass the `folderId`, then the users will be added to the folder and not the organization.
3. **Document:** This will provide them access to the specified document. It will also show users in the contact list of the document. If you pass the `documentId`, then the users will be added to the document and not the organization or folder.
* If organization does not exist, it will be created.
* If you provide documentId or folderId, then the users will only be added at that level and not at the organization level. To also add users at the organization level, you will need to call this API again with only the organizationId.
* If User's `initial` is not provided in the User object, then it will be automatically created using the name field.
**Access Control**
* Set `accessRole` to `viewer` (read-only) or `editor` (read/write) on each resource to define the user's capabilities for that resource.
* `accessRole` can only be set via the v2 Users and Auth Permissions REST APIs. Frontend SDK methods do not accept or change `accessRole`.
* Relevant endpoints: `/v2/users/add`, `/v2/users/update`, `/v2/auth/permissions/add`, `/v2/auth/generate_token`.
* See the [Access Control overview](/key-concepts/overview#access-control) for concepts and detailed guidance.
See the [Access Control overview](/key-concepts/overview#access-control) for concepts and detailed guidance.
# Endpoint
`POST https://api.velt.dev/v2/users/add`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
If set to true, a new organization will be created (if it doesn't exist) before users are added.
Document ID. Provide this if you want to add users to a specific document.
If set to true and `documentId` is provided but doesn't exist, a new document will be created before users are added.
Folder ID. Provide this if you want to add users to a specific folder. Either provide `documentId` or `folderId`.
If set to true and `folderId` is provided but doesn't exist, a new folder will be created before users are added.
Array of [User](/api-reference/sdk/models/data-models#user) objects.
## **Example Requests**
#### 1. Add users to a specific organization
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"users": [
{
"userId": "yourUserId1",
"name": "User Name",
"email": "user@email.com",
"accessRole": "editor"
}
]
}
}
```
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"users": [
{
"userId": "yourUserId1",
"name": "User Name",
"email": "user@email.com",
"accessRole": "viewer"
}
]
}
}
```
#### 2. Add users to a specific document within an organization
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"users": [
{
"userId": "yourUserId1",
"name": "User Name",
"email": "user@email.com",
"accessRole": "editor"
}
]
}
}
```
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"users": [
{
"userId": "yourUserId1",
"name": "User Name",
"email": "user@email.com",
"accessRole": "viewer"
}
]
}
}
```
#### 3. Add users to a specific folder within an organization
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"folderId": "yourFolderId",
"users": [
{
"userId": "yourUserId1",
"name": "User Name",
"email": "user@email.com",
"accessRole": "editor"
}
]
}
}
```
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"folderId": "yourFolderId",
"users": [
{
"userId": "yourUserId1",
"name": "User Name",
"email": "user@email.com",
"accessRole": "viewer"
}
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "User(s) processed successfully.",
"data": {
"yourUserId1": {
"success": true,
"id": "4c250058149d6c9fb8c894c9ef29c790",
"message": "User added."
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "User(s) processed successfully.",
"data": {
"yourUserId1": {
"success": true,
"id": "4c250058149d6c9fb8c894c9ef29c790",
"message": "User added."
}
}
}
}
```
# Delete Users
Source: https://docs.velt.dev/api-reference/rest-apis/v2/users/delete-users
POST https://api.velt.dev/v2/users/delete
Remove Users from an Organization or a Document.
Use this API to remove Users from:
1. **Organization:** This will remove their access from all the documents and data in the organization. It will also remove these users from the contact list of the organization.
2. **Document:** This will remove their access from the specified document. It will also remove these users from the contact list of the document. If you pass the `documentId`, then the users will be removed from the document.
# Endpoint
`POST https://api.velt.dev/v2/users/delete`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Organization ID
Document IDs. Provide this if you want to delete users from a specific document.
Folder ID. Either provide `documentId` or `folderId`.
Array of user Ids.
## **Example Requests**
#### 1. Delete users in a specific organization
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"userIds": [
"yourUserId1"
]
}
}
```
#### 2. Delete users in a specific document within an organization
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"userIds": [
"yourUserId1"
]
}
}
```
#### 3. Delete users in a specific folder within an organization
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"folderId": "yourFolderId",
"userIds": [
"yourUserId1"
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "User(s) deleted successfully.",
"data": {
"yourUserId1": {
"success": true,
"message": "User removed."
}
}
}
}
```
#### User(s) Not Found
```JSON theme={null}
{
"result": {
"status": "success",
"message": "User(s) deleted successfully.",
"data": {
"yourUserId1": {
"success": true,
"message": "User removed."
},
{
"yourUserId2": {
"success": false,
"message": "User does not exist."
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "User(s) deleted successfully.",
"data": {
"yourUserId1": {
"success": true,
"message": "User removed."
}
}
}
}
```
# Get Users
Source: https://docs.velt.dev/api-reference/rest-apis/v2/users/get-users-v2
POST https://api.velt.dev/v2/users/get
Use this API to retrieve users based on various filters such as organization ID, document ID, organization user group IDs or user IDs. You can use these filters in various combinations to get the desired users. Some examples are shown below.
Prior to using this API, you must:
* Enable advanced queries option in [the console](https://console.velt.dev/dashboard/config/appconfig)
* Deploy v4 series of the Velt SDK.
# Endpoint
`POST https://api.velt.dev/v2/users/get`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### **Params**
Organization ID
Document ID
Folder ID. Either provide `documentId` or `folderId`.
Array of User IDs. Limit: Only 30 items can be passed at a time.
Array of Organization User Group IDs. Only 30 items can be passed at a time.
If true, all document users within the organization will be retrieved. You need not pass `documentId` in this case. This will not fetch organization-level users.
If true, the response will be grouped by document ID. This works when `allDocuments` is set to true.
Number of items to be retrieved per page. Default: 1000.
Page token retrieved from previous API call.
## **Example Requests**
#### 1. Get users by organizationId
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"pageSize": 1000,
"pageToken": "pageToken"
}
}
```
#### 2. Get users by documentId within an organization
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId"
}
}
```
#### 3. Get Users from all documents within an organization.
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"allDocuments": true,
"groupByDocumentId": true
}
}
```
#### 4. Get users by specific user IDs in an organization
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"userIds": [
"yourUserId1",
"yourUserId2"
]
}
}
```
#### 5. Get users by specific user IDs in the given organization and document
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"userIds": [
"yourUserId1",
"yourUserId2"
]
}
}
```
#### 6. Get users by organization and organization user group IDs
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"organizationUserGroupIds": [
"yourOrganizationUserGroupId"
]
}
}
```
#### 7. Get users by organization, organization user group IDs and user IDs
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"userIds": [
"yourUserId1",
"yourUserId2"
],
"organizationUserGroupIds": [
"yourOrganizationUserGroupId"
]
}
}
```
#### 8. Get users by folderId within an organization
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"folderId": "yourFolderId"
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "User(s) retrieved successfully.",
"data": [
{
"email": "userEmail@domain.com",
"name": "userName",
"userId": "yourUserId"
}
],
"nextPageToken": "pageToken"
}
}
```
#### Success Response with allDocuments and groupByDocumentId
```JSON theme={null}
{
"result": {
"status": "success",
"message": "User(s) retrieved successfully.",
"data": {
"documentId1": [
{
"email": "userEmail@domain.com",
"name": "userName",
"userId": "yourUserId"
}
]
},
"nextPageToken": "pageToken"
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "Error retrieving user(s).",
"status": "ERROR_CODE"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "User(s) retrieved successfully.",
"data": [
{
"email": "userEmail@domain.com",
"name": "userName",
"userId": "yourUserId"
}
],
"pageToken": "pageToken"
}
}
```
# Update Users
Source: https://docs.velt.dev/api-reference/rest-apis/v2/users/update-users
POST https://api.velt.dev/v2/users/update
Use this API to update user metadata based on various filters such as organization ID, document ID, folder ID and user IDs.
You can use these filters in various combinations to get the desired results.
The user metadata such as name, email etc can be updated.
**Access Control**
* Set `accessRole` to `viewer` (read-only) or `editor` (read/write) on each resource to define the user's capabilities for that resource.
* `accessRole` can only be set via the v2 Users and Auth Permissions REST APIs. Frontend SDK methods do not accept or change `accessRole`.
* Relevant endpoints: `/v2/users/add`, `/v2/users/update`, `/v2/auth/permissions/add`, `/v2/auth/generate_token`.
* See the [Access Control overview](/key-concepts/overview#access-control) for concepts and detailed guidance.
# Endpoint
`POST https://api.velt.dev/v2/users/update`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### **Params**
Organization ID
Document ID
Folder ID. Either provide `documentId` or `folderId`.
Array of [User](/api-reference/sdk/models/data-models#user) objects.
## **Example Requests**
#### 1. Update users in a specific organization
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"users": [
{
"userId": "yourUserId1",
"name": "User Name",
"email": "user@email.com",
"accessRole": "editor"
}
]
}
}
```
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"users": [
{
"userId": "yourUserId1",
"name": "User Name",
"email": "user@email.com",
"accessRole": "viewer"
}
]
}
}
```
#### 2. Update users in a specific document within an organization
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"users": [
{
"userId": "yourUserId1",
"name": "User Name",
"email": "user@email.com",
"accessRole": "editor"
}
]
}
}
```
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"users": [
{
"userId": "yourUserId1",
"name": "User Name",
"email": "user@email.com",
"accessRole": "viewer"
}
]
}
}
```
#### 3. Update users in a specific folder within an organization
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"folderId": "yourFolderId",
"users": [
{
"userId": "yourUserId1",
"name": "User Name",
"email": "user@email.com",
"accessRole": "editor"
}
]
}
}
```
```JSON theme={null}
{
"data": {
"organizationId": "yourOrganizationId",
"folderId": "yourFolderId",
"users": [
{
"userId": "yourUserId1",
"name": "User Name",
"email": "user@email.com",
"accessRole": "viewer"
}
]
}
}
```
# Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "User(s) processed successfully.",
"data": {
"yourUserId1": {
"success": true,
"id": "7d87015b055a168b098cf05b870e40ff",
"message": "User updated."
}
}
}
}
```
#### Some User(s) Not Found
```JSON theme={null}
{
"result": {
"status": "success",
"message": "User(s) processed successfully.",
"data": {
"yourUserId1": {
"success": true,
"id": "7d87015b055a168b098cf05b870e40ff",
"message": "User updated."
},
"yourUserId2": {
"success": false,
"id": "ad22d93b49ad990d2b3d582d08d7768a",
"message": "User does not exist."
}
}
}
}
```
#### Failure Response
```JSON theme={null}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "User(s) processed successfully.",
"data": {
"yourUserId1": {
"success": true,
"id": "7d87015b055a168b098cf05b870e40ff",
"message": "User updated."
}
}
}
}
```
# Add Domains
Source: https://docs.velt.dev/api-reference/rest-apis/v2/workspace/add-domain
POST https://api.velt.dev/v2/workspace/domains/add
Use this API to add new organizations and its metadata.
# Endpoint
`POST https://api.velt.dev/v2/workspace/domains/add`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Array of domains
# Example Request
```JSON theme={null}
{
"data": {
"domains" : [
"https://www.google.com",
"https://*.firebase.com"
]
}
}
```
# Example Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Domain(s) added successfully to allowed domains.",
"data": {
"domainsAdded": [
"google.com",
"*.firebase.com"
]
}
}
}
```
#### Failure Response
##### If some domains are already in the allowed domains
```JSON theme={null}
{
"error": {
"details": {
"domainsAdded": [
"velt.dev"
],
"skippedDomains": [
"google.com"
]
},
"message": "Domain(s) added successfully to allowed domains. Skipped existing domains.",
"status": "INTERNAL"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Domain(s) added successfully to allowed domains.",
"data": {
"domainsAdded": [
"google.com",
"*.firebase.com"
]
}
}
}
```
# Delete Domains
Source: https://docs.velt.dev/api-reference/rest-apis/v2/workspace/delete-domain
POST https://api.velt.dev/v2/workspace/domains/delete
Use this API to add new organizations and its metadata.
# Endpoint
`POST https://api.velt.dev/v2/workspace/domains/delete`
# Headers
Your API key.
Your [Auth Token](/security/auth-tokens).
# Body
#### Params
Array of domains
# Example Request
```JSON theme={null}
{
"data": {
"domains" : [
"https://www.google.com",
"https://*.firebase.com"
]
}
}
```
# Example Response
#### Success Response
```JSON theme={null}
{
"result": {
"status": "success",
"message": "Domain(s) removed successfully from allowed domains.",
"data": {
"domainsRemoved": [
"google.com",
"*.firebase.com"
]
}
}
}
```
#### Failure Response
##### If some domains are not in the allowed domains
```JSON theme={null}
{
"error": {
"details": {
"domainsRemoved": [
"velt.dev"
],
"skippedDomains": [
"google.com"
]
},
"message": "Domain(s) removed successfully from allowed domains. Skipped non-existing domains.",
"status": "INTERNAL"
}
}
```
```js theme={null}
{
"result": {
"status": "success",
"message": "Domain(s) removed successfully from allowed domains.",
"data": {
"domainsRemoved": [
"google.com",
"*.firebase.com"
]
}
}
}
```
# API Methods Index
Source: https://docs.velt.dev/api-reference/sdk/api/api-methods
# Comments
### Threads
#### addCommentAnnotation()
Add a new comment annotation.
* Params: [AddCommentAnnotationRequest](/api-reference/sdk/models/data-models#addcommentannotationrequest)
* Returns: [AddCommentAnnotationEvent](/api-reference/sdk/models/data-models#addcommentannotationevent)
* React Hook: `useAddCommentAnnotation()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#addcommentannotation)
#### addCommentOnSelectedText()
Add a comment on selected text.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#addcommentonselectedtext)
#### addCommentOnElement()
Add a comment on a specific element.
* Params: `{ targetElement: object, commentData: array, status?: string }`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#addcommentonelement)
#### addManualComment()
Add a comment with custom positioning.
* Params: `ManualCommentAnnotationConfig`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#addmanualcomment)
#### deleteCommentAnnotation()
Delete a comment annotation.
* Params: [DeleteCommentAnnotationRequest](/api-reference/sdk/models/data-models#deletecommentannotationrequest)
* Returns: [DeleteCommentAnnotationEvent](/api-reference/sdk/models/data-models#deletecommentannotationevent)
* React Hook: `useDeleteCommentAnnotation()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#deletecommentannotation)
#### deleteSelectedComment()
Delete the currently selected comment.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#deleteselectedcomment)
#### getCommentAnnotationsCount()
Get the total and unread comment annotations count for specified documents.
* Params: [CommentRequestQuery](/api-reference/sdk/models/data-models#commentrequestquery) (optional)
* Returns: [`Observable`](/api-reference/sdk/models/data-models#getcommentannotationscountresponse)
* React Hook: `useCommentAnnotationsCount()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#getcommentannotationscount)
#### getUnreadCommentAnnotationCountByLocationId()
Get count of unread comment annotations by location ID.
* Params: `locationId: string`
* Returns: `Observable`
* React Hook: `useUnreadCommentAnnotationCountByLocationId()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#getunreadcommentannotationcountbylocationid)
#### getCommentAnnotations()
Get all the comment annotations for all the specified documents.
* Params: [CommentRequestQuery](/api-reference/sdk/models/data-models#commentrequestquery) (optional)
* Returns: [`Observable`](/api-reference/sdk/models/data-models#getcommentannotationsresponse)
* React Hook: `useGetCommentAnnotations()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#getcommentannotations)
#### getSelectedComments()
Get currently selected comment annotations.
* Params: none
* Returns: `Observable`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#getselectedcomments)
#### getCommentAnnotationById()
Get a specific comment annotation by ID.
* Params: `{ annotationId: string, documentId?: string }`
* Returns: `Observable`
* React Hook: `useCommentAnnotationById()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#getcommentannotationbyid)
#### getElementRefByAnnotationId()
Get the DOM element reference for a comment annotation.
* Params: `annotationId: string`
* Returns: `string`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#getelementrefbyannotationid)
### Slate
#### withVeltComments()
Higher-order function that enhances a Slate editor with Velt comments capabilities.
* Params:
* `editor: Editor`
* `options?: VeltCommentsEditorOptions`
* Returns: `VeltCommentsEditor`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/setup/slatejs#withveltcomments)
#### addComment()
Creates a comment annotation for the currently selected text in the editor.
* Signature: `async (request:` [AddCommentRequest](/api-reference/sdk/models/data-models#addcommentrequest)`) => Promise`
* Params: `request:` [AddCommentRequest](/api-reference/sdk/models/data-models#addcommentrequest)
* Returns: `Promise`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/setup/slatejs#addcomment)
#### renderComments()
Renders and highlights comment annotations in the editor.
* Signature: `(request:` [RenderCommentsRequest](/api-reference/sdk/models/data-models#rendercommentsrequest)`) => void`
* Params: `request:` [RenderCommentsRequest](/api-reference/sdk/models/data-models#rendercommentsrequest)
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/setup/slatejs#rendercomments)
#### SlateVeltComment
React component that renders a Velt comment text element with annotation ID.
* Params:
* `props: RenderElementProps`
* `element:` [VeltCommentsElement](/api-reference/sdk/models/data-models#veltcommentselement)
* Returns: `N/A`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/setup/slatejs#slateveltcomment)
### Tiptap
#### TiptapVeltComments.configure()
A custom Tiptap extension for Velt comments.
* Params: `options?:` [TiptapVeltCommentsOptions](/api-reference/sdk/models/data-models#tiptapveltcommentsoptions)
* Returns: `TiptapVeltComments`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/setup/tiptap#tiptapveltcomments)
#### addComment()
Creates a comment annotation for the currently selected text in the editor.
* Params:
* `request:` [AddCommentRequest](/api-reference/sdk/models/data-models#addcommentrequest)
* `editor: Editor`
* `editorId?: string`
* `context?: unknown`
* Returns: `Promise`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/setup/tiptap#addcomment)
#### renderComments()
Renders and highlights comment annotations in the editor.
* Params:
* `request:` [RenderCommentsRequest](/api-reference/sdk/models/data-models#rendercommentsrequest)
* `editor: Editor`
* `editorId?: string`
* `commentAnnotations?:` [CommentAnnotation\[\]](/api-reference/sdk/models/data-models#commentannotation)
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/setup/tiptap#rendercomments)
### Lexical
#### addComment()
Creates a comment annotation for the currently selected text in the editor.
* Signature: `addComment: async (request:` [AddCommentRequest](/api-reference/sdk/models/data-models#addcommentrequest-3)) `=> Promise`
* Params: [`AddCommentRequest`](/api-reference/sdk/models/data-models#addcommentrequest-3)
* Returns: `Promise`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/setup/lexical#addcomment)
#### renderComments()
Renders and highlights comment annotations in the editor.
* Signature: `renderComments: (request:` [RenderCommentsRequest](/api-reference/sdk/models/data-models#rendercommentsrequest-3)`) => void`
* Params: [`RenderCommentsRequest`](/api-reference/sdk/models/data-models#rendercommentsrequest-3)
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/setup/lexical#rendercomments)
#### exportJSONWithoutComments()
Export the editor state JSON while stripping comment nodes and normalizing adjacent text nodes.
* Signature: `exportJSONWithoutComments(editor: LexicalEditor): SerializedEditorState`
* Params: `editor:` [`LexicalEditor`](https://lexical.dev/docs/api/classes/lexical.LexicalEditor)
* Returns: `SerializedEditorState`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/setup/lexical#exportjsonwithoutcomments)
### Messages
#### addComment()
Add a comment to a specific comment annotation.
* Params: [AddCommentRequest](/api-reference/sdk/models/data-models#addcommentrequest)
* Returns: [AddCommentEvent](/api-reference/sdk/models/data-models#addcommentevent)
* React Hook: `useAddComment()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#addcomment)
#### updateComment()
Update a comment in a specific comment annotation.
* Params: [UpdateCommentRequest](/api-reference/sdk/models/data-models#updatecommentrequest)
* Returns: [UpdateCommentEvent](/api-reference/sdk/models/data-models#updatecommentevent)
* React Hook: `useUpdateComment()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#updatecomment)
#### deleteComment()
Delete a comment from a specific comment annotation.
* Params: [DeleteCommentRequest](/api-reference/sdk/models/data-models#deletecommentrequest)
* Returns: [DeleteCommentEvent](/api-reference/sdk/models/data-models#deletecommentevent)
* React Hook: `useDeleteComment()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#deletecomment)
#### getComment()
Get comments from a specific comment annotation.
* Params: [GetCommentRequest](/api-reference/sdk/models/data-models#getcommentrequest)
* Returns: [Comment\[\]](/api-reference/sdk/models/data-models#comment)
* React Hook: `useGetComment()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#getcomment)
#### getUnreadCommentCountOnCurrentDocument()
Get the number of unread comments on the current document.
* Params: none
* Returns: `Observable`
* React Hook: `useUnreadCommentCountOnCurrentDocument()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#getunreadcommentcountoncurrentdocument)
#### getUnreadCommentCountByLocationId()
Get the number of unread comments by location ID.
* Params: `locationId: string`
* Returns: `Observable`
* React Hook: `useUnreadCommentCountByLocationId()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#getunreadcommentcountbylocationid)
#### getUnreadCommentCountByAnnotationId()
Get the number of unread comments by annotation ID.
* Params: `annotationId: string`
* Returns: `Observable`
* React Hook: `useUnreadCommentCountByAnnotationId()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#getunreadcommentcountbyannotationid)
#### markAsRead()
Mark a comment annotation as read for the current user.
* Params: `annotationId: string`
* Returns: `Promise`
* React Hook: `useCommentUtils()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#markasread)
#### markAsUnread()
Mark a comment annotation as unread for the current user.
* Params: `annotationId: string`
* Returns: `Promise`
* React Hook: `useCommentUtils()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#markasunread)
### @Mentions
#### assignUser()
Assign a user to a comment annotation.
* Params: [AssignUserRequest](/api-reference/sdk/models/data-models#assignuserrequest)
* Returns: [AssignUserEvent](/api-reference/sdk/models/data-models#assignuserevent)
* React Hook: `useAssignUser()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#assignuser)
#### disableCustomAutocompleteSearch()
Disable custom autocomplete search for contact list.
* Params: `none`
* Returns: `void`
* React Hook: `useContactUtils()` or `useCommentUtils()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enablecustomautocompletesearch)
#### enableAtHere()
Enable or disable @here mentions.
* Params: none
* Returns: `void`
* React Hook: `useContactUtils()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enableathere)
#### enableUserMentions()
Enable or disable user @mentions.
* Params: none
* Returns: `void`
* React Hook: `useContactUtils()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enableusermentions)
#### enableCustomAutocompleteSearch()
Enable custom autocomplete search for contact list.
* Params: `none`
* Returns: `void`
* React Hook: `useContactUtils()` or `useCommentUtils()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enablecustomautocompletesearch)
#### getContactList()
Subscribe to the list of users added to organization, folder, document, user groups or the ones overwritten using the `updateContactList` API.
* Params: none
* Returns: [`Observable`](/api-reference/sdk/models/data-models#getcontactlistresponse)
* React Hook: `useContactList()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#getcontactlist)
#### onContactSelected()
Listen for when a contact is selected from the dropdown.
* Params: none
* Returns: [`Observable`](/api-reference/sdk/models/data-models#usercontactselectedpayload)
* React Hook: `useContactSelected()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#oncontactselected)
#### setAtHereLabel()
Customize the @here label text.
* Params: `label: string`
* Returns: `void`
* React Hook: `useContactUtils()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#setatherelabel)
#### setAtHereDescription()
Customize the @here description text.
* Params: `description: string`
* Returns: `void`
* React Hook: `useContactUtils()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#setatheredescription)
#### subscribeCommentAnnotation()
Subscribe to a comment annotation.
* Params: [SubscribeCommentAnnotationRequest](/api-reference/sdk/models/data-models#subscribecommentannotationrequest)
* Returns: [SubscribeCommentAnnotationEvent](/api-reference/sdk/models/data-models#subscribecommentannotationevent)
* React Hook: `useSubscribeCommentAnnotation()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#subscribecommentannotation)
#### unsubscribeCommentAnnotation()
Unsubscribe from a comment annotation.
* Params: [UnsubscribeCommentAnnotationRequest](/api-reference/sdk/models/data-models#unsubscribecommentannotationrequest)
* Returns: [UnsubscribeCommentAnnotationEvent](/api-reference/sdk/models/data-models#unsubscribecommentannotationevent)
* React Hook: `useUnsubscribeCommentAnnotation()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#unsubscribecommentannotation)
#### updateContactList()
Update the contact list for the current user session.
* Params: `contacts: Array<{userId: string, name: string, email: string}>, options?: {merge: boolean}`
* Returns: `void`
* React Hook: `useContactUtils()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#updatecontactlist)
#### updateContactListScopeForOrganizationUsers()
Restrict which contacts are shown in the dropdown for organization users.
* Params: `scopes: Array<'all' | 'organization' | 'organizationUserGroup' | 'document'>`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#updatecontactlistscopefororganizationusers)
### Metadata
#### addContext()
Add custom metadata to a comment annotation.
* Params: `{ [key: string]: any }`
* Returns: `void`
* React Hook: `useCommentEventCallback('addCommentAnnotation')`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#addcontext)
#### updateContext()
Update custom metadata on a comment annotation.
* Params: `annotationId: string, context: { [key: string]: any }, config?: { merge: boolean }`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#updatecontext)
### Custom Lists
#### addCustomListDataOnAnnotation()
Add a custom dropdown list at the Comment Annotation level.
* Params: `{ type: 'multi' | 'single', placeholder: string, data: Array<{ id: string, label: string }> }`
* Returns: `void`
* React Hook: `useCommentUtils()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#createcustomlistdataoncomment)
#### addCustomListDataOnComment()
Add a custom dropdown list that appears when a hotkey is pressed in the comment composer.
* Params: `{ hotkey: string, type: 'custom', data: Array }`
* Returns: `void`
* React Hook: `useCommentUtils()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#createcustomlistdataoncomment)
#### onAutocompleteChipClick()
Listen for clicks on autocomplete chips in comments.
* Params: none
* Returns: `Observable`
* React Hook: `useAutocompleteChipClick()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#createcustomlistdataoncomment)
#### enableCustomAutocompleteSearch()
Enable custom autocomplete search for custom list.
* Params: `none`
* Returns: `void`
* React Hook: `useCommentUtils()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enablecustomautocompletesearch)
#### disableCustomAutocompleteSearch()
Disable custom autocomplete search for custom list.
* Params: `none`
* Returns: `void`
* React Hook: `useCommentUtils()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enablecustomautocompletesearch)
### Event Subscription
#### on()
Subscribe to comment events.
* Params: `CommentEventType`. [Here](/async-collaboration/comments/customize-behavior#on) is the list of event types you can subscribe to.
* Returns: `Observable`. [Here](/api-reference/sdk/models/data-models#comment) is the list of events object types you can expect to receive.
* React Hook: `useCommentEventCallback(CommentEventType)`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#on)
### Attachments
#### enableAttachments()
Enable file attachments in comments.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enableattachments)
#### enableScreenshot()
Enable screenshot option in comments.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enablescreenshot)
#### disableScreenshot()
Disable screenshot option in comments.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enablescreenshot)
#### addAttachment()
Add an attachment to a specific comment annotation.
* Params: [AddAttachmentRequest](/api-reference/sdk/models/data-models#addattachmentrequest)
* Returns: `Promise`
* React Hook: `useAddAttachment()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#addattachment)
#### deleteAttachment()
Delete an attachment from a specific comment annotation.
* Params: [DeleteAttachmentConfig](/api-reference/sdk/models/data-models#deleteattachmentconfig)
* Returns: `Promise`
* React Hook: `useDeleteAttachment()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#deleteattachment)
#### getAttachment()
Get attachments from a specific comment annotation.
* Params: [GetAttachmentRequest](/api-reference/sdk/models/data-models#getattachmentrequest)
* Returns: `Promise`
* React Hook: `useGetAttachment()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#getattachment)
#### setAllowedFileTypes()
Limit file types in comment attachments by specifying allowed file extensions.
* Params: `string[]` (array of file extensions)
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#allowedfiletypes)
#### setComposerFileAttachments()
Programmatically add file attachments to the comment composer from your application instead of requiring users to select files from the file system.
* Params: [UploadFileData](/api-reference/sdk/models/data-models#uploadfiledata)
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#setcomposerfileattachments)
### Reactions
#### enableReactions()
Enable emoji reactions in comments.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enablereactions)
#### setCustomReactions()
Set custom reactions by passing a map containing reaction information.
* Params: `{[reactionId: string]: {url?: string, emoji?: string}}`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#setcustomreactions)
#### addReaction()
Add a reaction to a specific comment annotation.
* Params: [AddReactionRequest](/api-reference/sdk/models/data-models#addreactionrequest)
* Returns: `Promise`
* React Hook: `useAddReaction()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#addreaction)
#### deleteReaction()
Delete a reaction from a specific comment annotation.
* Params: [DeleteReactionRequest](/api-reference/sdk/models/data-models#deletereactionrequest)
* Returns: `Promise`
* React Hook: `useDeleteReaction()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#deletereaction)
#### toggleReaction()
Toggle a reaction for a specific comment annotation.
* Params: [ToggleReactionRequest](/api-reference/sdk/models/data-models#togglereactionrequest)
* Returns: `Promise`
* React Hook: `useToggleReaction()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#togglereaction)
### Status & Priority
#### enableStatus()
Enable status dropdown & filters in comments.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enablestatus)
#### setCustomStatus()
Set custom statuses by passing an array of status objects.
* Params: `StatusConfig[]`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#setcustomstatus)
#### enableResolveButton()
Enable resolve button on comments.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enableresolvebutton)
#### updateStatus()
Update the status of a comment annotation.
* Params: [UpdateStatusRequest](/api-reference/sdk/models/data-models#updatestatusrequest)
* Returns: `Promise`
* React Hook: `useUpdateStatus()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#updatestatus)
#### resolveCommentAnnotation()
Resolve a comment annotation.
* Params: [ResolveCommentAnnotationRequest](/api-reference/sdk/models/data-models#resolvecommentannotationrequest)
* Returns: `Promise`
* React Hook: `useResolveCommentAnnotation()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#resolvecommentannotation)
#### enablePriority()
Enable priority settings in comments.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enablepriority)
#### setCustomPriority()
Set custom priorities by passing an array of priority objects.
* Params: `PriorityConfig[]`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#setcustompriority)
#### updatePriority()
Update the priority of a comment annotation.
* Params: [UpdatePriorityRequest](/api-reference/sdk/models/data-models#updatepriorityrequest)
* Returns: `Promise`
* React Hook: `useUpdatePriority()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#updatepriority)
### Recordings
#### deleteRecording()
Delete a recording from a comment.
* Params: [DeleteRecordingRequest](/api-reference/sdk/models/data-models#deleterecordingrequest)
* Returns: `Promise`
* React Hook: `useDeleteRecording()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#deleterecording)
#### getRecording()
Get recordings from a comment.
* Params: [GetRecordingRequest](/api-reference/sdk/models/data-models#getrecordingrequest)
* Returns: `Promise`
* React Hook: `useGetRecording()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#getrecording)
#### setAllowedRecordings()
Set allowed recording types (audio, video, screen).
* Params: `string`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#setallowedrecordings)
#### enableRecordingCountdown()
Enable countdown before recording starts.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enablerecordingcountdown)
#### enableRecordingTranscription()
Enable AI transcription for recordings.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enablerecordingtranscription)
### Deep Link
#### getLink()
Get a link to a specific comment annotation.
* Params: [GetLinkRequest](/api-reference/sdk/models/data-models#getlinkrequest)
* Returns: [GetLinkResponse](/api-reference/sdk/models/data-models#getlinkresponse)
* React Hook: `useGetLink()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#getlink)
#### copyLink()
Copy a link to a specific comment annotation to clipboard.
* Params: [CopyLinkRequest](/api-reference/sdk/models/data-models#copylinkrequest)
* Returns: [CopyLinkEvent](/api-reference/sdk/models/data-models#copylinkevent)
* React Hook: `useCopyLink()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#copylink)
### Navigation
#### scrollToCommentByAnnotationId()
Scroll the page to a comment's location.
* Params: `annotationId: string`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#scrolltocommentbyannotationid)
#### selectCommentByAnnotationId()
Programmatically select a comment annotation. When called without arguments or with an invalid ID, it will close the currently selected annotation.
* Params: `annotationId?: string` (optional)
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#selectcommentbyannotationid)
#### onCommentSelectionChange()
Subscribe to comment selection changes.
* Params: none
* Returns: `Observable`
* React Hook: `useCommentSelectionChangeHandler()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#oncommentselectionchange)
#### enablescrollToComment()
Enable automatic scrolling to comments.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enablescrolltocomment)
### DOM Controls
#### allowedElementIds()
Set allowed element IDs for commenting.
* Params: `elementIds: string[]`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#allowedelementids)
#### allowedElementClassNames()
Set allowed element class names for commenting.
* Params: `classNames: string[]`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#allowedelementclassnames)
#### allowedElementQuerySelectors()
Set allowed element query selectors for commenting.
* Params: `selectors: string[]`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#allowedelementqueryselectors)
### AI Categorization
#### enableAutoCategorize()
Enable AI auto-categorization of comments.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enableautocategorize)
#### setCustomCategory()
Set custom categories for comment categorization.
* Params: `categories: Array<{id: string, name: string, color: string}>`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#setcustomcategory)
### UI
#### updateCommentDialogPosition()
Update position of comment dialog relative to pin.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#updatecommentdialogposition)
#### enableSidebarButtonOnCommentDialog()
Enable sidebar button on comment dialogs.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enablesidebarbuttononcommentdialog)
#### onSidebarButtonOnCommentDialogClick()
Subscribe to clicks on comment dialog sidebar button.
* Params: none
* Returns: `Observable`
* React Hook: `useCommentDialogSidebarClickHandler()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#onsidebarbuttononcommentdialogclick)
#### enableDeleteReplyConfirmation()
Enable confirmation dialog before deleting replies.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enabledeletereplyconfirmation)
#### enableMobileMode()
Enable mobile-optimized comment UI.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enablemobilemode)
#### enableCommentPinHighlighter()
Enable highlighting outline around comment pins.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enablecommentpinhighlighter)
#### showCommentsOnDom()
Show comments on the DOM.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#showCommentsOnDom)
#### enableDialogOnHover()
Enable showing comment dialog on hover.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enabledialogonhover)
#### enableFloatingCommentDialog()
Enable floating comment dialog next to pins.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enablefloatingcommentdialog)
#### showResolvedCommentsOnDom()
Show resolved comments on the DOM.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#showresolvedcommentsondom)
#### enableCollapsedComments()
Enable collapsing of comments in annotations.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enablecollapsedcomments)
#### enableShortUserName()
Enable shortening of long user names.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enableshortusername)
#### enableSignInButton()
Enable sign in button on comment dialog when user is anonymous or signed out.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enablesigninbutton)
#### onSignIn()
Handle sign in button click event.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#onsignin)
### Extra Information
#### enableCommentIndex()
Enable comment index indicators on pins and sidebar.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enablecommentindex)
#### enableDeviceInfo()
Enable device type indicators in comment threads.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enabledeviceinfo)
#### enableDeviceIndicatorOnCommentPins()
Enable device type indicators on comment pins.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enabledeviceindicatoroncommentpins)
#### enableGhostComments()
Enable showing ghost comments on the DOM.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enableghostcomments)
#### enableGhostCommentsIndicator()
Enable ghost comment labels in the sidebar.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enableghostcommentsindicator)
### Special File Type Support
#### enableSvgAsImg()
Treat SVGs as flat images instead of layered elements.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#svgAsImg)
### Keyboard Controls
#### enableHotkey()
Enable hotkeys for comments (e.g. 'c' to enable comment mode).
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enablehotkey)
#### enableEnterKeyToSubmit()
Enable using Enter key to submit comments.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enableentertosubmit)
#### enableDeleteOnBackspace()
Enable deleting comments with backspace key.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enabledeleteonbackspace)
### Moderation
#### enableModeratorMode()
Enable moderator mode for comments requiring approval.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enablemoderatormode)
#### enableResolveStatusAccessAdminOnly()
Restrict resolve action to admin users and comment authors.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enableresolvestatusaccessadminonly)
#### approveCommentAnnotation()
Approve a comment annotation in moderator mode.
* Params: `ApproveCommentAnnotationRequest`
* Returns: `Promise`
* React Hook: `useApproveCommentAnnotation()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#approvecommentannotation)
#### acceptCommentAnnotation()
Accept a comment annotation in suggestion mode.
* Params: `AcceptCommentAnnotationRequest`
* Returns: `Promise`
* React Hook: `useAcceptCommentAnnotation()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#acceptcommentannotation)
#### rejectCommentAnnotation()
Reject a comment annotation in suggestion mode.
* Params: `RejectCommentAnnotationRequest`
* Returns: `Promise`
* React Hook: `useRejectCommentAnnotation()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#rejectcommentannotation)
#### enableSuggestionMode()
Enable suggestion mode for accepting/rejecting comments.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enablesuggestionmode)
#### updateAccess()
Update access permissions for a comment annotation.
* Params: `UpdateAccessRequest`
* Returns: `Promise`
* React Hook: `useUpdateAccess()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#updateaccess)
#### enablePrivateCommentMode()
Enable private comment mode for admin-only comments.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enableprivatecomments)
### Comment Read Status
#### enableSeenByUsers()
Enable "Seen By" feature to show which users have seen each comment.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enableseenbyusers)
#### setUnreadIndicatorMode()
Set unread indicator mode to either minimal (dot) or verbose (badge).
* Params: `mode: "minimal" | "verbose"`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#setunreadindicatormode)
### Toggle Comment Types
#### enableAreaComment()
Enable area comments that allow drawing rectangles with comments.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enableareacomment)
#### enableInboxMode()
Enable inbox mode for comments.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enableinboxmode)
#### enablePopoverMode()
Enable popover mode for comments.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enablepopovermode)
#### enableStreamMode()
Enable stream mode for comments.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enablestreammode)
#### enableTextMode()
Enable text mode for comments.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enabletextmode)
#### enableInlineCommentMode()
Enable inline comment mode to show comments under associated text.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enableinlinecommentmode)
#### enableMultithread()
Enable multithreaded comments.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enablemultithread)
### Comment Bubble
#### enableGroupMatchedComments()
Enable grouping of multiple comment annotations in Comment Bubble component when multiple annotations match the provided `context` or `targetElementId`.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#groupMatchedComments)
### Comment Tool
#### enableCommentMode()
Enable comment mode to allow attaching comments to DOM elements.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enablecommentmode)
#### onCommentModeChange()
Subscribe to changes in comment mode state.
* Params: none
* Returns: `Observable`
* React Hook: `useCommentModeState()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#oncommentmodechange)
#### enableCommentTool()
Enable/disable the comment tool button.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enablecommenttool)
#### enableChangeDetectionInCommentMode()
Enable DOM change detection while in comment mode.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enablechangedetectionincommentmode)
#### enablePersistentCommentMode()
Enable persistent comment mode to continue leaving comments after finishing one.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enablepersistentcommentmode)
#### enableForceCloseAllOnEsc()
Force close persistent comment mode when ESC key is pressed, even if a comment thread is active.
* Params: none
* Returns: `void`
* React Hook: `useCommentUtils()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#forcecloseallonesc)
#### disableForceCloseAllOnEsc()
Disable force close behavior for persistent comment mode when ESC key is pressed.
* Params: none
* Returns: `void`
* React Hook: `useCommentUtils()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#forcecloseallonesc)
#### setPinCursorImage()
Set custom cursor image for comment mode.
* Params: `base64ImageString: string`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#setpincursorimage)
### Minimap
#### enableMinimap()
Enable minimap showing comment locations on screen edge.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enableminimap)
### Popover Comments
#### enableDialogOnTargetElementClick()
Enable opening comment dialog on target element click in popover mode.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enabledialogontargetelementclick)
#### enablePopoverTriangleComponent()
Enable triangle indicator on popover comments.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enablepoovertrianglecomponent)
### Video Timeline Comments
#### setTotalMediaLength()
Set the total length of media (in frames or seconds) for the timeline.
* Params: `length: number`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#settotalmediallength)
### Comment Pin
#### enableBubbleOnPin()
Show a Comment Bubble when hovering/clicking on Comment Pin instead of Comment Dialog.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enablebubbleonpin)
#### enableBubbleOnPinHover()
Show Comment Bubble on hover vs click for Comment Pins.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#enablebubbleonpinhover)
# Comments Sidebar
### Custom filtering, sorting and grouping
#### enableSidebarCustomActions()
Enable custom filtering, sorting and grouping actions in the comments sidebar.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments-sidebar/customize-behavior#custom-filtering-sorting-and-grouping)
#### setCommentSidebarData()
Set filtered/sorted/grouped data in the comments sidebar.
* Params: `data: CommentSidebarData[], options?: {grouping?: boolean}`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments-sidebar/customize-behavior#custom-filtering-sorting-and-grouping)
### Navigation
#### onCommentClick()
Listen for comment click events in the sidebar.
* Params: `(event: {documentId: string, location: Object, targetElementId: string, context: Object, annotation: CommentAnnotation}) => void`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments-sidebar/customize-behavior#oncommentclick)
#### enableSidebarUrlNavigation()
Enable automatic URL navigation when clicking comments in the sidebar.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments-sidebar/customize-behavior#enablesidebarurlnavigation)
### UI
#### openCommentSidebar()
Open the comments sidebar.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments-sidebar/customize-behavior#opencommentsidebar)
#### closeCommentSidebar()
Close the comments sidebar.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments-sidebar/customize-behavior#openCommentSidebar)
#### toggleCommentSidebar()
Toggle the comments sidebar open/closed state.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments-sidebar/customize-behavior#togglecommentsidebar)
#### enableFullScreenInSidebar()
Enable full-screen mode for the Comments Sidebar (only works in default mode).
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments-sidebar/customize-behavior#fullscreen)
#### disableFullScreenInSidebar()
Disable full-screen mode for the Comments Sidebar.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments-sidebar/customize-behavior#fullscreen)
#### excludeLocationIdsFromSidebar()
Filter out comments from specified locations in the sidebar.
* Params: `locationIds: string[]`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments-sidebar/customize-behavior#excludelocationidsfromsidebar)
### System Filters, Sorting and Grouping
#### setCommentSidebarFilters()
Set filters for the comments sidebar programmatically.
* Params: `filters: {location?: {id: string}[], people?: ({userId: string} | {email: string})[], priority?: string[], status?: string[], category?: string[]}`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/comments-sidebar/customize-behavior#setcommentsidebarfilters)
# Notifications
### Data
#### getNotificationsData()
Get the notifications data for the current user.
* Params:
* query: Optional. [`GetNotificationsDataQuery`](/api-reference/sdk/models/data-models#getnotificationsdataquery)
* `type`: Filter for notification type: all, for you, or documents.
* `forYou`: returns notifications where the current user is involved.
* `all` / `documents`: returns all notifications from the documents the user has access to.
* Returns: `Observable`
* React Hook: `useNotificationsData()`
* [Full Documentation →](/async-collaboration/notifications/customize-behavior#getnotificationsdata)
#### getUnreadNotificationsCount()
Get count of unread notifications by tab.
* Params: none
* Returns: `Observable<{forYou: number, all: number}>`
* React Hook: `useUnreadNotificationsCount()`
* [Full Documentation →](/async-collaboration/notifications/customize-behavior#getunreadnotificationscount)
### Event Subscription
#### on()
Subscribe to Notification events.
* Params: `NotificationEventType`. [Here](/api-reference/sdk/models/data-models#notification) is the list of events you can subscribe to.
* Returns: `Observable`. [Here](/api-reference/sdk/models/data-models#notification) is the list of events object types you can expect to receive.
* React Hook: `useNotificationEventCallback(NotificationEventType)`
#### onNotificationClick()
Listen for notification click events in the Notifications Panel.
* Params: `(notification: Notification) => void`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/notifications/customize-behavior#onnotificationclick)
### Configuration
#### setTabConfig()
Customize notification tab names and visibility.
* Params: `tabConfig: TabConfig`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/notifications/customize-behavior#settabconfig)
#### setMaxDays()
Set maximum age in days for displayed notifications.
* Params: `days: number`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/notifications/customize-behavior#setmaxdays)
#### enableReadNotificationsOnForYouTab()
Show read notifications in the "For You" tab.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/notifications/customize-behavior#enablereadnotificationsontheforyoutab)
### Actions
#### setAllNotificationsAsRead()
Mark all notifications as read globally or by tab.
* Params: `options?: {tabId?: string}`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/notifications/customize-behavior#setallnotificationsasread)
#### markNotificationAsReadById()
Mark a specific notification as read.
* Params: `notificationId: string`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/notifications/customize-behavior#marknotificationasreadbyid)
### Notification Settings
#### enableSettings()
Enable or disable the settings feature for notifications.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/notifications/customize-behavior#enablesettings)
#### disableSettings()
Disable the settings feature for notifications.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/notifications/customize-behavior#enablesettings)
#### setSettingsInitialConfig()
Set the initial default configuration for notification settings.
* Params: [`NotificationInitialSettingsConfig[]`](/api-reference/sdk/models/data-models#notificationinitialsettingsconfig)
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/notifications/customize-behavior#setsettingsinitialconfig)
#### muteAllNotifications()
Mute all notifications across all channels for the current user.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/notifications/customize-behavior#muteallnotifications)
#### setSettings()
Update notification settings configuration for the current user.
* Params: [`NotificationSettingsConfig`](/api-reference/sdk/models/data-models#notificationsettingsconfig)
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/notifications/customize-behavior#setsettings)
#### getSettings()
Get the current notification settings configuration for the user.
* Params: none
* Returns: [`Observable`](/api-reference/sdk/models/data-models#notificationsettingsconfig)
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/notifications/customize-behavior#getsettings)
#### enableCurrentDocumentOnly()
Filters notifications to show only those from the current document.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/notifications/customize-behavior#enablecurrentdocumentonly)
#### disableCurrentDocumentOnly()
Shows notifications from all documents, not just the current document.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/notifications/customize-behavior#disablecurrentdocumentonly)
# Recorder
#### downloadLatestVideo()
Downloads the latest version of a recording.
* Params: `recorderId: string`
* Returns: `Promise`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/recorder/customize-behavior#downloadlatestvideo)
#### enableRecordingCountdown()
Controls whether to display a countdown timer before a recording starts.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/recorder/customize-behavior#enablerecordingcountdown)
#### enableRecordingTranscription()
Controls whether to enable AI transcription for recordings.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/recorder/customize-behavior#enablerecordingtranscription)
#### fetchRecordings()
Fetches recording data.
* Params: [RecorderRequestQuery](/api-reference/sdk/models/data-models#recorderrequestquery)
* Returns: [`Promise`](/api-reference/sdk/models/data-models#getrecordingdataresponse)
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/recorder/customize-behavior#getrecordingdata)
### RecorderElement Methods
#### setMaxLength()
Sets the maximum recording duration in seconds.
* Params: `value: number`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/recorder/customize-behavior#setmaxlength)
#### enablePictureInPicture()
Enables Picture-in-Picture mode for recordings.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/recorder/customize-behavior#enablepictureinpicture)
#### disablePictureInPicture()
Disables Picture-in-Picture mode for recordings.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/recorder/customize-behavior#disablepictureinpicture)
#### openPictureInPicture()
Opens the Picture-in-Picture window for the current recording.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/recorder/customize-behavior#openpictureinpicture)
#### exitPictureInPicture()
Exits the Picture-in-Picture window.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/recorder/customize-behavior#exitpictureinpicture)
#### requestScreenPermission()
Requests screen capture permissions for recording preview.
* Params: none
* Returns: `Promise`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/recorder/customize-behavior#requestscreenpermission)
#### enablePlaybackOnPreviewClick()
Enables click-to-play/pause functionality on recording preview thumbnails.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/recorder/customize-behavior#playbackonpreviewclick)
#### disablePlaybackOnPreviewClick()
Disables click-to-play/pause functionality on recording preview thumbnails.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/recorder/customize-behavior#playbackonpreviewclick)
### Event Subscription
#### on()
Subscribe to Recorder events.
* Params: `RecorderEventType`. [Here](/api-reference/sdk/models/data-models#recorder) is the list of events you can subscribe to.
* Returns: `Observable`. [Here](/api-reference/sdk/models/data-models#recorder) is the list of events object types you can expect to receive.
* React Hook: `useRecorderEventCallback(RecorderEventType)`
* [Full Documentation →](/async-collaboration/recorder/customize-behavior#on)
# Inline Reactions
#### setCustomReactions()
Set custom reaction emojis for inline reactions.
* Params: `customReactions: { [reactionId: string]: { url?: string, emoji?: string } }`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/async-collaboration/reactions/customize-behavior#setcustomreactions)
# View Analytics
#### getUniqueViewsByUser()
Get unique views by user, optionally filtered by location.
* Params: `locationId?: string`
* Returns: `Observable`
* React Hook: `useUniqueViewsByUser()`
* [Full Documentation →](/async-collaboration/view-analytics/customize-behavior#getuniqueviewsbyuser)
#### getUniqueViewsByDate()
Get unique views by date, optionally filtered by location.
* Params: `locationId?: string`
* Returns: `Observable`
* React Hook: `useUniqueViewsByDate()`
* [Full Documentation →](/async-collaboration/view-analytics/customize-behavior#getuniqueviewsbydate)
# Live State Sync
#### getLiveStateData()
Retrieves live state data as an observable based on the provided ID.
* Params: `liveStateDataId?: string`
* Returns: `Observable`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/live-state-sync/setup)
#### setLiveStateData()
Sets live state data for the provided ID and data.
* Params:
* `liveStateDataId`: `string`
* `liveStateData`: `any`
* `config`: `SetLiveStateDataConfig`
* Returns: `any`
* React Hook: `useSetLiveStateData()`
* [Full Documentation →](/realtime-collaboration/live-state-sync/setup)
#### fetchLiveStateData()
Fetches live state data as a Promise. Use this when you need to retrieve the current state once, rather than subscribing to ongoing changes.
* Params: `request?:` [FetchLiveStateDataRequest](/api-reference/sdk/models/data-models#fetchlivestatedatarequest) - Optional. If not provided or if liveStateDataId is not specified, all live state data will be returned.
* Returns: `Promise` - Generic type support allows you to specify the expected data type
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/live-state-sync/setup#fetch-live-data)
# Single Editor Mode
#### enableSingleEditorMode()
Enables the single editor mode with an optional configuration.
* Params: `config?: SingleEditorConfig`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/single-editor-mode/setup)
#### disableSingleEditorMode()
Disables the single editor mode.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/single-editor-mode/setup)
#### isUserEditor()
Checks if the current user is an editor. Returns an observable.
* Params: none
* Returns: `Observable`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/single-editor-mode/setup)
#### getEditor()
Retrieves the current editor information.
* Params: none
* Returns: `Observable`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/single-editor-mode/setup)
#### setUserAsEditor()
Sets the current user as an editor.
* Params: none
* Returns: `Promise`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/single-editor-mode/customize-behavior#setuseraseditor)
Possible error codes returned in `SetUserAsEditorResponse.error`:
* `same_user_editor_current_tab`
* `same_user_editor_different_tab`
* `another_user_editor`
See types: [SetUserAsEditorResponse](/api-reference/sdk/models/data-models#setuseraseditorresponse), [ErrorEvent](/api-reference/sdk/models/data-models#errorevent)
#### resetUserAccess()
Resets the user access.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/single-editor-mode/setup)
#### singleEditorModeContainerIds()
Disables elements inside specific elements only when single editor mode is on.
* Params: `elementIds: string[]`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/single-editor-mode/setup)
#### enableAutoSyncState()
Enables the autosync state feature.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/single-editor-mode/setup)
#### requestEditorAccess()
Initiates a request for editor access.
* Params: none
* Returns: `Observable`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/single-editor-mode/setup)
#### isEditorAccessRequested()
Checks if editor access has been requested.
* Params: none
* Returns: `Observable<{ requestStatus: string, requestedBy: User } | null>`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/single-editor-mode/setup)
#### acceptEditorAccessRequest()
Accepts an editor access request.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/single-editor-mode/setup)
#### rejectEditorAccessRequest()
Rejects an editor access request.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/single-editor-mode/setup)
#### cancelEditorAccessRequest()
Cancels an editor access request.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/single-editor-mode/setup)
#### editCurrentTab()
Edits the current tab.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/single-editor-mode/setup)
#### setEditorAccessTimeout()
Sets a timeout for editor access. (in milliseconds)
* Params: `timeout: number`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/single-editor-mode/setup)
#### enableEditorAccessTransferOnTimeOut()
Enables the transfer of editor access on timeout.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/single-editor-mode/setup)
#### enableDefaultSingleEditorUI()
Enables the default UI for single editor mode.
* Params: none
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/single-editor-mode/setup)
#### enableHeartbeat()
Enables the heartbeat mechanism for Single Editor Mode presence detection. This feature is enabled by default when single editor mode is enabled.
* Params: `void`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/single-editor-mode/customize-behavior#heartbeat)
#### disableHeartbeat()
Disables the heartbeat mechanism for Single Editor Mode presence detection. Must be called before enabling single editor mode if you don't want to use the heartbeat functionality.
* Params: `void`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/single-editor-mode/customize-behavior#heartbeat)
# Cursors
#### setInactivityTime()
Set the time it takes for a user's cursor to be marked as inactive.
* Params: `milliseconds: number`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/cursors/customize-behavior#setinactivitytime)
#### allowedElementIds()
Set specific element IDs where cursors should be shown.
* Params: `elementIds: string[]`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/cursors/customize-behavior#allowedelementids)
#### onCursorUserChange()
Subscribe to cursor position changes for all users.
* Params: `callback: (cursorUsers: CursorUser[]) => void`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/cursors/customize-behavior#oncursoruserchange)
# Presence
#### updateUserPresence()
Send a lightweight heartbeat from your host app to Velt. Velt will use that as a fallback in rare edge cases if it fails to detect multi‑tab/device presence. Most apps don’t need this; use only if you see ambiguity in who’s the active editor.
* Params: `userPresence: LiveStateSingleEditorExternalUserPresence`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/single-editor-mode/customize-behavior#updateuserpresence)
See types: [LiveStateSingleEditorExternalUserPresence](/api-reference/sdk/models/data-models#livestatesingleeditorexternaluserpresence)
Set the time it takes for a user to be marked as inactive.
* Params: `milliseconds: number`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/presence/customize-behavior#setinactivitytime)
#### enableSelf()
Include the current user in the list of presence users.
* Params: `none`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/presence/customize-behavior#self)
#### on()
Subscribe to Presence events.
* Params: `PresenceEventType`. [Here](/api-reference/sdk/models/data-models#presence) is the list of events you can subscribe to.
* Returns: `Observable`. [Here](/api-reference/sdk/models/data-models#presence) is the list of events object types you can expect to receive.
* React Hook: `usePresenceEventCallback(PresenceEventType)`
* [Full Documentation →](/realtime-collaboration/presence/customize-behavior#on)
#### onPresenceUserChange()
Subscribe to presence changes for all users.
* Params: `callback: (presenceUsers: PresenceUser[]) => void`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/presence/customize-behavior#onpresenceuserchange)
#### onPresenceUserClick()
Handle click events on presence avatar circles.
* Params: `callback: (user: User) => void`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/presence/customize-behavior#onpresenceuserclick)
#### getData()
Subscribe to presence data.
* Params: `PresenceRequestQuery`
* Returns: `Observable`
* React Hook: `usePresenceData()`
* [Full Documentation →](/realtime-collaboration/presence/customize-behavior#getdata)
# Follow Mode
#### enableFlockMode()
Enable Follow Me mode globally wherever Presence is shown.
* Params: `none`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/presence/customize-behavior#flockmode)
#### startFollowingUser()
Start following a specific user.
* Params: `userId: string`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/flock-mode/customize-behavior#startfollowinguser)
#### stopFollowingUser()
Stop following the current user.
* Params: `none`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/flock-mode/customize-behavior#stopfollowinguser)
#### onNavigate()
Handle navigation events during Follow Me sessions.
* Params: `callback: (pageInfo: PageInfo) => void`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/flock-mode/customize-behavior#onnavigate)
# Huddle
#### enableChat()
Enable the ephemeral chat feature in Huddle.
* Params: `none`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/huddle/customize-behavior#chat)
#### enableFlockModeOnAvatarClick()
Enable Follow Me mode when clicking on a user's avatar in Huddle.
* Params: `none`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/huddle/customize-behavior#flockmodedonavatarclick)
# Live Selection
#### enableDefaultElementsTracking()
Enable automatic tracking of user presence on default element types (input, textarea, button, contenteditable).
* Params: `none`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/live-selection/customize-behavior#enabledefaultelementstracking)
#### enableUserIndicator()
Enable the user indicator (avatar/name label) that appears near selected elements.
* Params: `none`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/live-selection/customize-behavior#enableuserindicator)
#### setUserIndicatorPosition()
Set the position of the user indicator globally.
* Params: `position: 'start' | 'end'`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/live-selection/customize-behavior#setuserindicatorposition)
#### setUserIndicatorType()
Set the type of user indicator globally.
* Params: `type: 'avatar' | 'label'`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/live-selection/customize-behavior#setuserindicatortype)
#### getLiveSelectionData()
Get the live selection data for the current document.
* Params: `none`
* Returns: `Observable`
* React Hook: `useLiveSelectionDataHandler()`
* [Full Documentation →](/realtime-collaboration/live-selection/customize-behavior#getliveselectiondata)
# AI
#### enableRewriter()
Enable the rewriter.
* **Signature**: `enableRewriter()`
* **Params**: `n/a`
* **Returns**: `void`
* **React Hook**: `n/a`
# ReactFlow
#### [useVeltReactFlowCrdtExtension()](/api-reference/sdk/api/api-methods#useveltreactflowcrdtextension)
Provides real-time collaborative ReactFlow editor functionality with Yjs and Velt SDK synchronization.
* Signature: useVeltReactFlowCrdtExtension(config: VeltReactFlowCrdtExtensionConfig)
* Params: [VeltReactFlowCrdtExtensionConfig](/api-reference/sdk/models/data-models#veltreactflowcrdtextensionconfig)
* Returns: [VeltReactFlowCrdtExtensionResponse](/api-reference/sdk/models/data-models#veltreactflowcrdtextensionresponse)
* React Hook: `useVeltReactFlowCrdtExtension()`
* [Full Documentation →](/realtime-collaboration/crdt/setup/reactflow#useveltreactflowcrdtextension)
#### veltReactFlowStore
Create and initialize a collaborative React Flow Zustand store.
* Params: [VeltReactFlowStoreConfig](/api-reference/sdk/models/data-models#veltreactflowstoreconfig)
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/crdt/setup/reactflow#apis)
#### onNodesChange
CRDT-aware handler to apply node changes (add/update/remove) that sync across collaborators.
* Params: [NodeChange\[\]](/api-reference/sdk/models/data-models#nodechange)
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/crdt/setup/reactflow#apis)
#### onEdgesChange
CRDT-aware handler to apply edge changes (add/update/remove) that sync across collaborators.
* Params: [EdgeChange\[\]](/api-reference/sdk/models/data-models#edgechange)
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/crdt/setup/reactflow#apis)
#### onConnect
CRDT-aware connect handler compatible with React Flow’s `onConnect` prop.
* Params: [Connection](/api-reference/sdk/models/data-models#connection)
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/crdt/setup/reactflow#apis)
#### setNodes
Imperative setter for nodes (useful for non-event updates). Synced via the store.
* Params: [Node\[\]](/api-reference/sdk/models/data-models#node-react-flow) | ((prev: [Node\[\]](/api-reference/sdk/models/data-models#node-react-flow)) => [Node\[\]](/api-reference/sdk/models/data-models#node-react-flow))
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/crdt/setup/reactflow#apis)
#### setEdges
Imperative setter for edges (useful for non-event updates). Synced via the store.
* Params: [Edge\[\]](/api-reference/sdk/models/data-models#edge-react-flow) | ((prev: [Edge\[\]](/api-reference/sdk/models/data-models#edge-react-flow)) => [Edge\[\]](/api-reference/sdk/models/data-models#edge-react-flow))
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/crdt/setup/reactflow#apis)
# Encryption
#### setEncryptionProvider(encryptionProvider)
Register a custom encrypt/decrypt provider used by CRDT features.
* Params: `VeltEncryptionProvider`
* Returns: `void`
* [Full Documentation →](/realtime-collaboration/crdt/setup/tiptap#encryption)
# CodeMirror
#### [useVeltCodeMirrorCrdtExtension()](/api-reference/sdk/api/api-methods#useveltcodemirrorcrdtextension)
Provides real-time collaborative CodeMirror editor functionality with Yjs and Velt SDK synchronization.
* Signature: useVeltCodeMirrorCrdtExtension(config: VeltCodeMirrorCrdtExtensionConfig)
* Params: [VeltCodeMirrorCrdtExtensionConfig](/api-reference/sdk/models/data-models#veltcodemirrorcrdtextensionconfig)
* Returns: Extension | null
* React Hook: `useVeltCodeMirrorCrdtExtension()`
* [Full Documentation →](/realtime-collaboration/crdt/setup/codemirror#useveltcodemirrorcrdtextension)
#### createVeltCodeMirrorStore
Create and initialize a collaborative CodeMirror store instance.
* Params: `VeltCodeMirrorStoreConfig`
* Returns: `Promise`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/crdt/setup/codemirror#createveltcodemirrorstore)
#### getStore()
Get the underlying Store that manages state and synchronization.
* Params: `none`
* Returns: `Store`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/crdt/setup/codemirror#getstore)
#### getYDoc()
Access the Yjs document used for collaborative editing.
* Params: `none`
* Returns: `Y.Doc`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/crdt/setup/codemirror#getydoc)
#### getYText()
Get the shared Y.Text bound to the current CodeMirror document.
* Params: `none`
* Returns: `Y.Text | null`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/crdt/setup/codemirror#getytext)
#### getAwareness()
Access the Yjs Awareness instance associated with the store.
* Params: `none`
* Returns: `Awareness`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/crdt/setup/codemirror#getawareness)
#### getUndoManager()
Access the Yjs UndoManager for collaborative undo/redo.
* Params: `none`
* Returns: `Y.UndoManager`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/crdt/setup/codemirror#getundomanager)
#### destroy()
Clean up listeners and release resources.
* Params: `none`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/crdt/setup/codemirror#destroy)
# BlockNote
#### useVeltBlockNoteCrdtExtension()
Provides real-time collaborative BlockNote editor functionality with Yjs and Velt SDK synchronization.
* Signature: useVeltBlockNoteCrdtExtension(config: VeltBlockNoteCrdtExtensionConfig)
* Params: [VeltBlockNoteCrdtExtensionConfig](/api-reference/sdk/models/data-models#veltblocknotecrdtextensionconfig)
* Returns: [VeltCodeMirrorCrdtExtensionResponse](/api-reference/sdk/models/data-models#veltcodemirrorcrdtextensionresponse)
* React Hook: `useVeltBlockNoteCrdtExtension()`
* [Full Documentation →](/realtime-collaboration/crdt/setup/blocknote#useveltblocknotecrdtextension)
#### createVeltBlockNoteStore()
Create and initialize a collaborative BlockNote store instance.
* Params: `VeltBlockNoteStoreConfig`
* Returns: `VeltBlockNoteStore | null`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/crdt/setup/blocknote#createveltblocknotestore)
#### initialize()
Start syncing the collaborative document (usually auto-called by the factory).
* Params: `none`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/crdt/setup/blocknote#initialize)
#### destroy()
Tear down the store and clean listeners/resources.
* Params: `none`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/crdt/setup/blocknote#destroy)
#### getStore()
Access the underlying CRDT store (yjs doc + provider).
* Params: `none`
* Returns: `Store`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/crdt/setup/blocknote#getstore)
#### getYDoc()
Accessor for the underlying Yjs document.
* Params: `none`
* Returns: `Y.Doc`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/crdt/setup/blocknote#getydoc)
#### getYXml()
Get the Y.XmlFragment representing the BlockNote document tree.
* Params: `none`
* Returns: `Y.XmlFragment | null`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/crdt/setup/blocknote#getyxml)
# Tiptap
#### [useVeltTiptapCrdtExtension()](/api-reference/sdk/api/api-methods#usevelttiptapcrdtextension)
Provides real-time collaborative Tiptap editor functionality with Yjs and Velt SDK synchronization.
* Signature: useVeltTiptapCrdtExtension(config: VeltTiptapCrdtExtensionConfig)
* Params: [VeltTiptapCrdtExtensionConfig](/api-reference/sdk/models/data-models#velttiptapcrdtextensionconfig)
* Returns: [VeltTiptapCrdtExtensionResponse](/api-reference/sdk/models/data-models#velttiptapcrdtextensionresponse)
* React Hook: `useVeltTiptapCrdtExtension()`
* [Full Documentation →](/realtime-collaboration/crdt/setup/tiptap#usevelttiptapcrdtextension)
#### createVeltTipTapStore()
Create and initialize a collaborative Tiptap store instance.
* Params: `config`
* Returns: `VeltTipTapStore | null`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/crdt/setup/tiptap#apis)
#### initialize()
Initialize the store and start syncing the collaborative document.
* Params: `none`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/crdt/setup/tiptap#initialize)
#### getCollabExtension()
Get the Tiptap collaboration extension bound to the current Yjs document.
* Params: `none`
* Returns: `Extension`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/crdt/setup/tiptap#getcollabextension)
#### destroy()
Tear down the store and clean up listeners/resources.
* Params: `none`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/crdt/setup/tiptap#destroy)
#### getStore()
Access the underlying CRDT store managing document state.
* Params: `none`
* Returns: `Store`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/crdt/setup/tiptap#getstore)
#### getYDoc()
Accessor for the underlying Yjs document.
* Params: `none`
* Returns: `Y.Doc`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/crdt/setup/tiptap#apis)
#### getYXml()
Accessor for the XML fragment in the Yjs document.
* Params: `none`
* Returns: `Y.XmlFragment | null`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/crdt/setup/tiptap#apis)
# Core
### Client
#### initConfig()
Set up initial configurations for the Velt SDK.
* Params: `apiKey: string, config?: Config`
* Returns: `void`
* React Hook: `n/a`
#### getVeltInitState()
Subscribe to detect whether Velt is initialized.
* Params: `void`
* Returns: `Observable`
* React Hook: `useVeltInitState()`
* [Full Documentation →](/key-concepts/client#getveltinitstate)
#### get Velt Client
Access the core Velt client instance to call SDK APIs and subscribe to core events.
* Signature:
* React: `const { client } = useVeltClient()`
* Other frameworks: `const client = await initVelt(apiKey)`
* HTML: `await Velt.init(apiKey)` then use `Velt`
* Params: `none` [Here](/get-started/advanced#client-event-subscriptions) is the list of events you can subscribe to.
* Returns: `Velt` [Here](/api-reference/sdk/models/data-models#client-events) is the list of events object types you can expect to receive.
* React Hook: `useVeltClient()`
* See event payloads: [Core data model](/api-reference/sdk/models/data-models##core-events)
* Overview: [Client Event Subscriptions](/get-started/advanced#client-event-subscriptions)
#### getMetadata()
Get the currently set organization, document and location objects.
* Params: none
* Returns: `Promise`
* React Hook: `n/a`
* [Full Documentation →](/key-concepts/client#getmetadata)
#### getUserPermissions()
Get the current user's access roles across organization, folder, and document scopes.
* Params: [GetUserPermissionsRequest](/api-reference/sdk/models/data-models#getuserpermissionsrequest)
* Returns: [`Promise`](/api-reference/sdk/models/data-models#getuserpermissionsresponse)
* React Hook: `n/a`
* [Full Documentation →](/key-concepts/overview#configuration-modes)
**Error handling:** On failure, the response includes an `errorCode` from the [UserPermissionAccessRoleResult](/api-reference/sdk/models/data-models#userpermissionaccessroleresult) enum:
* `does_not_exist`: Resource not found
* `permission_denied`: User lacks access to the resource
* `something_went_wrong`: Unexpected error
#### getHeartbeat()
Subscribe to user-specific heartbeat data. Retrieve heartbeat data for the current user or specify a userId to monitor heartbeats for any user.
* Params: [`HeartbeatConfig`](/api-reference/sdk/models/data-models#heartbeatconfig) (optional)
* Returns: [`Observable`](/api-reference/sdk/models/data-models#getheartbeatresponse)
* React Hook: `useHeartbeat()`
* [Full Documentation →](/key-concepts/client#getheartbeat)
### Authentication
#### identify()
Authenticate the client's user with the Velt SDK.
* Params: `user: User, userOptions?: UserOptions`
* Returns: `Promise`
* React Hook: `useIdentify()`
#### setPermissionProvider()
Configure Permission Provider for real-time access validation.
* Params: [`VeltPermissionProvider`](/api-reference/sdk/models/data-models#veltpermissionprovider)
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/key-concepts/overview#c-real-time-permission-provider)
#### signOutUser()
To sign out a user.
* Params: `void`
* Returns: `any`
* React Hook: `n/a`
* [Full Documentation →](/key-concepts/client#client-events)
#### getUser()
Get the current authenticated user in Velt.
* Params: `void`
* Returns: `User`
* React Hook: `n/a`
* [Full Documentation →](/key-concepts/client#client-events)
#### getCurrentUser()
Subscribe to changes in the current user object.
* Params: `void`
* Returns: `Observable`
* React Hook: `useCurrentUser()`
* [Full Documentation →](/key-concepts/overview#get-current-user)
### Collaboration
#### createVeltStore()
Create and initialize a collaborative CRDT store instance.
* Params: `StoreConfig`
* Returns: `Promise | null>`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/crdt/setup/core#apis)
#### getDoc()
Get the underlying Yjs document.
* Params: `none`
* Returns: `Y.Doc`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/crdt/setup/core#apis)
#### getProvider()
Get the provider instance for the store.
* Params: `none`
* Returns: `Provider`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/crdt/setup/core#apis)
#### getText()
Get the Y.Text instance if store type is 'text'.
* Params: `none`
* Returns: `Y.Text | null`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/crdt/setup/core#apis)
#### getXml()
Get the Y.XmlFragment instance if store type is 'xml'.
* Params: `none`
* Returns: `Y.XmlFragment | null`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/crdt/setup/core#apis)
#### useVeltCrdtStore()
React Hook to create and sync a CRDT store.
* Params: `VeltCrdtStoreConfig`
* Returns: `Store`
* React Hook: `Yes`
* [Full Documentation →](/realtime-collaboration/crdt/setup/core#apis)
#### update()
Update the store value.
* Params: `newValue: T`
* Returns: `void`
* React Hook: `update()`
* [Full Documentation →](/realtime-collaboration/crdt/setup/core#update)
#### saveVersion()
Save the current state as a named version.
* Params: `versionName: string`
* Returns: `Promise`
* React Hook: `saveVersion()`
* [Full Documentation →](/realtime-collaboration/crdt/setup/core#saveversion)
#### getVersions()
Retrieve all saved versions.
* Params: `none`
* Returns: `Promise`
* React Hook: `getVersions()`
* [Full Documentation →](/realtime-collaboration/crdt/setup/core#getversions)
#### getVersionById()
Fetch a specific version by ID.
* Params: `versionId: string`
* Returns: `Promise`
* React Hook: `getVersionById()`
* [Full Documentation →](/realtime-collaboration/crdt/setup/core#getversionbyid)
#### setStateFromVersion()
Restore the state from a given version.
* Params: `version: Version`
* Returns: `Promise`
* React Hook: `setStateFromVersion()`
* [Full Documentation →](/realtime-collaboration/crdt/setup/core#setstatefromversion)
#### destroy()
Destroy the store, cleaning up resources and listeners.
* Params: `none`
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/crdt/setup/core#destroy)
#### subscribe()
Subscribe to store updates.
* Params: `(newValue: T) => void`
* Returns: `() => void` (unsubscribe)
* React Hook: `n/a`
* [Full Documentation →](/realtime-collaboration/crdt/setup/core#subscribe)
#### getValue()
Get the current store value.
* Params: `none`
* Returns: `T`
* React Hook: `value`
* [Full Documentation →](/realtime-collaboration/crdt/setup/core#getvalue)
#### value
Current value of the store.
* Params: `none`
* Returns: `T | null`
* React Hook: `value`
* [Full Documentation →](/realtime-collaboration/crdt/setup/core#value)
#### versions
List of all stored versions.
* Params: `none`
* Returns: `Version[]`
* React Hook: `versions`
* [Full Documentation →](/realtime-collaboration/crdt/setup/core#versions)
#### store
Underlying Velt Store instance.
* Params: `none`
* Returns: `Store | null`
* React Hook: `store`
* [Full Documentation →](/realtime-collaboration/crdt/setup/core#store)
#### restoreVersion()
Restore the store to a specific version by ID.
* Params: `versionId: string`
* Returns: `Promise`
* React Hook: `restoreVersion()`
* [Full Documentation →](/realtime-collaboration/crdt/setup/core#restoreversion)
### Debug Info
#### fetchDebugInfo()
Retrieve debug information about the current Velt SDK state as a one-time fetch. Returns a Promise that resolves with comprehensive debug data including SDK version, API key, and server/client state metadata.
* Params: `none`
* Returns: [`Promise`](/api-reference/sdk/models/data-models#veltdebuginfo)
* React Hook: `n/a`
* [Full Documentation →](/get-started/advanced#debug-info)
#### getDebugInfo()
Subscribe to debug information updates about the current Velt SDK state. Returns an Observable that emits debug data whenever the SDK state changes.
* Params: `none`
* Returns: [`Observable`](/api-reference/sdk/models/data-models#veltdebuginfo)
* React Hook: `n/a`
* [Full Documentation →](/get-started/advanced#debug-info)
### Folders
#### fetchFolders()
Fetch folder metadata and subfolders by organizationId, folderId with pagination.
* Params: `fetchFoldersRequest: FetchFoldersRequest`
* Returns: `Observable`
* React Hook: `n/a`
* [Full Documentation →](/api-reference/sdk/api/api-methods#client)
### Documents
#### setDocuments()
Initialize and subscribe to multiple Documents at once.
* Params:
* `documents`: [Document\[\]](/api-reference/sdk/models/data-models#document)
* `options?`: [SetDocumentsRequestOptions](/api-reference/sdk/models/data-models#setdocumentsrequestoptions)
* Returns: `Promise`
* React Hook: `useSetDocuments()`
* [Full Documentation →](/key-concepts/overview#set-multiple-documents)
**Behavior Update:** This method now filters out documents the user doesn't have access to instead of failing the entire operation. When using the `allDocuments` flag with a folder, only the first 50 documents are retrieved, and any inaccessible documents are automatically filtered out.
#### setDocument()
Initialize and subscribe to a single Document.
* Params:
* `documentId`: string
* `metadata?`: [DocumentMetadata](/api-reference/sdk/models/data-models#documentmetadata)
* Returns: `Promise`
* React Hook: `useSetDocument()`
* [Full Documentation →](/key-concepts/overview#set-a-single-document)
#### setRootDocument()
Set a different document as the root document when multiple documents are active.
* Params: `document:` [Document](/api-reference/sdk/models/data-models#document)
* Returns: `Promise`
* React Hook: `n/a`
#### unsetDocuments()
Use this to unsubscribe from all documents at once.
* Params: `void`
* Returns: `void`
* React Hook: `useUnsetDocuments()`
* [Full Documentation →](/key-concepts/overview#unset-multiple-documents)
#### fetchDocuments()
Fetch document metadata by `organizationId`, `folderId`, or specific `documentIds`. Supports pagination.
* Params: [FetchDocumentsRequest](/api-reference/sdk/models/data-models#fetchdocumentsrequest)
* Returns: [`Promise`](/api-reference/sdk/models/data-models#fetchdocumentsresponse)
* React Hook: `n/a`
* [Full Documentation →](/key-concepts/overview#fetch-documents)
#### updateDocuments()
Update document metadata by organizationId, folderId or documentIds.
* Params: `UpdateDocumentsRequest`
* Returns: `Promise`
* React Hook: `n/a`
* [Full Documentation →](/key-concepts/overview#update-document-metadata)
### Location
#### setLocation()
Set the current location context. Used to define specific areas within a document.
* Params: `location: Location, isAdditional?: boolean`
* `location`: Location object with:
* `id`: Required unique identifier
* `locationName?`: Optional display name for UI components
* `version?`: Optional version object with:
* `id`: Version identifier
* `name`: Version display name
* Additional custom key/value pairs
* `isAdditional?`: Boolean to add additional locations
* `false` (default): Set this as the root location
* `true`: Add as additional location
* Returns: `Promise`
* React Hook: `useSetLocation()`
* [Full Documentation →](/key-concepts/overview#set-location)
#### setLocations()
Initialize and/or append multiple locations at once.
* Params:
* `locations`: [Location\[\]](/api-reference/sdk/models/data-models#location)
* `options?`: [SetLocationsRequestOptions](/api-reference/sdk/models/data-models#setlocationsrequestoptions)
* Returns: `Promise`
* React Hook: `n/a`
#### setRootLocation()
Set a different location as the root location when multiple locations are active.
* Params: `location:` [Location](/api-reference/sdk/models/data-models#location)
* Returns: `Promise`
* React Hook: `n/a`
#### removeLocations()
Remove multiple locations.
* Params: `...locations:` [Location\[\]](/api-reference/sdk/models/data-models#location)
* Returns: `void`
* React Hook: `n/a`
#### unsetLocationsIds()
Unset locations by ids or all of them if you don't specify any parameters.
* Params: `ids?: string[]`
* If no ids provided, removes all locations
* If ids provided, removes that specific location
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/key-concepts/overview#unset-locations)
### Event Subscription
#### on()
Subscribe to Velt core events
* Params: `eventType: string`. [Here](/api-reference/sdk/models/data-models#client) is the list of events you can subscribe to.
* Returns: `Observable`. It will return one of the objects from [here](/api-reference/sdk/models/data-models#client)
* React Hook: `useVeltEventCallback()`
### Self Hosting
#### setDataProviders()
Set the data providers for self hosting data.
* Params: [`VeltDataProvider`](/api-reference/sdk/models/data-models#veltdataprovider)
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/self-host-data/overview)
### UI
#### setUiState()
Set custom state data that can be used in Velt wireframes, Velt if and Velt data components.
* Params: `Record`
* Object containing key-value pairs of custom state data
* Returns: `void`
* React Hook: `n/a`
#### getUiState()
Get the custom UI state data.
* Params: `void`
* Returns: `Observable>`
* Observable that emits the current UI state object
* React Hook: `n/a`
#### injectCustomCss()
To inject custom CSS within Components with Shadow DOM enabled.
* Params: `customCss: CustomCss`
* Returns: `void`
* React Hook: `n/a`
#### removeVeltContent()
To remove Velt specific content from provided html content. This is useful when using Velt on a text editor or editable element.
* Params: `htmlContent: string`
* Returns: `string`
* React Hook: `n/a`
#### resetVeltButtonState()
Reset the state of Velt Button components.
* Params: (optional) [VeltResetButtonStateConfig](/api-reference/sdk/models/data-models#veltresetbuttonstateconfig)
* Returns: `void`
* React Hook: `n/a`
* [Full Documentation →](/ui-customization/custom-action-component#reset-velt-button-state)
### Feature Utilities
#### getPresenceElement()
Get the Presence Element Object to access the raw presence data.
* Params: `void`
* Returns: `PresenceElement`
* React Hook: `n/a`
#### getCursorElement()
Get the Cursor Element Object to access the raw cursor data.
* Params: `void`
* Returns: `CursorElement`
* React Hook: `n/a`
#### getCommentElement()
Get the Comment Element Object to access the raw comment data.
* Params: `void`
* Returns: `CommentElement`
* React Hook: `useCommentUtils()`
#### getSelectionElement()
Get the Selection Object to enable/disable the feature.
* Params: `void`
* Returns: `SelectionElement`
* React Hook: `n/a`
#### getRecorderElement()
Get the Recorder Object.
* Params: `void`
* Returns: [`RecorderElement`](/api-reference/sdk/models/data-models#recorderelement)
* React Hook: `n/a`
#### getContactElement()
Get the Contact Object.
* Params: `void`
* Returns: `ContactElement`
* React Hook: `n/a`
#### getRewriterElement()
Get the Rewriter Object.
* Params: `void`
* Returns: `RewriterElement`
* React Hook: `n/a`
#### getLiveStateSyncElement()
Get the LiveStateSync Object.
* Params: `void`
* Returns: `LiveStateSyncElement`
* React Hook: `n/a`
#### getArrowElement()
Get the Arrow Object.
* Params: `void`
* Returns: `ArrowElement`
* React Hook: `n/a`
### Feature Gating
#### isUserAllowed\$()
To check if user is allowed in provided document or not.
* Params: `void`
* Returns: `Observable`
* React Hook: `n/a`
#### disableFeatures()
Provide a list of features to disable. Provide an empty array to enable all the features.
* Params: `features: Array`
* Returns: `void`
* React Hook: `n/a`
#### isPlanExpired\$()
To check if plan is expired or not.
* Params: `void`
* Returns: `Observable`
* React Hook: `n/a`
### Localization
#### setLanguage()
To set the language.
* Params: `language: string`
* Returns: `void`
* React Hook: `n/a`
#### setTranslations()
To set the translations for the language.
* Params: `language: string, translations: { [key: string]: string }`
* Returns: `void`
* React Hook: `n/a`
#### enableAutoTranslation()
To enable automatic translation of text in Velt Components based on User's language preference.
* Params: `void`
* Returns: `void`
* React Hook: `n/a`
### DOM Control
#### setScrollableElementsIds()
Tell us about the scrollable document ids to keep track on its scroll changes.
* Params: `ids: string[]`
* Returns: `void`
* React Hook: `n/a`
#### removeScrollableElementsIds()
To remove document params from a User.
* Params: `void`
* Returns: `void`
* React Hook: `n/a`
# React Hooks Index
Source: https://docs.velt.dev/api-reference/sdk/api/react-hooks
# Comments
#### useCommentUtils()
Hook to access comment utilities
* Params: `void`
* Returns: `CommentElement`
* Related API Method: `client.getCommentElement()`
* [Full Documentation →](/api-reference/sdk/api/api-methods#client)
### Threads
#### useAddCommentAnnotation()
Hook to add a comment annotation
* Params: [AddCommentAnnotationRequest](/api-reference/sdk/models/data-models#addcommentannotationrequest)
* Returns: `addCommentAnnotation()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#addcommentannotation)
#### useDeleteCommentAnnotation()
Hook to delete a comment annotation
* Params: [DeleteCommentAnnotationRequest](/api-reference/sdk/models/data-models#deletecommentannotationrequest)
* Returns: `deleteCommentAnnotation()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#deletecommentannotation)
#### useCommentAnnotationsCount()
Hook to get total and unread comment annotations count
* Params: [CommentRequestQuery](/api-reference/sdk/models/data-models#commentrequestquery) (optional)
* Returns: [GetCommentAnnotationsCountResponse](/api-reference/sdk/models/data-models#getcommentannotationscountresponse)
* [Full Documentation →](/async-collaboration/comments/customize-behavior#getcommentannotationscount)
#### useUnreadCommentAnnotationCountByLocationId()
Hook to get unread comment annotation count by location
* Params: `locationId: string`
* Returns: `UnreadCommentsCount | null`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#getunreadcommentannotationcountbylocationid)
#### useGetCommentAnnotations()
Hook to get all the comment annotations for all the specified documents
* Params: [CommentRequestQuery](/api-reference/sdk/models/data-models#commentrequestquery) (optional)
* Returns: [GetCommentAnnotationsResponse](/api-reference/sdk/models/data-models#getcommentannotationsresponse)
* [Full Documentation →](/async-collaboration/comments/customize-behavior#getcommentannotations)
#### useCommentAnnotationById()
Hook to get a specific comment annotation
* Params: `{ annotationId: string, documentId?: string }`
* Returns: `CommentAnnotation`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#getcommentannotationbyid)
### Messages
#### useAddComment()
Hook to add a comment to a specific annotation
* Params: [AddCommentRequest](/api-reference/sdk/models/data-models#addcommentrequest)
* Returns: `addComment()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#addcomment)
#### useUpdateComment()
Hook to update a comment in a specific annotation
* Params: [UpdateCommentRequest](/api-reference/sdk/models/data-models#updatecommentrequest)
* Returns: `updateComment()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#updatecomment)
#### useDeleteComment()
Hook to delete a comment from a specific annotation
* Params: [DeleteCommentRequest](/api-reference/sdk/models/data-models#deletecommentrequest)
* Returns: `deleteComment()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#deletecomment)
#### useGetComment()
Hook to get comments from a specific annotation
* Params: [GetCommentRequest](/api-reference/sdk/models/data-models#getcommentrequest)
* Returns: `getComment()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#getcomment)
#### useUnreadCommentCountOnCurrentDocument()
Hook to get number of unread comments on current document
* Params: `void`
* Returns: `UnreadCommentsCount | null`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#getunreadcommentcountoncurrentdocument)
#### useUnreadCommentCountByLocationId()
Hook to get number of unread comments by location
* Params: `locationId: string`
* Returns: `UnreadCommentsCount | null`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#getunreadcommentcountbylocationid)
#### useUnreadCommentCountByAnnotationId()
Hook to get number of unread comments by annotation
* Params: `annotationId: string`
* Returns: `number`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#getunreadcommentcountbyannotationid)
### @Mentions
#### useContactUtils()
Hook to access contact utility methods
* Returns: `ContactElement` with methods for managing contacts
* [Full Documentation →](/async-collaboration/comments/customize-behavior#updatecontactlist)
#### useAssignUser()
Hook to assign a user to a comment annotation
* Params: [AssignUserRequest](/api-reference/sdk/models/data-models#assignuserrequest)
* Returns: `assignUser()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#assignuser)
#### useContactSelected()
Hook to handle contact selection events
* Returns: `User`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#oncontactselected)
#### useContactList()
Hook to subscribe to the list of users added to organization, folder, document, user groups or the ones overwritten using the `updateContactList` API.
* Returns: [GetContactListResponse](/api-reference/sdk/models/data-models#getcontactlistresponse)
* [Full Documentation →](/async-collaboration/comments/customize-behavior#getcontactlist)
#### useSubscribeCommentAnnotation()
Hook to subscribe to a comment annotation
* Params: [SubscribeCommentAnnotationRequest](/api-reference/sdk/models/data-models#subscribecommentannotationrequest)
* Returns: `subscribeCommentAnnotation()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#subscribecommentannotation)
#### useUnsubscribeCommentAnnotation()
Hook to unsubscribe from a comment annotation
* Params: [UnsubscribeCommentAnnotationRequest](/api-reference/sdk/models/data-models#unsubscribecommentannotationrequest)
* Returns: `unsubscribeCommentAnnotation()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#unsubscribecommentannotation)
### Custom Lists
#### useAutocompleteUtils()
Hook to access autocomplete utilities for custom lists in comments
* Returns: `AutocompleteElement`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#createcustomlistdataoncomment)
#### useAutocompleteChipClick()
Hook to handle clicks on autocomplete chips in comments
* Returns: `AutocompleteItem` data when a chip is clicked
* [Full Documentation →](/async-collaboration/comments/customize-behavior#createcustomlistdataoncomment)
### Event Subscription
#### useCommentEventCallback()
Hook to subscribe to comment events
* Params: `eventType: string`. [Here](/async-collaboration/comments/customize-behavior#on) is the list of events you can subscribe to.
* Returns: Comment Event Object. It will return one of the objects from [here](/api-reference/sdk/models/data-models#comments)
* [Full Documentation →](/async-collaboration/comments/customize-behavior#on)
### Attachments
#### useAddAttachment()
Hook to add an attachment to a comment annotation
* Params: [AddAttachmentRequest](/api-reference/sdk/models/data-models#addattachmentrequest)
* Returns: `addAttachment()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#addattachment)
#### useDeleteAttachment()
Hook to delete an attachment from a comment annotation
* Params: [DeleteAttachmentConfig](/api-reference/sdk/models/data-models#deleteattachmentconfig)
* Returns: `deleteAttachment()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#deleteattachment)
#### useGetAttachment()
Hook to get attachments from a comment annotation
* Params: [GetAttachmentRequest](/api-reference/sdk/models/data-models#getattachmentrequest)
* Returns: `getAttachment()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#getattachment)
### Reactions
#### useAddReaction()
Hook to add a reaction to a comment
* Params: [AddReactionRequest](/api-reference/sdk/models/data-models#addreactionrequest)
* Returns: `addReaction()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#addreaction)
#### useDeleteReaction()
Hook to delete a reaction from a comment
* Params: [DeleteReactionRequest](/api-reference/sdk/models/data-models#deletereactionrequest)
* Returns: `deleteReaction()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#deletereaction)
#### useToggleReaction()
Hook to toggle a reaction on a comment
* Params: [ToggleReactionRequest](/api-reference/sdk/models/data-models#togglereactionrequest)
* Returns: `toggleReaction()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#togglereaction)
### Status & Priority
#### useUpdateStatus()
Hook to update the status of a comment annotation
* Params: [UpdateStatusRequest](/api-reference/sdk/models/data-models#updatestatusrequest)
* Returns: `updateStatus()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#updatestatus)
#### useResolveCommentAnnotation()
Hook to resolve a comment annotation
* Params: [ResolveCommentAnnotationRequest](/api-reference/sdk/models/data-models#resolvecommentannotationrequest)
* Returns: `resolveCommentAnnotation()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#resolvecommentannotation)
#### useUpdatePriority()
Hook to update the priority of a comment annotation
* Params: [UpdatePriorityRequest](/api-reference/sdk/models/data-models#updatepriorityrequest)
* Returns: `updatePriority()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#updatepriority)
### Recording
#### useDeleteRecording()
Hook to delete a recording from a comment annotation
* Params: [DeleteRecordingRequest](/api-reference/sdk/models/data-models#deleterecordingrequest)
* Returns: `deleteRecording()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#deleterecording)
#### useGetRecording()
Hook to get recordings from a comment annotation
* Params: [GetRecordingRequest](/api-reference/sdk/models/data-models#getrecordingrequest)
* Returns: `getRecording()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#getrecording)
### Deep Link
#### useGetLink()
Hook to get a link to a specific comment annotation
* Params: [GetLinkRequest](/api-reference/sdk/models/data-models#getlinkrequest)
* Returns: `getLink()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#getlink)
#### useCopyLink()
Hook to copy a comment annotation link to clipboard
* Params: [CopyLinkRequest](/api-reference/sdk/models/data-models#copylinkrequest)
* Returns: `copyLink()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#copylink)
### Navigation
#### useCommentSelectionChangeHandler()
Hook to subscribe to comment selection changes
* Returns: `CommentSelectionChangeData` with:
* `selected: boolean`
* `annotation: CommentAnnotation`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#oncommentselectionchange)
### UI
#### useUiState()
Hook to read and update UI state for use in wireframes, `VeltIf`, and `VeltData`.
* Returns: `{ uiState: Record | null, setUiState: (data: Record) => void }`
* [Full Documentation →](/ui-customization/template-variables)
```jsx theme={null}
const { uiState, setUiState } = useUiState();
useEffect(() => {
console.log('uiState: ', uiState);
}, [uiState]);
// Update values
setUiState({ a: 1, b: 2 });
// Reset fields to null
setUiState({ a: null, b: null });
```
#### useCommentDialogSidebarClickHandler()
Hook to handle clicks on the sidebar button in the comment dialog
* Returns: Event data
* [Full Documentation →](/async-collaboration/comments/customize-behavior#onsidebarbuttononcommentdialogclick)
### Moderation
#### useApproveCommentAnnotation()
Hook to approve comment annotations in moderator mode
* Params: [ApproveCommentAnnotationRequest](/api-reference/sdk/models/data-models#approvecommentannotationrequest)
* Returns: `approveCommentAnnotation()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#approvecommentannotation)
#### useAcceptCommentAnnotation()
Hook to accept comment annotations in suggestion mode
* Params: [AcceptCommentAnnotationRequest](/api-reference/sdk/models/data-models#acceptcommentannotationrequest)
* Returns: `acceptCommentAnnotation()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#acceptcommentannotation)
#### useRejectCommentAnnotation()
Hook to reject comment annotations in suggestion mode
* Params: [RejectCommentAnnotationRequest](/api-reference/sdk/models/data-models#rejectcommentannotationrequest)
* Returns: `rejectCommentAnnotation()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#rejectcommentannotation)
#### useUpdateAccess()
Hook to update access permissions for comment annotations
* Params: [UpdateAccessRequest](/api-reference/sdk/models/data-models#updateaccessrequest)
* Returns: `updateAccess()`
* [Full Documentation →](/async-collaboration/comments/customize-behavior#updateaccess)
### Comment Tool
#### useCommentModeState()
Hook to track the current state of comment mode
* Returns: `boolean` indicating if comment mode is active
* Automatically updates when comment mode changes
* [Full Documentation →](/async-collaboration/comments/customize-behavior#oncommentmodechange)
# Notifications
#### useNotificationSettings()
Hook to get and update notification settings for the current user
* Returns: `{ setSettingsInitialConfig, setSettings, settings }`
* [Full Documentation →](/async-collaboration/notifications/customize-behavior#setsettingsinitialconfig)
#### useNotificationUtils()
Hook to access notification element for utility methods
* Returns: `NotificationElement`
* [Full Documentation →](/async-collaboration/notifications/customize-behavior#settabconfig)
#### useNotificationsData()
Hook to access notifications data for the current user
* Params:
* query: Optional. [`GetNotificationsDataQuery`](/api-reference/sdk/models/data-models#getnotificationsdataquery)
* `type`: Filter for notification type: all, for you, or documents.
* `forYou`: returns notifications where the current user is involved.
* `all` / `documents`: returns all notifications from the documents the user has access to.
* Returns: Array of [`Notification`](/api-reference/sdk/models/data-models#notification) objects
* Automatically updates when notifications change
* [Full Documentation →](/async-collaboration/notifications/customize-behavior#getnotificationsdata)
#### useUnreadNotificationsCount()
Hook to get count of unread notifications
* Returns: Object with counts by tab
```typescript theme={null}
{
forYou: number, // Unread in "For You" tab
all: number // Unread in "All" tab
}
```
* Automatically updates when unread status changes
* [Full Documentation →](/async-collaboration/notifications/customize-behavior#getunreadnotificationscount)
# Inline Reactions
#### useReactionElement()
Hook to access reaction element for utility methods
* Returns: `ReactionElement`
* [Full Documentation →](/async-collaboration/reactions/customize-behavior#setcustomreactions)
# Recorder
#### useRecorderUtils()
Hook to access recorder element for utility methods
* Returns: `RecorderElement`
* [Full Documentation →](/async-collaboration/recorder/customize-behavior#enablerecordingcountdown)
#### useRecorderEventCallback()
Hook to subscribe to recorder events
* Params: `eventType: string`. [Here](/api-reference/sdk/models/data-models#recorder) is the list of events you can subscribe to.
* Returns: Recorder Event Object. It will return one of the objects from [here](/api-reference/sdk/models/data-models#recorder)
* [Full Documentation →](/async-collaboration/recorder/customize-behavior#on)
#### useRecordings()
Subscribe to all recording data from either the current document or specified recorder IDs.
* Params: [RecorderRequestQuery](/api-reference/sdk/models/data-models#recorderrequestquery) (optional)
* Returns: [`Observable`](/api-reference/sdk/models/data-models#getrecordingsresponse)
* [Full Documentation →](/async-collaboration/recorder/customize-behavior#getrecordings)
# View Analytics
#### useViewsElement()
Hook to access views element for utility methods
* Returns: `ViewsElement`
* [Full Documentation →](/async-collaboration/view-analytics/customize-behavior)
#### useUniqueViewsByUser()
Hook to get unique views grouped by user
* Params: `locationId: string`
* Returns: Array of view analytics data by user
* [Full Documentation →](/async-collaboration/view-analytics/customize-behavior#getuniqueviewsbyuser)
#### useUniqueViewsByDate()
Hook to get unique views grouped by date
* Params: `locationId: string`
* Returns: Array of view analytics data by date
* [Full Documentation →](/async-collaboration/view-analytics/customize-behavior#getuniqueviewsbydate)
# Live State Sync
#### useLiveStateSyncUtils()
Hook to access live state sync utilities
* Params: `void`
* Returns: `LiveStateSyncElement`
* Related API Method: `client.getLiveStateSyncElement()`
* [Full Documentation →](/realtime-collaboration/live-state-sync/setup)
#### useLiveStateData()
Hook to get live state data
* Params: `string`
* Returns: `any`
* Related API Method: `liveStateSyncElement.getLiveStateData()`
* [Full Documentation →](/realtime-collaboration/live-state-sync/setup)
#### useSetLiveStateData()
Hook to set live state data
* Params:
* `liveStateDataId`: `string`
* `liveStateData`: `any`
* `config`: `SetLiveStateDataConfig`
* Returns: `void`
* Related API Method: `liveStateSyncElement.setLiveStateData()`
* [Full Documentation →](/realtime-collaboration/live-state-sync/setup)
#### useLiveState()
Hook to sync state variables across clients in real-time (similar to React's useState)
* Params:
* `uniqueId`: string - Unique identifier to sync across screens
* `initialValue`: any - Initial value of the state
* `options?`: object
* `syncDuration`: number - Debounce duration in ms (default: 50)
* `resetLiveState`: boolean - Reset state on init (default: false)
* `listenToNewChangesOnly`: boolean - Only listen to new changes (default: false)
* Returns: `[value, setValue, serverConnectionState]`
* `value`: Current state value
* `setValue`: Function to update state
* `serverConnectionState`: Current server connection state
* [Full Documentation →](/realtime-collaboration/live-state-sync/setup)
#### useServerConnectionStateChangeHandler()
Hook to listen to server connection state changes
* Params: none
* Returns: `ServerConnectionState` - One of:
* `'online'` - Server connection is active
* `'offline'` - Server connection is lost
* `'pendingInit'` - Connection initialization pending
* `'pendingData'` - Waiting for data from server
* Related API Method: `liveStateSyncElement.onServerConnectionStateChange()`
* [Full Documentation →](/realtime-collaboration/live-state-sync/setup)
# Single Editor Mode
#### useUserEditorState()
Hook to check if current user is the editor
* Returns: `UserEditorAccess` object with:
* `isEditor`: boolean indicating if user is editor
* `isEditorOnCurrentTab`: boolean indicating if user is editor on current tab
* [Full Documentation →](/realtime-collaboration/single-editor-mode/setup)
#### useEditor()
Hook to get the current editor
* Returns: `User` object with editor details (email, name, photoUrl, userId)
* [Full Documentation →](/realtime-collaboration/single-editor-mode/setup)
#### useEditorAccessRequestHandler()
Hook to handle editor access requests
* Returns: Object with:
* `requestStatus`: 'requested' when access is requested
* `requestedBy`: User object of requester
* Returns `null` if user is not editor or request is canceled
* [Full Documentation →](/realtime-collaboration/single-editor-mode/setup)
#### useEditorAccessTimer()
Hook to track editor access request timer state
* Returns: Object with:
* `state`: 'idle' | 'inProgress' | 'completed'
* `durationLeft`: number of seconds remaining
* Useful for building custom UI for access requests
* [Full Documentation →](/realtime-collaboration/single-editor-mode/setup)
# Presence
#### usePresenceEventCallback()
Hook to subscribe to presence events
* Params: `eventType: string`. [Here](/api-reference/sdk/models/data-models#presence) is the list of events you can subscribe to.
* Returns: Presence Event Object. It will return one of the objects from [here](/api-reference/sdk/models/data-models#presence)
* [Full Documentation →](/realtime-collaboration/presence/customize-behavior#on)
#### usePresenceUtils()
Hook to access presence element for presence control methods
* Returns: `PresenceElement`
* [Full Documentation →](/realtime-collaboration/presence/customize-behavior#setinactivitytime)
#### usePresenceData()
Hook to subscribe to presence data
* Params: `PresenceRequestQuery`
* Returns: `Observable`
* [Full Documentation →](/realtime-collaboration/presence/customize-behavior#getdata)
# Cursor
#### useCursorUtils()
Hook to access cursor element for cursor utility methods
* Returns: `CursorElement`
#### useCursorUsers()
Hook to get online users with cursors activated
* Params: `void`
* Returns: `User[]`
* Related API Method: `cursorElement.getOnlineUsersOnCurrentDocument()`
* [Full Documentation →](/realtime-collaboration/cursors/customize-behavior#getonlineusersoncurrentdocument)
# Live Selection
#### useLiveSelectionUtils()
Hook to access live selection element for control methods
* Returns: `LiveSelectionElement`
* [Full Documentation →](/realtime-collaboration/live-selection/customize-behavior#enabledefaultelementsTracking)
#### useLiveSelectionDataHandler()
Hook to get live selection data for the current document
* Returns: `LiveSelectionData`
* Related API Method: `liveSelectionElement.getLiveSelectionData()`
* [Full Documentation →](/realtime-collaboration/live-selection/customize-behavior#getliveselectiondata)
# Huddle
#### useHuddleUtils()
Hook to access huddle utilities
* Params: `void`
* Returns: `HuddleElement`
* Related API Method: `client.getHuddleElement()`
* [Full Documentation →](/realtime-collaboration/huddle/customize-behavior)
# AI
#### useAIRewriterUtils()
Hook to access AI rewriter utilities
* Params: `void`
* Returns: `RewriterElement`
* Related API Method: `client.getRewriterElement()`
# Core
### Client
#### useVeltClient()
Hook to access the Velt client instance
* Returns: Object with:
* `client`: Velt
#### useVeltInitState()
Hook to get Velt initialization state
* Params: `void`
* Returns: `boolean`
* Related API Method: `client.getVeltInitState()`
* [Full Documentation →](/get-started/advanced)
#### useHeartbeat()
Hook to subscribe to user-specific heartbeat data
* Params: [`HeartbeatConfig`](/api-reference/sdk/models/data-models#heartbeatconfig) (optional)
* Returns: [`Observable`](/api-reference/sdk/models/data-models#getheartbeatresponse)
* [Full Documentation →](/realtime-collaboration/presence/heartbeat)
### Authentication
#### useIdentify()
Hook to authenticate a user with Velt
* Params:
* `user`: `User`
* `options?`: Object:
* `authToken?`: JWT token for additional security
* `forceReset?`: Force re-login (default: false)
* Must be called within a child component of VeltProvider
* Asynchronous operation
* [Full Documentation →](/get-started/advanced)
#### useCurrentUser()
Hook to subscribe to changes in the current user object
* Params: `void`
* Returns: `User | null`
* Related API Method: `client.getCurrentUser()`
* [Full Documentation →](/key-concepts/overview#get-current-user)
### Document
#### useSetDocuments()
Hook to initialize multiple documents at once
* Params:
* `documents`: [Document\[\]](/api-reference/sdk/models/data-models#document)
* `options?`: [SetDocumentsRequestOptions](/api-reference/sdk/models/data-models#setdocumentsrequestoptions)
* [Full Documentation →](/key-concepts/overview#set-multiple-documents)
#### useSetDocument()
Hook to initialize a document for collaboration
* Params:
* `documentId`: string
* `metadata?`: [DocumentMetadata](/api-reference/sdk/models/data-models#documentmetadata)
* [Full Documentation →](/key-concepts/overview#set-a-single-document)
#### useUnsetDocuments()
Hook to unsubscribe from all documents at once.
* Use when Velt features are not needed
* Cleans up document-specific resources
* [Full Documentation →](/key-concepts/overview#unset-multiple-documents)
### Location
#### useSetLocation()
Hook to set the current location context. Used to define specific areas within a document.
* Params:
* `location`: Location object with:
* `id`: Required unique identifier
* `locationName?`: Optional display name for UI components
* `version?`: Optional version object with:
* `id`: Version identifier
* `name`: Version display name
* Additional custom key/value pairs
* `isAdditional?`: Boolean to add additional locations
* `false` (default): Set this as the root location
* `true`: Add as additional location
* [Full Documentation →](/key-concepts/overview#set-location)
### Event Subscription
#### useVeltEventCallback()
Hook to subscribe to Velt core events
* Params: `eventType: string`. [Here](/api-reference/sdk/models/data-models#client) is the list of events you can subscribe to.
* Returns: `VeltEventTypesMap[T]`. It will return one of the objects from [here](/api-reference/sdk/models/data-models#client)
# null
Source: https://docs.velt.dev/api-reference/sdk/models/data-models
# Comments
### Threads
#### CommentAnnotation
***
| Property | Type | Required | Description |
| ------------------------- | ------------------------------------ | -------- | --------------------------------------------------------------------------------------------- |
| `annotationId` | `string` | Yes | Unique identifier for the comment pin annotation. Auto generated |
| `comments` | `Comment[]` | Yes | The list of all comments part of this annotation |
| `commentCategories` | `CustomCategory[]` | Yes | The list of categories that this comment pin annotation belongs to |
| `from` | `User` | Yes | The user who created this comment pin annotation |
| `color` | `string` | No | Color used for the comment pin annotation |
| `resolved` | `boolean` | No | Whether the comment annotation is marked resolved. Deprecated |
| `inProgress` | `boolean` | No | Whether the comment annotation is marked as in progress. Deprecated |
| `lastUpdated` | `any` | No | Timestamp when the comment annotation was last updated. Auto generated |
| `createdAt` | `any` | No | Timestamp when the comment annotation was created. Auto generated |
| `position` | `CursorPosition \| null` | No | Cursor position relative to the comment annotation |
| `locationId` | `number \| null` | No | Unique location id generated from provided location |
| `location` | `Location \| null` | No | Set location to identify user on sub document |
| `type` | `string` | No | Type of the comment annotation |
| `selectAllContent` | `boolean` | No | If true, sets text comment annotation on all the text content |
| `approved` | `boolean` | No | Whether the comment annotation is approved |
| `status` | `CustomStatus` | Yes | Status of the comment annotation. Default: CommentAnnotationStatusMap.OPEN |
| `annotationIndex` | `number` | No | Index of current annotation in the list |
| `annotationNumber` | `number` | No | Fixed annotation number that persists across sessions. Used for referencing specific comments |
| `pageInfo` | `PageInfo` | No | Page information related to the comment annotation |
| `assignedTo` | `User` | No | User to whom the comment annotation is assigned |
| `priority` | `CustomPriority` | No | Priority level of the comment annotation |
| `ghostComment` | `GhostComment \| null` | No | Placeholder for a non-existing comment |
| `context` | `any` | No | Custom context data provided by the user |
| `resolvedByUserId` | `string` | No | ID of the user who resolved the comment |
| `subscribedUsers` | `CommentAnnotationSubscribedUsers` | No | Users who explicitly subscribe to the comment |
| `unsubscribedUsers` | `CommentAnnotationUnsubscribedUsers` | No | Users who explicitly unsubscribe to the comment |
| `multiThreadAnnotationId` | `string` | No | ID of the multithread annotation group it belongs to, if created in multithread mode |
| `isDraft` | `boolean` | No | Indicates if the comment annotation is in draft state |
| `customList` | `CustomAnnotationDropdownItem[]` | No | Custom list of items for the comment annotation |
| `targetElementId` | `string` | No | ID of the target element for the comment annotation if available |
| `viewedBy` | [`Users[]`](#user) | No | List of users who have viewed/read this comment annotation |
#### Enum
| Enum Name | Event Type | Description |
| --------------------------- | ------------------------- | ---------------------------- |
| `ADD_COMMENT_ANNOTATION` | `addCommentAnnotation` | Add a new comment annotation |
| `DELETE_COMMENT_ANNOTATION` | `deleteCommentAnnotation` | Delete a comment annotation |
#### AddCommentAnnotationEvent
***
| Property | Type | Required | Description |
| ------------------- | ------------------------ | -------- | ----------------------------------------------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `commentAnnotation` | `CommentAnnotation` | Yes | Comment annotation object |
| `metadata` | `VeltEventMetadata` | Yes | Event metadata |
| `addContext` | `(context: any) => void` | Yes | Function to add custom metadata |
| `elementRef` | `{ xpath: string }` | No | Reference to DOM element where comment annotation was added |
#### DeleteCommentAnnotationEvent
***
| Property | Type | Required | Description |
| ------------------- | ------------------- | -------- | ------------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `commentAnnotation` | `CommentAnnotation` | Yes | Comment annotation object |
| `metadata` | `VeltEventMetadata` | Yes | Event metadata |
#### CommentAnnotationSubscribedUsers
***
| Property | Type | Required | Description |
| ------------ | -------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `userIdHash` | `string` | Yes | The user ID of the subscribed user |
| `user` | `User` | Yes | The user object of the subscribed user |
| `type` | `'manual' \| 'auto'` | Yes | Manual: if the user used the UI option to subscribe; Auto: When the system automatically adds the user to the subscribed list. eg: when the user creates a comment annotation |
#### CommentAnnotationUnsubscribedUsers
***
| Property | Type | Required | Description |
| ------------ | -------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `userIdHash` | `string` | Yes | The user ID of the unsubscribed user |
| `user` | `User` | Yes | The user object of the unsubscribed user |
| `type` | `'manual' \| 'auto'` | Yes | Manual: if the user used the UI option to unsubscribe; Auto: When the system automatically removes the user from the unsubscribed list. eg: when the comment where user was tagged is deleted |
#### AddCommentAnnotationRequest
***
| Property | Type | Required | Description |
| ------------ | ------------------- | -------- | ------------------ |
| `annotation` | `CommentAnnotation` | Yes | Comment annotation |
| `options` | `RequestOptions` | No | Request options |
#### DeleteCommentAnnotationRequest
***
| Property | Type | Required | Description |
| -------------- | ---------------- | -------- | -------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `options` | `RequestOptions` | No | Request options |
#### CommentRequestQuery
***
| Property | Type | Required | Description |
| --------------------- | ---------- | -------- | ----------------------------------------------------------------------- |
| `organizationId` | `string` | No | Organization ID to filter comment annotations by organization |
| `documentIds` | `string[]` | No | Array of document IDs to query |
| `locationIds` | `string[]` | No | Array of location IDs to filter by |
| `statusIds` | `string[]` | No | Array of status IDs to filter by |
| `folderId` | `string` | No | Folder ID to filter comment annotations by folder |
| `allDocuments` | `boolean` | No | If true, includes all documents in the query |
| `locationId` | `string` | No | Single location ID to filter by (alternative to `locationIds`) |
| `aggregateDocuments` | `boolean` | No | If true, aggregates comment annotation counts across multiple documents |
| `filterGhostComments` | `boolean` | No | If true, excludes ghost (deleted or orphaned) comments from the results |
#### GetCommentAnnotationsCountResponse
***
| Property | Type | Required | Description |
| -------- | ------------------------------------------------- | -------- | --------------------------------------------------------------- |
| `data` | `Record \| null` | Yes | Map of document IDs to their comment counts. Null while loading |
#### GetCommentAnnotationsResponse
***
| Property | Type | Required | Description |
| -------- | --------------------------------------------- | -------- | ------------------------------------------------------------ |
| `data` | `Record \| null` | Yes | Map of document IDs to their annotations. Null while loading |
#### FetchCommentAnnotationsRequest
***
| Property | Type | Required | Description |
| ------------------ | ----------------- | -------- | -------------------------------------------------------------- |
| `createdAfter` | `number` | No | Filter annotations created after this timestamp |
| `createdBefore` | `number` | No | Filter annotations created before this timestamp |
| `updatedAfter` | `number` | No | Filter annotations updated after this timestamp |
| `updatedBefore` | `number` | No | Filter annotations updated before this timestamp |
| `statusIds` | `string[]` | No | Filter annotations by status IDs |
| `order` | `'asc' \| 'desc'` | No | Sort order for annotations |
| `pageToken` | `string` | No | Token for fetching next page of results |
| `allDocuments` | `boolean` | No | Whether to fetch annotations from all documents |
| `pageSize` | `number` | No | Number of results per page |
| `organizationId` | `string` | No | Organization ID to fetch annotations from |
| `locationId` | `string` | No | Location ID to filter annotations by |
| `documentIds` | `string[]` | No | Array of specific document IDs to fetch from |
| `folderId` | `string` | No | Folder ID to fetch annotations from |
| `resolvedBy` | `string` | No | Filter comments by user who resolved the comment |
| `userIds` | `string[]` | No | Filter comments by comment annotation author |
| `mentionedUserIds` | `string[]` | No | Filter comments where provided users are tagged in the comment |
#### FetchCommentAnnotationsResponse
***
| Property | Type | Required | Description |
| --------------- | --------------------------------------------- | -------- | -------------------------------------------------------------- |
| `data` | `Record \| null` | Yes | Map of document IDs to their annotations. `Null` while loading |
| `nextPageToken` | `string` | Yes | Token for fetching next page of results |
#### GetCommentResolverRequest
***
| Property | Type | Required | Description |
| ---------------------- | ---------- | -------- | -------------------------------------------------------------------- |
| `organizationId` | `string` | Yes | Organization ID to fetch comments from |
| `commentAnnotationIds` | `string[]` | No | Array of comment annotation IDs to fetch comments from |
| `documentIds` | `string[]` | No | Array of document IDs to fetch comments from |
| `folderId` | `string` | No | Folder ID to fetch comments from |
| `allDocuments` | `boolean` | No | Whether to fetch comments from all documents within the given folder |
#### SaveCommentResolverRequest
***
| Property | Type | Required | Description |
| ------------------- | --------------------------------------------- | -------- | --------------------------------------------------------------------------------- |
| `commentAnnotation` | `{ [key: string]: PartialCommentAnnotation }` | Yes | Map of comment annotation data to save |
| `metadata` | `BaseMetadata` | No | Additional metadata for the request. eg: apikey, organizationId, documentId, etc. |
| `event` | `ResolverActions` | No | Event name that caused the save request |
| `commentId` | `string` | No | ID of the comment to save |
#### DeleteCommentResolverRequest
***
| Property | Type | Required | Description |
| --------------------- | ----------------- | -------- | --------------------------------------------------------------------------------- |
| `commentAnnotationId` | `string` | Yes | ID of the comment annotation to delete |
| `metadata` | `BaseMetadata` | No | Additional metadata for the request. eg: apikey, organizationId, documentId, etc. |
| `event` | `ResolverActions` | No | Event name that caused the delete request |
#### CustomAnnotationDropdownData
***
| Property | Type | Required | Description |
| ------------- | -------------------------------- | -------- | ----------------------------------------------------------- |
| `type` | `'multi' \| 'single'` | Yes | The type of the custom annotation dropdown |
| `placeholder` | `string` | Yes | The placeholder text for the dropdown. Defaults to 'Select' |
| `data` | `CustomAnnotationDropdownItem[]` | Yes | An array of dropdown items |
#### CustomAnnotationDropdownItem
***
| Property | Type | Required | Description |
| -------- | -------- | -------- | ------------------------------------------- |
| `id` | `string` | Yes | The unique identifier for the dropdown item |
| `label` | `string` | Yes | The display text for the dropdown item |
#### GetCommentAnnotationsResponse
***
| Property | Type | Required | Description |
| -------- | ------------------------------------- | -------- | ------------------------------------------------ |
| `data` | `Record` | Yes | Map of document IDs to their comment annotations |
#### CommentAnnotationsCount
***
| Property | Type | Required | Description |
| -------- | -------- | -------- | ------------------------- |
| `unread` | `number` | Yes | Number of unread comments |
| `total` | `number` | Yes | Total number of comments |
#### GetCommentAnnotationsCountResponse
***
| Property | Type | Required | Description |
| -------- | ----------------------------------------- | -------- | ------------------------------------------- |
| `data` | `Record` | Yes | Map of document IDs to their comment counts |
### Slate
#### AddCommentRequest
***
| Property | Type | Required | Description |
| ---------- | --------- | -------- | ---------------------------------------------------- |
| `editor` | `Editor` | Yes | Slate editor instance. |
| `editorId` | `string` | No | Optional editor ID used to scope operations. |
| `context` | `unknown` | No | Optional custom context to attach to the annotation. |
#### RenderCommentsRequest
***
| Property | Type | Required | Description |
| -------------------- | --------------------- | -------- | -------------------------------------------- |
| `editor` | `Editor` | Yes | Slate editor instance. |
| `editorId` | `string` | No | Optional editor ID used to scope operations. |
| `commentAnnotations` | `CommentAnnotation[]` | No | Annotations to render/highlight. |
For the CommentAnnotation model referenced above, see [CommentAnnotation](#commentannotation).
#### VeltCommentsElement
***
Slate element type representing a comment with optional annotation ID.
| Property | Type | Required | Description |
| -------------- | --------------- | -------- | ---------------------------------------- |
| `type` | `'veltComment'` | Yes | Discriminator for Velt comment elements. |
| `children` | `Descendant[]` | Yes | Slate child nodes. |
| `annotationId` | `string` | No | Associated CommentAnnotation ID. |
### Tiptap
#### AddCommentRequest
***
| Property | Type | Required | Description |
| ---------- | --------- | -------- | ---------------------------------------------------- |
| `editor` | `Editor` | Yes | Tiptap editor instance. |
| `editorId` | `string` | No | Optional editor ID used to scope operations. |
| `context` | `unknown` | No | Optional custom context to attach to the annotation. |
#### RenderCommentsRequest
***
| Property | Type | Required | Description |
| -------------------- | --------------------- | -------- | -------------------------------------------- |
| `editor` | `Editor` | Yes | Tiptap editor instance. |
| `editorId` | `string` | No | Optional editor ID used to scope operations. |
| `commentAnnotations` | `CommentAnnotation[]` | No | Annotations to render/highlight. |
For the CommentAnnotation model referenced above, see [CommentAnnotation](#commentannotation).
#### TiptapVeltCommentsOptions
***
| Property | Type | Required | Description |
| ------------------ | --------------------- | -------- | ---------------------------------------------------------- |
| `HTMLAttributes` | `Record` | Yes | Attributes applied to rendered comment nodes/marks. |
| `persistVeltMarks` | `boolean` | No | Whether to persist Velt marks across edits. Default: true |
| `editorId` | `string` | No | ID to scope Velt operations to a specific editor instance. |
### Lexical
#### AddCommentRequest
***
| Property | Type | Required | Description |
| ---------- | --------- | -------- | ---------------------------------------------------- |
| `editor` | `Editor` | Yes | Lexical editor instance. |
| `editorId` | `string` | No | Optional editor ID used to scope operations. |
| `context` | `unknown` | No | Optional custom context to attach to the annotation. |
#### RenderCommentsRequest
***
| Property | Type | Required | Description |
| -------------------- | --------------------- | -------- | -------------------------------------------- |
| `editor` | `Editor` | Yes | Lexical editor instance. |
| `editorId` | `string` | No | Optional editor ID used to scope operations. |
| `commentAnnotations` | `CommentAnnotation[]` | No | Annotations to render/highlight. |
For the CommentAnnotation model referenced above, see [CommentAnnotation](#commentannotation).
#### CommentNode
***
Inline Lexical element representing a comment with optional annotation IDs.
| Property | Type | Required | Description |
| ------------------------- | ------------------------- | -------- | --------------------------------------------------- |
| `type` | `'comment'` | Yes | Discriminator for Velt comment nodes. |
| `children` | `SerializedLexicalNode[]` | Yes | Lexical child nodes (from `SerializedElementNode`). |
| `annotationId` | `string` | No | Associated `CommentAnnotation` ID. |
| `multiThreadAnnotationId` | `string` | No | Associated multi-thread annotation ID. |
### Messages
#### ENUMs
| Enum Name | Event Type | Description |
| ---------------- | --------------- | -------------------------- |
| `ADD_COMMENT` | `addComment` | Add a new comment |
| `UPDATE_COMMENT` | `updateComment` | Update an existing comment |
| `DELETE_COMMENT` | `deleteComment` | Delete a comment |
#### Comment
***
| Property | Type | Required | Description |
| ----------------------- | -------------------------------------- | -------- | ----------------------------------------------------------------------- |
| `commentId` | `number` | Yes | Unique identifier for the comment pin annotation. Auto generated. |
| `type` | `'text' \| 'voice'` | Yes | This determines the comment content type. Default is 'text'. |
| `commentText` | `string` | Yes | The actual text content of the comment. |
| `commentHtml` | `string` | No | Same comment text but formatted in HTML. |
| `replaceContentHtml` | `string` | No | HTML content to replace the comment text when user accepts the comment. |
| `replaceContentText` | `string` | No | Text content to replace the comment text when user accepts the comment. |
| `commentVoiceUrl` | `string` | No | URL of the voice recording for the comment, if available. |
| `from` | `User` | Yes | The user who created this comment. |
| `to` | `User[]` | No | List of users that were @mentioned in this comment. |
| `lastUpdated` | `Date` | No | Timestamp of when this comment was last updated. Auto generated. |
| `editedAt` | `any` | No | Timestamp of when this comment was edited. Auto generated. |
| `createdAt` | `any` | No | Timestamp of when this comment was created. Auto generated. |
| `isEdited` | `boolean` | No | Whether the comment has been edited. Auto generated. |
| `status` | `'added' \| 'updated'` | Yes | Status of the comment indicating whether it was newly added or updated. |
| `attachments` | `Attachment[]` | Yes | List of attachments associated with the comment. |
| `recorders` | `RecordedData[]` | Yes | List of recorded data associated with the comment. |
| `reactionAnnotationIds` | `string[]` | Yes | List of annotation IDs for reactions to the comment. |
| `reactionAnnotations` | \[`ReactionAnnotation[]`] | No | List of reaction annotations associated with the comment. |
| `taggedUserContacts` | `AutocompleteUserContactReplaceData[]` | Yes | List of users that were @mentioned in this comment with UI metadata. |
| `customList` | `AutocompleteReplaceData[]` | Yes | List of custom list items added to the comment. |
| `isDraft` | `boolean` | Yes | Whether the comment is in draft state. |
#### AddCommentEvent
***
| Property | Type | Required | Description |
| ------------------- | ------------------- | -------- | ------------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `commentAnnotation` | `CommentAnnotation` | Yes | Comment annotation object |
| `commentId` | `number` | Yes | ID of the comment |
| `comment` | `Comment` | Yes | Comment Object |
| `metadata` | `VeltEventMetadata` | Yes | Event metadata |
#### UpdateCommentEvent
***
| Property | Type | Required | Description |
| ------------------- | ------------------- | -------- | ------------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `commentAnnotation` | `CommentAnnotation` | Yes | Comment annotation object |
| `commentId` | `number` | Yes | ID of the comment |
| `comment` | `Comment` | Yes | Comment Object |
| `metadata` | `VeltEventMetadata` | Yes | Event metadata |
#### DeleteCommentEvent
***
| Property | Type | Required | Description |
| ------------------- | ------------------- | -------- | ------------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `commentAnnotation` | `CommentAnnotation` | Yes | Comment annotation object |
| `commentId` | `number` | Yes | ID of the comment |
| `comment` | `Comment` | Yes | Comment Object |
| `metadata` | `VeltEventMetadata` | Yes | Event metadata |
#### AddCommentRequest
***
| Property | Type | Required | Description |
| -------------- | ---------------- | -------- | -------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `comment` | `Comment` | Yes | Comment object |
| `assignedTo` | `User` | No | Assigned user |
| `options` | `RequestOptions` | No | Request options |
#### UpdateCommentRequest
***
| Property | Type | Required | Description |
| -------------- | ---------------- | -------- | -------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `comment` | `Comment` | Yes | Comment object |
| `merge` | `boolean` | No | Merge comments |
| `options` | `RequestOptions` | No | Request options |
#### DeleteCommentRequest
***
| Property | Type | Required | Description |
| ------------------------------ | ---------------- | -------- | ------------------------ |
| `annotationId` | `string` | Yes | ID of the annotation |
| `commentId` | `number` | Yes | ID of the comment |
| `skipDeleteThreadConfirmation` | `boolean` | No | Skip delete confirmation |
| `options` | `RequestOptions` | No | Request options |
#### GetCommentRequest
***
| Property | Type | Required | Description |
| -------------- | ---------------- | -------- | -------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `options` | `RequestOptions` | No | Request options |
### @Mentions
#### ENUMs
| Enum Name | Event Type | Description |
| -------------------------------- | ------------------------------ | ------------------------------------------------------------------ |
| `ASSIGN_USER` | `assignUser` | Assign a user to a comment |
| `SUBSCRIBE_COMMENT_ANNOTATION` | `subscribeCommentAnnotation` | Subscribe to a comment annotation |
| `UNSUBSCRIBE_COMMENT_ANNOTATION` | `unsubscribeCommentAnnotation` | Unsubscribe from a comment annotation |
| `AUTOCOMPLETE_SEARCH` | `autocompleteSearch` | When user starts searching for a contact in the @mentions dropdown |
#### AssignUserRequest
***
| Property | Type | Required | Description |
| -------------- | ---------------- | -------- | -------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `assignedTo` | `UserContact` | Yes | User to assign |
| `options` | `RequestOptions` | No | Request options |
#### GetContactListResponse
***
| Property | Type | Required | Description |
| -------------------- | ------------- | -------- | -------------------------------------------------- |
| `organizationUsers` | `User[]` | No | List of users in the organization |
| `folderUsers` | `User[]` | No | List of users added to the folder |
| `documentUsers` | `User[]` | No | List of users added to the document |
| `userGroups` | `UserGroup[]` | No | List of user groups in the organization |
| `updatedContactList` | `User[]` | No | List of contacts updated via updateContactList API |
#### SubscribeCommentAnnotationRequest
***
| Property | Type | Required | Description |
| -------------- | ---------------- | -------- | -------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `options` | `RequestOptions` | No | Request options |
#### UnsubscribeCommentAnnotationRequest
***
| Property | Type | Required | Description |
| -------------- | ---------------- | -------- | -------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `options` | `RequestOptions` | No | Request options |
#### AutocompleteItem
***
| Property | Type | Required | Description |
| ------------- | -------- | -------- | ------------------------- |
| `id` | `string` | Yes | Unique identifier |
| `name` | `string` | Yes | Name of the item |
| `description` | `string` | No | Optional description |
| `icon` | `object` | No | Optional icon information |
| `icon.url` | `string` | No | URL of the icon |
| `link` | `string` | No | Link associated with item |
#### AutocompleteUserContactReplaceData
***
| Property | Type | Required | Description |
| --------- | -------- | -------- | ----------------------------------------------------------------- |
| `text` | `string` | Yes | The text displayed in the comment that represents the tagged user |
| `userId` | `string` | Yes | The user ID of the tagged user |
| `contact` | `User` | No | The user object of the tagged user |
#### AutocompleteReplaceData
***
| Property | Type | Required | Description |
| -------- | ------------------ | -------- | ----------------------------------------------------------------- |
| `text` | `string` | Yes | The text displayed in the comment that represents the custom item |
| `custom` | `AutocompleteItem` | Yes | The custom item object associated with this text |
#### AutocompleteItem
***
| Property | Type | Required | Description |
| ------------- | -------------------------------- | -------- | -------------------------------------------------------------- |
| `id` | `string` | Yes | Unique identifier for the autocomplete item |
| `name` | `string` | Yes | Name or label of the autocomplete item |
| `description` | `string` | No | Additional description of the autocomplete item |
| `icon` | `{ url?: string, svg?: string }` | No | Icon associated with the autocomplete item (URL or inline SVG) |
| `groupId` | `string` | No | Optional group id to categorize this item |
| `link` | `string` | No | Optional link associated with the autocomplete item |
#### AutocompleteData
***
| Property | Type | Required | Description |
| ------------- | ---------------------------------- | -------- | -------------------------------------------------- |
| `hotkey` | `string` | Yes | The hotkey or trigger for this autocomplete data |
| `description` | `string` | No | Optional description of the autocomplete data |
| `type` | `'custom' \| 'contact' \| 'group'` | Yes | The type of autocomplete data. Default is 'custom' |
| `groups` | `AutocompleteGroup[]` | No | Optional groups used to categorize items |
| `data` | `AutocompleteItem[]` | Yes | An array of AutocompleteItem objects |
#### AutocompleteGroup
***
| Property | Type | Required | Description |
| -------- | -------- | -------- | --------------------- |
| `id` | `string` | Yes | Unique group id |
| `name` | `string` | Yes | Display name of group |
#### AssignUserEvent
***
| Property | Type | Required | Description |
| ------------------- | ------------------- | -------- | ------------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `assignedTo` | `UserContact` | Yes | User being assigned |
| `commentAnnotation` | `CommentAnnotation` | Yes | Comment annotation object |
| `metadata` | `VeltEventMetadata` | No | Event metadata |
#### SubscribeCommentAnnotationEvent
***
| Property | Type | Required | Description |
| ------------------- | ------------------- | -------- | ------------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `commentAnnotation` | `CommentAnnotation` | Yes | Comment annotation object |
| `metadata` | `VeltEventMetadata` | Yes | Event metadata |
#### UnsubscribeCommentAnnotationEvent
***
| Property | Type | Required | Description |
| ------------------- | ------------------- | -------- | ------------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `commentAnnotation` | `CommentAnnotation` | Yes | Comment annotation object |
| `metadata` | `VeltEventMetadata` | Yes | Event metadata |
#### AutocompleteSearchEvent
***
| Property | Type | Required | Description |
| ------------ | -------------------------------------- | -------- | -------------------------------------------------------------------- |
| `event` | `KeyboardEvent \| InputEvent \| Event` | Yes | The triggering event |
| `searchText` | `string` | Yes | The search text entered |
| `type` | `'contact' \| 'custom'` | No | Type of autocomplete search. Whether is the @mentions or custom list |
| `metadata` | `VeltEventMetadata` | No | Event metadata |
#### LinkClickedEvent
***
| Property | Type | Required | Description |
| ------------------- | ------------------- | -------- | -------------------------------- |
| `text` | `string` | Yes | The clicked link text |
| `link` | `string` | Yes | The clicked URL |
| `commentAnnotation` | `CommentAnnotation` | Yes | Related comment annotation |
| `commentId` | `number` | Yes | The comment id within the thread |
| `metadata` | `VeltEventMetadata` | No | Event metadata |
### Custom List
#### ENUMs
| Enum Name | Event Type | Description |
| --------------------- | -------------------- | ---------------------------------------------------------------------- |
| `AUTOCOMPLETE_SEARCH` | `autocompleteSearch` | When user starts searching for a list item in the custom list dropdown |
#### AutocompleteSearchEvent
***
| Property | Type | Required | Description |
| ------------ | -------------------------------------- | -------- | -------------------------------------------------------------------- |
| `event` | `KeyboardEvent \| InputEvent \| Event` | Yes | The triggering event |
| `searchText` | `string` | Yes | The search text entered |
| `type` | `'contact' \| 'custom'` | No | Type of autocomplete search. Whether is the @mentions or custom list |
| `metadata` | `VeltEventMetadata` | No | Event metadata |
### Attachments
#### ENUMs
| Enum Name | Event Type | Description |
| ------------------- | ------------------ | ----------------------------------- |
| `ADD_ATTACHMENT` | `addAttachment` | Add an attachment to a comment |
| `DELETE_ATTACHMENT` | `deleteAttachment` | Delete an attachment from a comment |
#### Attachment
***
| Property | Type | Required | Description |
| -------------------------- | -------- | -------- | ---------------------------------------------------- |
| `attachmentId` | `number` | Yes | Unique identifier for the attachment. Auto-generated |
| `name` | `string` | No | File name of the attachment |
| `bucketPath` | `string` | No | Path to the file in storage bucket |
| `size` | `number` | No | File size of the attachment |
| `type` | `string` | No | File type of the attachment |
| `url` | `string` | No | Download URL of the attachment |
| `thumbnail` | `string` | No | Thumbnail image in base64 format |
| `thumbnailWithPlayIconUrl` | `string` | No | URL of the thumbnail with a play icon overlay |
| `metadata` | `any` | No | Additional metadata of the attachment |
| `mimeType` | `any` | No | MIME type of the attachment |
#### AddAttachmentRequest
***
| Property | Type | Required | Description |
| -------------- | ---------------- | -------- | -------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `files` | `File[]` | Yes | Array of files |
| `options` | `RequestOptions` | No | Request options |
#### DeleteAttachmentRequest
***
| Property | Type | Required | Description |
| -------------- | ---------------- | -------- | -------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `commentId` | `number` | Yes | ID of the comment |
| `attachmentId` | `number` | Yes | ID of the attachment |
| `options` | `RequestOptions` | No | Request options |
#### GetAttachmentRequest
***
| Property | Type | Required | Description |
| -------------- | ---------------- | -------- | -------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `commentId` | `number` | Yes | ID of the comment |
| `options` | `RequestOptions` | No | Request options |
#### UploadFileData
***
Configuration object for programmatically adding file attachments to the comment composer.
| Property | Type | Required | Description |
| ----------------- | -------- | -------- | ------------------------------------------------------------------------------------------------------------------ |
| `files` | `File[]` | Yes | Array of File objects to attach to the comment composer |
| `annotationId` | `string` | No | ID of the target comment annotation. Use this to add attachments to an existing comment thread |
| `targetElementId` | `string` | No | ID of the target element where the comment composer is attached. Use this to add attachments to a specific element |
#### AddAttachmentResponse
***
| Property | Type | Required | Description |
| ---------------- | ------------ | -------- | ----------------- |
| `valid` | `boolean` | Yes | Validity status |
| `file` | `File` | No | File object |
| `maxAllowedSize` | `number` | Yes | Max allowed size |
| `error` | `string` | No | Error message |
| `attachment` | `Attachment` | No | Attachment object |
#### DeleteAttachmentResolverRequest
***
| Property | Type | Required | Description |
| -------------- | ---------------------------- | -------- | --------------------------------------------------------------------------------- |
| `attachmentId` | `number` | Yes | ID of the attachment |
| `metadata` | `AttachmentResolverMetadata` | No | Additional metadata for the request. eg: apikey, organizationId, documentId, etc. |
| `event` | `ResolverActions` | No | Event that triggered the delete |
#### SaveAttachmentResolverRequest
***
| Property | Type | Required | Description |
| ------------ | ---------------------------- | -------- | --------------------------------------------------------------------------------- |
| `attachment` | `ResolverAttachment` | Yes | Attachment object to save |
| `metadata` | `AttachmentResolverMetadata` | No | Additional metadata for the request. eg: apikey, organizationId, documentId, etc. |
| `event` | `ResolverActions` | No | Event that triggered the save |
#### AddAttachmentEvent
***
| Property | Type | Required | Description |
| ------------------- | ------------------------- | -------- | ----------------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `commentAnnotation` | `CommentAnnotation` | Yes | Comment annotation object |
| `attachments` | `AddAttachmentResponse[]` | Yes | Array of attachment responses |
| `metadata` | `VeltEventMetadata` | Yes | Event metadata |
#### AddAttachmentResponse
***
| Property | Type | Required | Description |
| ---------------- | ------------ | -------- | --------------------------- |
| `valid` | `boolean` | Yes | Whether attachment is valid |
| `file` | `File` | No | File object |
| `maxAllowedSize` | `number` | Yes | Maximum allowed file size |
| `error` | `string` | No | Error message if invalid |
| `attachment` | `Attachment` | No | Attachment object |
#### DeleteAttachmentEvent
***
| Property | Type | Required | Description |
| ------------------- | ------------------- | -------- | ------------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `commentId` | `number` | Yes | ID of the comment |
| `commentAnnotation` | `CommentAnnotation` | Yes | Comment annotation object |
| `attachment` | `Attachment` | Yes | Attachment Object |
| `metadata` | `VeltEventMetadata` | Yes | Event metadata |
### Reactions
#### ENUMs
| Enum Name | Event Type | Description |
| ----------------- | ---------------- | -------------------------------- |
| `ADD_REACTION` | `addReaction` | Add a reaction to a comment |
| `DELETE_REACTION` | `deleteReaction` | Delete a reaction from a comment |
| `TOGGLE_REACTION` | `toggleReaction` | Toggle a reaction on a comment |
#### AddReactionRequest
***
| Property | Type | Required | Description |
| -------------- | -------------------------------------------------------- | -------- | ----------------------------------------------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `commentId` | `number` | Yes | ID of the comment |
| `reaction` | `{ reactionId: string; customReaction?: ReactionItem; }` | Yes | Reaction object with reactionId and optional customReaction |
| `options` | `RequestOptions` | No | Request options |
#### DeleteReactionRequest
***
| Property | Type | Required | Description |
| -------------- | -------------------------------------------------------- | -------- | ----------------------------------------------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `commentId` | `number` | Yes | ID of the comment |
| `reaction` | `{ reactionId: string; customReaction?: ReactionItem; }` | Yes | Reaction object with reactionId and optional customReaction |
| `options` | `RequestOptions` | No | Request options |
#### ToggleReactionRequest
***
| Property | Type | Required | Description |
| -------------- | -------------------------------------------------------- | -------- | ----------------------------------------------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `commentId` | `number` | Yes | ID of the comment |
| `reaction` | `{ reactionId: string; customReaction?: ReactionItem; }` | Yes | Reaction object with reactionId and optional customReaction |
| `options` | `RequestOptions` | No | Request options |
#### ReactionItem
***
| Property | Type | Required | Description |
| -------- | -------- | -------- | ------------------------- |
| `url` | `string` | No | URL of the reaction image |
| `emoji` | `string` | No | Emoji character |
#### GetReactionResolverRequest
***
| Property | Type | Required | Description |
| ----------------------- | ---------- | -------- | ------------------------------------------------------------------- |
| `organizationId` | `string` | Yes | ID of the organization to fetch reactions from |
| `reactionAnnotationIds` | `string[]` | No | Array of reaction annotation IDs to fetch reactions from |
| `documentIds` | `string[]` | No | Array of document IDs to fetch reactions from |
| `folderId` | `string` | No | ID of the folder to fetch reactions from |
| `allDocuments` | `boolean` | No | Whether to get reactions from all documents within the given folder |
#### SaveReactionResolverRequest
***
| Property | Type | Required | Description |
| -------------------- | ---------------------------------------------- | -------- | --------------------------------------------------------------------------------- |
| `reactionAnnotation` | `{ [key: string]: PartialReactionAnnotation }` | Yes | Map of reaction annotation id to reaction annotation data |
| `metadata` | `BaseMetadata` | No | Additional metadata for the request. eg: apikey, organizationId, documentId, etc. |
| `event` | `ResolverActions` | No | Event name that caused the save request |
#### DeleteReactionResolverRequest
***
| Property | Type | Required | Description |
| ---------------------- | ----------------- | -------- | --------------------------------------------------------------------------------- |
| `reactionAnnotationId` | `string` | Yes | ID of the reaction annotation |
| `metadata` | `BaseMetadata` | No | Additional metadata for the request. eg: apikey, organizationId, documentId, etc. |
| `event` | `ResolverActions` | No | Event name that caused the delete request |
#### AddReactionEvent
***
| Property | Type | Required | Description |
| ------------------- | -------------------- | -------- | ------------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `commentAnnotation` | `CommentAnnotation` | Yes | Comment annotation object |
| `commentId` | `number` | Yes | ID of the comment |
| `reaction` | `ReactionAnnotation` | Yes | Reaction Object |
| `metadata` | `VeltEventMetadata` | Yes | Event metadata |
#### DeleteReactionEvent
***
| Property | Type | Required | Description |
| ------------------- | -------------------- | -------- | ------------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `commentAnnotation` | `CommentAnnotation` | Yes | Comment annotation object |
| `commentId` | `number` | Yes | ID of the comment |
| `reaction` | `ReactionAnnotation` | Yes | Reaction Object |
| `metadata` | `VeltEventMetadata` | Yes | Event metadata |
#### ToggleReactionEvent
***
| Property | Type | Required | Description |
| ------------------- | -------------------- | -------- | ------------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `commentAnnotation` | `CommentAnnotation` | Yes | Comment annotation object |
| `commentId` | `number` | Yes | ID of the comment |
| `reaction` | `ReactionAnnotation` | Yes | Reaction Object |
| `metadata` | `VeltEventMetadata` | Yes | Event metadata |
### Status & Priority
#### ENUMs
| Enum Name | Event Type | Description |
| ---------------------------- | -------------------------- | -------------------------------- |
| `UPDATE_STATUS` | `updateStatus` | Update the status of a comment |
| `RESOLVE_COMMENT` | `resolveComment` | Resolve a comment |
| `UPDATE_PRIORITY` | `updatePriority` | Update the priority of a comment |
| `APPROVE_COMMENT_ANNOTATION` | `approveCommentAnnotation` | Approve a comment annotation |
| `ACCEPT_COMMENT_ANNOTATION` | `acceptCommentAnnotation` | Accept a comment annotation |
| `REJECT_COMMENT_ANNOTATION` | `rejectCommentAnnotation` | Reject a comment annotation |
#### UpdateStatusRequest
***
| Property | Type | Required | Description |
| -------------- | ---------------- | -------- | -------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `status` | `CustomStatus` | Yes | Status value |
| `options` | `RequestOptions` | No | Request options |
#### ResolveCommentAnnotationRequest
***
| Property | Type | Required | Description |
| -------------- | ---------------- | -------- | -------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `options` | `RequestOptions` | No | Request options |
#### UpdatePriorityRequest
***
| Property | Type | Required | Description |
| -------------- | ---------------- | -------- | -------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `priority` | `CustomPriority` | No | Priority object |
| `options` | `RequestOptions` | No | Request options |
#### ApproveCommentAnnotationRequest
***
| Property | Type | Required | Description |
| -------------- | ---------------- | -------- | -------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `options` | `RequestOptions` | No | Request options |
#### AcceptCommentAnnotationRequest
***
| Property | Type | Required | Description |
| -------------- | ---------------- | -------- | -------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `options` | `RequestOptions` | No | Request options |
#### RejectCommentAnnotationRequest
***
| Property | Type | Required | Description |
| -------------- | ---------------- | -------- | -------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `options` | `RequestOptions` | No | Request options |
#### CustomPriority
***
| Property | Type | Required | Description |
| ------------ | -------- | -------- | ------------------------------------------- |
| `id` | `string` | Yes | Unique identifier for the custom priority |
| `color` | `string` | Yes | Color associated with the custom priority |
| `name` | `string` | Yes | Name or label of the custom priority |
| `lightColor` | `string` | No | Light color variant for the custom priority |
#### CustomStatus
***
| Property | Type | Required | Description |
| ------------ | ------------ | -------- | -------------------------------------------------------------- |
| `id` | `string` | Yes | Unique identifier for the custom status |
| `color` | `string` | Yes | Text and comment pin color associated with the custom status |
| `name` | `string` | Yes | Name or label of the custom status |
| `type` | `StatusType` | Yes | Type of the status (`default`, `ongoing`, or `terminal`) |
| `lightColor` | `string` | No | Background color on the status indicator for the custom status |
| `iconUrl` | `string` | No | URL to an icon image for the custom status |
#### UpdateStatusEvent
***
| Property | Type | Required | Description |
| ------------------- | ------------------- | -------- | ------------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `commentAnnotation` | `CommentAnnotation` | Yes | Comment annotation object |
| `newStatus` | `CustomStatus` | Yes | New status object |
| `oldStatus` | `CustomStatus` | Yes | Previous status object |
| `metadata` | `VeltEventMetadata` | Yes | Event metadata |
#### ResolveCommentEvent
***
| Property | Type | Required | Description |
| ------------------- | ------------------- | -------- | ------------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `commentAnnotation` | `CommentAnnotation` | Yes | Comment annotation object |
| `metadata` | `VeltEventMetadata` | Yes | Event metadata |
#### UpdatePriorityEvent
***
| Property | Type | Required | Description |
| ------------------- | ------------------- | -------- | ------------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `commentAnnotation` | `CommentAnnotation` | Yes | Comment annotation object |
| `newPriority` | `CustomPriority` | No | New Priority object |
| `oldPriority` | `CustomPriority` | No | Previous Priority object |
| `metadata` | `VeltEventMetadata` | Yes | Event metadata |
#### ApproveCommentAnnotationEvent
***
| Property | Type | Required | Description |
| ------------------- | ------------------- | -------- | ------------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `commentAnnotation` | `CommentAnnotation` | Yes | Comment annotation object |
| `metadata` | `VeltEventMetadata` | Yes | Event metadata |
#### AcceptCommentAnnotationEvent
***
| Property | Type | Required | Description |
| -------------------- | ------------------- | -------- | ----------------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `commentAnnotation` | `CommentAnnotation` | Yes | Comment annotation object |
| `metadata` | `VeltEventMetadata` | Yes | Event metadata |
| `actionUser` | `User` | Yes | User who performed the action |
| `replaceContentHtml` | `string` | No | HTML content to replace with |
| `replaceContentText` | `string` | No | Text content to replace with |
#### RejectCommentAnnotationEvent
***
| Property | Type | Required | Description |
| -------------------- | ------------------- | -------- | ----------------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `commentAnnotation` | `CommentAnnotation` | Yes | Comment annotation object |
| `metadata` | `VeltEventMetadata` | Yes | Event metadata |
| `actionUser` | `User` | Yes | User who performed the action |
| `replaceContentHtml` | `string` | No | HTML content to replace with |
| `replaceContentText` | `string` | No | Text content to replace with |
### Recordings
#### ENUMs
| Enum Name | Event Type | Description |
| ------------------ | ----------------- | --------------------------------- |
| `DELETE_RECORDING` | `deleteRecording` | Delete a recording from a comment |
#### GetRecordingRequest
***
| Property | Type | Required | Description |
| -------------- | ---------------- | -------- | -------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `commentId` | `number` | Yes | ID of the comment |
| `options` | `RequestOptions` | No | Request options |
#### DeleteRecordingRequest
***
| Property | Type | Required | Description |
| -------------- | ---------------- | -------- | -------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `commentId` | `number` | Yes | ID of the comment |
| `recorderId` | `string` | Yes | ID of the recorder |
| `options` | `RequestOptions` | No | Request options |
#### DeleteRecordingEvent
***
| Property | Type | Required | Description |
| ------------------- | ------------------- | -------- | ------------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `commentAnnotation` | `CommentAnnotation` | Yes | Comment annotation object |
| `commentId` | `number` | Yes | ID of the comment |
| `recording` | `RecordedData` | Yes | Recording data |
| `metadata` | `VeltEventMetadata` | Yes | Event metadata |
### Deep Links
#### ENUMs
| Enum Name | Event Type | Description |
| ----------- | ---------- | ----------------------------- |
| `COPY_LINK` | `copyLink` | Copy a deep link to a comment |
#### GetLinkRequest
***
| Property | Type | Required | Description |
| -------------- | ---------------- | -------- | -------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `options` | `RequestOptions` | No | Request options |
#### CopyLinkRequest
***
| Property | Type | Required | Description |
| -------------- | ---------------- | -------- | -------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `options` | `RequestOptions` | No | Request options |
#### CopyLinkEvent
***
| Property | Type | Required | Description |
| ------------------- | ------------------- | -------- | ------------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `commentAnnotation` | `CommentAnnotation` | Yes | Comment annotation object |
| `link` | `string` | Yes | Copied link |
| `metadata` | `VeltEventMetadata` | Yes | Event metadata |
#### GetLinkResponse
***
| Property | Type | Required | Description |
| ------------------- | ------------------- | -------- | ------------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `commentAnnotation` | `CommentAnnotation` | Yes | Comment annotation object |
| `link` | `string \| null` | Yes | Generated link |
| `metadata` | `VeltEventMetadata` | Yes | Event metadata |
### Access
#### ENUMs
| Enum Name | Event Type | Description |
| --------------- | -------------- | ------------------------------------ |
| `UPDATE_ACCESS` | `updateAccess` | Update access settings for a comment |
#### UpdateAccessRequest
***
| Property | Type | Required | Description |
| -------------- | ------------------- | -------- | -------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `accessMode` | `CommentAccessMode` | Yes | Access mode |
| `options` | `RequestOptions` | No | Request options |
#### UpdateAccessEvent
***
| Property | Type | Required | Description |
| ------------------- | ------------------- | -------- | ------------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `commentAnnotation` | `CommentAnnotation` | Yes | Comment annotation object |
| `newAccessMode` | `CommentAccessMode` | No | New access mode |
| `oldAccessMode` | `CommentAccessMode` | No | Previous access mode |
| `metadata` | `VeltEventMetadata` | Yes | Event metadata |
#### UserPermissionAccessRole
***
Type: `'editor' | 'viewer'`
* editor: Write access
* viewer: Read-only access
#### UserPermissionAccessRoleResult
***
Type: `'does_not_exist' | 'permission_denied' | 'something_went_wrong'`
Error codes returned when permission resolution fails:
* `does_not_exist`: The requested resource (organization, folder, or document) does not exist
* `permission_denied`: The user does not have permission to access the requested resource
* `something_went_wrong`: An unexpected error occurred during permission resolution
#### GetUserPermissionsRequest
***
| Property | Type | Required | Description |
| ---------------- | ---------- | -------- | -------------------------------------------- |
| `organizationId` | `string` | No | Organization to scope the permission lookup. |
| `folderIds` | `string[]` | No | Folder IDs to include in the lookup. |
| `documentIds` | `string[]` | No | Document IDs to include in the lookup. |
#### UserPermissionInfo
***
| Property | Type | Required | Description |
| ------------ | -------------------------------- | -------- | ---------------------------------------------------------------- |
| `accessRole` | `UserPermissionAccessRole` | No | Access role for the resource. |
| `expiresAt` | `number` | No | Expiry (Unix ms) for temporary access, if applicable. |
| `error` | `string` | No | Error message if permission resolution failed. |
| `errorCode` | `UserPermissionAccessRoleResult` | No | Error code indicating the type of permission resolution failure. |
#### GetUserPermissionsResponse
***
Map of user IDs to their resolved permissions across organization, folders, and documents.
| Property | Type | Required | Description |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | -------- | ------------------------------------------------------- |
| `[userId: string]` | `{ folders?: Record; organization?: Record; documents?: Record; }` | Yes | Permissions for a user, keyed by resource scope and ID. |
### UI
#### ENUMs
| Enum Name | Event Type | Description |
| --------------------- | ------------------- | ------------------------------------------ |
| `COMPOSER_CLICKED` | `composerClicked` | Triggered when comment composer is clicked |
| `COMMENT_PIN_CLICKED` | `commentPinClicked` | Triggered when a comment pin is clicked |
#### ComposerClickedEvent
***
| Property | Type | Required | Description |
| ------------------- | ------------------- | -------- | --------------------------------------------------------------------------------------- |
| `commentAnnotation` | `CommentAnnotation` | No | Comment annotation object. This is `undefined` if it's a new comment annotation object. |
| `metadata` | `VeltEventMetadata` | Yes | Event metadata |
#### CommentPinClickedEvent
***
| Property | Type | Required | Description |
| ------------------- | ------------------- | -------- | ------------------------- |
| `annotationId` | `string` | Yes | ID of the annotation |
| `commentAnnotation` | `CommentAnnotation` | Yes | Comment annotation object |
| `metadata` | `VeltEventMetadata` | No | Event metadata |
### Comment Sidebar
#### ENUMs
| Enum Name | Event Type | Description |
| ----------------------------- | -------------------------- | --------------------------------------------------- |
| `COMMENT_SIDEBAR_DATA_INIT` | `commentSidebarDataInit` | Triggered when comment sidebar data is first loaded |
| `COMMENT_SIDEBAR_DATA_UPDATE` | `commentSidebarDataUpdate` | Triggered when comment sidebar data is updated |
#### CommentStatus
***
| Property | Type | Required | Description |
| ------------ | -------- | -------- | -------------------------------------------- |
| `color` | `string` | Yes | Primary color for the status. |
| `id` | `string` | Yes | Unique identifier for the status. |
| `lightColor` | `string` | Yes | Light variant of the status color. |
| `name` | `string` | Yes | Display name of the status. |
| `svg` | `string` | Yes | SVG icon for the status. |
| `type` | `string` | No | Optional type classification for the status. |
#### CommentPriority
***
| Property | Type | Required | Description |
| ------------ | -------- | -------- | ------------------------------------ |
| `color` | `string` | Yes | Primary color for the priority. |
| `id` | `string` | Yes | Unique identifier for the priority. |
| `lightColor` | `string` | Yes | Light variant of the priority color. |
| `name` | `string` | Yes | Display name of the priority. |
#### CustomFilter
***
| Property | Type | Required | Description |
| -------- | -------- | -------- | --------------------------------------- |
| `id` | `string` | Yes | Unique identifier for the custom filter |
| `color` | `string` | Yes | Color associated with the custom filter |
| `name` | `string` | Yes | Name or label of the custom filter |
#### CustomCategory
***
| Property | Type | Required | Description |
| -------- | -------- | -------- | ----------------------------------------- |
| `id` | `string` | Yes | Unique identifier for the custom category |
| `color` | `string` | Yes | Color associated with the custom category |
| `name` | `string` | Yes | Name or label of the custom category |
#### CommentSidebarDataInitEvent
***
| Property | Type | Required | Description |
| ----------------------------- | ------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------- |
| `buttonContext` | `VeltButtonContext` | Yes | Button context |
| `metadata` | `VeltEventMetadata` | Yes | Event metadata |
| `commentAnnotation` | `CommentAnnotation` | No | Comment annotation object |
| `comment` | `Comment` | No | Comment object |
| `index` | `number` | No | Index value |
| `commentAnnotations` | `CommentAnnotation[]` | No | Array of comment annotations |
| `systemFilteredAnnotations` | `CommentAnnotation[]` | No | Filtered comment annotations |
| `unreadCommentAnnotationsMap` | `{ [commentAnnotationId: string]: number }` | No | Map of unread comment counts |
| `customFilters` | `CustomFilters` | No | Custom filters applied in the Comment Sidebar. Only available when custom sidebar filters are used. |
#### CommentSidebarDataUpdateEvent
***
| Property | Type | Required | Description |
| ----------------------------- | ------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------- |
| `buttonContext` | `VeltButtonContext` | Yes | Button context |
| `metadata` | `VeltEventMetadata` | Yes | Event metadata |
| `commentAnnotation` | `CommentAnnotation` | No | Comment annotation object |
| `comment` | `Comment` | No | Comment object |
| `index` | `number` | No | Index value |
| `commentAnnotations` | `CommentAnnotation[]` | No | Array of comment annotations |
| `systemFilteredAnnotations` | `CommentAnnotation[]` | No | Filtered comment annotations |
| `unreadCommentAnnotationsMap` | `{ [commentAnnotationId: string]: number }` | No | Map of unread comment counts |
| `customFilters` | `CustomFilters` | No | Custom filters applied in the Comment Sidebar. Only available when custom sidebar filters are used. |
#### CommentSidebarFilterConfig
***
| Property | Type | Required | Description |
| --------------- | ------------------------------- | -------- | ------------------------------------------------------------------------------------------------------ |
| `location` | `FilterTypeConfig` | No | Configuration for the location filter type. |
| `document` | `FilterTypeConfig` | No | Configuration for the document filter type. Only use it if you are using multiple documents or folders |
| `people` | `FilterTypeConfig` | No | Configuration for the author filter type. |
| `tagged` | `FilterTypeConfig` | No | Configuration for the tagged/mentioned filter type. |
| `assigned` | `FilterTypeConfig` | No | Configuration for the assigned filter type. |
| `involved` | `FilterTypeConfig` | No | Configuration for the involved filter type (author, mentioned, assigned). |
| `priority` | `FilterTypeConfig` | No | Configuration for the priority filter type. |
| `category` | `FilterTypeConfig` | No | Configuration for the category filter type. |
| `commentType` | `FilterTypeConfig` | No | Configuration for the comment type filter. |
| `version` | `FilterTypeConfig` | No | Configuration for the version filter type. |
| `status` | `FilterTypeConfig` | No | Configuration for the status filter type. |
| `[key: string]` | `FilterTypeConfig \| undefined` | No | Custom filter type configurations. |
#### FilterTypeConfig
***
| Property | Type | Required | Description |
| ---------------- | ---------------------- | -------- | --------------------------------------------------------------------------------------------- |
| `name` | `string` | No | The name of the filter type |
| `enable` | `boolean` | No | Enables or disables the filter type |
| `multiSelection` | `boolean` | No | Allows multiple selections if set to true |
| `enableGrouping` | `boolean` | No | Enables grouping within the filter type if set to true |
| `placeholder` | `string` | No | The placeholder text for the filter type. Used when `filterOptionLayout` is set to `dropdown` |
| `id` | `string` | No | The unique identifier for the filter type |
| `type` | `'custom' \| 'system'` | No | The type of filter - custom or system |
| `options` | `FilterOption[]` | No | Array of filter options available for this filter type |
#### CommentSidebarGroupConfig
***
| Property | Type | Required | Description |
| --------------- | ----------------------------------------------------------- | -------- | ---------------------------- |
| `enable` | `boolean` | No | Enables or disables grouping |
| `name` | `string` | No | The name of the group |
| `[key: string]` | `{ id?: string, name?: string }[] \| string[] \| undefined` | No | Custom filter configurations |
#### CommentSidebarFilters
***
| Property | Type | Required | Description |
| ---------- | -------------------- | -------- | ---------------------------------------------------------------------------------------- |
| `location` | `{id: string}[]` | No | Filter by location Ids |
| `document` | `{id: string}[]` | No | Filter by document Ids |
| `people` | `{userId: string}[]` | No | Filter by author of comment annotation |
| `tagged` | `{userId: string}[]` | No | Filter by users who were tagged/mentioned in the comment |
| `assigned` | `{userId: string}[]` | No | Filter by users who were assigned to the comment annotation |
| `involved` | `{userId: string}[]` | No | Filter by users who are involved in the comment annotation (author, mentioned, assigned) |
| `priority` | `string[]` | No | Filter by priority ids |
| `status` | `string[]` | No | Filter by status ids |
| `category` | `string[]` | No | Filter by category ids |
| `version` | `{id: string}[]` | No | Filter by version Ids |
#### CommentSidebarData
***
| Property | Type | Required | Description |
| ------------- | --------------------- | -------- | ----------------------------------------------- |
| `groupId` | `string` | No | ID of the group. Defaults to 'others' |
| `groupName` | `string` | No | Name of the group. Defaults to 'Others' |
| `isExpanded` | `boolean` | No | Whether the group is expanded. Defaults to true |
| `annotations` | `CommentAnnotation[]` | Yes | List of CommentAnnotations in the group |
#### Options
***
| Property | Type | Required | Description |
| ---------- | --------- | -------- | ------------------------------------------- |
| `grouping` | `boolean` | No | Whether to group the data. Defaults to true |
#### CustomFilterOption
***
| Property | Type | Required | Description |
| ---------- | --------- | -------- | ----------------------------------------------- |
| `id` | `string` | Yes | Unique identifier for the filter option |
| `name` | `string` | Yes | Display name for the filter option |
| `selected` | `boolean` | Yes | Whether the filter option is currently selected |
#### CustomFilters
***
| Property | Type | Required | Description |
| --------------- | ---------------------- | -------- | ------------------------------------------------- |
| `[key: string]` | `CustomFilterOption[]` | No | Custom filter configurations mapped by filter key |
#### FilterOption
***
| Property | Type | Required | Description |
| -------- | -------- | -------- | --------------------------------------- |
| `id` | `string` | Yes | Unique identifier for the filter option |
| `name` | `string` | Yes | Display name for the filter option |
#### CustomFilter
***
| Property | Type | Required | Description |
| -------- | ------ | -------- | ---------------------------------------- |
| `id` | string | Yes | Unique identifier for the custom filter. |
| `color` | string | Yes | Color associated with the custom filter. |
| `name` | string | Yes | Name or label of the custom filter. |
#### CustomPriority
***
| Property | Type | Required | Description |
| ------------ | ------ | -------- | -------------------------------------------- |
| `id` | string | Yes | Unique identifier for the custom priority. |
| `color` | string | Yes | Color associated with the custom priority. |
| `name` | string | Yes | Name or label of the custom priority. |
| `lightColor` | string | No | Light color variant for the custom priority. |
#### CustomStatus
***
| Property | Type | Required | Description |
| ------------ | ---------- | -------- | --------------------------------------------------------- |
| `id` | string | Yes | Unique identifier for the custom status. |
| `color` | string | Yes | Color associated with the custom status. |
| `name` | string | Yes | Name or label of the custom status. |
| `type` | StatusType | Yes | Type of the status (`default`, `ongoing`, or `terminal`). |
| `lightColor` | string | No | Light color for the custom status. |
| `iconUrl` | string | No | URL to an icon image for the custom status. |
#### CustomCategory
***
| Property | Type | Required | Description |
| -------- | ------ | -------- | ------------------------------------------ |
| `id` | string | Yes | Unique identifier for the custom category. |
| `color` | string | Yes | Color associated with the custom category. |
| `name` | string | Yes | Name or label of the custom category. |
# Recorder
| Enum Name | Event Type | Description |
| -------------------------- | ------------------------ | ---------------------------------------------------------- |
| `TRANSCRIPTION_DONE` | `transcriptionDone` | Triggered when a transcription is generated and ready |
| `RECORDING_DONE` | `recordingDone` | Triggered when a recording is completed |
| `RECORDING_DELETE` | `deleteRecording` | Triggered when a recording is deleted |
| `RECORDING_EDIT_DONE` | `recordingEditDone` | Triggered when a recording is edited and saved |
| `RECORDING_SAVE_INITIATED` | `recordingSaveInitiated` | Triggered when a recording saved is initiated |
| `ERROR` | `error` | Triggered when an error occurs during recording operations |
### Recorder Data
#### RecorderRequestQuery
***
| Property | Type | Required | Description |
| ------------- | ---------- | -------- | ------------------------------ |
| `recorderIds` | `string[]` | Yes | Array of recorder IDs to query |
#### DeleteRecordingsRequest
***
| Property | Type | Required | Description |
| ------------------- | --------------------------- | -------- | ---------------------------------------------------------- |
| `recorderId` | `string` | Yes | ID of the recorder |
| `from` | `User \| null` | No | The user who created the recorder |
| `metadata` | `RecorderMetadata` | No | Metadata for the recording |
| `assets` | `RecorderDataAsset[]` | Yes | Array of recording assets for the latest version |
| `assetsAllVersions` | `RecorderDataAsset[]` | Yes | Array of all versions of recording assets |
| `transcription` | `RecorderDataTranscription` | Yes | Transcription data for the latest version of the recording |
#### GetRecordingDataResponse
***
| Property | Type | Required | Description |
| ------------------- | --------------------------- | -------- | ---------------------------------------------------------- |
| `recorderId` | `string` | Yes | ID of the recorder |
| `from` | `User \| null` | No | The user who created the recorder |
| `metadata` | `RecorderMetadata` | No | Metadata for the recording |
| `assets` | `RecorderDataAsset[]` | Yes | Array of recording assets for the latest version |
| `assetsAllVersions` | `RecorderDataAsset[]` | Yes | Array of all versions of recording assets |
| `transcription` | `RecorderDataTranscription` | Yes | Transcription data for the latest version of the recording |
### DeleteRecordingsResponse
***
| Property | Type | Required | Description |
| ------------------- | --------------------------- | -------- | ---------------------------------------------------------- |
| `recorderId` | `string` | Yes | ID of the recorder |
| `from` | `User \| null` | No | The user who created the recorder |
| `metadata` | `RecorderMetadata` | No | Metadata for the recording |
| `assets` | `RecorderDataAsset[]` | Yes | Array of recording assets for the latest version |
| `assetsAllVersions` | `RecorderDataAsset[]` | Yes | Array of all versions of recording assets |
| `transcription` | `RecorderDataTranscription` | Yes | Transcription data for the latest version of the recording |
### Recorder Configuration
#### RecorderQualityConstraints
***
| Property | Type | Required | Description |
| -------- | ----------------------------------- | -------- | ------------------------------------------------------------- |
| `safari` | `RecorderQualityConstraintsOptions` | No | Constraints specific to the Safari browser. |
| `other` | `RecorderQualityConstraintsOptions` | No | Constraints for other browsers (e.g., Chrome, Firefox, Edge). |
#### RecorderEncodingOptions
***
| Property | Type | Required | Description |
| -------- | ---------------------- | -------- | ------------------------------------------------------------------ |
| `safari` | `MediaRecorderOptions` | No | Encoding options specific to the Safari browser. |
| `other` | `MediaRecorderOptions` | No | Encoding options for other browsers (e.g., Chrome, Firefox, Edge). |
#### RecordingDoneEvent
***
| Property | Type | Required | Description |
| ------------------- | --------------------------- | -------- | ------------------------------------------------ |
| `recorderId` | `string` | Yes | ID of the recorder |
| `from` | `User \| null` | No | The user who created the recorder |
| `metadata` | `RecorderMetadata` | No | Metadata for the recording |
| `assets` | `RecorderDataAsset[]` | Yes | Array of recording assets for the latest version |
| `assetsAllVersions` | `RecorderDataAsset[]` | Yes | Array of all versions of recording assets |
| `transcription` | `RecorderDataTranscription` | Yes | Transcription data for the recording |
#### RecordingDeleteEvent
***
| Property | Type | Required | Description |
| ------------------- | --------------------------- | -------- | ------------------------------------------------ |
| `recorderId` | `string` | Yes | ID of the recorder |
| `from` | `User \| null` | No | The user who created the recorder |
| `metadata` | `RecorderMetadata` | No | Metadata for the recording |
| `assets` | `RecorderDataAsset[]` | Yes | Array of recording assets for the latest version |
| `assetsAllVersions` | `RecorderDataAsset[]` | Yes | Array of all versions of recording assets |
| `transcription` | `RecorderDataTranscription` | Yes | Transcription data for the recording |
#### RecordingEditDoneEvent
***
| Property | Type | Required | Description |
| ------------------- | --------------------------- | -------- | ------------------------------------------------ |
| `recorderId` | `string` | Yes | ID of the recorder |
| `from` | `User \| null` | No | The user who created the recorder |
| `metadata` | `RecorderMetadata` | No | Metadata for the recording |
| `assets` | `RecorderDataAsset[]` | Yes | Array of recording assets for the latest version |
| `assetsAllVersions` | `RecorderDataAsset[]` | Yes | Array of all versions of recording assets |
| `transcription` | `RecorderDataTranscription` | Yes | Transcription data for the recording |
#### RecordingSaveInitiatedEvent
***
| Property | Type | Required | Description |
| -------------- | -------------------- | -------- | ---------------------------------------------------------------------------- |
| `annotationId` | `string` | No | ID of the annotation. This property is only available when `type` is 'edit'. |
| `message` | `string` | Yes | A descriptive message about the save initiation. |
| `type` | `'edit' \| 'record'` | Yes | Specifies whether the save was initiated for an 'edit' or a new 'recording'. |
#### RecordingStartedEvent
***
| Property | Type | Required | Description |
| -------- | -------------------------------- | -------- | ----------------------------------- |
| `type` | `'audio' \| 'video' \| 'screen'` | Yes | The type of recording that started. |
#### RecordingPausedEvent
***
| Property | Type | Required | Description |
| -------- | -------------------------------- | -------- | -------------------------------------- |
| `type` | `'audio' \| 'video' \| 'screen'` | Yes | The type of recording that was paused. |
#### RecordingResumedEvent
***
| Property | Type | Required | Description |
| -------- | -------------------------------- | -------- | --------------------------------------- |
| `type` | `'audio' \| 'video' \| 'screen'` | Yes | The type of recording that was resumed. |
#### RecordingCancelledEvent
***
| Property | Type | Required | Description |
| -------- | -------------------------------- | -------- | ----------------------------------------- |
| `type` | `'audio' \| 'video' \| 'screen'` | Yes | The type of recording that was cancelled. |
#### RecordingStoppedEvent
***
| Property | Type | Required | Description |
| -------- | -------------------------------- | -------- | --------------------------------------- |
| `type` | `'audio' \| 'video' \| 'screen'` | Yes | The type of recording that was stopped. |
#### TranscriptionDoneEvent
***
| Property | Type | Required | Description |
| ------------------- | --------------------------- | -------- | ------------------------------------------------ |
| `recorderId` | `string` | Yes | ID of the recorder |
| `from` | `User \| null` | No | The user who created the recorder |
| `metadata` | `RecorderMetadata` | No | Metadata for the recording |
| `assets` | `RecorderDataAsset[]` | Yes | Array of recording assets for the latest version |
| `assetsAllVersions` | `RecorderDataAsset[]` | Yes | Array of all versions of recording assets |
| `transcription` | `RecorderDataTranscription` | Yes | Transcription data for the recording |
#### RecordingErrorEvent
***
| Property | Type | Required | Description |
| ------------ | -------- | -------- | ------------------------------------------------------------------------------------------- |
| `type` | `string` | Yes | The type of error that occurred. eg: `editFailed`, `recordingFailed`, `transcriptionFailed` |
| `message` | `string` | Yes | A descriptive message about the error. |
| `recorderId` | `string` | No | ID of the recorder, if the error is specific to one. |
#### RecorderConfig
***
| Property | Type | Required | Description |
| ----------------- | -------------------------------------------------------- | -------- | ------------------------------ |
| `type` | `{ audio?: boolean, video?: boolean, screen?: boolean }` | Yes | Types of media to be recorded |
| `recorderOptions` | `MediaRecorderOptions` | No | Options for the media recorder |
#### RecordedData
***
| Property | Type | Required | Description |
| -------------------------- | ---------- | -------- | ------------------------------------------------------------------------------------------------- |
| `id` | `string` | Yes | Annotation ID of recorder annotation |
| `tag` | `string` | Yes | Recorder player tag containing recorder annotation id which can be added anywhere on the DOM |
| `type` | `string` | Yes | Type of recorded data. Possible values are 'audio', 'video', and 'screen' |
| `thumbnailUrl` | `string` | No | URL of the thumbnail image for the recorded data |
| `thumbnailWithPlayIconUrl` | `string` | No | URL of the thumbnail image with a play icon overlay |
| `videoUrl` | `string` | No | URL of the recorded video |
| `audioUrl` | `string` | No | URL of the recorded audio |
| `videoPlayerUrl` | `string` | No | URL of the hosted website to open video in a new tab |
| `getThumbnailTag` | `function` | Yes | A method that returns an HTML string for displaying the thumbnail with a link to the video player |
#### RecorderAnnotation
***
| Property | Type | Required | Description | |
| ----------------- | ------------- | -------- | ----------------------------------------------------------------------- | - |
| `annotationId` | String | Yes | Unique identifier for the recorder annotation, automatically generated. | |
| `from` | `User` | Yes | The user who created the recorder annotation. | |
| `color` | String | No | Color used for the annotation. | |
| `lastUpdated` | Any | No | Timestamp of the last update, automatically generated. | |
| `locationId` | Number | No | Unique location ID from provided location. | |
| `location` | `Location` | No | Location to identify user on sub document. | |
| `type` | String | No | Type of annotation. | |
| `recordingType` | String | Yes | Type of recording for the annotation. | |
| `mode` | String | Yes | Mode of the recorder annotation, 'floating' or 'thread'. | |
| `approved` | Boolean | No | Indicates if the annotation is approved. | |
| `attachment` | Attachment | No | Attachment for recorded media. Deprecated. | |
| `attachments` | Attachment\[] | Yes | List of attachments for the annotation. | |
| `annotationIndex` | Number | No | Index of the annotation in a list. | |
| `pageInfo` | PageInfo | No | Information about the page where the annotation is made. | |
| `recordedTime` | Object | No | Recorded time details. | |
| `transcription` | Transcription | No | Transcription of the recorded media. | |
#### RecorderDataTranscriptSegment
***
| Property | Type | Required | Description |
| -------------------- | ------ | -------- | --------------------------------------- |
| `startTime` | String | Yes | Start time of the transcription segment |
| `endTime` | String | Yes | End time of the transcription segment |
| `startTimeInSeconds` | Number | Yes | Start time of the segment in seconds |
| `endTimeInSeconds` | Number | Yes | End time of the segment in seconds |
| `text` | String | Yes | Transcribed text content of the segment |
#### RecorderDataTranscription
***
| Property | Type | Required | Description |
| -------------------- | --------------------------------- | -------- | ---------------------------------------- |
| `transcriptSegments` | `RecorderDataTranscriptSegment[]` | No | Array of transcription segments |
| `vttFileUrl` | String | No | URL to the VTT format transcription file |
| `contentSummary` | String | No | Summary of the transcribed content |
#### RecorderDataAsset
***
| Property | Type | Required | Description |
| ----------------- | --------------------------- | -------- | --------------------------------------------------------------- |
| `version` | `number` | No | Version of the asset. |
| `url` | `string` | Yes | URL to the recorded media |
| `mimeType` | `string` | No | MIME type of the recorded media |
| `fileName` | `string` | No | Name of the recorded file |
| `fileSizeInBytes` | `number` | No | File size in bytes |
| `fileFormat` | `RecorderFileFormat` | No | The format/extension of the file. Example: 'mp3', 'mp4', 'webm' |
| `thumbnailUrl` | `string` | No | URL to the thumbnail image |
| `transcription` | `RecorderDataTranscription` | No | Transcription data for the recording |
#### RecorderData
***
| Property | Type | Required | Description |
| ------------------- | --------------------------- | -------- | ---------------------------------------------------------- |
| `recorderId` | `string` | Yes | ID of the recorder |
| `from` | `User \| null` | No | The user who created the recorder |
| `metadata` | `RecorderMetadata` | No | Metadata for the recording |
| `assets` | `RecorderDataAsset[]` | Yes | Array of recording assets for the latest version |
| `assetsAllVersions` | `RecorderDataAsset[]` | Yes | Array of all versions of recording assets |
| `transcription` | `RecorderDataTranscription` | Yes | Transcription data for the latest version of the recording |
#### MediaPreviewConfig
***
| Property | Type | Required | Description |
| ---------------- | ----------- | -------- | --------------------------------- |
| `audio` | Object | No | Configuration for audio preview |
| `audio.enabled` | boolean | No | Whether audio preview is enabled |
| `audio.deviceId` | string | No | Device ID for audio input |
| `video` | Object | No | Configuration for video preview |
| `video.enabled` | boolean | No | Whether video preview is enabled |
| `video.deviceId` | string | No | Device ID for video input |
| `screen` | Object | No | Configuration for screen preview |
| `screen.enabled` | boolean | No | Whether screen preview is enabled |
| `screen.stream` | MediaStream | No | MediaStream for screen sharing |
#### MediaRecorderOptions
***
| Property | Type | Required | Description |
| -------------------- | -------- | -------- | -------------------------------------------------------------------------------------------- |
| `audioBitsPerSecond` | `number` | No | Controls the audio encoding quality by setting the number of bits used per second for audio. |
| `videoBitsPerSecond` | `number` | No | Controls the video encoding quality by setting the number of bits used per second for video. |
#### RecorderQualityConstraintsOptions
***
| Property | Type | Required | Description |
| -------- | ----------------------- | -------- | ---------------------------------------------- |
| `video` | `MediaTrackConstraints` | No | Specifies the constraints for the video track. |
| `audio` | `MediaTrackConstraints` | No | Specifies the constraints for the audio track. |
#### MediaTrackConstraints
***
| Property | Type | Required | Description |
| ------------------ | ------------------ | -------- | ---------------------------------------------------------------- |
| `aspectRatio` | `ConstrainDouble` | No | Controls the width-to-height ratio of the captured video stream. |
| `frameRate` | `ConstrainDouble` | No | Determines the number of frames per second for the video stream. |
| `height` | `ConstrainULong` | No | Sets the vertical resolution (in pixels) of the video stream. |
| `width` | `ConstrainULong` | No | Sets the horizontal resolution (in pixels) of the video stream. |
| `autoGainControl` | `ConstrainBoolean` | No | Enables/disables automatic volume adjustment for audio input. |
| `echoCancellation` | `ConstrainBoolean` | No | Enables/disables the removal of audio echo effects. |
| `noiseSuppression` | `ConstrainBoolean` | No | Enables/disables the filtering of background noise from audio. |
| `sampleRate` | `ConstrainULong` | No | Controls the number of audio samples taken per second. |
#### ConstrainDouble
***
| Property | Type | Required | Description |
| -------- | -------- | -------- | -------------------------------------------------------------------- |
| `min` | `number` | No | The minimum acceptable value. |
| `max` | `number` | No | The maximum acceptable value. |
| `ideal` | `number` | No | The preferred value that the browser will try to match if possible. |
| `exact` | `number` | No | A mandatory value that must be matched exactly or the request fails. |
#### ConstrainULong
***
| Property | Type | Required | Description |
| -------- | -------- | -------- | -------------------------------------------------------------------- |
| `min` | `number` | No | The minimum acceptable value. |
| `max` | `number` | No | The maximum acceptable value. |
| `ideal` | `number` | No | The preferred value that the browser will try to match if possible. |
| `exact` | `number` | No | A mandatory value that must be matched exactly or the request fails. |
#### ConstrainBoolean
***
| Property | Type | Required | Description |
| -------- | --------- | -------- | -------------------------------------------------------------------- |
| `ideal` | `boolean` | No | The preferred value that the browser will try to match if possible. |
| `exact` | `boolean` | No | A mandatory value that must be matched exactly or the request fails. |
#### RecorderDevicePermissionOptions
***
| Property | Type | Required | Description |
| -------- | ------- | -------- | ------------------------------------------------------ |
| `audio` | boolean | No | Whether to request permission for audio input devices. |
| `video` | boolean | No | Whether to request permission for video input devices. |
### RecorderElement Interface
#### RecorderElement
***
Interface representing the Recorder element object that provides methods for controlling recording behavior, Picture-in-Picture mode, and permissions.
| Method | Parameters | Returns | Description |
| ------------------------- | --------------- | --------------- | ------------------------------------------------------------- |
| `setMaxLength` | `value: number` | `void` | Sets the maximum recording duration in seconds |
| `enablePictureInPicture` | None | `void` | Enables Picture-in-Picture mode for recordings |
| `disablePictureInPicture` | None | `void` | Disables Picture-in-Picture mode for recordings |
| `openPictureInPicture` | None | `void` | Opens the Picture-in-Picture window for the current recording |
| `exitPictureInPicture` | None | `void` | Exits the Picture-in-Picture window |
| `requestScreenPermission` | None | `Promise` | Requests screen capture permissions for recording preview |
# Notifications
#### Notification
***
| Property | Type | Required | Description |
| ------------------------------------ | ----------------------------------- | -------- | ----------------------------------------------------------------------------- |
| `id` | `string` | Yes | Notification ID |
| `notificationSource` | `string` | Yes | Notification source. e.g., 'comment', 'custom', etc. |
| `actionType` | `string` | No | Action that triggered the notification. e.g., 'added' |
| `isUnread` | `boolean` | No | Whether the notification is unread for the user |
| `actionUser` | `User` | No | The user who triggered the action |
| `timestamp` | `number` | No | Timestamp of the notification |
| `displayHeadlineMessage` | `string` | No | The headline message of the notification |
| `displayBodyMessage` | `string` | No | The body message of the notification |
| `displayHeadlineMessageTemplate` | `string` | No | The template of the headline message |
| `displayHeadlineMessageTemplateData` | `object` | No | The data used to fill the headline message template |
| `forYou` | `boolean` | No | Whether the notification is for the current logged-in user |
| `targetAnnotationId` | `string` | No | ID of the annotation that triggered the notification |
| `notificationSourceData` | `any` | No | The data of the notification source. e.g., `CommentAnnotation` |
| `metadata` | `NotificationMetadata` | No | Metadata for the current notification. e.g., `documentId` |
| `notifyUsers` | `{ [emailHash: string]: boolean }` | No | Map of email hashes to boolean values indicating whether to notify the user |
| `notifyUsersByUserId` | `{ [userIdHash: string]: boolean }` | No | Map of user ID hashes to boolean values indicating whether to notify the user |
#### NotificationMetadata
***
| Property | Type | Required | Description |
| ---------------------- | ---------- | -------- | -------------------------------------------------- |
| `apiKey` | `string` | No | Your API key |
| `clientOrganizationId` | `string` | No | The organization ID that you set |
| `organizationId` | `string` | No | The organization ID generated by us |
| `clientDocumentId` | `string` | No | The document ID that you set |
| `documentId` | `string` | No | The document ID generated by us |
| `locationId` | `number` | No | The unique location ID |
| `location` | `Location` | No | The location object |
| `documentMetadata` | `Object` | No | Contains the complete document metadata object |
| `organizationMetadata` | `Object` | No | Contains the complete organization metadata object |
#### SettingsUpdatedEvent
***
| Property | Type | Required | Description |
| ------------ | ---------------------------- | -------- | ------------------------------------------------ |
| `settings` | `NotificationSettingsConfig` | Yes | The updated notification settings configuration. |
| `isMutedAll` | `boolean` | Yes | Whether all notifications are muted. |
| Enum Name | Event Type | Description |
| ------------------ | ----------------- | ---------------------------------------------------- |
| `SETTINGS_UPDATED` | `settingsUpdated` | Triggered when the notification settings are updated |
#### NotificationSettingsConfig
***
Sets what notifications the user will receive on the provided channel.
| Property | Type | Required | Description |
| --------------- | ------------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `[key: string]` | `NotificationSettingsItemType` | No | Dynamic key-value pairs for notification settings configuration. The key represents the channel ID and the value represents the one of the NotificationSettingsItemType. |
#### NotificationSettingsItemType
***
Decides what notifications the user will receive on the current channel.
Type: `'ALL' | 'MINE' | 'NONE' | string`
**Description:**
* `ALL`: Subscribes the user to all notifications whether or not the user is involved in the notification on the current document.
* `MINE`: Subscribes the user to notifications that are related to the current user on the current document.
* `NONE`: Subscribes the user to no notifications on this channel on the current document.
#### NotificationInitialSettingsConfig
***
| Property | Type | Required | Description |
| --------- | --------------------------- | -------- | ------------------------------------------------------ |
| `name` | `string` | No | Display name for the notification channel. |
| `id` | `string` | Yes | Unique channel ID for the notification channel. |
| `default` | `string` | No | Default value for the notification channel. |
| `enable` | `boolean` | No | Whether the notification channel is enabled. |
| `values` | `NotificationConfigValue[]` | No | Array of possible values for the notification channel. |
#### NotificationConfigValue
***
| Property | Type | Required | Description |
| -------- | ------------------------------ | -------- | ----------------------------------------- |
| `id` | `NotificationSettingsItemType` | Yes | Unique id for the configuration value. |
| `name` | `string` | No | Display name for the configuration value. |
#### GetNotificationsDataQuery
***
| Property | Type | Required | Description |
| -------- | ---------------------------------- | -------- | --------------------------------------------------------- |
| `type` | `'all' \| 'forYou' \| 'documents'` | No | Filter for notification type: all, for you, or documents. |
# Single Editor Mode
#### AccessRequestEvent
***
This event object is related to requests for editor access. It is emitted for `accessRequested`, `accessRequestCanceled`, `accessAccepted`, and `accessRejected` events.
| Property | Type | Required | Description |
| ----------- | -------- | -------- | ------------------------------------------------------------------------------------------ |
| `viewer` | `User` | No | The user who is the current viewer and is involved in the access request. |
| `editor` | `User` | No | The user who is the current editor at the time of the event. |
| `timestamp` | `number` | No | UNIX timestamp (in milliseconds) of when the event occurred. |
| `status` | `string` | No | The status of the access request (e.g., "requested", "canceled", "accepted", "rejected" ). |
#### SEMEvent
***
This event object is related to editor/viewer assignments and editor status changes. It is emitted for `editorAssigned`, `viewerAssigned`, and `editorOnDifferentTabDetected` events.
| Property | Type | Required | Description |
| ----------- | -------- | -------- | ------------------------------------------------------------------------------------- |
| `viewer` | `User` | No | The user who is the current viewer at the time of the event. |
| `editor` | `User` | No | The user who is the current editor at the time of the event. |
| `timestamp` | `number` | No | UNIX timestamp (in milliseconds) of when the event occurred. |
| `role` | `string` | No | The role relevant to the event, typically "editor" or "viewer" for assignment events. |
#### SingleEditorLiveStateData
***
| Property | Type | Required | Description |
| --------------------- | ---------------- | -------- | ----------------------------------------- |
| `editor` | `User \| null` | No | The user who is currently editing, if any |
| `requestEditorAccess` | `Object \| null` | No | Details about a request for editor access |
| `tabId` | `string \| null` | No | The identifier of the tab, if applicable |
#### RequestEditorAccess
***
| Property | Type | Required | Description |
| --------------------- | ------------------------------------------------------ | -------- | ------------------------------------------------------- |
| `user` | `User` | Yes | The user requesting editor access |
| `requestedAt` | `any` | Yes | The timestamp when the access was requested |
| `status` | `'pending' \| 'accepted' \| 'rejected' \| 'cancelled'` | Yes | The status of the access request |
| `editorAccessTimeout` | `number` | Yes | Timeout duration for the editor access |
| `tabId` | `string \| null` | No | The identifier of the tab related to the access request |
#### SingleEditorConfig
***
| Property | Type | Required | Description |
| ----------------- | --------- | -------- | -------------------------------------------------------------------------------------------- |
| `customMode` | `boolean` | No | Enables/disables custom mode. In custom mode, input elements are not disabled for the viewer |
| `singleTabEditor` | `boolean` | Yes | Enables/disables editor mode on a single tab only |
#### UserEditorAccess
***
| Property | Type | Required | Description |
| ---------------------- | --------- | -------- | ---------------------------------------------------------- |
| `isEditor` | `boolean` | No | Indicates whether the user has editor privileges |
| `isEditorOnCurrentTab` | `boolean` | No | Indicates whether the user is an editor on the current tab |
#### EditorAccessTimer
***
| Property | Type | Required | Description |
| -------------- | --------------------------------------- | -------- | ---------------------------------------------------------- |
| `state` | `'idle' \| 'inProgress' \| 'completed'` | Yes | The state of the Editor Access Request timer |
| `durationLeft` | `number` | No | Duration left for the editor access timer to be completed. |
# Live State Data
#### LiveStateData
***
| Property | Type | Required | Description |
| ----------------- | ------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------- |
| `id` | `string` | Yes | A unique identifier likely used for quick reference and indexing. It's an MD5 hash of `liveStateDataId` |
| `liveStateDataId` | `string` | Yes | A unique identifier for the state data being synced |
| `data` | `string \| number \| boolean \| JSON` | Yes | The actual data you want to synchronize across clients |
| `lastUpdated` | `any` | Yes | A timestamp or similar data indicating the last time the state data was updated |
| `updatedBy` | `User` | Yes | The user who last updated the state data |
| `tabId` | `string \| null` | No | An identifier that could be used to associate the state data with a specific tab or instance |
#### LiveStateDataMap
***
| Property | Type | Required | Description |
| ------------------------------- | ----------------------------------------------- | -------- | --------------------------------------------------------------------------------------- |
| `custom` | `{ [liveStateDataId: string]: LiveStateData; }` | No | Map of all unique LiveStateData set by you on the given document. |
| `default` | Object | No | Map of all unique LiveStateData set by the default editor on the given document. |
| `default.singleEditor` | `SingleEditorLiveStateData` | No | Part of `default`, representing single editor live state data. |
| `default.autoSyncState` | Object | | Part of `default`, representing auto synchronization state. |
| `default.autoSyncState.current` | `LiveStateData` | No | Part of `autoSyncState`, current live state data. |
| `default.autoSyncState.history` | `[liveStateDataId: string]: LiveStateData` | No | Part of `autoSyncState`, map of historical live state data keyed by live state data ID. |
#### LiveStateData
***
| Property | Type | Required | Description |
| --------------- | ------- | -------- | ----------------------------------------- |
| `id` | string | Yes | Unique identifier for the live state data |
| `locationName` | string | Yes | Name of the location |
| `version` | Version | Yes | Version information |
| `[key: string]` | any | Yes | Additional dynamic properties |
#### SetLiveStateDataConfig
***
| Property | Type | Required | Description |
| -------- | --------- | -------- | ------------------------------------------------------------- |
| `merge` | `boolean` | No | Whether to merge data with existing data. Default is `false`. |
#### FetchLiveStateDataRequest
***
| Property | Type | Required | Description |
| ----------------- | -------- | -------- | ------------------------------------------------------------------------------------------------------------------ |
| `liveStateDataId` | `string` | No | Unique identifier for the specific live state data to fetch. If not provided, all live state data will be fetched. |
#### ServerConnectionState
***
| Property | Type | Required | Description |
| -------------- | ------ | -------- | ----------------------------------------------------------------- |
| `ONLINE` | string | Yes | Server connection is online and active. Value: 'online' |
| `OFFLINE` | string | Yes | Server connection is offline. Value: 'offline' |
| `PENDING_INIT` | string | Yes | Server connection initialization is pending. Value: 'pendingInit' |
| `PENDING_DATA` | string | Yes | Server is waiting for data. Value: 'pendingData' |
# Client
#### Client Events
| Event Type | Event Name | Description | Event Object |
| --------------------- | -------------------- | ---------------------------------------------------------------------------- | --------------------------------------------------- |
| `USER_UPDATE` | `userUpdate` | Fired when the Velt user logs in, logs out, or changes. | [UserUpdateEvent](#userupdateevent) |
| `INIT_UPDATE` | `initUpdate` | Initialization lifecycle updates (documents/locations set/unset, user init). | [InitUpdateEvent](#initupdateevent) |
| `DOCUMENT_INIT` | `documentInit` | Document initialization status changes. | [DocumentInitEvent](#documentinitevent) |
| `ERROR` | `error` | Error events emitted by the SDK (e.g., token issues, retry limits). | [ErrorEvent](#errorevent) |
| `VELT_BUTTON_CLICK` | `veltButtonClick` | Fired when a Velt Button is clicked. | [VeltButtonClickEvent](#veltbuttonclickevent) |
| `PERMISSION_PROVIDER` | `permissionProvider` | Permission Provider events for access requests, results, and errors. | [PermissionProviderEvent](#permissionproviderevent) |
#### InitUpdateEvent
| Sub-event (string) | Description |
| -------------------------- | ---------------------------------------------------------------------------------------- |
| `userUpdate` | User initialized or updated as part of init. |
| `setDocumentsTriggered` | A document(s) set action was triggered (`setDocument`, `setDocuments`, `setDocumentId`). |
| `setRootDocumentTriggered` | Root document set was triggered (`setRootDocument`). |
| `setDocumentsSuccess` | Documents successfully set. |
| `unsetDocumentsTriggered` | Unset document(s) was triggered (`unsetDocumentId`, `unsetDocuments`). |
| `unsetDocumentsSuccess` | Documents successfully unset. |
| `setLocationsTriggered` | A location(s) set action was triggered (`setLocation`, `setLocations`). |
| `setRootLocationTriggered` | Root location set was triggered (`setRootLocation`). |
| `setLocationsSuccess` | Locations successfully set. |
| `unsetLocationsTriggered` | Unsetting location IDs was triggered (`unsetLocationIds`). |
#### PermissionProviderEvent
| Sub-Event Type | Description |
| -------------------------------------- | ------------------------------------------------------------------------------------------ |
| `resourceAccessRequestFormed` | Triggered when a permission request is formed internally before being sent |
| `resourceAccessRequestTriggered` | Triggered when a permission request is actually triggered and sent |
| `resourceAccessResult` | Triggered when a permission check result is received from your server |
| `resourceAccessError` | Triggered when an error occurs during permission checking |
| `resourceAccessResultFromCache` | Triggered when a permission result is retrieved from cache instead of making a new request |
| `revokeAccessOnDocumentUnsetTriggered` | Triggered when permissions are automatically revoked due to document unset trigger |
| `revokeAccessOnUserLogoutTriggered` | Triggered when permissions are automatically revoked due to user logout trigger |
#### Error Codes
| Code | Meaning (summary) |
| ------------------ | ---------------------------------- |
| `token_expired` | The auth token is no longer valid. |
| `too_many_retries` | Retried and hit the retry limit. |
#### DocumentMetadata
***
| Property | Type | Required | Description |
| ---------------- | -------------------------------------------- | -------- | ---------------------------------------------------- |
| `documentId` | `string` | Yes | Unique document id generated from client document id |
| `documentName` | `string` | No | Display name of the document |
| `folderId` | `string` | No | ID of the folder containing this document |
| `apiKey` | `string` | No | API key associated with the document |
| `organizationId` | `string` | Yes | Organization ID that owns this document |
| `locations` | `{ [locationId: number]: LocationMetadata }` | No | Location metadata for this document |
### Folders
#### FetchFoldersRequest
***
| Property | Type | Required | Description |
| ---------------- | -------- | -------- | -------------------------------------------- |
| `organizationId` | `string` | Yes | Organization ID to fetch folders from |
| `folderId` | `string` | No | Parent folder ID to fetch child folders from |
#### FetchFoldersResponse
***
| Property | Type | Required | Description |
| --------------- | ---------------------------------------- | -------- | --------------------------------------------------------- |
| `data` | `Record \| null` | Yes | Map of folder IDs to their metadata. `Null` while loading |
| `nextPageToken` | `string` | Yes | Token for fetching next page of results |
### Documents
#### FetchDocumentsRequest
***
| Property | Type | Required | Description |
| ---------------- | ---------- | -------- | ------------------------------------------------------------------------ |
| `organizationId` | `string` | No | Organization ID to fetch documents from |
| `documentIds` | `string[]` | No | Array of specific document IDs to fetch |
| `folderId` | `string` | No | Folder ID to fetch documents from |
| `allDocuments` | `boolean` | No | Whether to fetch all documents. Use with `organizationId` or `folderId`. |
#### FetchDocumentsResponse
***
| Property | Type | Required | Description |
| --------------- | -------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `data` | `Record \| null` | Yes | Map of document groups to arrays of [DocumentMetadata](/api-reference/sdk/models/data-models#documentmetadata). `null` while loading. |
| `nextPageToken` | `string` | Yes | Token for fetching next page of results. Default page size is 1000. |
#### DocumentInitEvent
***
* `DocumentInitEvent` can be of type: `boolean | undefined`
* This represents the document initialization status.
#### ErrorEvent
***
| Property | Type | Required | Description |
| --------- | -------- | -------- | ------------- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | No | Error message |
#### List of error codes:
| Code | Description |
| -------------------------------- | -------------------------------------------- |
| `token_expired` | The JWT token has expired |
| `same_user_editor_current_tab` | Same user is already editor in current tab |
| `same_user_editor_different_tab` | Same user is already editor in different tab |
| `another_user_editor` | Another user is already editor |
#### SetUserAsEditorResponse
***
| Property | Type | Required | Description |
| -------- | ------------ | -------- | ----------------------------------------- |
| `error` | `ErrorEvent` | No | Present when the action cannot be applied |
#### LiveStateSingleEditorExternalUserPresence
***
| Property | Type | Required | Description |
| --------------------------- | ---------- | -------- | ------------------------------------------------------ |
| `sameUserPresentOnTab` | `boolean` | No | True if the same user is present on a different tab |
| `differentUserPresentOnTab` | `boolean` | No | True if a different user is present on a different tab |
| `userIds` | `string[]` | No | User IDs of users present on a different tab |
#### UserUpdateEvent
***
* `UserUpdateEvent` will return data of type: `User | null`
* If there is no user, it will return `null` else it will return the user object.
#### VeltButtonClickEvent
***
| Property | Type | Required | Description |
| ----------------------------- | ------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `buttonContext` | `VeltButtonContext` | Yes | Button context |
| `metadata` | `VeltEventMetadata` | Yes | Event metadata |
| `commentAnnotation` | `CommentAnnotation` | No | Comment annotation object |
| `comment` | `Comment` | No | Comment object |
| `index` | `number` | No | Index of the repeated component the button is in. eg: Comment, Notification component. |
| `commentAnnotations` | `CommentAnnotation[]` | No | Array of comment annotations |
| `systemFilteredAnnotations` | `CommentAnnotation[]` | No | Filtered comment annotations |
| `unreadCommentAnnotationsMap` | `{ [commentAnnotationId: string]: number }` | No | Map of unread comment counts |
| `notification` | `Notification` | No | Notification object |
| `notifications` | `Notification[]` | No | Array of notifications |
| `customFilters` | `CustomFilters` | No | Custom filters applied in the Comment Sidebar. Only available when custom sidebar filters are used and when the button is in the sidebar. |
#### PermissionProviderEvent
***
| Property | Type | Required | Description |
| ---------- | --------- | -------- | ----------------------------------------------------------- |
| `type` | `string` | Yes | Event type: `'request'`, `'result'`, or `'error'` |
| `userId` | `string` | Yes | User ID making the permission request |
| `resource` | `object` | Yes | Resource being accessed (organization, folder, or document) |
| `result` | `boolean` | No | Permission result (present when type is `'result'`) |
| `error` | `string` | No | Error message (present when type is `'error'`) |
#### RevokeAccessEvent
***
| Property | Type | Required | Description |
| -------------- | -------- | -------- | --------------------------------------------------------------- |
| `userId` | `string` | Yes | User ID whose access is being revoked |
| `resourceType` | `string` | Yes | Type of resource: `'document'`, `'folder'`, or `'organization'` |
| `resourceId` | `string` | Yes | ID of the resource |
| `trigger` | `string` | Yes | Trigger type: `'documentUnset'` or `'userLogout'` |
| `timestamp` | `number` | Yes | Unix timestamp when revocation occurred |
#### Config
| Property | Type | Required | Description |
| ----------------------- | -------------- | -------- | ------------------------------------------------------------------------------------------------------------------------ |
| `urlAllowList` | string\[] | No | Restricts Velt features to specific pages by specifying partial URL strings. |
| `featureAllowList` | FeatureType\[] | No | Only allows the provided Velt features to run. |
| `userPlanAllowList` | string\[] | No | Restricts Velt features to specific user plans. |
| `userIdAllowList` | string\[] | No | Restricts Velt features to specific users. |
| `usePrefersColorScheme` | boolean | No | If set to true, listens to changes on the `prefers-color-scheme` media query to set the global theme of Velt components. |
#### Features
***
| Property | Type | Required | Description |
| ----------------- | ----------------- | -------- | -------------------------------------------------- |
| `AREA` | `'area'` | No | Area feature for drawing areas/rectangles |
| `ARROW` | `'arrow'` | No | Arrow feature for drawing arrows |
| `AUDIO_HUDDLE` | `'audioHuddle'` | No | Audio huddle feature for voice conversations |
| `COMMENT` | `'comment'` | No | Comment feature for adding comments |
| `CURSOR` | `'cursor'` | No | Cursor feature for showing user cursors |
| `HUDDLE` | `'huddle'` | No | Huddle feature for video conversations |
| `LIVE_STATE_SYNC` | `'liveStateSync'` | No | Live state sync feature |
| `PRESENCE` | `'presence'` | No | Presence feature for showing online users |
| `TAG` | `'tag'` | No | Tag feature for adding tags |
| `RECORDER` | `'recorder'` | No | Recorder feature for recording sessions |
| `REWRITER` | `'rewriter'` | No | Rewriter feature for text rewriting |
| `LIVE_SELECTION` | `'liveSelection'` | No | Live selection feature for showing user selections |
#### VeltEventMetadata
***
| Property | Type | Required | Description |
| ---------------------- | -------------------------------- | -------- | --------------------- |
| `organizationMetadata` | `OrganizationMetadata` \| `null` | No | Organization metadata |
| `documentMetadata` | `DocumentMetadata` \| `null` | No | Document metadata |
| `location` | `Location` \| `null` | No | Location information |
#### VeltButtonContext
***
| Property | Type | Required | Description |
| ----------------- | ------------------------------------------------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------ |
| `type` | `'button' \| 'button-toggle' \| 'multi-select' \| 'single-select'` | No | Type of button (default: 'button') |
| `groupId` | `string` | No | ID of the button group |
| `selections` | `VeltButtonSelectionMap` | No | Map of button selections grouped by button groupIds. For buttons without a group, the groupdId will be 'ungrouped' |
| `clickedButtonId` | `string` | No | ID of the clicked button |
#### VeltButtonSelectionMap
***
| Property | Type | Required | Description |
| ------------------- | --------------------------------- | -------- | ------------------------------------ |
| `[groupId: string]` | `{ [buttonId: string]: boolean }` | No | Map of button selections for a group |
#### UpdateDocumentsRequest
***
| Property | Type | Required | Description |
| ---------------- | ----------------------------- | -------- | --------------------------------------------- |
| `organizationId` | `string` | No | Unique identifier for the organization. |
| `folderId` | `string` | No | Unique identifier for the folder. |
| `documents` | `UpdateDocumentMetadata[]` | No | Array of document metadata objects to update. |
#### UpdateDocumentMetadata
***
| Property | Type | Required | Description | |
| --------------- | -------- | -------- | ----------------------------------- | ------------------------------------------------------- |
| `documentId` | `string` | Yes | Unique identifier for the document. | |
| `[key: string]` | \`T | string\` | No | Additional custom properties for the document metadata. |
#### Metadata
***
| Property | Type | Required | Description |
| --------------- | ---------------------- | -------- | ------------------------------------------------------- |
| `apiKey` | `string` | Yes | API key associated with the event. |
| `pageInfo` | `PageInfo` | No | Information about the page where the event occurred. |
| `folderId` | `string` | No | Unique identifier for the folder. |
| `locations` | `object` | No | Object containing location data indexed by location ID. |
| `document` | `DocumentMetadata` | No | Document metadata associated with the event. |
| `organization` | `OrganizationMetadata` | No | Organization metadata associated with the event. |
| `[key: string]` | `any` | No | Additional custom properties. |
#### DocumentMetadata
***
| Property | Type | Required | Description |
| ---------------- | -------- | -------- | --------------------------------------- |
| `documentId` | `string` | Yes | Unique identifier for the document. |
| `documentName` | `string` | No | Name of the document. |
| `organizationId` | `string` | No | Unique identifier for the organization. |
| `folderId` | `string` | No | Unique identifier for the folder. |
| `[key: string]` | `any` | No | Additional custom properties. |
#### OrganizationMetadata
***
| Property | Type | Required | Description |
| ---------------- | -------- | -------- | --------------------------------------- |
| `organizationId` | `string` | Yes | Unique identifier for the organization. |
| `[key: string]` | `any` | No | Additional custom properties. |
#### PageInfo
***
| Property | Type | Required | Description |
| ------------- | -------- | -------- | --------------------------------- |
| `baseUrl` | `string` | Yes | Base URL of the page. |
| `path` | `string` | Yes | Path of the page. |
| `queryParams` | `string` | No | Query parameters of the page URL. |
| `title` | `string` | Yes | Title of the page. |
| `url` | `string` | Yes | Full URL of the page. |
#### VeltAuthTokenRequest
***
| Property | Type | Required | Description |
| ---------------- | --------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `apiKey` | `string` | Yes | **API Key**. Must be provided, cannot be empty or whitespace only. |
| `userId` | `string` | Yes | **User ID**. Must be provided, cannot be empty or whitespace only. |
| `userProperties` | `UserProperties` | No | Additional user information to embed in the auth token. See below for details. |
| `permissions` | `{ resources: Resource[] }` | No | Permissions configuration. Defines what resources the user can access and their access levels. If not provided, defaults to no resource access. |
#### UserProperties
***
| Property | Type | Required | Description |
| --------------- | --------- | -------- | ------------------------------------------------------------------------------------ |
| `isAdmin` | `boolean` | No | Whether the user is an admin. |
| `name` | `string` | No | User's display name. If provided, cannot be empty or whitespace only. |
| `email` | `string` | No | User's email address. If provided, cannot be empty and must be a valid email format. |
| `[key: string]` | `any` | No | Allows flexibility for custom user attributes. |
#### Permissions
***
| Property | Type | Required | Description |
| ----------- | ------------ | -------- | ----------------------------------------------------------------------------------------- |
| `resources` | `Resource[]` | No | Array of resources the user has permission to access. Defaults to empty array if not set. |
#### Resource
***
Each resource represents something the user can access (organization, folder, or document).
| Property | Type | Required | Description |
| ---------------- | ------------------------------------------ | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `type` | `'organization' \| 'folder' \| 'document'` | Yes | Resource type. Must be one of: 'organization', 'folder', or 'document'. Determines the scope and level of access. |
| `id` | `string` | Yes | Unique identifier for the specific resource. Cannot be whitespace only. For organization: the organization ID. For folder: the folder ID. For document: the document ID. |
| `organizationId` | `string` | Conditionally | Organization ID. **Required** for `folder` and `document` types. Optional for `organization` type. Must be provided and non-empty for folder/document resources. Links the resource to a specific organization. |
| `expiresAt` | `number` | No | Expiration timestamp (Unix timestamp). If provided, must be a positive integer, greater than the current time, and a valid number. Used for temporary access grants. |
#### BaseMetadata
***
| Property | Type | Required | Description |
| ---------------- | -------- | -------- | --------------------------------------- |
| `apiKey` | `string` | No | API key associated with the request. |
| `documentId` | `string` | No | Unique identifier for the document. |
| `organizationId` | `string` | No | Unique identifier for the organization. |
| `folderId` | `string` | No | Unique identifier for the folder. |
#### Document
***
| Property | Type | Required | Description |
| ---------- | ------------------ | -------- | ------------------------------------- |
| `id` | `string` | Yes | Unique identifier for the document |
| `metadata` | `DocumentMetadata` | Yes | Metadata associated with the document |
#### SetDocumentsRequestOptions
***
| Property | Type | Required | Description |
| ---------------- | --------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `organizationId` | `string` | No | Organization ID for the documents |
| `folderId` | `string` | No | Subscribe to all or provided documents in the given folder |
| `locationId` | `string` | No | Filter and subscribe to document data for a specific location |
| `allDocuments` | `boolean` | No | Subscribe to all documents in the folder. Use this when folderId is provided |
| `rootDocumentId` | `string` | No | The unique identifier of the root document. Used to specify the root document when multiple documents are subscribed. |
| `context` | [`SetDocumentsContext`](#setdocumentscontext) | No | Filter comments by custom context fields. Fetches comments matching all provided field values (AND logic across fields). When Permission Provider is enabled with `isContextEnabled: true`, each context value triggers a separate permission request. |
#### FolderMetadata
***
| Property | Type | Required | Description |
| ---------------- | -------- | -------- | ------------------------------------------ |
| `folderId` | `string` | No | Unique identifier for the folder |
| `parentFolderId` | `string` | No | ID of the parent folder |
| `folderName` | `string` | No | Display name of the folder |
| `createdAt` | `number` | No | Timestamp when folder was created |
| `lastUpdated` | `number` | No | Timestamp when folder was last updated |
| `apiKey` | `string` | No | API key associated with the folder |
| `organizationId` | `string` | No | Organization ID that the folder belongs to |
#### CustomCss
***
| Property | Type | Required | Description |
| -------- | ------------------ | -------- | --------------------------------------------------------------------- |
| `type` | 'link' \| 'styles' | Yes | The type of custom CSS, either a link to a CSS file or inline styles. |
| `value` | string | Yes | The value of the custom CSS, either a URL or CSS styles. |
### Debug Info
#### VeltDebugInfo
***
| Property | Type | Required | Description |
| ------------- | -------------------------------------------------------------------- | -------- | ---------------------------------------------- |
| `veltVersion` | `string` | No | The version of the Velt SDK currently running |
| `apiKey` | `string` | No | The API key used to initialize the Velt client |
| `serverMap` | [`DebugInfoMap`](/api-reference/sdk/models/data-models#debuginfomap) | No | Debug information from the server-side state |
| `clientMap` | [`DebugInfoMap`](/api-reference/sdk/models/data-models#debuginfomap) | No | Debug information from the client-side state |
#### DebugInfoMap
***
| Property | Type | Required | Description |
| -------------- | ------------------------------------------------------------------------------------ | -------- | ------------------------------------------------------ |
| `organization` | [`OrganizationMetadata`](/api-reference/sdk/models/data-models#organizationmetadata) | No | Metadata about the current organization |
| `documents` | [`DocumentMetadata[]`](/api-reference/sdk/models/data-models#documentmetadata) | No | Array of document metadata for all active documents |
| `locations` | [`Location[]`](/api-reference/sdk/models/data-models#location) | No | Array of location information for all active locations |
| `folder` | [`FolderMetadata`](/api-reference/sdk/models/data-models#foldermetadata) | No | Metadata about the current folder |
| `user` | [`User`](/api-reference/sdk/models/data-models#user) | No | The currently authenticated user |
## Location
#### Location
| Property | Type | Required | Description |
| --------------- | --------- | -------- | ----------------------------------------------- |
| `id` | `string` | No | Unique identifier for the location. |
| `locationName` | `string` | No | Name of the location. |
| `version` | `Version` | No | Version information provided by the user. |
| `[key: string]` | `any` | No | Additional dynamic properties for the location. |
#### UpdateLocationsRequest
***
| Property | Type | Required | Description |
| ---------------- | ----------------------------- | -------- | ---------------------------------------------- |
| `organizationId` | `string` | No | Unique identifier for the organization. |
| `documentIds` | `string[]` | No | Array of document IDs to update locations for. |
| `locations` | `UpdateLocationMetadata[]` | No | Array of location metadata objects to update. |
#### UpdateLocationMetadata
***
| Property | Type | Required | Description | |
| --------------- | -------- | -------- | ----------------------------------- | ------------------------------------------------------- |
| `id` | `string` | Yes | Unique identifier for the location. | |
| `[key: string]` | \`T | string\` | No | Additional custom properties for the location metadata. |
#### LocationMetadata
***
| Property | Type | Required | Description |
| ------------ | ------------------ | -------- | ------------------------------------------------------------- |
| `locationId` | number | No | Unique location id generated from client location information |
| `location` | `Location` \| null | No | Location object provided by a client |
#### SetLocationsRequestOptions
***
| Property | Type | Required | Description |
| ---------------- | --------- | -------- | ---------------- |
| `rootLocationId` | `string` | No | Root location. |
| `appendLocation` | `boolean` | No | Merge locations. |
# Self Hosting
#### PartialReactionAnnotation
***
| Property | Type | Required | Description |
| -------------- | -------------- | -------- | ----------------------------- |
| `annotationId` | `string` | Yes | ID of the reaction annotation |
| `metadata` | `BaseMetadata` | No | Additional metadata |
| `icon` | `string` | No | Icon for the reaction |
#### ResolverActions
***
An enum that defines the different types of actions that can trigger resolver events.
| Name | Value | Description |
| --------------------------- | ----------------------------- | ------------------------------------------------------ |
| `COMMENT_ANNOTATION_ADD` | `'comment_annotation.add'` | Triggered when a new comment annotation is added |
| `COMMENT_ANNOTATION_DELETE` | `'comment_annotation.delete'` | Triggered when a comment annotation is deleted |
| `COMMENT_ADD` | `'comment.add'` | Triggered when a new comment is added to an annotation |
| `COMMENT_DELETE` | `'comment.delete'` | Triggered when a comment is deleted from an annotation |
| `COMMENT_UPDATE` | `'comment.update'` | Triggered when a comment is updated |
| `REACTION_ADD` | `'reaction.add'` | Triggered when a reaction is added to a comment |
| `REACTION_DELETE` | `'reaction.delete'` | Triggered when a reaction is removed from a comment |
| `ATTACHMENT_ADD` | `'attachment.add'` | Triggered when an attachment is added to a comment |
| `ATTACHMENT_DELETE` | `'attachment.delete'` | Triggered when an attachment is deleted from a comment |
#### PartialComment
***
| Property | Type | Required | Description |
| ------------- | ----------------------------------------------- | -------- | ------------------------------------------------ |
| `commentId` | `string \| number` | Yes | Unique identifier for the comment |
| `commentHtml` | `string` | No | HTML content of the comment |
| `commentText` | `string` | No | Plain text content of the comment |
| `attachments` | `{ [attachmentId: number]: PartialAttachment }` | No | Map of attachment IDs to partial attachment data |
#### PartialCommentAnnotation
***
| Property | Type | Required | Description |
| -------------- | -------------------------------- | -------- | ------------------------------------------- |
| `annotationId` | `string` | Yes | ID of the comment annotation |
| `metadata` | `BaseMetadata` | No | Additional metadata |
| `comments` | `Record` | Yes | Map of comment IDs to partial comments data |
#### PartialAttachment
***
| Property | Type | Required | Description |
| -------------- | -------- | -------- | -------------------------------- |
| `url` | `string` | Yes | URL of the attachment |
| `name` | `string` | Yes | Name of the attachment |
| `attachmentId` | `number` | Yes | Unique identifier for attachment |
#### ResolverAttachment
***
| Property | Type | Required | Description |
| -------------- | ---------------------------- | -------- | -------------------------------- |
| `attachmentId` | `number` | Yes | Unique identifier for attachment |
| `file` | `File` | Yes | File to be uploaded |
| `name` | `string` | No | File name |
| `metadata` | `AttachmentResolverMetadata` | No | Metadata of the attachment |
| `mimeType` | `string` | No | Mime type of the attachment |
#### AttachmentResolverMetadata
***
| Property | Type | Required | Description |
| --------------------- | ---------------- | -------- | ---------------------------- |
| `organizationId` | `string \| null` | Yes | ID of the organization |
| `documentId` | `string \| null` | Yes | ID of the document |
| `folderId` | `string \| null` | No | ID of the folder |
| `attachmentId` | `number \| null` | Yes | ID of the attachment |
| `commentAnnotationId` | `string \| null` | Yes | ID of the comment annotation |
| `apiKey` | `string \| null` | Yes | API key for authentication |
#### VeltDataProvider
***
| Property | Type | Required | Description |
| ------------ | -------------------------------- | -------- | ------------------------------------- |
| `comment` | `CommentAnnotationDataProvider` | No | Provider for comment annotation data |
| `user` | `UserDataProvider` | No | Provider for user data |
| `reaction` | `ReactionAnnotationDataProvider` | No | Provider for reaction annotation data |
| `attachment` | `AttachmentDataProvider` | No | Provider for file attachment data |
#### ResolverConfig
***
| Property | Type | Required | Description |
| -------------------- | -------------------- | -------- | ------------------------------------------------------------------------------------- |
| `resolveTimeout` | `number` | No | Timeout duration (in milliseconds) for resolver operations |
| `saveRetryConfig` | `RetryConfig` | No | Retry configuration for save operations |
| `deleteRetryConfig` | `RetryConfig` | No | Retry configuration for delete operations |
| `getRetryConfig` | `RetryConfig` | No | Retry configuration for get operations. Currently not supported for UserDataProvider. |
| `resolveUsersConfig` | `ResolveUsersConfig` | No | Configuration for resolving users |
#### ResolverResponse
***
Generic response format for backend endpoints and data providers.
**Permission Provider Update (v4.5.8-beta.2)**: For Permission Provider backend endpoints, the `signature` field is no longer required. The SDK now handles validation internally.
| Property | Type | Required | Description |
| ------------ | --------- | -------- | -------------------------------------------------------------------------------- |
| `data` | `T` | No | Response data of generic type T |
| `success` | `boolean` | Yes | Whether the operation was successful. Must be `true` for successful responses |
| `message` | `string` | No | Optional message describing the result |
| `timestamp` | `number` | No | Optional timestamp of the response |
| `statusCode` | `number` | Yes | HTTP status code. Must be `200` for Velt to accept the response |
| `signature` | `string` | No | Cryptographic signature (deprecated for Permission Provider as of v4.5.8-beta.2) |
#### RetryConfig
***
| Property | Type | Required | Description |
| ----------------- | --------- | -------- | -------------------------------------------- |
| `retryCount` | `number` | No | Number of retry attempts |
| `retryDelay` | `number` | No | Delay between retry attempts in milliseconds |
| `revertOnFailure` | `boolean` | No | Whether to revert changes on failure |
#### ResolveUsersConfig
***
| Property | Type | Required | Description |
| -------------- | --------- | -------- | ------------------------------------- |
| `organization` | `boolean` | No | Whether to resolve organization users |
| `folder` | `boolean` | No | Whether to resolve folder users |
| `document` | `boolean` | No | Whether to resolve document users |
#### CommentAnnotationDataProvider
***
| Property | Type | Required | Description |
| -------- | ------------------------------------------------------------------------------------------------------------- | -------- | -------------------------------------- |
| `get` | `(request: GetCommentResolverRequest) => Promise>>` | Yes | Function to fetch comment annotations |
| `save` | `(request: SaveCommentResolverRequest) => Promise>` | Yes | Function to save comment annotations |
| `delete` | `(request: DeleteCommentResolverRequest) => Promise>` | Yes | Function to delete comment annotations |
| `config` | `ResolverConfig` | No | Configuration for the data provider |
#### ReactionAnnotationDataProvider
***
| Property | Type | Required | Description |
| -------- | --------------------------------------------------------------------------------------------------------------- | -------- | --------------------------------------- |
| `get` | `(request: GetReactionResolverRequest) => Promise>>` | Yes | Function to fetch reaction annotations |
| `save` | `(request: SaveReactionResolverRequest) => Promise>` | Yes | Function to save reaction annotations |
| `delete` | `(request: DeleteReactionResolverRequest) => Promise>` | Yes | Function to delete reaction annotations |
| `config` | `ResolverConfig` | No | Configuration for the data provider |
#### UserDataProvider
***
| Property | Type | Required | Description |
| -------- | ------------------------------------------------------ | -------- | --------------------------------------- |
| `get` | `(userIds: string[]) => Promise>` | Yes | Function to fetch user data by user IDs |
| `config` | `ResolverConfig` | No | Configuration for the data provider |
#### AttachmentDataProvider
***
| Property | Type | Required | Description |
| -------- | --------------------------------------------------------------------------------------------------- | -------- | ----------------------------------- |
| `save` | `(request: SaveAttachmentResolverRequest) => Promise>` | Yes | Function to save attachment data |
| `delete` | `(request: DeleteAttachmentResolverRequest) => Promise>` | Yes | Function to delete attachment data |
| `config` | `ResolverConfig` | No | Configuration for the data provider |
#### SaveAttachmentResolverData
***
| Property | Type | Required | Description |
| -------- | -------- | -------- | --------------------------- |
| `url` | `string` | Yes | URL of the saved attachment |
# Presence
#### PresenceUser
***
| Property | Type | Required | Description |
| ------------------ | ------------------ | -------- | --------------------------------------------------------------------------------------------------------------------- |
| `userId` | `string` | Yes | Unique user identifier |
| `name` | `string` | No | User's full name (Default: Random avatar name) |
| `email` | `string` | No | User's email address |
| `photoUrl` | `string` | No | User's display picture URL (Default: Random avatar image) |
| `onlineStatus` | `string` | Yes | Online status (active, away, offline) (Auto generated) |
| `color` | `string` | No | Assigned color for the user (Auto generated) |
| `timestamp` | `any` | Yes | Server Timestamp |
| `type` | `string` | No | User type |
| `selections` | `any` | No | User selections |
| `documentParamsId` | `number \| null` | No | Deprecated unique document params ID |
| `documentParams` | `object \| null` | No | Deprecated document params |
| `locationId` | `number \| null` | No | Unique location ID |
| `location` | `Location \| null` | No | Location of user on sub document |
| `isReadOnly` | `boolean` | No | Indicates if user is readonly |
| `isAnonymous` | `boolean` | No | If user can only view comments (Anonymous) |
| `pageInfo` | `PageInfo` | Yes | Information about the page |
| `isUserIdle` | `boolean` | No | Indicates if user is idle. This is based on the `inactivityTime` configured in the Presence feature. (Auto generated) |
| `isTabAway` | `boolean` | No | Indicates if user's tab is unfocused. (Auto generated) |
#### PresenceUserStateChangeEvent
***
This event object is emitted when a user's online status changes to online.
| Property | Type | Required | Description |
| -------- | -------------- | -------- | ----------------------------------------------------------------------- |
| `user` | `PresenceUser` | Yes | The current user's Presence object. |
| `state` | `string` | Yes | The new presence state of the user (e.g., `online`, `offline`, `away`). |
#### ENUMs
| Enum Name | Event Type | Description |
| ------------------- | ----------------- | ------------------------------------------------------------------------- |
| `USER_STATE_CHANGE` | `userStateChange` | Triggered when a user's online status changes to online, offline, or away |
#### PresenceRequestQuery
***
| Property | Type | Required | Description |
| ---------------- | ---------- | -------- | ---------------------------------------------------------------------------- |
| `documentId` | `string` | No | ID of the document to query presence for. |
| `organizationId` | `string` | No | ID of the organization to query presence for. |
| `statuses` | `string[]` | No | Array of user statuses to filter by (e.g., `['online', 'away', 'offline']`). |
#### GetPresenceDataResponse
***
| Property | Type | Required | Description |
| -------- | ------------------------ | -------- | ---------------------------------------------------------------------------------------------------------- |
| `data` | `PresenceUser[] \| null` | Yes | Array of [PresenceUser](/api-reference/sdk/models/data-models#presenceuser) objects. `null` while loading. |
#### HeartbeatConfig
***
| Property | Type | Required | Description |
| -------- | -------- | -------- | ----------------------------------------------------------------------------------------------------- |
| `userId` | `string` | No | User ID to retrieve heartbeat data for. If not provided, returns heartbeat data for the current user. |
#### GetHeartbeatResponse
***
| Property | Type | Required | Description |
| -------- | --------------------- | -------- | ----------------------------------------------------------------------------------------------- |
| `data` | `Heartbeat[] \| null` | Yes | Array of heartbeat data for the specified user. Returns null if no heartbeat data is available. |
# Webhooks
#### WebhookV2Payload
***
| Property | Type | Required | Description |
| ------------ | --------------------------------- | -------- | ------------------------------------------------------- |
| `event` | `string` | Yes | The event type that triggered the webhook. |
| `actionType` | `string` | Yes | The specific action that occurred. |
| `source` | `string` | Yes | The source of the event. |
| `data` | `CommentPayload \| HuddlePayload` | Yes | The payload data containing event-specific information. |
| `webhookId` | `string` | Yes | Unique identifier for the webhook. |
#### WebhookV2PayloadEncoded
***
| Property | Type | Required | Description |
| ---------------- | -------- | -------- | ------------------------------- |
| `encodedPayload` | `string` | Yes | Base64 encoded webhook payload. |
#### WebhookV2PayloadEncrypted
***
| Property | Type | Required | Description |
| --------------- | -------- | -------- | ------------------------------------- |
| `encryptedData` | `string` | Yes | Encrypted webhook data. |
| `encryptedKey` | `string` | Yes | Encrypted encryption key. |
| `iv` | `string` | Yes | Initialization vector for decryption. |
#### WebhookV1Payload (Comment Events)
***
| Property | Type | Required | Description |
| -------------------- | ------------------- | -------- | ---------------------------------------------------------------------------------- |
| `webhookId` | `string` | Yes | Unique identifier for the webhook. |
| `commentAnnotation` | `CommentAnnotation` | Yes | The comment annotation associated with the event. |
| `targetComment` | `Comment` | No | The target comment for the event. |
| `actionType` | `string` | No | The specific action that occurred in the event. |
| `notificationSource` | `string` | No | Indicates the source of the notification (if applicable). |
| `metadata` | `Metadata` | No | Additional metadata providing context for the event. |
| `actionUser` | `User` | No | The user who performed the action. |
| `newPriority` | `CommentPriority` | No | New priority of the comment, provided for priority change events. |
| `platform` | `'sdk'` | No | Set to `'sdk'` if the event originated from SDK actions. |
| `oldStatus` | `CommentStatus` | No | Previous status of the comment, used for status change events. |
| `newStatus` | `CommentStatus` | No | New status of the comment, used for status change events. |
| `assigned` | `boolean` | No | Indicates whether the comment is currently assigned to a user (`true` or `false`). |
#### CommentPayload
***
| Property | Type | Required | Description |
| ------------------- | ------------------- | -------- | ---------------------------------------------------------- |
| `commentAnnotation` | `CommentAnnotation` | No | The comment annotation associated with the event. |
| `targetComment` | `Comment` | No | The target comment for the event. |
| `actionUser` | `User` | No | The user who performed the action. |
| `metadata` | `Metadata` | No | Additional metadata about the event context. |
| `oldStatus` | `CommentStatus` | No | Previous status of the comment (for status change events). |
| `newStatus` | `CommentStatus` | No | New status of the comment (for status change events). |
| `newPriority` | `CommentPriority` | No | New priority of the comment (for priority change events). |
#### HuddlePayload
***
| Property | Type | Required | Description |
| ------------ | ---------- | -------- | -------------------------------------------- |
| `actionUser` | `User` | No | The user who performed the action. |
| `metadata` | `Metadata` | No | Additional metadata about the event context. |
# Misc
#### RequestOptions
***
| Property | Type | Required | Description |
| ------------ | -------- | -------- | ----------- |
| `documentId` | `string` | No | Document ID |
#### CommentSelectionChangeData
***
| Property | Type | Required | Description |
| ------------ | ------------------- | -------- | -------------------------------------- |
| `selected` | `boolean` | Yes | Whether a comment is selected |
| `annotation` | `CommentAnnotation` | Yes | Object data of the selected annotation |
#### ContactListScopeForOrganizationUsers Enum
***
| Enum Name | Event Type | Description |
| ------------------------- | ----------------------- | ------------------------------ |
| `ALL` | `all` | Show all the contacts |
| `ORGANIZATION` | `organization` | Show organization contacts. |
| `ORGANIZATION_USER_GROUP` | `organizationUserGroup` | Show organization user groups. |
| `DOCUMENT` | `document` | Show document contacts. |
#### CursorUser
***
| Property | Type | Required | Description |
| -------------- | ------------------------ | -------- | --------------------------------------------------------------------------------------- |
| `userId` | `string` | Yes | Unique user identifier that you use to identify your user. |
| `name` | `string` | No | Your user's full name. Default: Random avatar name. |
| `email` | `string` | No | Your user's email address. |
| `photoUrl` | `string` | No | Your user's display picture URL. Default: Random avatar image. |
| `comment` | `string` | No | Short comment that user can add to their live cursor. |
| `onlineStatus` | `string` | Yes | User's online status (active, inactive, offline). Auto generated. |
| `color` | `string` | No | A random color assigned to the user for the session, used on avatar border/live cursor. |
| `timestamp` | `any` | Yes | Server Timestamp. |
| `type` | `string` | No | User type. |
| `locationId` | `number \| null` | No | Unique location id from provided location. |
| `location` | `Location \| null` | No | Location to identify user on sub document. |
| `position` | `CursorPosition \| null` | No | User's cursor position on their screen. |
| `isReadOnly` | `boolean` | No | Indicates if user is readonly. |
| `isAnonymous` | `boolean` | No | Indicates if user is anonymous and can only view comments. |
#### FlockOptions
***
| Property | Type | Required | Description |
| -------------------------- | ------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `useHistoryAPI` | `boolean` | Yes | Indicates whether the application should use the HTML5 History API for navigation |
| `onNavigate` | `(url: PageInfo) => void` | No | A callback function that is called when navigation occurs. It takes a `PageInfo` object as its argument, which contains details about the new page |
| `disableDefaultNavigation` | `boolean` | Yes | If `true`, the application's default navigation handling is disabled, perhaps to be managed manually or by another system |
| `darkMode` | `boolean` | Yes | A flag indicating whether the application should display in dark mode, a display preference that may be more comfortable for users in low-light conditions |
#### Version
***
| Property | Type | Required | Description |
| -------- | ------ | -------- | --------------------------------- |
| `id` | string | Yes | Unique identifier for the version |
| `name` | string | Yes | Name of the version |
#### displayHeadlineMessageTemplateData
***
| Property | Type | Required | Description |
| --------------- | -------- | -------- | --------------------------------------- |
| `actionUser` | `User` | No | The user who performed the action |
| `recipientUser` | `User` | No | The user receiving the notification |
| `actionMessage` | `string` | No | The message describing the action |
| `project` | `string` | No | The project related to the notification |
| `[key: string]` | `any` | No | Any additional custom properties |
#### PageInfo
***
| Property | Type | Required | Description |
| ------------- | -------- | -------- | -------------------------------------- |
| `url` | `string` | No | URL of the webpage |
| `path` | `string` | No | Path of the webpage excluding base url |
| `baseUrl` | `string` | No | Base URL (domain) of a webpage |
| `title` | `string` | No | Title of the webpage |
| `commentUrl` | `string` | No | Reference url of a comment annotation |
| `recorderUrl` | `string` | No | Reference url of a recorder annotation |
| `screenWidth` | `number` | No | User's screen width. Auto generated. |
#### `getThumbnailTag` Method
The `getThumbnailTag` method takes an optional `url` parameter and returns an HTML string. It creates an anchor tag linking to the `videoPlayerUrl` and embeds an image tag using either the provided `url`, `thumbnailWithPlayIconUrl`, or `thumbnailUrl` (in that order of preference).
#### RewriterAnnotation
***
| Property | Type | Required | Description |
| ------------------------ | ----------------------- | -------- | ------------------------------------------------------------------------------------- |
| `annotationId` | String | Yes | Unique identifier for the rewriter annotation, automatically generated. |
| `from` | `User` | Yes | The user who created this rewriter annotation. |
| `color` | String | No | Color used for the rewriter annotation. |
| `lastUpdated` | Any | No | Timestamp when the rewriter annotation was last updated, automatically generated. |
| `documentParamsId` | Number \| null | No | Unique document params ID, deprecated, use `locationId` instead. |
| `documentParams` | `Location` \| null | No | Document params to identify user on sub document, deprecated, use `location` instead. |
| `locationId` | Number \| null | No | Unique location ID generated from provided location. |
| `location` | Location \| null | No | Set location to identify user on sub document. |
| `type` | String | No | Type of annotation. |
| `rewriterType` | String | Yes | Type of rewriter for the annotation, either 'generic' or 'copywriter'. |
| `targetTextRange` | TargetTextRange \| null | No | Selected text range of rewriter annotation. |
| `annotationIndex` | Number | No | Index of the current annotation in the list of annotations. |
| `pageInfo` | `PageInfo` | No | Information about the page where the annotation is made. |
| `selectedRewriterOption` | String | No | Selected rewriter option used in the annotation. |
#### SyncVideoPlayer
***
| Property | Type | Required | Description |
| ------------------ | -------------------- | -------- | ----------------------------------------------------- |
| `playerId` | String | No | The identifier for the video player instance. |
| `src` | String | No | The source URL of the video. |
| `sources` | String\[] | No | An array of source URLs for the video. |
| `lastUpdated` | Number | No | The timestamp of when the player was last updated. |
| `lastUpdatedBy` | `User` | No | The user who last updated the player. |
| `lastUpdatedEvent` | String | No | The name of the event that triggered the last update. |
| `playerState` | SyncVideoPlayerState | Yes | The state object of the video player. |
#### SyncVideoPlayerState
***
| Property | Type | Required | Description |
| ------------- | ------- | -------- | -------------------------------------------- |
| `playing` | Boolean | No | Indicates if the video is currently playing. |
| `currentTime` | Number | No | The current playback time of the video. |
| `muted` | Boolean | No | Indicates if the video is muted. |
| `volume` | Number | No | The volume level of the video. |
| `speed` | Number | No | The playback rate of the video. |
#### Toast
***
| Property | Type | Required | Default Value | Description |
| ---------- | -------------------- | -------- | ------------- | ------------------------------------------------------------------------ |
| `id` | Number | No | None | A unique identifier for the toast notification. |
| `message` | String | Yes | None | The message content displayed in the toast notification. |
| `type` | 'success' \| 'error' | Yes | None | The type of toast notification, indicating success or error. |
| `duration` | Number | No | 3000 | The length of time the toast notification is displayed, in milliseconds. |
#### Transcription
***
| Property | Type | Required | Description |
| ------------------ | ------ | -------- | ----------------------------------------------------- |
| `from` | User | Yes | The user who created the transcription. |
| `lastUpdated` | Number | No | Timestamp of when the transcription was last updated. |
| `transcriptedText` | String | No | The text that has been transcribed. |
#### User
***
| Property | Type | Required | Description |
| ---------------- | -------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `userId` | string | Yes | Unique user identifier used to identify your user. |
| `name` | string | No | The full name of your user. Defaults to a random avatar name if not provided. |
| `photoUrl` | string | No | The display picture URL of your user. Defaults to a random avatar image if not provided. |
| `email` | string | No | Required for sending email or Slack notifications to users about comments and mentions. |
| `plan` | string | No | The product plan the user is on. |
| `organizationId` | string | Yes | organizationId to which the user belongs. |
| `color` | string | No | A color assigned to the user for the current session, used for avatar border, live cursor, selection etc. |
| `textColor` | string | No | Used in the text color of the user's intial when photoUrl is not present. |
| `type` | string | No | The type of user. |
| `isReadOnly` | boolean | No | Indicates if the user has read-only access. |
| `isAnonymous` | boolean | No | Indicates if the user is anonymous and can only view comments. |
| `isGuest` | boolean | No | Indicates if the user is a guest. |
| `isAdmin` | boolean | No | Use this to set the user as an admin. You also need to ensure that the jwt token you generate also has this property set to true. |
| `groupId` | string | No | \[DEPRECATED] A domain name or identifier used to cluster a group of users who work together. |
| `clientGroupId` | string | No | \[DEPRECATED] The original groupId provided by the user. |
| `initial` | string | No | First letter of the user's first name. |
| `accessRole` | "viewer" \| "editor" | No | Optional access role for this resource. Allowed values: “viewer” \| “editor”. Default: "editor". |
**Access Control**
* Set `accessRole` to `viewer` (read-only) or `editor` (read/write) on each resource to define the user's capabilities for that resource.
* `accessRole` can only be set via the v2 Users and Auth Permissions REST APIs. Frontend SDK methods do not accept or change `accessRole`.
* Relevant endpoints: `/v2/users/add`, `/v2/users/update`, `/v2/auth/permissions/add`, `/v2/auth/generate_token`.
* See the [Access Control overview](/key-concepts/overview#access-control) for concepts and detailed guidance.
#### UserOptions
***
| Property | Type | Required | Description |
| ----------------- | ------- | -------- | ---------------------------------------------------------------------------------------------- |
| `replaceContacts` | boolean | No | If set to true, it will replace the user's personal and group contacts with the ones provided. |
| `authToken` | string | No | The authentication token of the user. |
#### UserContactSelectedPayload
***
| Property | Type | Required | Description |
| ----------------------- | ----------- | -------- | ------------------------------------- |
| `contact` | UserContact | Yes | Selected user contact details. |
| `isOrganizationContact` | boolean | Yes | Is user part of organization contact. |
| `isDocumentContact` | boolean | Yes | Is user part of document contact. |
| `documentAccessType` | string | Yes | Document access type. |
#### UserContactUs
***
| Property | Type | Required | Description |
| ------------- | ------------------------ | -------- | ------------------------------------------------ |
| `id` | string | No | Unique identifier of the feedback. |
| `apiKey` | string \| null | No | API key of the client. |
| `emailId` | string | No | Email address of the feedback provider. |
| `message` | string | No | Content of the user's feedback message. |
| `from` | User \| null | No | User who submitted the feedback. |
| `lastUpdated` | any | No | Timestamp of when the feedback was last updated. |
| `metadata` | DocumentMetadata \| null | No | Metadata associated with the document. |
| `pageInfo` | PageInfo | No | Information about the user's current page. |
#### UserFeedback
***
| Property | Type | Required | Description |
| ------------- | ------------------------ | -------- | ------------------------------------------------ |
| `id` | string | No | Unique identifier of the feedback. |
| `apiKey` | string \| null | No | API key of the client. |
| `emailId` | string | No | Email address of the feedback provider. |
| `message` | string | No | Content of the user's feedback message. |
| `from` | User \| null | No | User who submitted the feedback. |
| `lastUpdated` | any | No | Timestamp of when the feedback was last updated. |
| `metadata` | DocumentMetadata \| null | No | Metadata associated with the document. |
| `pageInfo` | PageInfo | No | Information about the user's current page. |
#### UnreadCommentsCount
***
| Property | Type | Required | Description |
| -------- | -------- | -------- | ----------------------------------------- |
| `count` | `number` | Yes | The number of unread comments or threads. |
#### UserGroup
***
| Property | Type | Required | Description |
| ----------- | -------- | -------- | ---------------------------------------- |
| `groupId` | `string` | Yes | Unique identifier for the user group |
| `groupName` | `string` | Yes | Display name of the user group |
| `users` | `User[]` | No | Array of users that belong to this group |
#### VeltResetButtonStateConfig
***
| Property | Type | Required | Description |
| -------- | -------- | -------- | ------------------------------------------------------------------------------- |
| `id` | `string` | No | The ID of the button to reset. If not provided, resets all buttons |
| `group` | `string` | No | The group ID of buttons to reset. If not provided, resets buttons in all groups |
#### VeltAuthProvider
***
| Property | Type | Required | Description |
| --------------- | ----------------------------------------------- | -------- | ------------------------------------------------------------------------------------------- |
| `user` | `User` | Yes | The user object to authenticate. |
| `options` | `Options` | No | Additional options for authentication (e.g., `authToken`, `forceReset`). |
| `retryConfig` | `{ retryCount?: number; retryDelay?: number; }` | No | Configuration for retrying token generation (number of retries and delay in ms). |
| `generateToken` | `() => Promise` | No | Async function to generate a Velt JWT token. Called automatically when a token is required. |
#### AuthRetryConfig
***
| Property | Type | Required | Description |
| ------------ | -------- | -------- | ----------------------------------------------------- |
| `retryCount` | `number` | No | Number of times to retry token generation on failure. |
| `retryDelay` | `number` | No | Delay in milliseconds between retry attempts. |
#### RevokeAccessOn
***
Configuration for automatic access revocation triggers.
| Property | Type | Required | Description |
| -------------------------- | ----------------------------------------- | -------- | -------------------------------------------------------------------------------------- |
| `type` | [RevokeAccessOnType](#revokeaccessontype) | Yes | Type of trigger that will revoke access. Options: `document_unset` or `user_logout` |
| `revokeOrganizationAccess` | `boolean` | No | Whether to also revoke organization-level permissions when triggered. Default: `false` |
#### RevokeAccessOnType
***
Enum specifying when to automatically revoke permissions.
| Value | Description |
| ---------------- | ---------------------------------------------------- |
| `DOCUMENT_UNSET` | Revoke access when user unsets or leaves a document |
| `USER_LOGOUT` | Revoke access when user logs out of the organization |
#### PermissionSource
***
Enum identifying which SDK method triggered the permission check. This helps debug and trace permission request origins.
| Value | Description |
| ------------------- | ----------------------------------------------------- |
| `SET_DOCUMENTS` | Permission check triggered by `setDocuments()` method |
| `IDENTIFY` | Permission check triggered by `identify()` method |
| `GET_NOTIFICATIONS` | Permission check triggered by notifications fetching |
| `SET_NOTIFICATIONS` | Permission check triggered by notifications setting |
#### PermissionResourceType
***
Enum defining the types of resources that can be validated through Permission Provider. Used in permission queries to identify the resource type being accessed.
| Value | Description |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `ORGANIZATION` | `organization`: Organization-level resource permissions |
| `DOCUMENT` | `document`: Document-level resource permissions |
| `LOCATION` | `location`: Location-specific resource permissions within a document |
| `CONTEXT` | `context`: Context-based resource permissions. Added in v4.5.8-beta.4 for granular context-level access control when `isContextEnabled: true` |
#### VeltPermissionProvider
***
Configuration interface for Permission Provider. Velt validates access requests in real-time by querying your backend endpoint configured in the [Velt Console](https://console.velt.dev). The SDK automatically handles permission caching, validation, and synchronization.
| Property | Type | Required | Description |
| ------------------ | ------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `isContextEnabled` | `boolean` | No | Enable context-based permission requests. When enabled, the backend receives individual permission requests for each context value when using context filtering. Default: `false`. Added in v4.5.8-beta.4. |
| `retryConfig` | [AuthRetryConfig](#authretryconfig) | No | Configuration for retrying failed permission requests. Defaults to 3 retries with 2000ms delay. |
| `forceRefresh` | `boolean` | No | Set to `true` if access control changes frequently. Forces re-validation on each access check in the current session. Default: `false` |
| `revokeAccessOn` | [RevokeAccessOn\[\]](#revokeaccesson) | No | Configure automatic access revocation triggers. Revokes permissions when specified events occur (e.g., document unset or user logout). |
#### PermissionQuery
***
Request structure for permission queries sent to the Permission Provider.
| Property | Type | Required | Description |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `userId` | `string` | Yes | ID of the user requesting access to the resource. |
| `resource` | `{ type:` [PermissionResourceType](#permissionresourcetype)`; id: string; source:` [PermissionSource](#permissionsource)`; organizationId: string; context?:` [Context](#context) `}` | Yes | Resource the user is requesting access to. The `type` uses [`PermissionResourceType`](#permissionresourcetype) enum. The `source` field identifies which SDK method triggered the permission check. The optional `context` field is present only when `isContextEnabled: true` and contains the specific context value being validated. Includes `organizationId` for context. |
#### PermissionResult
***
Individual permission decision for a user's access to a specific resource.
| Property | Type | Required | Description |
| ---------------- | ----------------------------------------------------- | -------- | --------------------------------------------------------------------------------------------- |
| `userId` | `string` | Yes | Unique identifier of the user requesting access. |
| `resourceId` | `string` | Yes | Unique identifier of the resource being accessed. |
| `type` | [PermissionResourceType](#permissionresourcetype) | Yes | Type of resource being accessed. Can be `organization`, `document`, `location`, or `context`. |
| `organizationId` | `string` | Yes | Organization ID associated with the resource. |
| `accessRole` | [UserPermissionAccessRole](#userpermissionaccessrole) | No | Access role granted to the user for this resource. |
| `expiresAt` | `number` | No | Unix timestamp (in milliseconds) when the permission expires. |
| `hasAccess` | `boolean` | Yes | Whether the user has access to the requested resource. |
#### SignatureResult
***
Response structure returned from the [Generate Signature API](/api-reference/rest-apis/v2/auth/generate-signature).
| Property | Type | Required | Description |
| ----------------------- | -------- | -------- | ------------------------------------------- |
| `result.status` | `string` | Yes | Status of the response. Always `"success"`. |
| `result.message` | `string` | Yes | Success message. |
| `result.data.signature` | `string` | Yes | Generated authorization signature string. |
**Example:**
```json theme={null}
{
"result": {
"status": "success",
"message": "Signature generated successfully.",
"data": {
"signature": "03638f2191bf59c0e536e5b31cbde86df5f44b03fc8e82ee9a8bed7eb324f252"
}
}
}
```
#### PermissionData
***
Individual permission decision for a user-resource pair.
| Property | Type | Required | Description |
| ------------ | ------------------------------------------ | -------- | --------------------------------------------------------------------------------------------------------------------------- |
| `userId` | `string` | Yes | ID of the user this permission applies to. |
| `resourceId` | `string` | Yes | ID of the resource (document, folder, or organization). |
| `type` | `'document' \| 'folder' \| 'organization'` | Yes | Type of the resource. |
| `hasAccess` | `boolean` | Yes | Whether the user has access to the resource. |
| `accessRole` | `'viewer' \| 'editor'` | No | Access role for the user. Only applicable for document resources. `viewer` can view and comment, `editor` can edit content. |
| `expiresAt` | `number` | No | UTC timestamp in milliseconds when this permission expires. Velt will revalidate access after expiration. |
#### Context
***
The `Context` interface is used in Permission Provider backend requests for context-based permission validation. Each context value is sent as an individual permission request.
| Property | Type | Required | Description |
| -------- | ------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `access` | `{ [key: string]: string \| number }` | Yes | Key-value pairs for context-based permissions. Keys are custom field names, values are single strings or numbers representing the specific context value being validated. |
**Usage:** The `Context` interface is used in:
* Backend Permission Provider requests when `isContextEnabled: true`
* Each context value from frontend methods triggers a separate permission request with this format
**Integration with Permission Provider:**
When you enable context-based permissions (`isContextEnabled: true`), Velt automatically converts array values from [`SetDocumentsContext`](#setdocumentscontext) into individual permission requests using the `Context` interface format.
#### SetDocumentsContext
***
The `SetDocumentsContext` interface is used for filtering comments and notifications based on custom context fields when calling frontend SDK methods. This enables precise filtering based on your application's data model.
| Property | Type | Required | Description |
| -------- | -------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `access` | `{ [key: string]: Array }` | Yes | Key-value pairs for filtering. Keys are custom field names, values are arrays of strings or numbers to filter by. Multiple values in an array use OR logic. |
**Usage:** The `SetDocumentsContext` interface is used in:
* `setDocuments()` method to fetch comments filtered by context
* `identify()` method to filter notifications by context
* Frontend SDK methods that require context filtering
**Filtering Logic:**
* **Within a field (OR logic)**: When multiple values are provided for a single field, comments/notifications matching any value are returned
* **Across fields (AND logic)**: When multiple fields are provided, comments/notifications must match all field values
**Permission Provider Integration:**
When Permission Provider is enabled with `isContextEnabled: true`, each value in the arrays is sent as a separate permission request to your backend using the [`Context`](#context) interface format. This allows granular access control at the context value level.
#### Options
***
| Property | Type | Required | Description |
| ------------ | --------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `authToken` | `string` | No | The authentication token for the user. |
| `forceReset` | `boolean` | No | If true, forces the user to re-login. |
| `context` | [`SetDocumentsContext`](#setdocumentscontext) | No | Filter notifications by custom context fields. Fetches notifications matching any of the provided values (OR logic within a field). When Permission Provider is enabled with `isContextEnabled: true`, each context value triggers a separate permission request. |
# React Flow Collaboration
#### VeltReactFlowCrdtExtensionConfig
***
Configuration for the `useVeltReactFlowCrdtExtension` React hook.
| Property | Type | Required | Description |
| -------------- | -------- | -------- | ------------------------------------------------------------------- |
| `editorId` | `string` | Yes | Unique document identifier for synchronization. |
| `initialNodes` | `Node[]` | Yes | Initial set of nodes. Applied only when no server-side data exists. |
| `initialEdges` | `Edge[]` | Yes | Initial set of edges. Applied only when no server-side data exists. |
| `debounceMs` | `number` | No | Debounce time for update propagation in milliseconds. |
#### VeltReactFlowCrdtExtensionResponse
***
Interface extending [`VeltReactFlowAppState`](#appstate).
| Property | Type | Description |
| --------------- | ------------------------- | -------------------------------------- |
| `store` | `Store` | ReactFlow CRDT store instance. |
| `nodes` | `Node[]` | Array of nodes in the flow diagram. |
| `edges` | `Edge[]` | Array of edges connecting the nodes. |
| `onNodesChange` | `OnNodesChange` | Callback for handling node changes. |
| `onEdgesChange` | `OnEdgesChange` | Callback for handling edge changes. |
| `onConnect` | `OnConnect` | Callback for handling new connections. |
| `setNodes` | `(nodes: Node[]) => void` | Function to set all nodes at once. |
| `setEdges` | `(edges: Edge[]) => void` | Function to set all edges at once. |
#### VeltReactFlowStoreConfig
***
| Property | Type | Required | Description |
| -------------- | -------- | -------- | ------------------------------------------------------------------- |
| `editorId` | `string` | Yes | Unique ID for this collaborative React Flow instance. |
| `veltClient` | `Velt` | Yes | Client from `useVeltClient()` for auth/session and syncing. |
| `initialNodes` | `Node[]` | Yes | Initial set of nodes. Applied only when no server-side data exists. |
| `initialEdges` | `Edge[]` | Yes | Initial set of edges. Applied only when no server-side data exists. |
| `debounceMs` | `number` | No | Debounce time for updates (milliseconds). |
#### AppState
***
| Property | Type | Description |
| --------------- | ------------------------- | -------------------------------------- |
| `nodes` | `Node[]` | Array of nodes in the flow diagram. |
| `edges` | `Edge[]` | Array of edges connecting the nodes. |
| `onNodesChange` | `OnNodesChange` | Callback for handling node changes. |
| `onEdgesChange` | `OnEdgesChange` | Callback for handling edge changes. |
| `onConnect` | `OnConnect` | Callback for handling new connections. |
| `setNodes` | `(nodes: Node[]) => void` | Function to set all nodes at once. |
| `setEdges` | `(edges: Edge[]) => void` | Function to set all edges at once. |
#### Node (React Flow)
***
| Property | Type | Required | Description |
| ---------- | -------------------------- | -------- | -------------------------------------------- |
| `id` | `string` | Yes | Unique node identifier. |
| `type` | `string` | No | React Flow node type (e.g., `"input"`). |
| `data` | `{ label?: string }` | No | Freeform node data (label used in examples). |
| `position` | `{ x: number; y: number }` | Yes | Canvas position in px. |
| `origin` | `[number, number]` | No | Optional anchor origin used in examples. |
#### Edge (React Flow)
***
| Property | Type | Required | Description |
| -------- | -------- | -------- | --------------- |
| `id` | `string` | Yes | Unique edge id. |
| `source` | `string` | Yes | Source node id. |
| `target` | `string` | Yes | Target node id. |
#### NodeChange
***
| Property | Type | Required | Description |
| -------- | ------------------------------- | --------------- | ----------------------------- |
| `type` | `'add' \| 'update' \| 'remove'` | Yes | Kind of change. |
| `item` | `Node` | Yes (for `add`) | Node to add (as in examples). |
#### EdgeChange
***
| Property | Type | Required | Description |
| -------- | ------------------------------- | --------------- | ----------------------------- |
| `type` | `'add' \| 'update' \| 'remove'` | Yes | Kind of change. |
| `item` | `Edge` | Yes (for `add`) | Edge to add (as in examples). |
#### Connection
***
| Property | Type | Required | Description |
| -------- | -------- | -------- | -------------------------------------- |
| `source` | `string` | Yes | Source node id. |
| `target` | `string` | Yes | Target node id. |
| *…* | *varies* | No | Other React Flow fields as applicable. |
#### ConnectionState (used in onConnectEnd)
***
| Property | Type | Required | Description |
| ---------- | ---------------- | -------- | -------------------------------------------- |
| `isValid` | `boolean` | Yes | Whether the provisional connection is valid. |
| `fromNode` | `{ id: string }` | Yes | Node the drag originated from. |
# CodeMirror Collaboration
#### VeltCodeMirrorCrdtExtensionConfig
***
Configuration for the `useVeltCodeMirrorCrdtExtension` React hook.
| Property | Type | Required | Description |
| ---------------- | -------- | -------- | -------------------------------------------------------------------------- |
| `editorId` | `string` | Yes | Unique document identifier for synchronization. |
| `initialContent` | `string` | No | Initial CodeMirror document. Applied only when no server-side data exists. |
| `debounceMs` | `number` | No | Debounce time for update propagation in milliseconds. |
#### VeltCodeMirrorCrdtExtensionResponse
***
Response returned by `useVeltCodeMirrorCrdtExtension`.
| Property | Type | Description |
| ----------- | ----------------------------- | ----------------------------------------------------- |
| `store` | `VeltCodeMirrorStore \| null` | CodeMirror CRDT store instance. |
| `isLoading` | `boolean` | `false` once store is initialized, `true` by default. |
#### VeltCodeMirrorStoreConfig
***
| Property | Type | Required | Description |
| ---------------- | -------- | -------- | --------------------------------------------------------------------- |
| `editorId` | `string` | Yes | Unique document identifier for synchronization. |
| `veltClient` | `Velt` | Yes | Velt client for Velt SDK integration. |
| `initialContent` | `string` | No | Initial editor content. Applied only when no server-side data exists. |
| `debounceMs` | `number` | No | Debounce time for updates (milliseconds). |
# BlockNote Collaboration
#### VeltBlockNoteCrdtExtensionConfig
***
Configuration for the `useVeltBlockNoteCrdtExtension` React hook.
| Property | Type | Required | Description |
| ---------------- | -------- | -------- | ----------------------------------------------------- |
| `editorId` | `string` | Yes | Unique document identifier for synchronization. |
| `initialContent` | `string` | No | Initial BlockNote document (JSON string of blocks). |
| `debounceMs` | `number` | No | Debounce time for update propagation in milliseconds. |
#### VeltBlockNoteCrdtExtensionResponse
***
Response returned by `useVeltBlockNoteCrdtExtension`.
| Property | Type | Description |
| --------------------- | --------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| `collaborationConfig` | `{ fragment: any; provider: any; user: { name: string; color: string } } \| null` | Configuration object to pass into BlockNote’s `useCreateBlockNote({ collaboration })`. |
| `store` | `VeltBlockNoteStore \| null` | BlockNote CRDT store instance. |
| `isLoading` | `boolean` | `false` once store is initialized, `true` by default. |
#### VeltBlockNoteStoreConfig
***
Configuration for creating a BlockNote collaboration store.
| Property | Type | Required | Description |
| ------------------- | ------------------------ | -------- | ---------------------------------------------------------------------------------------- |
| `editorId` | string | Yes | Unique document identifier used for syncing. |
| `initialContent` | string | No | JSON string representing an array of blocks to seed the doc (parsed into Y.XmlFragment). |
| `collection` | string | No | Backend collection name (e.g., Firestore). Defaults internally. |
| `debounceMs` | number | No | Debounce (ms) for update batching. |
| `onSynced` | `(doc?: Y.Doc) => void` | No | Called after initial sync completes. |
| `onConnectionError` | `(error: Error) => void` | No | Called if a connection error occurs. |
| `veltClient` | `Velt` | No | Velt client used for auth/session context and user resolution. |
# Tiptap Collaboration
#### VeltTiptapCrdtExtensionConfig
***
Configuration for the Tiptap CRDT extension that enables real-time collaborative editing.
| Property | Type | Required | Description |
| ---------------- | -------- | -------- | --------------------------------------------------------------------- |
| `editorId` | `string` | Yes | Unique document identifier for synchronization. |
| `initialContent` | `string` | No | Initial editor content. Applied only when no server-side data exists. |
| `debounceMs` | `number` | No | Debounce time for update propagation (ms). |
#### VeltTiptapCrdtExtensionResponse
***
| Property | Type | Description |
| ----------- | ---------------------------- | ----------------------------------------------------- |
| `VeltCrdt` | `Extension \| null` | Tiptap Velt CRDT Extension. |
| `store` | `VeltTipTapStore \| null` | Tiptap CRDT store instance. |
| `isLoading` | `boolean` | `false` once store is initialized, `true` by default. |
#### VeltTipTapStoreConfig
***
Configuration for creating a Tiptap collaboration store.
| Property | Type | Required | Description |
| ---------------- | -------- | -------- | ------------------------------------------------------------------------------ |
| `editorId` | `string` | Yes | Unique document identifier for synchronization. Use a different ID per editor. |
| `veltClient` | `Velt` | Yes | Velt client for velt sdk integration |
| `initialContent` | `string` | No | Initial editor content. Applied only when no server-side data exists. |
| `debounceMs` | `number` | No | Debounce time for updates in milliseconds |
#### VeltTipTapStore
***
Represents the Tiptap collaboration store instance. Public API surface only; all other fields are private.
| Method / Property | Type / Signature | Description |
| ------------------------- | ------------------------------------- | --------------------------------------------------------- |
| `constructor` | `(config: VeltTipTapStoreConfig)` | Creates a new store wrapper over Yjs + persistence. |
| `initialize()` | `Promise` | Initializes the underlying Store and triggers callbacks. |
| `getStore()` | `Store` | Returns the underlying CRDT store instance. |
| `getYText()` (deprecated) | `Y.Text \| null` | Legacy text accessor; usually returns null (XML is used). |
| `getYXml()` | `Y.XmlFragment \| null` | Accessor for XML fragment in the Yjs document. |
| `getYDoc()` | `Y.Doc` | Accessor for the Yjs document. |
| `isConnected()` | `boolean` | Collaboration readiness flag (initialized). |
| `setStateFromVersion()` | `(version: Version) => Promise` | Restores document to a specific version. |
| `destroy()` | `void` | Cleans up resources and marks instance uninitialized. |
| `getCollabExtension()` | `Extension` | Tiptap Extension configured with current Yjs doc. |
#### createVeltTipTapStore
***
Factory method that constructs a `VeltTipTapStore`, calls `initialize()`, and returns it.
| Parameter | Type | Required | Description |
| --------- | ----------------------- | -------- | ------------------------------------ |
| `config` | `VeltTipTapStoreConfig` | Yes | Configuration options for the store. |
| Returns | Type | Description |
| ------- | ---------------------------------- | --------------------------------------- |
| result | `Promise` | Initialized store or `null` on failure. |
# Core Collaboration
#### StoreConfig``;
***
| Property | Type | Required | Description |
| ---------------- | ------------------------------------- | -------- | ------------------------------------------------------------------ |
| `id` | `string` | Yes | Unique identifier for the collaborative store (e.g., document ID). |
| `veltClient` | `Velt` | Yes | Velt client for SDK integration. |
| `type` | `'array' \| 'map' \| 'text' \| 'xml'` | Yes | Backing CRDT data type for the store. |
| `initialValue` | `T` | No | Optional initial value (e.g., `''` for text, `[]` for array). |
| `enablePresence` | `boolean` | No | Enable realtime presence tracking (default: `true`). |
| `debounceMs` | `number` | No | Debounce interval in ms for batching local updates before syncing. |
#### YjsType
***
`'array' | 'map' | 'text' | 'xml'`
#### useVeltCrdtStore
***
| Property | Type | Description |
| --------------------- | ------------------------------------------ | ------------------------------------------- |
| `value` | `T \| null` | Current value of the store. |
| `versions` | `Version[]` | List of all stored versions. |
| `store` | `Store \| null` | The underlying Velt Store instance. |
| `update` | `(newValue: T) => void` | Updates the store value. |
| `saveVersion` | `(name: string) => Promise` | Saves a new version and returns its ID. |
| `getVersions` | `() => Promise` | Fetches all versions. |
| `getVersionById` | `(id: string) => Promise` | Fetches a specific version by ID. |
| `restoreVersion` | `(id: string) => Promise` | Restores the store to a specific version. |
| `setStateFromVersion` | `(version: Version) => Promise` | Sets the store state from a version object. |
# Encryption
#### EncryptConfig
***
| Property | Type | Required | Description |
| -------- | -------- | -------- | ---------------------------------------------------- |
| `data` | `T` | Yes | The payload to encrypt. |
| `type` | `string` | No | Optional type hint to select an encryption strategy. |
#### DecryptConfig
***
| Property | Type | Required | Description |
| -------- | -------- | -------- | --------------------------------------------------- |
| `data` | `R` | Yes | The payload to decrypt. |
| `type` | `string` | No | Optional type hint to select a decryption strategy. |
#### VeltEncryptionProvider
***
| Property | Type | Required | Description |
| --------- | ------------------------------------------ | -------- | -------------------------------------------------------------------------- |
| `encrypt` | `(config: EncryptConfig) => Promise` | Yes | Asynchronous function that encrypts data and returns the encrypted result. |
| `decrypt` | `(config: DecryptConfig) => Promise` | Yes | Asynchronous function that decrypts data and returns the original value. |
# Customize Behavior
Source: https://docs.velt.dev/async-collaboration/arrows/customize-behavior
## 1. Getting the Arrow Element
To get access to the Arrow Element APIs, you will first need to get the Arrow Element object from the client.
```jsx theme={null}
const arrowElement = client.getArrowElement();
```
```jsx theme={null}
const arrowElement = Velt.getArrowElement();
```
## 2. Set which elements Arrows can be added to
You can use the `allowedElementIds()` property to set an allowed list of elements the `Arrows` feature can be added to.
```jsx theme={null}
```
```jsx theme={null}
```
API Methods:
You can use the `arrowElement.allowedElementIds()` method to set an allowed list of elements the `Arrows` feature can be added to.
```jsx theme={null}
arrowElement.allowedElementIds(['ALLOWED_ID_1', 'ALLOWED_ID_2']);
```
```jsx theme={null}
arrowElement.allowedElementIds(['ALLOWED_ID_1', 'ALLOWED_ID_2']);
```
## 3. Dark Mode
Whether dark mode is enabled.
`Default: false`
```js theme={null}
```
```js theme={null}
```
# Arrows
Source: https://docs.velt.dev/async-collaboration/arrows/overview
[Open in larger window](https://landing-page-demo-velt.vercel.app/?feature=arrows)
# Setup
Source: https://docs.velt.dev/async-collaboration/arrows/setup
Import the `Arrow` components
```js theme={null}
import { VeltArrows, VeltArrowTool } from '@veltdev/react';
```
Place the `VeltArrows` component at the root of your app.
```js theme={null}