Streamed List Objects
curl --request POST \
--url https://sync.useparagon.com/api/permissions/{syncId}/streamed-list-objects \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"objectType": "file",
"user": "email@example.com",
"role": "can_read"
}
'import requests
url = "https://sync.useparagon.com/api/permissions/{syncId}/streamed-list-objects"
payload = {
"objectType": "file",
"user": "email@example.com",
"role": "can_read"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({objectType: 'file', user: 'email@example.com', role: 'can_read'})
};
fetch('https://sync.useparagon.com/api/permissions/{syncId}/streamed-list-objects', 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://sync.useparagon.com/api/permissions/{syncId}/streamed-list-objects",
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([
'objectType' => 'file',
'user' => 'email@example.com',
'role' => 'can_read'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://sync.useparagon.com/api/permissions/{syncId}/streamed-list-objects"
payload := strings.NewReader("{\n \"objectType\": \"file\",\n \"user\": \"email@example.com\",\n \"role\": \"can_read\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <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://sync.useparagon.com/api/permissions/{syncId}/streamed-list-objects")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"objectType\": \"file\",\n \"user\": \"email@example.com\",\n \"role\": \"can_read\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sync.useparagon.com/api/permissions/{syncId}/streamed-list-objects")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"objectType\": \"file\",\n \"user\": \"email@example.com\",\n \"role\": \"can_read\"\n}"
response = http.request(request)
puts response.read_body"<string>"Permissions API
Streamed List Objects
List all accessible objects for a user as a streamed response.
POST
/
api
/
permissions
/
{syncId}
/
streamed-list-objects
Streamed List Objects
curl --request POST \
--url https://sync.useparagon.com/api/permissions/{syncId}/streamed-list-objects \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"objectType": "file",
"user": "email@example.com",
"role": "can_read"
}
'import requests
url = "https://sync.useparagon.com/api/permissions/{syncId}/streamed-list-objects"
payload = {
"objectType": "file",
"user": "email@example.com",
"role": "can_read"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({objectType: 'file', user: 'email@example.com', role: 'can_read'})
};
fetch('https://sync.useparagon.com/api/permissions/{syncId}/streamed-list-objects', 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://sync.useparagon.com/api/permissions/{syncId}/streamed-list-objects",
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([
'objectType' => 'file',
'user' => 'email@example.com',
'role' => 'can_read'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://sync.useparagon.com/api/permissions/{syncId}/streamed-list-objects"
payload := strings.NewReader("{\n \"objectType\": \"file\",\n \"user\": \"email@example.com\",\n \"role\": \"can_read\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <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://sync.useparagon.com/api/permissions/{syncId}/streamed-list-objects")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"objectType\": \"file\",\n \"user\": \"email@example.com\",\n \"role\": \"can_read\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sync.useparagon.com/api/permissions/{syncId}/streamed-list-objects")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"objectType\": \"file\",\n \"user\": \"email@example.com\",\n \"role\": \"can_read\"\n}"
response = http.request(request)
puts response.read_body"<string>"Use this endpoint when a user may have access to more than 1000 objects in a single Sync and you are using a pre-filtering approach for your search index. For smaller result sets, the buffered List Objects endpoint is simpler to consume.
To enumerate accessible objects across all of a Connected User’s Permission Syncs in a project (for example, Google Drive and SharePoint together), use Streamed List Objects (All Syncs) instead.
Parse the response one line at a time. Each line is independently valid JSON; the response body as a whole is not.
Response format
The response is sent asapplication/x-ndjson with Transfer-Encoding: chunked. Each line of the response body is a JSON object containing a single object field, whose value is the UUID of a Synced Object the user has access to with the specified role:
{"object":"a657df3b-17e2-5989-bc5f-13ddb7fdab41"}
{"object":"b842ec1c-2f3a-4a91-9f8d-6cf2b73a1d04"}
{"object":"c91f0a2d-4e58-4b3b-8a1c-7d9e2b0c41ef"}
Authorizations
Paragon User Token. Add to the Authorization header of your requests.
Path Parameters
UUID of the Sync to query, returned from the Enable Sync endpoint.
Body
application/json
The type of object to list.
Available options:
file, folder Example:
"file"
The email of the user to list accessible objects for.
Example:
"email@example.com"
The role to use for identifying accessible objects.
Available options:
can_read, can_write, is_owner Example:
"can_read"
Response
A newline-delimited JSON stream. Each line is a JSON object of the form { "object": "<uuid>" }, where object is the UUID of a Synced Object the user has access to with the specified role.
The response is of type string.
Was this page helpful?