Get Permissions
curl --request POST \
--url https://api.velt.dev/v2/auth/permissions/get \
--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>",
"userIds": [
"<string>"
],
"folderIds": [
"<string>"
],
"documentIds": [
"<string>"
]
}
}
'import requests
url = "https://api.velt.dev/v2/auth/permissions/get"
payload = { "data": {
"organizationId": "<string>",
"userIds": ["<string>"],
"folderIds": ["<string>"],
"documentIds": ["<string>"]
} }
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>',
userIds: ['<string>'],
folderIds: ['<string>'],
documentIds: ['<string>']
}
})
};
fetch('https://api.velt.dev/v2/auth/permissions/get', 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/auth/permissions/get",
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>',
'userIds' => [
'<string>'
],
'folderIds' => [
'<string>'
],
'documentIds' => [
'<string>'
]
]
]),
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/auth/permissions/get"
payload := strings.NewReader("{\n \"data\": {\n \"organizationId\": \"<string>\",\n \"userIds\": [\n \"<string>\"\n ],\n \"folderIds\": [\n \"<string>\"\n ],\n \"documentIds\": [\n \"<string>\"\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/auth/permissions/get")
.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 \"userIds\": [\n \"<string>\"\n ],\n \"folderIds\": [\n \"<string>\"\n ],\n \"documentIds\": [\n \"<string>\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.velt.dev/v2/auth/permissions/get")
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 \"userIds\": [\n \"<string>\"\n ],\n \"folderIds\": [\n \"<string>\"\n ],\n \"documentIds\": [\n \"<string>\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"result": {
"status": "success",
"message": "User permissions retrieved successfully.",
"data": {
"1.1": {
"folders": {
"folder2": {
"accessRole": "editor",
"accessType": "restricted"
}
},
"documents": {
"document1-26-may-2025-folder2": {
"accessRole": "viewer",
"accessType": "restricted"
}
},
"organization": {
"org1": {
"accessRole": "editor"
}
}
}
}
}
}
Access Control
Get user permissions (v2)
Retrieve a user’s current access roles across organizations, folders, and documents using the Velt v2 REST API for authorization checks and audits.
POST
/
v2
/
auth
/
permissions
/
get
Get Permissions
curl --request POST \
--url https://api.velt.dev/v2/auth/permissions/get \
--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>",
"userIds": [
"<string>"
],
"folderIds": [
"<string>"
],
"documentIds": [
"<string>"
]
}
}
'import requests
url = "https://api.velt.dev/v2/auth/permissions/get"
payload = { "data": {
"organizationId": "<string>",
"userIds": ["<string>"],
"folderIds": ["<string>"],
"documentIds": ["<string>"]
} }
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>',
userIds: ['<string>'],
folderIds: ['<string>'],
documentIds: ['<string>']
}
})
};
fetch('https://api.velt.dev/v2/auth/permissions/get', 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/auth/permissions/get",
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>',
'userIds' => [
'<string>'
],
'folderIds' => [
'<string>'
],
'documentIds' => [
'<string>'
]
]
]),
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/auth/permissions/get"
payload := strings.NewReader("{\n \"data\": {\n \"organizationId\": \"<string>\",\n \"userIds\": [\n \"<string>\"\n ],\n \"folderIds\": [\n \"<string>\"\n ],\n \"documentIds\": [\n \"<string>\"\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/auth/permissions/get")
.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 \"userIds\": [\n \"<string>\"\n ],\n \"folderIds\": [\n \"<string>\"\n ],\n \"documentIds\": [\n \"<string>\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.velt.dev/v2/auth/permissions/get")
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 \"userIds\": [\n \"<string>\"\n ],\n \"folderIds\": [\n \"<string>\"\n ],\n \"documentIds\": [\n \"<string>\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"result": {
"status": "success",
"message": "User permissions retrieved successfully.",
"data": {
"1.1": {
"folders": {
"folder2": {
"accessRole": "editor",
"accessType": "restricted"
}
},
"documents": {
"document1-26-may-2025-folder2": {
"accessRole": "viewer",
"accessType": "restricted"
}
},
"organization": {
"org1": {
"accessRole": "editor"
}
}
}
}
}
}
Use this API to get a user’s permissions for various resources like organizations, folders, documents, etc.
The
- Returns permissions per user and resource. Temporary permissions include an
expiresAt(Unix seconds) value. - See the Access Control overview for concepts and detailed guidance.
Endpoint
POST https://api.velt.dev/v2/auth/permissions/get
Headers
Your API key.
Your Auth Token.
Body
Example Request
- JSON
- cURL
{
"data": {
"organizationId": "org1",
"documentIds": ["freestyle-comments1"],
"userIds": ["samarth"]
}
}
cURL
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 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") |
accessType | string | The effective access type for the resource: "public", "restricted", or "organizationPrivate". Documents inside folders inherit the folder’s accessType. Also present on PERMISSION_DENIED entries. |
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 enum (v4.5.4+) |
Success Response
{
"result": {
"status": "success",
"message": "User permissions retrieved successfully.",
"data": {
"1.1": {
"folders": {
"folder2": {
"accessRole": "editor",
"accessType": "restricted"
}
},
"documents": {
"document1-26-may-2025-folder2": {
"accessRole": "viewer",
"accessType": "restricted"
}
},
"organization": {
"org1": {
"accessRole": "editor"
}
}
}
}
}
}
Success Response with Context Access Info
When using Access Context for feature-level permissions, the response includes acontext object with accessFields showing which context values the user has access to:
{
"result": {
"status": "success",
"message": "User permissions retrieved successfully.",
"data": {
"user_123": {
"documents": {
"document1": {
"accessRole": "editor",
"accessType": "organizationPrivate"
}
},
"organization": {
"org1": {
"accessRole": "editor"
}
},
"context": {
"accessFields": ["widgetId:1", "widgetId:2", "widgetId:3"]
}
}
}
}
}
accessFields array contains strings in the format "fieldName:value" representing each context field and value combination the user has access to.
Permission Denied
{
"result": {
"status": "success",
"message": "User permissions retrieved successfully.",
"data": {
"1.1": {
"documents": {
"document5": {
"error": "User does not have access to document",
"errorCode": "permission_denied",
"accessType": "restricted"
}
},
"organization": {
"org1": {
"accessRole": "editor"
}
}
}
}
}
}
Error Response Examples
When a resource does not exist, is denied, or encounters an error, the response includes both anerror message and an errorCode:
Resource Not Found:
{
"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
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
{
"result": {
"status": "success",
"message": "User permissions retrieved successfully.",
"data": {
"1.1": {
"folders": {
"folder2": {
"accessRole": "editor",
"accessType": "restricted"
}
},
"documents": {
"document1-26-may-2025-folder2": {
"accessRole": "viewer",
"accessType": "restricted"
}
},
"organization": {
"org1": {
"accessRole": "editor"
}
}
}
}
}
}
Was this page helpful?
⌘I

