# 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 your `onResourceAccessRequired` function is called, 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.
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
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.
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."
# 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
#### Success Response with single documentId
```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
],
"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.
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/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
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": "
",
"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/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.
## **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.
# 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. 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.