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

# Initiate Multipart Upload



## OpenAPI

````yaml /openapi/document.yaml post /api/v1/documents/multipart/initiate
openapi: 3.1.0
info:
  title: Document Service
  description: Centralised document management system.
  version: 1.0.0
servers:
  - url: https://api.diginacape.co.ke/documents
    description: Production
security: []
paths:
  /api/v1/documents/multipart/initiate:
    post:
      tags:
        - Documents
        - Multipart
      summary: Initiate Multipart Upload
      operationId: initiate_multipart_upload_api_v1_documents_multipart_initiate_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MultipartInitiateRequest'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MultipartInitiateResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    MultipartInitiateRequest:
      properties:
        filename:
          type: string
          maxLength: 255
          minLength: 1
          title: Filename
        content_type:
          type: string
          title: Content Type
        file_size:
          type: integer
          exclusiveMinimum: 0
          title: File Size
        document_category:
          type: string
          maxLength: 50
          title: Document Category
        resource_type:
          anyOf:
            - type: string
              maxLength: 50
            - type: 'null'
          title: Resource Type
        resource_id:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Resource Id
        description:
          anyOf:
            - type: string
              maxLength: 1000
            - type: 'null'
          title: Description
        tags:
          anyOf:
            - type: string
            - type: 'null'
          title: Tags
        is_public:
          type: boolean
          title: Is Public
          default: false
        allowed_departments:
          anyOf:
            - type: string
            - type: 'null'
          title: Allowed Departments
        allowed_users:
          anyOf:
            - type: string
            - type: 'null'
          title: Allowed Users
        allowed_roles:
          anyOf:
            - type: string
            - type: 'null'
          title: Allowed Roles
        part_size:
          type: integer
          minimum: 5242880
          title: Part Size
          default: 104857600
        expires_hours:
          type: integer
          maximum: 72
          minimum: 1
          title: Expires Hours
          default: 12
      type: object
      required:
        - filename
        - content_type
        - file_size
        - document_category
      title: MultipartInitiateRequest
    MultipartInitiateResponse:
      properties:
        document_id:
          type: string
          title: Document Id
        upload_id:
          type: string
          title: Upload Id
        object_name:
          type: string
          title: Object Name
        part_urls:
          items:
            $ref: '#/components/schemas/PartUrl'
          type: array
          title: Part Urls
        total_parts:
          type: integer
          title: Total Parts
        part_size:
          type: integer
          title: Part Size
        expires_hours:
          type: integer
          title: Expires Hours
      type: object
      required:
        - document_id
        - upload_id
        - object_name
        - part_urls
        - total_parts
        - part_size
        - expires_hours
      title: MultipartInitiateResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PartUrl:
      properties:
        part_number:
          type: integer
          title: Part Number
        url:
          type: string
          title: Url
      type: object
      required:
        - part_number
        - url
      title: PartUrl
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````