List Documents
curl --request GET \
--url https://api.example.com/v1/documentsimport requests
url = "https://api.example.com/v1/documents"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/documents', 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.example.com/v1/documents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/documents"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/documents")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/documents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"documents": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"mime_type": "<string>",
"size_bytes": 123,
"storage_path": "<string>",
"folder": "<string>",
"tags": [
{}
],
"created_by": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}
]
},
"meta": {}
}Documents
List Documents
Paginate over documents stored in the workspace, optionally filtered by folder or tag
GET
/
v1
/
documents
List Documents
curl --request GET \
--url https://api.example.com/v1/documentsimport requests
url = "https://api.example.com/v1/documents"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/documents', 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.example.com/v1/documents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/documents"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/documents")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/documents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"documents": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"mime_type": "<string>",
"size_bytes": 123,
"storage_path": "<string>",
"folder": "<string>",
"tags": [
{}
],
"created_by": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}
]
},
"meta": {}
}Request
Query Parameters
integer
default:"1"
Page number.
integer
default:"25"
Results per page. Maximum 100.
string
Filter to documents in a specific folder path (e.g.
/clients/acme/ndas).string
Filter to documents with the given tag. Repeat the parameter to require multiple tags.
string
Filter to a MIME type (e.g.
application/pdf).string
Search against
name and description.string
ISO 8601 lower bound on
created_at.Headers
Authorization: Bearer wbk_your_api_key_here
Response
object
Show properties
Show properties
object
Pagination metadata:
page, per_page, total.X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, and X-Request-ID.
curl "https://data.leadlex.com/functions/v1/api-gateway/v1/documents?folder=/clients/acme&per_page=50" \
-H "Authorization: Bearer wbk_your_api_key_here"
import requests
API_KEY = "wbk_your_api_key_here"
BASE_URL = "https://data.leadlex.com/functions/v1/api-gateway"
r = requests.get(
f"{BASE_URL}/v1/documents",
headers={"Authorization": f"Bearer {API_KEY}"},
params={"folder": "/clients/acme", "per_page": 50},
)
for d in r.json()["data"]["documents"]:
print(d["name"], d["mime_type"], d["size_bytes"])
const url = new URL('https://data.leadlex.com/functions/v1/api-gateway/v1/documents');
url.searchParams.set('folder', '/clients/acme');
url.searchParams.set('per_page', '50');
const res = await fetch(url, { headers: { Authorization: 'Bearer wbk_your_api_key_here' } });
const { data } = await res.json();
console.log(data.documents.length);
Example Response
{
"data": {
"documents": [
{
"id": "doc_01HY1",
"name": "Acme-NDA-2026.pdf",
"description": "Mutual NDA with Acme Corp",
"mime_type": "application/pdf",
"size_bytes": 183204,
"storage_path": "workspaces/ws_123/documents/doc_01HY1.pdf",
"folder": "/clients/acme/ndas",
"tags": ["nda", "confidentiality"],
"created_by": "usr_01HW0",
"created_at": "2026-04-17T09:00:00Z",
"updated_at": "2026-04-17T09:00:00Z"
}
]
},
"meta": { "page": 1, "per_page": 50, "total": 12 }
}
Errors
| Status | Code | Description |
|---|---|---|
| 401 | invalid_key | Invalid or expired API key |
| 403 | insufficient_permissions | Missing read:documents permission |
| 429 | rate_limited | Rate limit exceeded |