> ## Documentation Index
> Fetch the complete documentation index at: https://docs.light.inc/llms.txt
> Use this file to discover all available pages before exploring further.

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



## OpenAPI

````yaml /openapi-public.json post /v1/contracts/{contractId}/generate-document-upload-url
openapi: 3.0.1
info:
  title: Light API
  version: 1.0.0
servers: []
security:
  - apiKeyAuth: []
  - bearerAuth: []
paths:
  /v1/contracts/{contractId}/generate-document-upload-url:
    post:
      tags:
        - v1 - Contracts
      summary: Generate document upload URL
      description: >-
        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.
      operationId: generateContractDocumentUploadUrl
      parameters:
        - name: contractId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json;charset=UTF-8:
            schema:
              $ref: >-
                #/components/schemas/ExternalContractDocumentUploadRequestV1Model
      responses:
        default:
          description: default response
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: >-
                  #/components/schemas/ExternalContractDocumentUploadUrlResponseV1Model
components:
  schemas:
    ExternalContractDocumentUploadRequestV1Model:
      type: object
      properties:
        filename:
          type: string
          description: Name of the file to upload
    ExternalContractDocumentUploadUrlResponseV1Model:
      type: object
      properties:
        uploadUrl:
          type: string
          description: Pre-signed URL to upload the document to
        key:
          type: string
          description: Key to identify the uploaded document
        metadata:
          type: object
          additionalProperties:
            type: string
            description: Metadata to include with the upload request
            nullable: true
          description: Metadata to include with the upload request
          nullable: true
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      description: >-
        Basic authentication header of the form **Basic** **<api_key>**, where
        **<api_key>** is your api key.
      name: Authorization
      in: header
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````