Get Document
curl --request GET \
--url https://api.example.com/v1/documents/{id}import requests
url = "https://api.example.com/v1/documents/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/documents/{id}', 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/{id}",
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/{id}"
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/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/documents/{id}")
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": {
"id": "<string>",
"name": "<string>",
"description": "<string>",
"mime_type": "<string>",
"size_bytes": 123,
"storage_path": "<string>",
"folder": "<string>",
"tags": [
{}
],
"linked_entities": [
{}
],
"download_url": "<string>",
"download_url_expires_at": "<string>",
"created_by": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}
}Documents
Get Document
Retrieve metadata and a short-lived signed download URL for a stored document
GET
/
v1
/
documents
/
{id}
Get Document
curl --request GET \
--url https://api.example.com/v1/documents/{id}import requests
url = "https://api.example.com/v1/documents/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/documents/{id}', 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/{id}",
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/{id}"
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/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/documents/{id}")
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": {
"id": "<string>",
"name": "<string>",
"description": "<string>",
"mime_type": "<string>",
"size_bytes": 123,
"storage_path": "<string>",
"folder": "<string>",
"tags": [
{}
],
"linked_entities": [
{}
],
"download_url": "<string>",
"download_url_expires_at": "<string>",
"created_by": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}
}Request
Path Parameters
string
required
Document UUID returned by
GET /v1/documents.Query Parameters
boolean
default:"true"
When
true (default), the response includes a signed URL valid for 15 minutes. Set to false for a lightweight metadata-only fetch.Headers
Authorization: Bearer wbk_your_api_key_here
Response
object
Show properties
Show properties
string
Document UUID
string
Display name
string
Description
string
MIME type
integer
File size
string
Storage key
string
Folder path
array
Tag strings
array
Entities the document is attached to (
entity_type, entity_id)string
Signed URL for downloading the bytes. Only present when
download=true.string
ISO 8601 timestamp when the URL expires
string
Creator user UUID
string
ISO 8601 timestamp
string
ISO 8601 timestamp
X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, and X-Request-ID.
curl https://data.leadlex.com/functions/v1/api-gateway/v1/documents/doc_01HY1 \
-H "Authorization: Bearer wbk_your_api_key_here"
import requests
API_KEY = "wbk_your_api_key_here"
doc_id = "doc_01HY1"
r = requests.get(
f"https://data.leadlex.com/functions/v1/api-gateway/v1/documents/{doc_id}",
headers={"Authorization": f"Bearer {API_KEY}"},
)
doc = r.json()["data"]
print(doc["name"], doc.get("download_url"))
const id = 'doc_01HY1';
const res = await fetch(
`https://data.leadlex.com/functions/v1/api-gateway/v1/documents/${id}`,
{ headers: { Authorization: 'Bearer wbk_your_api_key_here' } },
);
const { data } = await res.json();
console.log(data.download_url);
Example Response
{
"data": {
"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"],
"linked_entities": [
{ "entity_type": "contact", "entity_id": "123e4567-e89b-12d3-a456-426614174000" }
],
"download_url": "https://storage.leadlex.com/signed/...",
"download_url_expires_at": "2026-04-17T11:00:00Z",
"created_by": "usr_01HW0",
"created_at": "2026-04-17T09:00:00Z",
"updated_at": "2026-04-17T09:00:00Z"
}
}
Errors
| Status | Code | Description |
|---|---|---|
| 401 | invalid_key | Invalid or expired API key |
| 403 | insufficient_permissions | Missing read:documents permission |
| 404 | not_found | Document not found |
| 429 | rate_limited | Rate limit exceeded |