---
title: "Upload document"
url: "https://apipartners.mosaicinsurance.com/apis/trident-sandbox-1/versions/063565b3-7d5d-4ebb-9e4e-ea5966a41579/operations/uploadDocument"
---

> Full API specification: https://apipartners.mosaicinsurance.com/apis/trident-sandbox-1/versions/063565b3-7d5d-4ebb-9e4e-ea5966a41579.md

# Upload document

`PUT` `/uploaddocument`

Operation ID: `uploadDocument`

Uploads a document to the DMS for a specific policy. Supports file uploads to designated locations within the policy's DMS folder structure.

## Query parameters

- `policyKey` (string, required) - Unique identifier of the policy
- `location` (string, optional) - Folder location within the DMS structure where the document should be uploaded. Spaces and special characters (%20 for space, %26 for &) are URL-encoded and will be decoded.
- `policyReference` (string, optional) - Reference identifier for the policy (e.g., quote reference)

## Header parameters

- `X-Origination-Source` (string, required) - Identifies the calling system or channel that originated this request. Used for traceability and auditing across the platform.
- `X-Audit-UserId` (string, required) - Identifier of the end user on whose behalf this request is made, recorded for audit trail purposes.

## Request body (required)

Content types: `multipart/form-data`

## Responses

- `200` - Document uploaded successfully
- `400` - Bad Request - Missing required parameters or invalid file
- `500` - Internal Server Error
- `503` - Service Unavailable - DMS service is temporarily unavailable
- `504` - Gateway Timeout - DMS service request timed out

## OpenAPI definition

```yaml
openapi: 3.0.1
info:
  title: Trident APIs
  version: dev
servers:
  - url: https://apinonprod.mosaicinsurance.com
    description: Generated server url
paths:
  /uploaddocument:
    put:
      security:
        - api_key: []
      tags:
        - Document Upload to DMS
      summary: Upload document
      description: Uploads a document to the DMS for a specific policy. Supports file
        uploads to designated locations within the policy's DMS folder
        structure.
      operationId: uploadDocument
      parameters:
        - $ref: "#/components/parameters/XOriginationSource"
        - $ref: "#/components/parameters/XAuditUserId"
        - name: policyKey
          in: query
          required: true
          description: Unique identifier of the policy
          schema:
            type: string
          example: "20740"
        - name: location
          in: query
          required: false
          description: Folder location within the DMS structure where the document should
            be uploaded. Spaces and special characters (%20 for space, %26 for
            &) are URL-encoded and will be decoded.
          schema:
            type: string
          example: Supporting Documents
        - name: policyReference
          in: query
          required: false
          description: Reference identifier for the policy (e.g., quote reference)
          schema:
            type: string
          example: F0022390
      requestBody:
        description: File to be uploaded to the DMS
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: File to be uploaded
              required:
                - file
            encoding:
              file:
                contentType: application/octet-stream
        required: true
      responses:
        "200":
          description: Document uploaded successfully
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            text/plain:
              schema:
                type: string
              example: Document uploaded successfully
        "400":
          description: Bad Request - Missing required parameters or invalid file
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                Missing File:
                  summary: Missing file parameter
                  description: Missing File
                  value:
                    error:
                      code: VALIDATION_ERROR
                      message: File parameter is required
                Missing Policy Key:
                  summary: Missing policy key
                  description: Missing Policy Key
                  value:
                    error:
                      code: VALIDATION_ERROR
                      message: Policy Key is required
        "500":
          description: Internal Server Error
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                Upload Error:
                  summary: Document upload error
                  description: Upload Error
                  value:
                    error:
                      code: UPLOAD_ERROR
                      message: Failed to upload document to DMS
        "503":
          description: Service Unavailable - DMS service is temporarily unavailable
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                DMS Service Unavailable:
                  summary: DMS service unavailable
                  description: DMS Service Unavailable
                  value:
                    error:
                      code: DMS_SERVICE_UNAVAILABLE
                      message: DMS service is currently unavailable
        "504":
          description: Gateway Timeout - DMS service request timed out
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                DMS Timeout:
                  summary: DMS service timeout
                  description: DMS Timeout
                  value:
                    error:
                      code: DMS_TIMEOUT
                      message: Request to DMS service timed out
security:
  - api_key: []
components:
  parameters:
    XOriginationSource:
      name: X-Origination-Source
      in: header
      required: true
      description: Identifies the calling system or channel that originated this
        request. Used for traceability and auditing across the platform.
      schema:
        type: string
      example: S01x
    XAuditUserId:
      name: X-Audit-UserId
      in: header
      required: true
      description: Identifier of the end user on whose behalf this request is made,
        recorded for audit trail purposes.
      schema:
        type: string
      example: jsmith
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          $ref: "#/components/schemas/ErrorDetail"
    ErrorDetail:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
  securitySchemes:
    api_key:
      type: apiKey
      name: x-api-key
      in: header
```
