Add Users
curl --request POST \
--url https://api.velt.dev/v2/users/add \
--header 'Content-Type: application/json' \
--header 'x-velt-api-key: <x-velt-api-key>' \
--header 'x-velt-auth-token: <x-velt-auth-token>' \
--data '
{
"data": {
"organizationId": "<string>",
"createOrganization": true,
"documentId": "<string>",
"createDocument": true,
"folderId": "<string>",
"createFolder": true,
"users": [
{}
]
}
}
'import requests
url = "https://api.velt.dev/v2/users/add"
payload = { "data": {
"organizationId": "<string>",
"createOrganization": True,
"documentId": "<string>",
"createDocument": True,
"folderId": "<string>",
"createFolder": True,
"users": [{}]
} }
headers = {
"x-velt-api-key": "<x-velt-api-key>",
"x-velt-auth-token": "<x-velt-auth-token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-velt-api-key': '<x-velt-api-key>',
'x-velt-auth-token': '<x-velt-auth-token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
organizationId: '<string>',
createOrganization: true,
documentId: '<string>',
createDocument: true,
folderId: '<string>',
createFolder: true,
users: [{}]
}
})
};
fetch('https://api.velt.dev/v2/users/add', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.velt.dev/v2/users/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'organizationId' => '<string>',
'createOrganization' => true,
'documentId' => '<string>',
'createDocument' => true,
'folderId' => '<string>',
'createFolder' => true,
'users' => [
[
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-velt-api-key: <x-velt-api-key>",
"x-velt-auth-token: <x-velt-auth-token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.velt.dev/v2/users/add"
payload := strings.NewReader("{\n \"data\": {\n \"organizationId\": \"<string>\",\n \"createOrganization\": true,\n \"documentId\": \"<string>\",\n \"createDocument\": true,\n \"folderId\": \"<string>\",\n \"createFolder\": true,\n \"users\": [\n {}\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-velt-api-key", "<x-velt-api-key>")
req.Header.Add("x-velt-auth-token", "<x-velt-auth-token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.velt.dev/v2/users/add")
.header("x-velt-api-key", "<x-velt-api-key>")
.header("x-velt-auth-token", "<x-velt-auth-token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"organizationId\": \"<string>\",\n \"createOrganization\": true,\n \"documentId\": \"<string>\",\n \"createDocument\": true,\n \"folderId\": \"<string>\",\n \"createFolder\": true,\n \"users\": [\n {}\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.velt.dev/v2/users/add")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-velt-api-key"] = '<x-velt-api-key>'
request["x-velt-auth-token"] = '<x-velt-auth-token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"organizationId\": \"<string>\",\n \"createOrganization\": true,\n \"documentId\": \"<string>\",\n \"createDocument\": true,\n \"folderId\": \"<string>\",\n \"createFolder\": true,\n \"users\": [\n {}\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"result": {
"status": "success",
"message": "User(s) processed successfully.",
"data": {
"yourUserId1": {
"success": true,
"id": "4c250058149d6c9fb8c894c9ef29c790",
"message": "User added."
}
}
}
}
Users
Add Users
POST
/
v2
/
users
/
add
Add Users
curl --request POST \
--url https://api.velt.dev/v2/users/add \
--header 'Content-Type: application/json' \
--header 'x-velt-api-key: <x-velt-api-key>' \
--header 'x-velt-auth-token: <x-velt-auth-token>' \
--data '
{
"data": {
"organizationId": "<string>",
"createOrganization": true,
"documentId": "<string>",
"createDocument": true,
"folderId": "<string>",
"createFolder": true,
"users": [
{}
]
}
}
'import requests
url = "https://api.velt.dev/v2/users/add"
payload = { "data": {
"organizationId": "<string>",
"createOrganization": True,
"documentId": "<string>",
"createDocument": True,
"folderId": "<string>",
"createFolder": True,
"users": [{}]
} }
headers = {
"x-velt-api-key": "<x-velt-api-key>",
"x-velt-auth-token": "<x-velt-auth-token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-velt-api-key': '<x-velt-api-key>',
'x-velt-auth-token': '<x-velt-auth-token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
organizationId: '<string>',
createOrganization: true,
documentId: '<string>',
createDocument: true,
folderId: '<string>',
createFolder: true,
users: [{}]
}
})
};
fetch('https://api.velt.dev/v2/users/add', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.velt.dev/v2/users/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'organizationId' => '<string>',
'createOrganization' => true,
'documentId' => '<string>',
'createDocument' => true,
'folderId' => '<string>',
'createFolder' => true,
'users' => [
[
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-velt-api-key: <x-velt-api-key>",
"x-velt-auth-token: <x-velt-auth-token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.velt.dev/v2/users/add"
payload := strings.NewReader("{\n \"data\": {\n \"organizationId\": \"<string>\",\n \"createOrganization\": true,\n \"documentId\": \"<string>\",\n \"createDocument\": true,\n \"folderId\": \"<string>\",\n \"createFolder\": true,\n \"users\": [\n {}\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-velt-api-key", "<x-velt-api-key>")
req.Header.Add("x-velt-auth-token", "<x-velt-auth-token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.velt.dev/v2/users/add")
.header("x-velt-api-key", "<x-velt-api-key>")
.header("x-velt-auth-token", "<x-velt-auth-token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"organizationId\": \"<string>\",\n \"createOrganization\": true,\n \"documentId\": \"<string>\",\n \"createDocument\": true,\n \"folderId\": \"<string>\",\n \"createFolder\": true,\n \"users\": [\n {}\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.velt.dev/v2/users/add")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-velt-api-key"] = '<x-velt-api-key>'
request["x-velt-auth-token"] = '<x-velt-auth-token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"organizationId\": \"<string>\",\n \"createOrganization\": true,\n \"documentId\": \"<string>\",\n \"createDocument\": true,\n \"folderId\": \"<string>\",\n \"createFolder\": true,\n \"users\": [\n {}\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"result": {
"status": "success",
"message": "User(s) processed successfully.",
"data": {
"yourUserId1": {
"success": true,
"id": "4c250058149d6c9fb8c894c9ef29c790",
"message": "User added."
}
}
}
}
Use this API to add Users to:
- Organization: This will provide them access to all the documents in the organization unless the document has
restrictedaccess type. It will also show users in the contact list of the organization. - 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. - 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
initialis not provided in the User object, then it will be automatically created using the name field.
Access Control
- Set
accessRoletoviewer(read-only) oreditor(read/write) on each resource to define the user’s capabilities for that resource. accessRolecan only be set via the v2 Users and Auth Permissions REST APIs. Frontend SDK methods do not accept or changeaccessRole.- Relevant endpoints:
/v2/users/add,/v2/users/update,/v2/auth/permissions/add,/v2/auth/generate_token. - See the Access Control overview for concepts and detailed guidance.
See the Access Control overview for concepts and detailed guidance.
Endpoint
POST https://api.velt.dev/v2/users/add
Headers
string
required
Your API key.
string
required
Your Auth Token.
Body
Params
object
required
Show properties
Show properties
string
required
Organization ID
boolean
If set to true, a new organization will be created (if it doesn’t exist) before users are added.
string
Document ID. Provide this if you want to add users to a specific document.
boolean
If set to true and
documentId is provided but doesn’t exist, a new document will be created before users are added.string
Folder ID. Provide this if you want to add users to a specific folder. Either provide
documentId or folderId.boolean
If set to true and
folderId is provided but doesn’t exist, a new folder will be created before users are added.Example Requests
1. Add users to a specific organization
- Editor
- Viewer
{
"data": {
"organizationId": "yourOrganizationId",
"users": [
{
"userId": "yourUserId1",
"name": "User Name",
"email": "user@email.com",
"accessRole": "editor"
}
]
}
}
{
"data": {
"organizationId": "yourOrganizationId",
"users": [
{
"userId": "yourUserId1",
"name": "User Name",
"email": "user@email.com",
"accessRole": "viewer"
}
]
}
}
2. Add users to a specific document within an organization
- Editor
- Viewer
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"users": [
{
"userId": "yourUserId1",
"name": "User Name",
"email": "user@email.com",
"accessRole": "editor"
}
]
}
}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"users": [
{
"userId": "yourUserId1",
"name": "User Name",
"email": "user@email.com",
"accessRole": "viewer"
}
]
}
}
3. Add users to a specific folder within an organization
- Editor
- Viewer
{
"data": {
"organizationId": "yourOrganizationId",
"folderId": "yourFolderId",
"users": [
{
"userId": "yourUserId1",
"name": "User Name",
"email": "user@email.com",
"accessRole": "editor"
}
]
}
}
{
"data": {
"organizationId": "yourOrganizationId",
"folderId": "yourFolderId",
"users": [
{
"userId": "yourUserId1",
"name": "User Name",
"email": "user@email.com",
"accessRole": "viewer"
}
]
}
}
Response
Success Response
{
"result": {
"status": "success",
"message": "User(s) processed successfully.",
"data": {
"yourUserId1": {
"success": true,
"id": "4c250058149d6c9fb8c894c9ef29c790",
"message": "User added."
}
}
}
}
Failure Response
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
{
"result": {
"status": "success",
"message": "User(s) processed successfully.",
"data": {
"yourUserId1": {
"success": true,
"id": "4c250058149d6c9fb8c894c9ef29c790",
"message": "User added."
}
}
}
}
Was this page helpful?
⌘I

