List Deal Documents
curl --request GET \
--url https://api.example.com/v1/deals/{id}/documentsimport requests
url = "https://api.example.com/v1/deals/{id}/documents"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/deals/{id}/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/deals/{id}/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/deals/{id}/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/deals/{id}/documents")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/deals/{id}/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>",
"mime_type": "<string>",
"size_bytes": 123,
"folder": "<string>",
"tags": [
{}
],
"role": "<string>",
"linked_at": "<string>",
"created_at": "<string>"
}
]
},
"meta": {}
}Documents
List Deal Documents
Return every document linked to the specified deal
GET
/
v1
/
deals
/
{id}
/
documents
List Deal Documents
curl --request GET \
--url https://api.example.com/v1/deals/{id}/documentsimport requests
url = "https://api.example.com/v1/deals/{id}/documents"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/deals/{id}/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/deals/{id}/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/deals/{id}/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/deals/{id}/documents")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/deals/{id}/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>",
"mime_type": "<string>",
"size_bytes": 123,
"folder": "<string>",
"tags": [
{}
],
"role": "<string>",
"linked_at": "<string>",
"created_at": "<string>"
}
]
},
"meta": {}
}Request
Path Parameters
string
required
Deal UUID.
Query Parameters
integer
default:"1"
Page number.
integer
default:"25"
Results per page. Maximum 100.
string
Filter to documents linked with a specific relationship role.
Headers
Authorization: Bearer wbk_your_api_key_here
Response
object
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/deals/deal_01HY1/documents" \
-H "Authorization: Bearer wbk_your_api_key_here"
import requests
API_KEY = "wbk_your_api_key_here"
deal_id = "deal_01HY1"
r = requests.get(
f"https://data.leadlex.com/functions/v1/api-gateway/v1/deals/{deal_id}/documents",
headers={"Authorization": f"Bearer {API_KEY}"},
)
for d in r.json()["data"]["documents"]:
print(d["name"], d.get("role"))
const id = 'deal_01HY1';
const res = await fetch(
`https://data.leadlex.com/functions/v1/api-gateway/v1/deals/${id}/documents`,
{ headers: { Authorization: 'Bearer wbk_your_api_key_here' } },
);
const { data } = await res.json();
console.log(data.documents.length);
Example Response
{
"data": {
"documents": [
{
"id": "doc_02HY2",
"name": "Acme-SPA-draft-v3.pdf",
"mime_type": "application/pdf",
"size_bytes": 512400,
"folder": "/clients/acme/spa",
"tags": ["spa", "draft"],
"role": "draft",
"linked_at": "2026-04-16T13:00:00Z",
"created_at": "2026-04-16T13:00:00Z"
}
]
},
"meta": { "page": 1, "per_page": 25, "total": 3 }
}
Errors
| Status | Code | Description |
|---|---|---|
| 401 | invalid_key | Invalid or expired API key |
| 403 | insufficient_permissions | Missing read:documents permission |
| 404 | not_found | Deal not found |
| 429 | rate_limited | Rate limit exceeded |