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.
Only while the contract is DRAFT (CONTRACT_CANNOT_BE_MODIFIED). PUT the PDF to uploadUrl within five minutes with Content-Type: application/pdf and every entry of metadata as a request header (see Files). The file is attached asynchronously, and only if the contract is still editable at that moment; otherwise it is dropped. Nothing on this API shows the result: GET /v1/contracts/{contractId} has no document field, and the upload does not trigger any parsing or change any field.
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
Path parameters
-
contractIdstring · uuidrequired
Request body
application/json;charset=UTF-8
-
filenamestringName of the file to upload
Response
-
uploadUrlstringPre-signed URL to upload the document to
-
keystringKey to identify the uploaded document
-
metadataobjectMetadata to include with the upload request