Add Users
curl --request POST \
--url https://api.velt.dev/v1/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>",
"documentId": "<string>",
"folderId": "<string>",
"users": [
{}
]
}
}
'import requests
url = "https://api.velt.dev/v1/users/add"
payload = { "data": {
"organizationId": "<string>",
"documentId": "<string>",
"folderId": "<string>",
"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>',
documentId: '<string>',
folderId: '<string>',
users: [{}]
}
})
};
fetch('https://api.velt.dev/v1/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/v1/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>',
'documentId' => '<string>',
'folderId' => '<string>',
'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/v1/users/add"
payload := strings.NewReader("{\n \"data\": {\n \"organizationId\": \"<string>\",\n \"documentId\": \"<string>\",\n \"folderId\": \"<string>\",\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/v1/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 \"documentId\": \"<string>\",\n \"folderId\": \"<string>\",\n \"users\": [\n {}\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.velt.dev/v1/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 \"documentId\": \"<string>\",\n \"folderId\": \"<string>\",\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
/
v1
/
users
/
add
Add Users
curl --request POST \
--url https://api.velt.dev/v1/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>",
"documentId": "<string>",
"folderId": "<string>",
"users": [
{}
]
}
}
'import requests
url = "https://api.velt.dev/v1/users/add"
payload = { "data": {
"organizationId": "<string>",
"documentId": "<string>",
"folderId": "<string>",
"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>',
documentId: '<string>',
folderId: '<string>',
users: [{}]
}
})
};
fetch('https://api.velt.dev/v1/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/v1/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>',
'documentId' => '<string>',
'folderId' => '<string>',
'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/v1/users/add"
payload := strings.NewReader("{\n \"data\": {\n \"organizationId\": \"<string>\",\n \"documentId\": \"<string>\",\n \"folderId\": \"<string>\",\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/v1/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 \"documentId\": \"<string>\",\n \"folderId\": \"<string>\",\n \"users\": [\n {}\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.velt.dev/v1/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 \"documentId\": \"<string>\",\n \"folderId\": \"<string>\",\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.
Endpoint
POST https://api.velt.dev/v1/users/add
Headers
Your API key.
Your Auth Token.
Body
Params
Show properties
Show properties
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.Example Requests
1. Add users to a specific organization
{
"data": {
"organizationId": "yourOrganizationId",
"users": [
{
"userId": "yourUserId1",
"name": "User Name",
"email": "user@email.com"
}
]
}
}
2. Add users to a specific document within an organization
{
"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
{
"data": {
"organizationId": "yourOrganizationId",
"folderId": "yourFolderId",
"users": [
{
"userId": "yourUserId1",
"name": "User Name",
"email": "user@email.com"
}
]
}
}
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

