# 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.

`POST https://api.light.inc/v1/contracts/{contractId}/generate-document-upload-url`

## Note

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 (/docs/getting-started/pagination-filtering-errors 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

- API key
- Bearer token

See https://light.inc/docs/getting-started/authentication.

## Path parameters

- `contractId` (string, uuid, required)

## Request body

`application/json;charset=UTF-8`


```json
{
  "filename": "string"
}
```

Values above are generated from the schema: the shapes and types are real, the values are placeholders, and fields that exclude each other are all shown. Do not send it unchanged.

## Response


```json
{
  "uploadUrl": "string",
  "key": "string",
  "metadata": null
}
```

Values above are generated from the schema: the shapes and types are real, the values are placeholders.

## Code

```bash
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"
}'
```

---

Full page: https://light.inc/docs/api-reference/v1--contracts/generate-document-upload-url · Index: https://light.inc/docs/llms.txt
