API /
Reference /
Contracts
Generate document upload URL
POST
https://api.light.inc/v1/contracts/{contractId}/generate-document-upload-url
Generates a pre-signed URL to upload the main contract document (PDF). After uploading to this URL, the document will appear in the contract's document preview.
Authorization
Send one of these on every request. See
Authentication for how to get credentials.
API key Basic authentication header of the form Basic <api_key> , where <api_key> is your api key.
Bearer token
Request body
application/json;charset=UTF-8
filename
string
Name of the file to upload
Response
uploadUrl
string
Pre-signed URL to upload the document to
key
string
Key to identify the uploaded document
metadata
object
Metadata to include with the upload request
cURL
JavaScript
Python
Copy
curl -X POST "https://api.light.inc/v1/contracts/3c90c3cc-0d44-4b50-8888-8dd25736052a/generate-document-upload-url" \
-H "Authorization: Basic YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"filename": "string"
}'
Copy
const res = await fetch("https://api.light.inc/v1/contracts/3c90c3cc-0d44-4b50-8888-8dd25736052a/generate-document-upload-url", {
method: "POST",
headers: {
Authorization: `Basic ${process.env.LIGHT_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"filename": "string"
}),
});
const data = await res.json();
Copy
import os, requests
res = requests.post(
"https://api.light.inc/v1/contracts/3c90c3cc-0d44-4b50-8888-8dd25736052a/generate-document-upload-url",
headers={"Authorization": f"Basic {os.environ['LIGHT_API_KEY']}"},
json={
"filename": "string"
},
)
data = res.json()
Example response
Copy
{
"uploadUrl": "string",
"key": "string",
"metadata": null
}
Generated from the schema — shapes and types are real, values are placeholders.