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

# Generate Upload Document Url

> Generates a presigned URL to upload a document to the brokerage firm. Provide document metadata in the body and any additional parameters in the query.



## OpenAPI

````yaml /openapi.json post /brokerage-firms/{brokerageFirmId}/documents
openapi: 3.0.0
info:
  title: Korint Documentation
  description: Korint API Documentation
  version: 1.0.0
  contact: {}
servers: []
security:
  - bearerAuth: []
tags: []
paths:
  /brokerage-firms/{brokerageFirmId}/documents:
    post:
      tags:
        - brokerage-firms
      summary: Generate Upload Document Url
      description: >-
        Generates a presigned URL to upload a document to the brokerage firm.
        Provide document metadata in the body and any additional parameters in
        the query.
      operationId: BrokerageFirmController_generateUploadDocumentUrl
      parameters:
        - name: brokerageFirmId
          required: true
          in: path
          description: the brokerageFirm id
          schema:
            type: string
        - name: whenAt
          required: false
          in: query
          description: 'Optional: the whenAt datetime'
          schema:
            type: string
        - name: branchId
          required: false
          in: query
          description: 'Optional: the branchId'
          schema:
            type: string
      requestBody:
        required: true
        description: Document metadata for upload
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/BrokerageFirmGenerateDocumentUploadUrlInputBody
      responses:
        '200':
          description: Upload URL generated successfully.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/BrokerageFirmGenerateDocumentUploadUrlOutput
        '400':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/InvalidEventCreationDateErrorDto'
              examples:
                INVALID_EVENT_CREATION_DATE:
                  $ref: '#/components/schemas/InvalidEventCreationDateErrorDto'
          description: ''
        '403':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/ForbiddenErrorDto'
              examples:
                FORBIDDEN:
                  $ref: '#/components/schemas/ForbiddenErrorDto'
          description: ''
        '404':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/PolicyNotFoundErrorDto'
              examples:
                POLICY_NOT_FOUND:
                  $ref: '#/components/schemas/PolicyNotFoundErrorDto'
          description: ''
components:
  schemas:
    BrokerageFirmGenerateDocumentUploadUrlInputBody:
      type: object
      properties:
        name:
          type: string
          description: 'name '
        metadata:
          description: metadata of the policy
          example:
            - key: category
              value: kbis
          type: array
          items:
            $ref: '#/components/schemas/Metadata'
      required:
        - name
    BrokerageFirmGenerateDocumentUploadUrlOutput:
      type: object
      properties:
        type:
          type: string
          description: type
        id:
          type: string
          description: the document's id
        url:
          type: string
          description: url of the document
      required:
        - type
        - id
        - url
    InvalidEventCreationDateErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - INVALID_EVENT_CREATION_DATE
        message:
          type: string
          example: >-
            You are trying to push an event that is created on {createdAt}, but
            the creation date should be after the latest event which was created
            on {latestCreatedAt}
        details:
          $ref: '#/components/schemas/InvalidEventCreationDateDetailsDto'
      required:
        - code
        - message
        - details
    ForbiddenErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - FORBIDDEN
        message:
          type: string
          example: Forbidden
        details:
          $ref: '#/components/schemas/ForbiddenDetailsDto'
      required:
        - code
        - message
        - details
    PolicyNotFoundErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - POLICY_NOT_FOUND
        message:
          type: string
          example: Policy {policyId} ({branchId}) not found
        details:
          $ref: '#/components/schemas/PolicyNotFoundDetailsDto'
      required:
        - code
        - message
        - details
    Metadata:
      type: object
      properties:
        key:
          type: string
          description: the key of the metadata
        value:
          type: string
          description: the value of the metadata
      required:
        - key
        - value
    InvalidEventCreationDateDetailsDto:
      type: object
      properties:
        createdAt:
          format: date-time
          type: string
        latestCreatedAt:
          format: date-time
          type: string
      required:
        - createdAt
        - latestCreatedAt
    ForbiddenDetailsDto:
      type: object
      properties:
        message:
          type: string
        documentKey:
          type: string
        userId:
          type: string
        ownerId:
          type: string
      required:
        - message
        - documentKey
        - userId
        - ownerId
    PolicyNotFoundDetailsDto:
      type: object
      properties:
        policyId:
          type: string
        branchId:
          type: string
        whenAt:
          type: string
        simulatedAt:
          type: string
      required:
        - policyId

````